vendor.js 434 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648
  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. /* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createPlugin = createPlugin;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 3);
  11. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 4));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  12. var realAtob;
  13. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  14. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  15. if (typeof atob !== 'function') {
  16. realAtob = function realAtob(str) {
  17. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  18. if (!b64re.test(str)) {throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");}
  19. // Adding the padding if missing, for semplicity
  20. str += '=='.slice(2 - (str.length & 3));
  21. var bitmap;var result = '';var r1;var r2;var i = 0;
  22. for (; i < str.length;) {
  23. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 |
  24. (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  25. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) :
  26. r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) :
  27. String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  28. }
  29. return result;
  30. };
  31. } else {
  32. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  33. realAtob = atob;
  34. }
  35. function b64DecodeUnicode(str) {
  36. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  37. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  38. }).join(''));
  39. }
  40. function getCurrentUserInfo() {
  41. var token = wx.getStorageSync('uni_id_token') || '';
  42. var tokenArr = token.split('.');
  43. if (!token || tokenArr.length !== 3) {
  44. return {
  45. uid: null,
  46. role: [],
  47. permission: [],
  48. tokenExpired: 0 };
  49. }
  50. var userInfo;
  51. try {
  52. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  53. } catch (error) {
  54. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  55. }
  56. userInfo.tokenExpired = userInfo.exp * 1000;
  57. delete userInfo.exp;
  58. delete userInfo.iat;
  59. return userInfo;
  60. }
  61. function uniIdMixin(Vue) {
  62. Vue.prototype.uniIDHasRole = function (roleId) {var _getCurrentUserInfo =
  63. getCurrentUserInfo(),role = _getCurrentUserInfo.role;
  64. return role.indexOf(roleId) > -1;
  65. };
  66. Vue.prototype.uniIDHasPermission = function (permissionId) {var _getCurrentUserInfo2 =
  67. getCurrentUserInfo(),permission = _getCurrentUserInfo2.permission;
  68. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  69. };
  70. Vue.prototype.uniIDTokenValid = function () {var _getCurrentUserInfo3 =
  71. getCurrentUserInfo(),tokenExpired = _getCurrentUserInfo3.tokenExpired;
  72. return tokenExpired > Date.now();
  73. };
  74. }
  75. var _toString = Object.prototype.toString;
  76. var hasOwnProperty = Object.prototype.hasOwnProperty;
  77. function isFn(fn) {
  78. return typeof fn === 'function';
  79. }
  80. function isStr(str) {
  81. return typeof str === 'string';
  82. }
  83. function isPlainObject(obj) {
  84. return _toString.call(obj) === '[object Object]';
  85. }
  86. function hasOwn(obj, key) {
  87. return hasOwnProperty.call(obj, key);
  88. }
  89. function noop() {}
  90. /**
  91. * Create a cached version of a pure function.
  92. */
  93. function cached(fn) {
  94. var cache = Object.create(null);
  95. return function cachedFn(str) {
  96. var hit = cache[str];
  97. return hit || (cache[str] = fn(str));
  98. };
  99. }
  100. /**
  101. * Camelize a hyphen-delimited string.
  102. */
  103. var camelizeRE = /-(\w)/g;
  104. var camelize = cached(function (str) {
  105. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  106. });
  107. function sortObject(obj) {
  108. var sortObj = {};
  109. if (isPlainObject(obj)) {
  110. Object.keys(obj).sort().forEach(function (key) {
  111. sortObj[key] = obj[key];
  112. });
  113. }
  114. return !Object.keys(sortObj) ? obj : sortObj;
  115. }
  116. var HOOKS = [
  117. 'invoke',
  118. 'success',
  119. 'fail',
  120. 'complete',
  121. 'returnValue'];
  122. var globalInterceptors = {};
  123. var scopedInterceptors = {};
  124. function mergeHook(parentVal, childVal) {
  125. var res = childVal ?
  126. parentVal ?
  127. parentVal.concat(childVal) :
  128. Array.isArray(childVal) ?
  129. childVal : [childVal] :
  130. parentVal;
  131. return res ?
  132. dedupeHooks(res) :
  133. res;
  134. }
  135. function dedupeHooks(hooks) {
  136. var res = [];
  137. for (var i = 0; i < hooks.length; i++) {
  138. if (res.indexOf(hooks[i]) === -1) {
  139. res.push(hooks[i]);
  140. }
  141. }
  142. return res;
  143. }
  144. function removeHook(hooks, hook) {
  145. var index = hooks.indexOf(hook);
  146. if (index !== -1) {
  147. hooks.splice(index, 1);
  148. }
  149. }
  150. function mergeInterceptorHook(interceptor, option) {
  151. Object.keys(option).forEach(function (hook) {
  152. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  153. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  154. }
  155. });
  156. }
  157. function removeInterceptorHook(interceptor, option) {
  158. if (!interceptor || !option) {
  159. return;
  160. }
  161. Object.keys(option).forEach(function (hook) {
  162. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  163. removeHook(interceptor[hook], option[hook]);
  164. }
  165. });
  166. }
  167. function addInterceptor(method, option) {
  168. if (typeof method === 'string' && isPlainObject(option)) {
  169. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  170. } else if (isPlainObject(method)) {
  171. mergeInterceptorHook(globalInterceptors, method);
  172. }
  173. }
  174. function removeInterceptor(method, option) {
  175. if (typeof method === 'string') {
  176. if (isPlainObject(option)) {
  177. removeInterceptorHook(scopedInterceptors[method], option);
  178. } else {
  179. delete scopedInterceptors[method];
  180. }
  181. } else if (isPlainObject(method)) {
  182. removeInterceptorHook(globalInterceptors, method);
  183. }
  184. }
  185. function wrapperHook(hook) {
  186. return function (data) {
  187. return hook(data) || data;
  188. };
  189. }
  190. function isPromise(obj) {
  191. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  192. }
  193. function queue(hooks, data) {
  194. var promise = false;
  195. for (var i = 0; i < hooks.length; i++) {
  196. var hook = hooks[i];
  197. if (promise) {
  198. promise = Promise.resolve(wrapperHook(hook));
  199. } else {
  200. var res = hook(data);
  201. if (isPromise(res)) {
  202. promise = Promise.resolve(res);
  203. }
  204. if (res === false) {
  205. return {
  206. then: function then() {} };
  207. }
  208. }
  209. }
  210. return promise || {
  211. then: function then(callback) {
  212. return callback(data);
  213. } };
  214. }
  215. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  216. ['success', 'fail', 'complete'].forEach(function (name) {
  217. if (Array.isArray(interceptor[name])) {
  218. var oldCallback = options[name];
  219. options[name] = function callbackInterceptor(res) {
  220. queue(interceptor[name], res).then(function (res) {
  221. /* eslint-disable no-mixed-operators */
  222. return isFn(oldCallback) && oldCallback(res) || res;
  223. });
  224. };
  225. }
  226. });
  227. return options;
  228. }
  229. function wrapperReturnValue(method, returnValue) {
  230. var returnValueHooks = [];
  231. if (Array.isArray(globalInterceptors.returnValue)) {
  232. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  233. }
  234. var interceptor = scopedInterceptors[method];
  235. if (interceptor && Array.isArray(interceptor.returnValue)) {
  236. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  237. }
  238. returnValueHooks.forEach(function (hook) {
  239. returnValue = hook(returnValue) || returnValue;
  240. });
  241. return returnValue;
  242. }
  243. function getApiInterceptorHooks(method) {
  244. var interceptor = Object.create(null);
  245. Object.keys(globalInterceptors).forEach(function (hook) {
  246. if (hook !== 'returnValue') {
  247. interceptor[hook] = globalInterceptors[hook].slice();
  248. }
  249. });
  250. var scopedInterceptor = scopedInterceptors[method];
  251. if (scopedInterceptor) {
  252. Object.keys(scopedInterceptor).forEach(function (hook) {
  253. if (hook !== 'returnValue') {
  254. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  255. }
  256. });
  257. }
  258. return interceptor;
  259. }
  260. 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];}
  261. var interceptor = getApiInterceptorHooks(method);
  262. if (interceptor && Object.keys(interceptor).length) {
  263. if (Array.isArray(interceptor.invoke)) {
  264. var res = queue(interceptor.invoke, options);
  265. return res.then(function (options) {
  266. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  267. });
  268. } else {
  269. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  270. }
  271. }
  272. return api.apply(void 0, [options].concat(params));
  273. }
  274. var promiseInterceptor = {
  275. returnValue: function returnValue(res) {
  276. if (!isPromise(res)) {
  277. return res;
  278. }
  279. return new Promise(function (resolve, reject) {
  280. res.then(function (res) {
  281. if (res[0]) {
  282. reject(res[0]);
  283. } else {
  284. resolve(res[1]);
  285. }
  286. });
  287. });
  288. } };
  289. var SYNC_API_RE =
  290. /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo/;
  291. var CONTEXT_API_RE = /^create|Manager$/;
  292. // Context例外情况
  293. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  294. // 同步例外情况
  295. var ASYNC_API = ['createBLEConnection'];
  296. var CALLBACK_API_RE = /^on|^off/;
  297. function isContextApi(name) {
  298. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  299. }
  300. function isSyncApi(name) {
  301. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  302. }
  303. function isCallbackApi(name) {
  304. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  305. }
  306. function handlePromise(promise) {
  307. return promise.then(function (data) {
  308. return [null, data];
  309. }).
  310. catch(function (err) {return [err];});
  311. }
  312. function shouldPromise(name) {
  313. if (
  314. isContextApi(name) ||
  315. isSyncApi(name) ||
  316. isCallbackApi(name))
  317. {
  318. return false;
  319. }
  320. return true;
  321. }
  322. /* eslint-disable no-extend-native */
  323. if (!Promise.prototype.finally) {
  324. Promise.prototype.finally = function (callback) {
  325. var promise = this.constructor;
  326. return this.then(
  327. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  328. function (reason) {return promise.resolve(callback()).then(function () {
  329. throw reason;
  330. });});
  331. };
  332. }
  333. function promisify(name, api) {
  334. if (!shouldPromise(name)) {
  335. return api;
  336. }
  337. 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];}
  338. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  339. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  340. }
  341. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  342. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  343. success: resolve,
  344. fail: reject })].concat(
  345. params));
  346. })));
  347. };
  348. }
  349. var EPS = 1e-4;
  350. var BASE_DEVICE_WIDTH = 750;
  351. var isIOS = false;
  352. var deviceWidth = 0;
  353. var deviceDPR = 0;
  354. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  355. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  356. deviceWidth = windowWidth;
  357. deviceDPR = pixelRatio;
  358. isIOS = platform === 'ios';
  359. }
  360. function upx2px(number, newDeviceWidth) {
  361. if (deviceWidth === 0) {
  362. checkDeviceWidth();
  363. }
  364. number = Number(number);
  365. if (number === 0) {
  366. return 0;
  367. }
  368. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  369. if (result < 0) {
  370. result = -result;
  371. }
  372. result = Math.floor(result + EPS);
  373. if (result === 0) {
  374. if (deviceDPR === 1 || !isIOS) {
  375. result = 1;
  376. } else {
  377. result = 0.5;
  378. }
  379. }
  380. return number < 0 ? -result : result;
  381. }
  382. var LOCALE_ZH_HANS = 'zh-Hans';
  383. var LOCALE_ZH_HANT = 'zh-Hant';
  384. var LOCALE_EN = 'en';
  385. var LOCALE_FR = 'fr';
  386. var LOCALE_ES = 'es';
  387. var messages = {};
  388. var locale;
  389. {
  390. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  391. }
  392. function initI18nMessages() {
  393. if (!isEnableLocale()) {
  394. return;
  395. }
  396. var localeKeys = Object.keys(__uniConfig.locales);
  397. if (localeKeys.length) {
  398. localeKeys.forEach(function (locale) {
  399. var curMessages = messages[locale];
  400. var userMessages = __uniConfig.locales[locale];
  401. if (curMessages) {
  402. Object.assign(curMessages, userMessages);
  403. } else {
  404. messages[locale] = userMessages;
  405. }
  406. });
  407. }
  408. }
  409. initI18nMessages();
  410. var i18n = (0, _uniI18n.initVueI18n)(
  411. locale,
  412. {});
  413. var t = i18n.t;
  414. var i18nMixin = i18n.mixin = {
  415. beforeCreate: function beforeCreate() {var _this = this;
  416. var unwatch = i18n.i18n.watchLocale(function () {
  417. _this.$forceUpdate();
  418. });
  419. this.$once('hook:beforeDestroy', function () {
  420. unwatch();
  421. });
  422. },
  423. methods: {
  424. $$t: function $$t(key, values) {
  425. return t(key, values);
  426. } } };
  427. var setLocale = i18n.setLocale;
  428. var getLocale = i18n.getLocale;
  429. function initAppLocale(Vue, appVm, locale) {
  430. var state = Vue.observable({
  431. locale: locale || i18n.getLocale() });
  432. var localeWatchers = [];
  433. appVm.$watchLocale = function (fn) {
  434. localeWatchers.push(fn);
  435. };
  436. Object.defineProperty(appVm, '$locale', {
  437. get: function get() {
  438. return state.locale;
  439. },
  440. set: function set(v) {
  441. state.locale = v;
  442. localeWatchers.forEach(function (watch) {return watch(v);});
  443. } });
  444. }
  445. function isEnableLocale() {
  446. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  447. }
  448. function include(str, parts) {
  449. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  450. }
  451. function startsWith(str, parts) {
  452. return parts.find(function (part) {return str.indexOf(part) === 0;});
  453. }
  454. function normalizeLocale(locale, messages) {
  455. if (!locale) {
  456. return;
  457. }
  458. locale = locale.trim().replace(/_/g, '-');
  459. if (messages && messages[locale]) {
  460. return locale;
  461. }
  462. locale = locale.toLowerCase();
  463. if (locale === 'chinese') {
  464. // 支付宝
  465. return LOCALE_ZH_HANS;
  466. }
  467. if (locale.indexOf('zh') === 0) {
  468. if (locale.indexOf('-hans') > -1) {
  469. return LOCALE_ZH_HANS;
  470. }
  471. if (locale.indexOf('-hant') > -1) {
  472. return LOCALE_ZH_HANT;
  473. }
  474. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  475. return LOCALE_ZH_HANT;
  476. }
  477. return LOCALE_ZH_HANS;
  478. }
  479. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  480. if (lang) {
  481. return lang;
  482. }
  483. }
  484. // export function initI18n() {
  485. // const localeKeys = Object.keys(__uniConfig.locales || {})
  486. // if (localeKeys.length) {
  487. // localeKeys.forEach((locale) =>
  488. // i18n.add(locale, __uniConfig.locales[locale])
  489. // )
  490. // }
  491. // }
  492. function getLocale$1() {
  493. // 优先使用 $locale
  494. var app = getApp({
  495. allowDefault: true });
  496. if (app && app.$vm) {
  497. return app.$vm.$locale;
  498. }
  499. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  500. }
  501. function setLocale$1(locale) {
  502. var app = getApp();
  503. if (!app) {
  504. return false;
  505. }
  506. var oldLocale = app.$vm.$locale;
  507. if (oldLocale !== locale) {
  508. app.$vm.$locale = locale;
  509. onLocaleChangeCallbacks.forEach(function (fn) {return fn({
  510. locale: locale });});
  511. return true;
  512. }
  513. return false;
  514. }
  515. var onLocaleChangeCallbacks = [];
  516. function onLocaleChange(fn) {
  517. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  518. onLocaleChangeCallbacks.push(fn);
  519. }
  520. }
  521. if (typeof global !== 'undefined') {
  522. global.getLocale = getLocale$1;
  523. }
  524. var interceptors = {
  525. promiseInterceptor: promiseInterceptor };
  526. var baseApi = /*#__PURE__*/Object.freeze({
  527. __proto__: null,
  528. upx2px: upx2px,
  529. getLocale: getLocale$1,
  530. setLocale: setLocale$1,
  531. onLocaleChange: onLocaleChange,
  532. addInterceptor: addInterceptor,
  533. removeInterceptor: removeInterceptor,
  534. interceptors: interceptors });
  535. function findExistsPageIndex(url) {
  536. var pages = getCurrentPages();
  537. var len = pages.length;
  538. while (len--) {
  539. var page = pages[len];
  540. if (page.$page && page.$page.fullPath === url) {
  541. return len;
  542. }
  543. }
  544. return -1;
  545. }
  546. var redirectTo = {
  547. name: function name(fromArgs) {
  548. if (fromArgs.exists === 'back' && fromArgs.delta) {
  549. return 'navigateBack';
  550. }
  551. return 'redirectTo';
  552. },
  553. args: function args(fromArgs) {
  554. if (fromArgs.exists === 'back' && fromArgs.url) {
  555. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  556. if (existsPageIndex !== -1) {
  557. var delta = getCurrentPages().length - 1 - existsPageIndex;
  558. if (delta > 0) {
  559. fromArgs.delta = delta;
  560. }
  561. }
  562. }
  563. } };
  564. var previewImage = {
  565. args: function args(fromArgs) {
  566. var currentIndex = parseInt(fromArgs.current);
  567. if (isNaN(currentIndex)) {
  568. return;
  569. }
  570. var urls = fromArgs.urls;
  571. if (!Array.isArray(urls)) {
  572. return;
  573. }
  574. var len = urls.length;
  575. if (!len) {
  576. return;
  577. }
  578. if (currentIndex < 0) {
  579. currentIndex = 0;
  580. } else if (currentIndex >= len) {
  581. currentIndex = len - 1;
  582. }
  583. if (currentIndex > 0) {
  584. fromArgs.current = urls[currentIndex];
  585. fromArgs.urls = urls.filter(
  586. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  587. } else {
  588. fromArgs.current = urls[0];
  589. }
  590. return {
  591. indicator: false,
  592. loop: false };
  593. } };
  594. var UUID_KEY = '__DC_STAT_UUID';
  595. var deviceId;
  596. function useDeviceId(result) {
  597. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  598. if (!deviceId) {
  599. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  600. wx.setStorage({
  601. key: UUID_KEY,
  602. data: deviceId });
  603. }
  604. result.deviceId = deviceId;
  605. }
  606. function addSafeAreaInsets(result) {
  607. if (result.safeArea) {
  608. var safeArea = result.safeArea;
  609. result.safeAreaInsets = {
  610. top: safeArea.top,
  611. left: safeArea.left,
  612. right: result.windowWidth - safeArea.right,
  613. bottom: result.screenHeight - safeArea.bottom };
  614. }
  615. }
  616. function populateParameters(result) {var _result$brand =
  617. result.brand,brand = _result$brand === void 0 ? '' : _result$brand,_result$model = result.model,model = _result$model === void 0 ? '' : _result$model,_result$system = result.system,system = _result$system === void 0 ? '' : _result$system,_result$language = result.language,language = _result$language === void 0 ? '' : _result$language,theme = result.theme,version = result.version,platform = result.platform,fontSizeSetting = result.fontSizeSetting,SDKVersion = result.SDKVersion,pixelRatio = result.pixelRatio,deviceOrientation = result.deviceOrientation;
  618. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  619. // osName osVersion
  620. var osName = '';
  621. var osVersion = '';
  622. {
  623. osName = system.split(' ')[0] || '';
  624. osVersion = system.split(' ')[1] || '';
  625. }
  626. var hostVersion = version;
  627. // deviceType
  628. var deviceType = getGetDeviceType(result, model);
  629. // deviceModel
  630. var deviceBrand = getDeviceBrand(brand);
  631. // hostName
  632. var _hostName = getHostName(result);
  633. // deviceOrientation
  634. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  635. // devicePixelRatio
  636. var _devicePixelRatio = pixelRatio;
  637. // SDKVersion
  638. var _SDKVersion = SDKVersion;
  639. // hostLanguage
  640. var hostLanguage = language.replace(/_/g, '-');
  641. // wx.getAccountInfoSync
  642. var parameters = {
  643. appId: "__UNI__1C40FB4",
  644. appName: "mdapp",
  645. appVersion: "1.0.0",
  646. appVersionCode: "100",
  647. appLanguage: getAppLanguage(hostLanguage),
  648. uniCompileVersion: "3.4.18",
  649. uniRuntimeVersion: "3.4.18",
  650. uniPlatform: undefined || "mp-weixin",
  651. deviceBrand: deviceBrand,
  652. deviceModel: model,
  653. deviceType: deviceType,
  654. devicePixelRatio: _devicePixelRatio,
  655. deviceOrientation: _deviceOrientation,
  656. osName: osName.toLocaleLowerCase(),
  657. osVersion: osVersion,
  658. hostTheme: theme,
  659. hostVersion: hostVersion,
  660. hostLanguage: hostLanguage,
  661. hostName: _hostName,
  662. hostSDKVersion: _SDKVersion,
  663. hostFontSizeSetting: fontSizeSetting,
  664. windowTop: 0,
  665. windowBottom: 0,
  666. // TODO
  667. osLanguage: undefined,
  668. osTheme: undefined,
  669. ua: undefined,
  670. hostPackageName: undefined,
  671. browserName: undefined,
  672. browserVersion: undefined };
  673. Object.assign(result, parameters);
  674. }
  675. function getGetDeviceType(result, model) {
  676. var deviceType = result.deviceType || 'phone';
  677. {
  678. var deviceTypeMaps = {
  679. ipad: 'pad',
  680. windows: 'pc',
  681. mac: 'pc' };
  682. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  683. var _model = model.toLocaleLowerCase();
  684. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  685. var _m = deviceTypeMapsKeys[index];
  686. if (_model.indexOf(_m) !== -1) {
  687. deviceType = deviceTypeMaps[_m];
  688. break;
  689. }
  690. }
  691. }
  692. return deviceType;
  693. }
  694. function getDeviceBrand(brand) {
  695. var deviceBrand = brand;
  696. if (deviceBrand) {
  697. deviceBrand = brand.toLocaleLowerCase();
  698. }
  699. return deviceBrand;
  700. }
  701. function getAppLanguage(defaultLanguage) {
  702. return getLocale$1 ?
  703. getLocale$1() :
  704. defaultLanguage;
  705. }
  706. function getHostName(result) {
  707. var _platform = 'WeChat';
  708. var _hostName = result.hostName || _platform; // mp-jd
  709. {
  710. if (result.environment) {
  711. _hostName = result.environment;
  712. } else if (result.host && result.host.env) {
  713. _hostName = result.host.env;
  714. }
  715. }
  716. return _hostName;
  717. }
  718. var getSystemInfo = {
  719. returnValue: function returnValue(result) {
  720. useDeviceId(result);
  721. addSafeAreaInsets(result);
  722. populateParameters(result);
  723. } };
  724. var showActionSheet = {
  725. args: function args(fromArgs) {
  726. if (typeof fromArgs === 'object') {
  727. fromArgs.alertText = fromArgs.title;
  728. }
  729. } };
  730. var getAppBaseInfo = {
  731. returnValue: function returnValue(result) {var _result =
  732. result,version = _result.version,language = _result.language,SDKVersion = _result.SDKVersion,theme = _result.theme;
  733. var _hostName = getHostName(result);
  734. var hostLanguage = language.replace('_', '-');
  735. result = sortObject(Object.assign(result, {
  736. appId: "__UNI__1C40FB4",
  737. appName: "mdapp",
  738. appVersion: "1.0.0",
  739. appVersionCode: "100",
  740. appLanguage: getAppLanguage(hostLanguage),
  741. hostVersion: version,
  742. hostLanguage: hostLanguage,
  743. hostName: _hostName,
  744. hostSDKVersion: SDKVersion,
  745. hostTheme: theme }));
  746. } };
  747. var getDeviceInfo = {
  748. returnValue: function returnValue(result) {var _result2 =
  749. result,brand = _result2.brand,model = _result2.model;
  750. var deviceType = getGetDeviceType(result, model);
  751. var deviceBrand = getDeviceBrand(brand);
  752. useDeviceId(result);
  753. result = sortObject(Object.assign(result, {
  754. deviceType: deviceType,
  755. deviceBrand: deviceBrand,
  756. deviceModel: model }));
  757. } };
  758. var getWindowInfo = {
  759. returnValue: function returnValue(result) {
  760. addSafeAreaInsets(result);
  761. result = sortObject(Object.assign(result, {
  762. windowTop: 0,
  763. windowBottom: 0 }));
  764. } };
  765. // import navigateTo from 'uni-helpers/navigate-to'
  766. var protocols = {
  767. redirectTo: redirectTo,
  768. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  769. previewImage: previewImage,
  770. getSystemInfo: getSystemInfo,
  771. getSystemInfoSync: getSystemInfo,
  772. showActionSheet: showActionSheet,
  773. getAppBaseInfo: getAppBaseInfo,
  774. getDeviceInfo: getDeviceInfo,
  775. getWindowInfo: getWindowInfo };
  776. var todos = [
  777. 'vibrate',
  778. 'preloadPage',
  779. 'unPreloadPage',
  780. 'loadSubPackage'];
  781. var canIUses = [];
  782. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  783. function processCallback(methodName, method, returnValue) {
  784. return function (res) {
  785. return method(processReturnValue(methodName, res, returnValue));
  786. };
  787. }
  788. 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;
  789. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  790. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  791. if (isFn(argsOption)) {
  792. argsOption = argsOption(fromArgs, toArgs) || {};
  793. }
  794. for (var key in fromArgs) {
  795. if (hasOwn(argsOption, key)) {
  796. var keyOption = argsOption[key];
  797. if (isFn(keyOption)) {
  798. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  799. }
  800. if (!keyOption) {// 不支持的参数
  801. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  802. } else if (isStr(keyOption)) {// 重写参数 key
  803. toArgs[keyOption] = fromArgs[key];
  804. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  805. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  806. }
  807. } else if (CALLBACKS.indexOf(key) !== -1) {
  808. if (isFn(fromArgs[key])) {
  809. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  810. }
  811. } else {
  812. if (!keepFromArgs) {
  813. toArgs[key] = fromArgs[key];
  814. }
  815. }
  816. }
  817. return toArgs;
  818. } else if (isFn(fromArgs)) {
  819. fromArgs = processCallback(methodName, fromArgs, returnValue);
  820. }
  821. return fromArgs;
  822. }
  823. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  824. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  825. res = protocols.returnValue(methodName, res);
  826. }
  827. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  828. }
  829. function wrapper(methodName, method) {
  830. if (hasOwn(protocols, methodName)) {
  831. var protocol = protocols[methodName];
  832. if (!protocol) {// 暂不支持的 api
  833. return function () {
  834. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  835. };
  836. }
  837. return function (arg1, arg2) {// 目前 api 最多两个参数
  838. var options = protocol;
  839. if (isFn(protocol)) {
  840. options = protocol(arg1);
  841. }
  842. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  843. var args = [arg1];
  844. if (typeof arg2 !== 'undefined') {
  845. args.push(arg2);
  846. }
  847. if (isFn(options.name)) {
  848. methodName = options.name(arg1);
  849. } else if (isStr(options.name)) {
  850. methodName = options.name;
  851. }
  852. var returnValue = wx[methodName].apply(wx, args);
  853. if (isSyncApi(methodName)) {// 同步 api
  854. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  855. }
  856. return returnValue;
  857. };
  858. }
  859. return method;
  860. }
  861. var todoApis = Object.create(null);
  862. var TODOS = [
  863. 'onTabBarMidButtonTap',
  864. 'subscribePush',
  865. 'unsubscribePush',
  866. 'onPush',
  867. 'offPush',
  868. 'share'];
  869. function createTodoApi(name) {
  870. return function todoApi(_ref)
  871. {var fail = _ref.fail,complete = _ref.complete;
  872. var res = {
  873. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  874. isFn(fail) && fail(res);
  875. isFn(complete) && complete(res);
  876. };
  877. }
  878. TODOS.forEach(function (name) {
  879. todoApis[name] = createTodoApi(name);
  880. });
  881. var providers = {
  882. oauth: ['weixin'],
  883. share: ['weixin'],
  884. payment: ['wxpay'],
  885. push: ['weixin'] };
  886. function getProvider(_ref2)
  887. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  888. var res = false;
  889. if (providers[service]) {
  890. res = {
  891. errMsg: 'getProvider:ok',
  892. service: service,
  893. provider: providers[service] };
  894. isFn(success) && success(res);
  895. } else {
  896. res = {
  897. errMsg: 'getProvider:fail service not found' };
  898. isFn(fail) && fail(res);
  899. }
  900. isFn(complete) && complete(res);
  901. }
  902. var extraApi = /*#__PURE__*/Object.freeze({
  903. __proto__: null,
  904. getProvider: getProvider });
  905. var getEmitter = function () {
  906. var Emitter;
  907. return function getUniEmitter() {
  908. if (!Emitter) {
  909. Emitter = new _vue.default();
  910. }
  911. return Emitter;
  912. };
  913. }();
  914. function apply(ctx, method, args) {
  915. return ctx[method].apply(ctx, args);
  916. }
  917. function $on() {
  918. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  919. }
  920. function $off() {
  921. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  922. }
  923. function $once() {
  924. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  925. }
  926. function $emit() {
  927. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  928. }
  929. var eventApi = /*#__PURE__*/Object.freeze({
  930. __proto__: null,
  931. $on: $on,
  932. $off: $off,
  933. $once: $once,
  934. $emit: $emit });
  935. /**
  936. * 框架内 try-catch
  937. */
  938. /**
  939. * 开发者 try-catch
  940. */
  941. function tryCatch(fn) {
  942. return function () {
  943. try {
  944. return fn.apply(fn, arguments);
  945. } catch (e) {
  946. // TODO
  947. console.error(e);
  948. }
  949. };
  950. }
  951. function getApiCallbacks(params) {
  952. var apiCallbacks = {};
  953. for (var name in params) {
  954. var param = params[name];
  955. if (isFn(param)) {
  956. apiCallbacks[name] = tryCatch(param);
  957. delete params[name];
  958. }
  959. }
  960. return apiCallbacks;
  961. }
  962. var cid;
  963. var cidErrMsg;
  964. function normalizePushMessage(message) {
  965. try {
  966. return JSON.parse(message);
  967. } catch (e) {}
  968. return message;
  969. }
  970. function invokePushCallback(
  971. args)
  972. {
  973. if (args.type === 'clientId') {
  974. cid = args.cid;
  975. cidErrMsg = args.errMsg;
  976. invokeGetPushCidCallbacks(cid, args.errMsg);
  977. } else if (args.type === 'pushMsg') {
  978. onPushMessageCallbacks.forEach(function (callback) {
  979. callback({
  980. type: 'receive',
  981. data: normalizePushMessage(args.message) });
  982. });
  983. } else if (args.type === 'click') {
  984. onPushMessageCallbacks.forEach(function (callback) {
  985. callback({
  986. type: 'click',
  987. data: normalizePushMessage(args.message) });
  988. });
  989. }
  990. }
  991. var getPushCidCallbacks = [];
  992. function invokeGetPushCidCallbacks(cid, errMsg) {
  993. getPushCidCallbacks.forEach(function (callback) {
  994. callback(cid, errMsg);
  995. });
  996. getPushCidCallbacks.length = 0;
  997. }
  998. function getPushClientid(args) {
  999. if (!isPlainObject(args)) {
  1000. args = {};
  1001. }var _getApiCallbacks =
  1002. getApiCallbacks(args),success = _getApiCallbacks.success,fail = _getApiCallbacks.fail,complete = _getApiCallbacks.complete;
  1003. var hasSuccess = isFn(success);
  1004. var hasFail = isFn(fail);
  1005. var hasComplete = isFn(complete);
  1006. getPushCidCallbacks.push(function (cid, errMsg) {
  1007. var res;
  1008. if (cid) {
  1009. res = {
  1010. errMsg: 'getPushClientid:ok',
  1011. cid: cid };
  1012. hasSuccess && success(res);
  1013. } else {
  1014. res = {
  1015. errMsg: 'getPushClientid:fail' + (errMsg ? ' ' + errMsg : '') };
  1016. hasFail && fail(res);
  1017. }
  1018. hasComplete && complete(res);
  1019. });
  1020. if (typeof cid !== 'undefined') {
  1021. Promise.resolve().then(function () {return invokeGetPushCidCallbacks(cid, cidErrMsg);});
  1022. }
  1023. }
  1024. var onPushMessageCallbacks = [];
  1025. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1026. var onPushMessage = function onPushMessage(fn) {
  1027. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1028. onPushMessageCallbacks.push(fn);
  1029. }
  1030. };
  1031. var offPushMessage = function offPushMessage(fn) {
  1032. if (!fn) {
  1033. onPushMessageCallbacks.length = 0;
  1034. } else {
  1035. var index = onPushMessageCallbacks.indexOf(fn);
  1036. if (index > -1) {
  1037. onPushMessageCallbacks.splice(index, 1);
  1038. }
  1039. }
  1040. };
  1041. var api = /*#__PURE__*/Object.freeze({
  1042. __proto__: null,
  1043. getPushClientid: getPushClientid,
  1044. onPushMessage: onPushMessage,
  1045. offPushMessage: offPushMessage,
  1046. invokePushCallback: invokePushCallback });
  1047. var MPPage = Page;
  1048. var MPComponent = Component;
  1049. var customizeRE = /:/g;
  1050. var customize = cached(function (str) {
  1051. return camelize(str.replace(customizeRE, '-'));
  1052. });
  1053. function initTriggerEvent(mpInstance) {
  1054. var oldTriggerEvent = mpInstance.triggerEvent;
  1055. var newTriggerEvent = function newTriggerEvent(event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  1056. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  1057. };
  1058. try {
  1059. // 京东小程序 triggerEvent 为只读
  1060. mpInstance.triggerEvent = newTriggerEvent;
  1061. } catch (error) {
  1062. mpInstance._triggerEvent = newTriggerEvent;
  1063. }
  1064. }
  1065. function initHook(name, options, isComponent) {
  1066. var oldHook = options[name];
  1067. if (!oldHook) {
  1068. options[name] = function () {
  1069. initTriggerEvent(this);
  1070. };
  1071. } else {
  1072. options[name] = function () {
  1073. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  1074. return oldHook.apply(this, args);
  1075. };
  1076. }
  1077. }
  1078. if (!MPPage.__$wrappered) {
  1079. MPPage.__$wrappered = true;
  1080. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1081. initHook('onLoad', options);
  1082. return MPPage(options);
  1083. };
  1084. Page.after = MPPage.after;
  1085. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1086. initHook('created', options);
  1087. return MPComponent(options);
  1088. };
  1089. }
  1090. var PAGE_EVENT_HOOKS = [
  1091. 'onPullDownRefresh',
  1092. 'onReachBottom',
  1093. 'onAddToFavorites',
  1094. 'onShareTimeline',
  1095. 'onShareAppMessage',
  1096. 'onPageScroll',
  1097. 'onResize',
  1098. 'onTabItemTap'];
  1099. function initMocks(vm, mocks) {
  1100. var mpInstance = vm.$mp[vm.mpType];
  1101. mocks.forEach(function (mock) {
  1102. if (hasOwn(mpInstance, mock)) {
  1103. vm[mock] = mpInstance[mock];
  1104. }
  1105. });
  1106. }
  1107. function hasHook(hook, vueOptions) {
  1108. if (!vueOptions) {
  1109. return true;
  1110. }
  1111. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  1112. return true;
  1113. }
  1114. vueOptions = vueOptions.default || vueOptions;
  1115. if (isFn(vueOptions)) {
  1116. if (isFn(vueOptions.extendOptions[hook])) {
  1117. return true;
  1118. }
  1119. if (vueOptions.super &&
  1120. vueOptions.super.options &&
  1121. Array.isArray(vueOptions.super.options[hook])) {
  1122. return true;
  1123. }
  1124. return false;
  1125. }
  1126. if (isFn(vueOptions[hook])) {
  1127. return true;
  1128. }
  1129. var mixins = vueOptions.mixins;
  1130. if (Array.isArray(mixins)) {
  1131. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  1132. }
  1133. }
  1134. function initHooks(mpOptions, hooks, vueOptions) {
  1135. hooks.forEach(function (hook) {
  1136. if (hasHook(hook, vueOptions)) {
  1137. mpOptions[hook] = function (args) {
  1138. return this.$vm && this.$vm.__call_hook(hook, args);
  1139. };
  1140. }
  1141. });
  1142. }
  1143. function initVueComponent(Vue, vueOptions) {
  1144. vueOptions = vueOptions.default || vueOptions;
  1145. var VueComponent;
  1146. if (isFn(vueOptions)) {
  1147. VueComponent = vueOptions;
  1148. } else {
  1149. VueComponent = Vue.extend(vueOptions);
  1150. }
  1151. vueOptions = VueComponent.options;
  1152. return [VueComponent, vueOptions];
  1153. }
  1154. function initSlots(vm, vueSlots) {
  1155. if (Array.isArray(vueSlots) && vueSlots.length) {
  1156. var $slots = Object.create(null);
  1157. vueSlots.forEach(function (slotName) {
  1158. $slots[slotName] = true;
  1159. });
  1160. vm.$scopedSlots = vm.$slots = $slots;
  1161. }
  1162. }
  1163. function initVueIds(vueIds, mpInstance) {
  1164. vueIds = (vueIds || '').split(',');
  1165. var len = vueIds.length;
  1166. if (len === 1) {
  1167. mpInstance._$vueId = vueIds[0];
  1168. } else if (len === 2) {
  1169. mpInstance._$vueId = vueIds[0];
  1170. mpInstance._$vuePid = vueIds[1];
  1171. }
  1172. }
  1173. function initData(vueOptions, context) {
  1174. var data = vueOptions.data || {};
  1175. var methods = vueOptions.methods || {};
  1176. if (typeof data === 'function') {
  1177. try {
  1178. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  1179. } catch (e) {
  1180. if (Object({"VUE_APP_NAME":"mdapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  1181. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  1182. }
  1183. }
  1184. } else {
  1185. try {
  1186. // 对 data 格式化
  1187. data = JSON.parse(JSON.stringify(data));
  1188. } catch (e) {}
  1189. }
  1190. if (!isPlainObject(data)) {
  1191. data = {};
  1192. }
  1193. Object.keys(methods).forEach(function (methodName) {
  1194. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  1195. data[methodName] = methods[methodName];
  1196. }
  1197. });
  1198. return data;
  1199. }
  1200. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  1201. function createObserver(name) {
  1202. return function observer(newVal, oldVal) {
  1203. if (this.$vm) {
  1204. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  1205. }
  1206. };
  1207. }
  1208. function initBehaviors(vueOptions, initBehavior) {
  1209. var vueBehaviors = vueOptions.behaviors;
  1210. var vueExtends = vueOptions.extends;
  1211. var vueMixins = vueOptions.mixins;
  1212. var vueProps = vueOptions.props;
  1213. if (!vueProps) {
  1214. vueOptions.props = vueProps = [];
  1215. }
  1216. var behaviors = [];
  1217. if (Array.isArray(vueBehaviors)) {
  1218. vueBehaviors.forEach(function (behavior) {
  1219. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  1220. if (behavior === 'uni://form-field') {
  1221. if (Array.isArray(vueProps)) {
  1222. vueProps.push('name');
  1223. vueProps.push('value');
  1224. } else {
  1225. vueProps.name = {
  1226. type: String,
  1227. default: '' };
  1228. vueProps.value = {
  1229. type: [String, Number, Boolean, Array, Object, Date],
  1230. default: '' };
  1231. }
  1232. }
  1233. });
  1234. }
  1235. if (isPlainObject(vueExtends) && vueExtends.props) {
  1236. behaviors.push(
  1237. initBehavior({
  1238. properties: initProperties(vueExtends.props, true) }));
  1239. }
  1240. if (Array.isArray(vueMixins)) {
  1241. vueMixins.forEach(function (vueMixin) {
  1242. if (isPlainObject(vueMixin) && vueMixin.props) {
  1243. behaviors.push(
  1244. initBehavior({
  1245. properties: initProperties(vueMixin.props, true) }));
  1246. }
  1247. });
  1248. }
  1249. return behaviors;
  1250. }
  1251. function parsePropType(key, type, defaultValue, file) {
  1252. // [String]=>String
  1253. if (Array.isArray(type) && type.length === 1) {
  1254. return type[0];
  1255. }
  1256. return type;
  1257. }
  1258. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  1259. var properties = {};
  1260. if (!isBehavior) {
  1261. properties.vueId = {
  1262. type: String,
  1263. value: '' };
  1264. // 用于字节跳动小程序模拟抽象节点
  1265. properties.generic = {
  1266. type: Object,
  1267. value: null };
  1268. // scopedSlotsCompiler auto
  1269. properties.scopedSlotsCompiler = {
  1270. type: String,
  1271. value: '' };
  1272. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  1273. type: null,
  1274. value: [],
  1275. observer: function observer(newVal, oldVal) {
  1276. var $slots = Object.create(null);
  1277. newVal.forEach(function (slotName) {
  1278. $slots[slotName] = true;
  1279. });
  1280. this.setData({
  1281. $slots: $slots });
  1282. } };
  1283. }
  1284. if (Array.isArray(props)) {// ['title']
  1285. props.forEach(function (key) {
  1286. properties[key] = {
  1287. type: null,
  1288. observer: createObserver(key) };
  1289. });
  1290. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  1291. Object.keys(props).forEach(function (key) {
  1292. var opts = props[key];
  1293. if (isPlainObject(opts)) {// title:{type:String,default:''}
  1294. var value = opts.default;
  1295. if (isFn(value)) {
  1296. value = value();
  1297. }
  1298. opts.type = parsePropType(key, opts.type);
  1299. properties[key] = {
  1300. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  1301. value: value,
  1302. observer: createObserver(key) };
  1303. } else {// content:String
  1304. var type = parsePropType(key, opts);
  1305. properties[key] = {
  1306. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  1307. observer: createObserver(key) };
  1308. }
  1309. });
  1310. }
  1311. return properties;
  1312. }
  1313. function wrapper$1(event) {
  1314. // TODO 又得兼容 mpvue 的 mp 对象
  1315. try {
  1316. event.mp = JSON.parse(JSON.stringify(event));
  1317. } catch (e) {}
  1318. event.stopPropagation = noop;
  1319. event.preventDefault = noop;
  1320. event.target = event.target || {};
  1321. if (!hasOwn(event, 'detail')) {
  1322. event.detail = {};
  1323. }
  1324. if (hasOwn(event, 'markerId')) {
  1325. event.detail = typeof event.detail === 'object' ? event.detail : {};
  1326. event.detail.markerId = event.markerId;
  1327. }
  1328. if (isPlainObject(event.detail)) {
  1329. event.target = Object.assign({}, event.target, event.detail);
  1330. }
  1331. return event;
  1332. }
  1333. function getExtraValue(vm, dataPathsArray) {
  1334. var context = vm;
  1335. dataPathsArray.forEach(function (dataPathArray) {
  1336. var dataPath = dataPathArray[0];
  1337. var value = dataPathArray[2];
  1338. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  1339. var propPath = dataPathArray[1];
  1340. var valuePath = dataPathArray[3];
  1341. var vFor;
  1342. if (Number.isInteger(dataPath)) {
  1343. vFor = dataPath;
  1344. } else if (!dataPath) {
  1345. vFor = context;
  1346. } else if (typeof dataPath === 'string' && dataPath) {
  1347. if (dataPath.indexOf('#s#') === 0) {
  1348. vFor = dataPath.substr(3);
  1349. } else {
  1350. vFor = vm.__get_value(dataPath, context);
  1351. }
  1352. }
  1353. if (Number.isInteger(vFor)) {
  1354. context = value;
  1355. } else if (!propPath) {
  1356. context = vFor[value];
  1357. } else {
  1358. if (Array.isArray(vFor)) {
  1359. context = vFor.find(function (vForItem) {
  1360. return vm.__get_value(propPath, vForItem) === value;
  1361. });
  1362. } else if (isPlainObject(vFor)) {
  1363. context = Object.keys(vFor).find(function (vForKey) {
  1364. return vm.__get_value(propPath, vFor[vForKey]) === value;
  1365. });
  1366. } else {
  1367. console.error('v-for 暂不支持循环数据:', vFor);
  1368. }
  1369. }
  1370. if (valuePath) {
  1371. context = vm.__get_value(valuePath, context);
  1372. }
  1373. }
  1374. });
  1375. return context;
  1376. }
  1377. function processEventExtra(vm, extra, event) {
  1378. var extraObj = {};
  1379. if (Array.isArray(extra) && extra.length) {
  1380. /**
  1381. *[
  1382. * ['data.items', 'data.id', item.data.id],
  1383. * ['metas', 'id', meta.id]
  1384. *],
  1385. *[
  1386. * ['data.items', 'data.id', item.data.id],
  1387. * ['metas', 'id', meta.id]
  1388. *],
  1389. *'test'
  1390. */
  1391. extra.forEach(function (dataPath, index) {
  1392. if (typeof dataPath === 'string') {
  1393. if (!dataPath) {// model,prop.sync
  1394. extraObj['$' + index] = vm;
  1395. } else {
  1396. if (dataPath === '$event') {// $event
  1397. extraObj['$' + index] = event;
  1398. } else if (dataPath === 'arguments') {
  1399. if (event.detail && event.detail.__args__) {
  1400. extraObj['$' + index] = event.detail.__args__;
  1401. } else {
  1402. extraObj['$' + index] = [event];
  1403. }
  1404. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1405. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1406. } else {
  1407. extraObj['$' + index] = vm.__get_value(dataPath);
  1408. }
  1409. }
  1410. } else {
  1411. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1412. }
  1413. });
  1414. }
  1415. return extraObj;
  1416. }
  1417. function getObjByArray(arr) {
  1418. var obj = {};
  1419. for (var i = 1; i < arr.length; i++) {
  1420. var element = arr[i];
  1421. obj[element[0]] = element[1];
  1422. }
  1423. return obj;
  1424. }
  1425. 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;
  1426. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1427. if (isCustom) {// 自定义事件
  1428. isCustomMPEvent = event.currentTarget &&
  1429. event.currentTarget.dataset &&
  1430. event.currentTarget.dataset.comType === 'wx';
  1431. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1432. if (isCustomMPEvent) {
  1433. return [event];
  1434. }
  1435. return event.detail.__args__ || event.detail;
  1436. }
  1437. }
  1438. var extraObj = processEventExtra(vm, extra, event);
  1439. var ret = [];
  1440. args.forEach(function (arg) {
  1441. if (arg === '$event') {
  1442. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1443. ret.push(event.target.value);
  1444. } else {
  1445. if (isCustom && !isCustomMPEvent) {
  1446. ret.push(event.detail.__args__[0]);
  1447. } else {// wxcomponent 组件或内置组件
  1448. ret.push(event);
  1449. }
  1450. }
  1451. } else {
  1452. if (Array.isArray(arg) && arg[0] === 'o') {
  1453. ret.push(getObjByArray(arg));
  1454. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1455. ret.push(extraObj[arg]);
  1456. } else {
  1457. ret.push(arg);
  1458. }
  1459. }
  1460. });
  1461. return ret;
  1462. }
  1463. var ONCE = '~';
  1464. var CUSTOM = '^';
  1465. function isMatchEventType(eventType, optType) {
  1466. return eventType === optType ||
  1467. optType === 'regionchange' && (
  1468. eventType === 'begin' ||
  1469. eventType === 'end');
  1470. }
  1471. function getContextVm(vm) {
  1472. var $parent = vm.$parent;
  1473. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1474. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1475. $parent = $parent.$parent;
  1476. }
  1477. return $parent && $parent.$parent;
  1478. }
  1479. function handleEvent(event) {var _this2 = this;
  1480. event = wrapper$1(event);
  1481. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1482. var dataset = (event.currentTarget || event.target).dataset;
  1483. if (!dataset) {
  1484. return console.warn('事件信息不存在');
  1485. }
  1486. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1487. if (!eventOpts) {
  1488. return console.warn('事件信息不存在');
  1489. }
  1490. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1491. var eventType = event.type;
  1492. var ret = [];
  1493. eventOpts.forEach(function (eventOpt) {
  1494. var type = eventOpt[0];
  1495. var eventsArray = eventOpt[1];
  1496. var isCustom = type.charAt(0) === CUSTOM;
  1497. type = isCustom ? type.slice(1) : type;
  1498. var isOnce = type.charAt(0) === ONCE;
  1499. type = isOnce ? type.slice(1) : type;
  1500. if (eventsArray && isMatchEventType(eventType, type)) {
  1501. eventsArray.forEach(function (eventArray) {
  1502. var methodName = eventArray[0];
  1503. if (methodName) {
  1504. var handlerCtx = _this2.$vm;
  1505. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1506. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1507. }
  1508. if (methodName === '$emit') {
  1509. handlerCtx.$emit.apply(handlerCtx,
  1510. processEventArgs(
  1511. _this2.$vm,
  1512. event,
  1513. eventArray[1],
  1514. eventArray[2],
  1515. isCustom,
  1516. methodName));
  1517. return;
  1518. }
  1519. var handler = handlerCtx[methodName];
  1520. if (!isFn(handler)) {
  1521. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1522. }
  1523. if (isOnce) {
  1524. if (handler.once) {
  1525. return;
  1526. }
  1527. handler.once = true;
  1528. }
  1529. var params = processEventArgs(
  1530. _this2.$vm,
  1531. event,
  1532. eventArray[1],
  1533. eventArray[2],
  1534. isCustom,
  1535. methodName);
  1536. params = Array.isArray(params) ? params : [];
  1537. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1538. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1539. // eslint-disable-next-line no-sparse-arrays
  1540. params = params.concat([,,,,,,,,,, event]);
  1541. }
  1542. ret.push(handler.apply(handlerCtx, params));
  1543. }
  1544. });
  1545. }
  1546. });
  1547. if (
  1548. eventType === 'input' &&
  1549. ret.length === 1 &&
  1550. typeof ret[0] !== 'undefined')
  1551. {
  1552. return ret[0];
  1553. }
  1554. }
  1555. var eventChannels = {};
  1556. var eventChannelStack = [];
  1557. function getEventChannel(id) {
  1558. if (id) {
  1559. var eventChannel = eventChannels[id];
  1560. delete eventChannels[id];
  1561. return eventChannel;
  1562. }
  1563. return eventChannelStack.shift();
  1564. }
  1565. var hooks = [
  1566. 'onShow',
  1567. 'onHide',
  1568. 'onError',
  1569. 'onPageNotFound',
  1570. 'onThemeChange',
  1571. 'onUnhandledRejection'];
  1572. function initEventChannel() {
  1573. _vue.default.prototype.getOpenerEventChannel = function () {
  1574. // 微信小程序使用自身getOpenerEventChannel
  1575. {
  1576. return this.$scope.getOpenerEventChannel();
  1577. }
  1578. };
  1579. var callHook = _vue.default.prototype.__call_hook;
  1580. _vue.default.prototype.__call_hook = function (hook, args) {
  1581. if (hook === 'onLoad' && args && args.__id__) {
  1582. this.__eventChannel__ = getEventChannel(args.__id__);
  1583. delete args.__id__;
  1584. }
  1585. return callHook.call(this, hook, args);
  1586. };
  1587. }
  1588. function initScopedSlotsParams() {
  1589. var center = {};
  1590. var parents = {};
  1591. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1592. var has = center[vueId];
  1593. if (!has) {
  1594. parents[vueId] = this;
  1595. this.$on('hook:destroyed', function () {
  1596. delete parents[vueId];
  1597. });
  1598. }
  1599. return has;
  1600. };
  1601. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1602. var data = center[vueId];
  1603. if (data) {
  1604. var object = data[name] || {};
  1605. return key ? object[key] : object;
  1606. } else {
  1607. parents[vueId] = this;
  1608. this.$on('hook:destroyed', function () {
  1609. delete parents[vueId];
  1610. });
  1611. }
  1612. };
  1613. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1614. var vueIds = this.$options.propsData.vueId;
  1615. if (vueIds) {
  1616. var vueId = vueIds.split(',')[0];
  1617. var object = center[vueId] = center[vueId] || {};
  1618. object[name] = value;
  1619. if (parents[vueId]) {
  1620. parents[vueId].$forceUpdate();
  1621. }
  1622. }
  1623. };
  1624. _vue.default.mixin({
  1625. destroyed: function destroyed() {
  1626. var propsData = this.$options.propsData;
  1627. var vueId = propsData && propsData.vueId;
  1628. if (vueId) {
  1629. delete center[vueId];
  1630. delete parents[vueId];
  1631. }
  1632. } });
  1633. }
  1634. function parseBaseApp(vm, _ref3)
  1635. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1636. initEventChannel();
  1637. {
  1638. initScopedSlotsParams();
  1639. }
  1640. if (vm.$options.store) {
  1641. _vue.default.prototype.$store = vm.$options.store;
  1642. }
  1643. uniIdMixin(_vue.default);
  1644. _vue.default.prototype.mpHost = "mp-weixin";
  1645. _vue.default.mixin({
  1646. beforeCreate: function beforeCreate() {
  1647. if (!this.$options.mpType) {
  1648. return;
  1649. }
  1650. this.mpType = this.$options.mpType;
  1651. this.$mp = _defineProperty({
  1652. data: {} },
  1653. this.mpType, this.$options.mpInstance);
  1654. this.$scope = this.$options.mpInstance;
  1655. delete this.$options.mpType;
  1656. delete this.$options.mpInstance;
  1657. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1658. var app = getApp();
  1659. if (app.$vm && app.$vm.$i18n) {
  1660. this._i18n = app.$vm.$i18n;
  1661. }
  1662. }
  1663. if (this.mpType !== 'app') {
  1664. initRefs(this);
  1665. initMocks(this, mocks);
  1666. }
  1667. } });
  1668. var appOptions = {
  1669. onLaunch: function onLaunch(args) {
  1670. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1671. return;
  1672. }
  1673. {
  1674. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1675. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1676. }
  1677. }
  1678. this.$vm = vm;
  1679. this.$vm.$mp = {
  1680. app: this };
  1681. this.$vm.$scope = this;
  1682. // vm 上也挂载 globalData
  1683. this.$vm.globalData = this.globalData;
  1684. this.$vm._isMounted = true;
  1685. this.$vm.__call_hook('mounted', args);
  1686. this.$vm.__call_hook('onLaunch', args);
  1687. } };
  1688. // 兼容旧版本 globalData
  1689. appOptions.globalData = vm.$options.globalData || {};
  1690. // 将 methods 中的方法挂在 getApp() 中
  1691. var methods = vm.$options.methods;
  1692. if (methods) {
  1693. Object.keys(methods).forEach(function (name) {
  1694. appOptions[name] = methods[name];
  1695. });
  1696. }
  1697. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  1698. initHooks(appOptions, hooks);
  1699. return appOptions;
  1700. }
  1701. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1702. function findVmByVueId(vm, vuePid) {
  1703. var $children = vm.$children;
  1704. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1705. for (var i = $children.length - 1; i >= 0; i--) {
  1706. var childVm = $children[i];
  1707. if (childVm.$scope._$vueId === vuePid) {
  1708. return childVm;
  1709. }
  1710. }
  1711. // 反向递归查找
  1712. var parentVm;
  1713. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1714. parentVm = findVmByVueId($children[_i], vuePid);
  1715. if (parentVm) {
  1716. return parentVm;
  1717. }
  1718. }
  1719. }
  1720. function initBehavior(options) {
  1721. return Behavior(options);
  1722. }
  1723. function isPage() {
  1724. return !!this.route;
  1725. }
  1726. function initRelation(detail) {
  1727. this.triggerEvent('__l', detail);
  1728. }
  1729. function selectAllComponents(mpInstance, selector, $refs) {
  1730. var components = mpInstance.selectAllComponents(selector);
  1731. components.forEach(function (component) {
  1732. var ref = component.dataset.ref;
  1733. $refs[ref] = component.$vm || component;
  1734. {
  1735. if (component.dataset.vueGeneric === 'scoped') {
  1736. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1737. selectAllComponents(scopedComponent, selector, $refs);
  1738. });
  1739. }
  1740. }
  1741. });
  1742. }
  1743. function initRefs(vm) {
  1744. var mpInstance = vm.$scope;
  1745. Object.defineProperty(vm, '$refs', {
  1746. get: function get() {
  1747. var $refs = {};
  1748. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1749. // TODO 暂不考虑 for 中的 scoped
  1750. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1751. forComponents.forEach(function (component) {
  1752. var ref = component.dataset.ref;
  1753. if (!$refs[ref]) {
  1754. $refs[ref] = [];
  1755. }
  1756. $refs[ref].push(component.$vm || component);
  1757. });
  1758. return $refs;
  1759. } });
  1760. }
  1761. function handleLink(event) {var _ref4 =
  1762. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1763. var parentVm;
  1764. if (vuePid) {
  1765. parentVm = findVmByVueId(this.$vm, vuePid);
  1766. }
  1767. if (!parentVm) {
  1768. parentVm = this.$vm;
  1769. }
  1770. vueOptions.parent = parentVm;
  1771. }
  1772. function parseApp(vm) {
  1773. return parseBaseApp(vm, {
  1774. mocks: mocks,
  1775. initRefs: initRefs });
  1776. }
  1777. function createApp(vm) {
  1778. App(parseApp(vm));
  1779. return vm;
  1780. }
  1781. var encodeReserveRE = /[!'()*]/g;
  1782. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1783. var commaRE = /%2C/g;
  1784. // fixed encodeURIComponent which is more conformant to RFC3986:
  1785. // - escapes [!'()*]
  1786. // - preserve commas
  1787. var encode = function encode(str) {return encodeURIComponent(str).
  1788. replace(encodeReserveRE, encodeReserveReplacer).
  1789. replace(commaRE, ',');};
  1790. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1791. var res = obj ? Object.keys(obj).map(function (key) {
  1792. var val = obj[key];
  1793. if (val === undefined) {
  1794. return '';
  1795. }
  1796. if (val === null) {
  1797. return encodeStr(key);
  1798. }
  1799. if (Array.isArray(val)) {
  1800. var result = [];
  1801. val.forEach(function (val2) {
  1802. if (val2 === undefined) {
  1803. return;
  1804. }
  1805. if (val2 === null) {
  1806. result.push(encodeStr(key));
  1807. } else {
  1808. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1809. }
  1810. });
  1811. return result.join('&');
  1812. }
  1813. return encodeStr(key) + '=' + encodeStr(val);
  1814. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1815. return res ? "?".concat(res) : '';
  1816. }
  1817. function parseBaseComponent(vueComponentOptions)
  1818. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1819. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1820. var options = _objectSpread({
  1821. multipleSlots: true,
  1822. addGlobalClass: true },
  1823. vueOptions.options || {});
  1824. {
  1825. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1826. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1827. Object.assign(options, vueOptions['mp-weixin'].options);
  1828. }
  1829. }
  1830. var componentOptions = {
  1831. options: options,
  1832. data: initData(vueOptions, _vue.default.prototype),
  1833. behaviors: initBehaviors(vueOptions, initBehavior),
  1834. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1835. lifetimes: {
  1836. attached: function attached() {
  1837. var properties = this.properties;
  1838. var options = {
  1839. mpType: isPage.call(this) ? 'page' : 'component',
  1840. mpInstance: this,
  1841. propsData: properties };
  1842. initVueIds(properties.vueId, this);
  1843. // 处理父子关系
  1844. initRelation.call(this, {
  1845. vuePid: this._$vuePid,
  1846. vueOptions: options });
  1847. // 初始化 vue 实例
  1848. this.$vm = new VueComponent(options);
  1849. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1850. initSlots(this.$vm, properties.vueSlots);
  1851. // 触发首次 setData
  1852. this.$vm.$mount();
  1853. },
  1854. ready: function ready() {
  1855. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1856. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1857. if (this.$vm) {
  1858. this.$vm._isMounted = true;
  1859. this.$vm.__call_hook('mounted');
  1860. this.$vm.__call_hook('onReady');
  1861. }
  1862. },
  1863. detached: function detached() {
  1864. this.$vm && this.$vm.$destroy();
  1865. } },
  1866. pageLifetimes: {
  1867. show: function show(args) {
  1868. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1869. },
  1870. hide: function hide() {
  1871. this.$vm && this.$vm.__call_hook('onPageHide');
  1872. },
  1873. resize: function resize(size) {
  1874. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1875. } },
  1876. methods: {
  1877. __l: handleLink,
  1878. __e: handleEvent } };
  1879. // externalClasses
  1880. if (vueOptions.externalClasses) {
  1881. componentOptions.externalClasses = vueOptions.externalClasses;
  1882. }
  1883. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1884. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1885. componentOptions.methods[callMethod] = function (args) {
  1886. return this.$vm[callMethod](args);
  1887. };
  1888. });
  1889. }
  1890. if (isPage) {
  1891. return componentOptions;
  1892. }
  1893. return [componentOptions, VueComponent];
  1894. }
  1895. function parseComponent(vueComponentOptions) {
  1896. return parseBaseComponent(vueComponentOptions, {
  1897. isPage: isPage,
  1898. initRelation: initRelation });
  1899. }
  1900. var hooks$1 = [
  1901. 'onShow',
  1902. 'onHide',
  1903. 'onUnload'];
  1904. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1905. function parseBasePage(vuePageOptions, _ref6)
  1906. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1907. var pageOptions = parseComponent(vuePageOptions);
  1908. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1909. pageOptions.methods.onLoad = function (query) {
  1910. this.options = query;
  1911. var copyQuery = Object.assign({}, query);
  1912. delete copyQuery.__id__;
  1913. this.$page = {
  1914. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1915. this.$vm.$mp.query = query; // 兼容 mpvue
  1916. this.$vm.__call_hook('onLoad', query);
  1917. };
  1918. return pageOptions;
  1919. }
  1920. function parsePage(vuePageOptions) {
  1921. return parseBasePage(vuePageOptions, {
  1922. isPage: isPage,
  1923. initRelation: initRelation });
  1924. }
  1925. function createPage(vuePageOptions) {
  1926. {
  1927. return Component(parsePage(vuePageOptions));
  1928. }
  1929. }
  1930. function createComponent(vueOptions) {
  1931. {
  1932. return Component(parseComponent(vueOptions));
  1933. }
  1934. }
  1935. function createSubpackageApp(vm) {
  1936. var appOptions = parseApp(vm);
  1937. var app = getApp({
  1938. allowDefault: true });
  1939. vm.$scope = app;
  1940. var globalData = app.globalData;
  1941. if (globalData) {
  1942. Object.keys(appOptions.globalData).forEach(function (name) {
  1943. if (!hasOwn(globalData, name)) {
  1944. globalData[name] = appOptions.globalData[name];
  1945. }
  1946. });
  1947. }
  1948. Object.keys(appOptions).forEach(function (name) {
  1949. if (!hasOwn(app, name)) {
  1950. app[name] = appOptions[name];
  1951. }
  1952. });
  1953. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1954. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1955. vm.__call_hook('onShow', args);
  1956. });
  1957. }
  1958. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1959. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1960. vm.__call_hook('onHide', args);
  1961. });
  1962. }
  1963. if (isFn(appOptions.onLaunch)) {
  1964. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1965. vm.__call_hook('onLaunch', args);
  1966. }
  1967. return vm;
  1968. }
  1969. function createPlugin(vm) {
  1970. var appOptions = parseApp(vm);
  1971. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1972. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  1973. vm.__call_hook('onShow', args);
  1974. });
  1975. }
  1976. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1977. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  1978. vm.__call_hook('onHide', args);
  1979. });
  1980. }
  1981. if (isFn(appOptions.onLaunch)) {
  1982. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1983. vm.__call_hook('onLaunch', args);
  1984. }
  1985. return vm;
  1986. }
  1987. todos.forEach(function (todoApi) {
  1988. protocols[todoApi] = false;
  1989. });
  1990. canIUses.forEach(function (canIUseApi) {
  1991. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1992. canIUseApi;
  1993. if (!wx.canIUse(apiName)) {
  1994. protocols[canIUseApi] = false;
  1995. }
  1996. });
  1997. var uni = {};
  1998. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1999. uni = new Proxy({}, {
  2000. get: function get(target, name) {
  2001. if (hasOwn(target, name)) {
  2002. return target[name];
  2003. }
  2004. if (baseApi[name]) {
  2005. return baseApi[name];
  2006. }
  2007. if (api[name]) {
  2008. return promisify(name, api[name]);
  2009. }
  2010. {
  2011. if (extraApi[name]) {
  2012. return promisify(name, extraApi[name]);
  2013. }
  2014. if (todoApis[name]) {
  2015. return promisify(name, todoApis[name]);
  2016. }
  2017. }
  2018. if (eventApi[name]) {
  2019. return eventApi[name];
  2020. }
  2021. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  2022. return;
  2023. }
  2024. return promisify(name, wrapper(name, wx[name]));
  2025. },
  2026. set: function set(target, name, value) {
  2027. target[name] = value;
  2028. return true;
  2029. } });
  2030. } else {
  2031. Object.keys(baseApi).forEach(function (name) {
  2032. uni[name] = baseApi[name];
  2033. });
  2034. {
  2035. Object.keys(todoApis).forEach(function (name) {
  2036. uni[name] = promisify(name, todoApis[name]);
  2037. });
  2038. Object.keys(extraApi).forEach(function (name) {
  2039. uni[name] = promisify(name, todoApis[name]);
  2040. });
  2041. }
  2042. Object.keys(eventApi).forEach(function (name) {
  2043. uni[name] = eventApi[name];
  2044. });
  2045. Object.keys(api).forEach(function (name) {
  2046. uni[name] = promisify(name, api[name]);
  2047. });
  2048. Object.keys(wx).forEach(function (name) {
  2049. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2050. uni[name] = promisify(name, wrapper(name, wx[name]));
  2051. }
  2052. });
  2053. }
  2054. wx.createApp = createApp;
  2055. wx.createPage = createPage;
  2056. wx.createComponent = createComponent;
  2057. wx.createSubpackageApp = createSubpackageApp;
  2058. wx.createPlugin = createPlugin;
  2059. var uni$1 = uni;var _default =
  2060. uni$1;exports.default = _default;
  2061. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  2062. /***/ }),
  2063. /* 2 */
  2064. /*!***********************************!*\
  2065. !*** (webpack)/buildin/global.js ***!
  2066. \***********************************/
  2067. /*! no static exports found */
  2068. /***/ (function(module, exports) {
  2069. var g;
  2070. // This works in non-strict mode
  2071. g = (function() {
  2072. return this;
  2073. })();
  2074. try {
  2075. // This works if eval is allowed (see CSP)
  2076. g = g || new Function("return this")();
  2077. } catch (e) {
  2078. // This works if the window reference is available
  2079. if (typeof window === "object") g = window;
  2080. }
  2081. // g can still be undefined, but nothing to do about it...
  2082. // We return undefined, instead of nothing here, so it's
  2083. // easier to handle this case. if(!global) { ...}
  2084. module.exports = g;
  2085. /***/ }),
  2086. /* 3 */
  2087. /*!*************************************************************!*\
  2088. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  2089. \*************************************************************/
  2090. /*! no static exports found */
  2091. /***/ (function(module, exports, __webpack_require__) {
  2092. "use strict";
  2093. /* WEBPACK VAR INJECTION */(function(uni, global) {Object.defineProperty(exports, "__esModule", { value: true });exports.compileI18nJsonStr = compileI18nJsonStr;exports.hasI18nJson = hasI18nJson;exports.initVueI18n = initVueI18n;exports.isI18nStr = isI18nStr;exports.normalizeLocale = normalizeLocale;exports.parseI18nJson = parseI18nJson;exports.resolveLocale = resolveLocale;exports.isString = exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var isArray = Array.isArray;
  2094. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  2095. var defaultDelimiters = ['{', '}'];var
  2096. BaseFormatter = /*#__PURE__*/function () {
  2097. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  2098. this._caches = Object.create(null);
  2099. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  2100. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  2101. if (!values) {
  2102. return [message];
  2103. }
  2104. var tokens = this._caches[message];
  2105. if (!tokens) {
  2106. tokens = parse(message, delimiters);
  2107. this._caches[message] = tokens;
  2108. }
  2109. return compile(tokens, values);
  2110. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  2111. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  2112. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  2113. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  2114. var tokens = [];
  2115. var position = 0;
  2116. var text = '';
  2117. while (position < format.length) {
  2118. var char = format[position++];
  2119. if (char === startDelimiter) {
  2120. if (text) {
  2121. tokens.push({ type: 'text', value: text });
  2122. }
  2123. text = '';
  2124. var sub = '';
  2125. char = format[position++];
  2126. while (char !== undefined && char !== endDelimiter) {
  2127. sub += char;
  2128. char = format[position++];
  2129. }
  2130. var isClosed = char === endDelimiter;
  2131. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  2132. 'list' :
  2133. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  2134. 'named' :
  2135. 'unknown';
  2136. tokens.push({ value: sub, type: type });
  2137. }
  2138. // else if (char === '%') {
  2139. // // when found rails i18n syntax, skip text capture
  2140. // if (format[position] !== '{') {
  2141. // text += char
  2142. // }
  2143. // }
  2144. else {
  2145. text += char;
  2146. }
  2147. }
  2148. text && tokens.push({ type: 'text', value: text });
  2149. return tokens;
  2150. }
  2151. function compile(tokens, values) {
  2152. var compiled = [];
  2153. var index = 0;
  2154. var mode = isArray(values) ?
  2155. 'list' :
  2156. isObject(values) ?
  2157. 'named' :
  2158. 'unknown';
  2159. if (mode === 'unknown') {
  2160. return compiled;
  2161. }
  2162. while (index < tokens.length) {
  2163. var token = tokens[index];
  2164. switch (token.type) {
  2165. case 'text':
  2166. compiled.push(token.value);
  2167. break;
  2168. case 'list':
  2169. compiled.push(values[parseInt(token.value, 10)]);
  2170. break;
  2171. case 'named':
  2172. if (mode === 'named') {
  2173. compiled.push(values[token.value]);
  2174. } else
  2175. {
  2176. if (true) {
  2177. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  2178. }
  2179. }
  2180. break;
  2181. case 'unknown':
  2182. if (true) {
  2183. console.warn("Detect 'unknown' type of token!");
  2184. }
  2185. break;}
  2186. index++;
  2187. }
  2188. return compiled;
  2189. }
  2190. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  2191. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  2192. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  2193. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  2194. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  2195. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2196. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  2197. var defaultFormatter = new BaseFormatter();
  2198. function include(str, parts) {
  2199. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  2200. }
  2201. function startsWith(str, parts) {
  2202. return parts.find(function (part) {return str.indexOf(part) === 0;});
  2203. }
  2204. function normalizeLocale(locale, messages) {
  2205. if (!locale) {
  2206. return;
  2207. }
  2208. locale = locale.trim().replace(/_/g, '-');
  2209. if (messages && messages[locale]) {
  2210. return locale;
  2211. }
  2212. locale = locale.toLowerCase();
  2213. if (locale.indexOf('zh') === 0) {
  2214. if (locale.indexOf('-hans') > -1) {
  2215. return LOCALE_ZH_HANS;
  2216. }
  2217. if (locale.indexOf('-hant') > -1) {
  2218. return LOCALE_ZH_HANT;
  2219. }
  2220. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  2221. return LOCALE_ZH_HANT;
  2222. }
  2223. return LOCALE_ZH_HANS;
  2224. }
  2225. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  2226. if (lang) {
  2227. return lang;
  2228. }
  2229. }var
  2230. I18n = /*#__PURE__*/function () {
  2231. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  2232. this.locale = LOCALE_EN;
  2233. this.fallbackLocale = LOCALE_EN;
  2234. this.message = {};
  2235. this.messages = {};
  2236. this.watchers = [];
  2237. if (fallbackLocale) {
  2238. this.fallbackLocale = fallbackLocale;
  2239. }
  2240. this.formater = formater || defaultFormatter;
  2241. this.messages = messages || {};
  2242. this.setLocale(locale || LOCALE_EN);
  2243. if (watcher) {
  2244. this.watchLocale(watcher);
  2245. }
  2246. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  2247. locale) {var _this = this;
  2248. var oldLocale = this.locale;
  2249. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  2250. if (!this.messages[this.locale]) {
  2251. // 可能初始化时不存在
  2252. this.messages[this.locale] = {};
  2253. }
  2254. this.message = this.messages[this.locale];
  2255. // 仅发生变化时,通知
  2256. if (oldLocale !== this.locale) {
  2257. this.watchers.forEach(function (watcher) {
  2258. watcher(_this.locale, oldLocale);
  2259. });
  2260. }
  2261. } }, { key: "getLocale", value: function getLocale()
  2262. {
  2263. return this.locale;
  2264. } }, { key: "watchLocale", value: function watchLocale(
  2265. fn) {var _this2 = this;
  2266. var index = this.watchers.push(fn) - 1;
  2267. return function () {
  2268. _this2.watchers.splice(index, 1);
  2269. };
  2270. } }, { key: "add", value: function add(
  2271. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  2272. var curMessages = this.messages[locale];
  2273. if (curMessages) {
  2274. if (override) {
  2275. Object.assign(curMessages, message);
  2276. } else
  2277. {
  2278. Object.keys(message).forEach(function (key) {
  2279. if (!hasOwn(curMessages, key)) {
  2280. curMessages[key] = message[key];
  2281. }
  2282. });
  2283. }
  2284. } else
  2285. {
  2286. this.messages[locale] = message;
  2287. }
  2288. } }, { key: "f", value: function f(
  2289. message, values, delimiters) {
  2290. return this.formater.interpolate(message, values, delimiters).join('');
  2291. } }, { key: "t", value: function t(
  2292. key, locale, values) {
  2293. var message = this.message;
  2294. if (typeof locale === 'string') {
  2295. locale = normalizeLocale(locale, this.messages);
  2296. locale && (message = this.messages[locale]);
  2297. } else
  2298. {
  2299. values = locale;
  2300. }
  2301. if (!hasOwn(message, key)) {
  2302. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  2303. return key;
  2304. }
  2305. return this.formater.interpolate(message[key], values).join('');
  2306. } }]);return I18n;}();exports.I18n = I18n;
  2307. function watchAppLocale(appVm, i18n) {
  2308. // 需要保证 watch 的触发在组件渲染之前
  2309. if (appVm.$watchLocale) {
  2310. // vue2
  2311. appVm.$watchLocale(function (newLocale) {
  2312. i18n.setLocale(newLocale);
  2313. });
  2314. } else
  2315. {
  2316. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  2317. i18n.setLocale(newLocale);
  2318. });
  2319. }
  2320. }
  2321. function getDefaultLocale() {
  2322. if (typeof uni !== 'undefined' && uni.getLocale) {
  2323. return uni.getLocale();
  2324. }
  2325. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  2326. if (typeof global !== 'undefined' && global.getLocale) {
  2327. return global.getLocale();
  2328. }
  2329. return LOCALE_EN;
  2330. }
  2331. function initVueI18n(locale) {var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;var watcher = arguments.length > 3 ? arguments[3] : undefined;
  2332. // 兼容旧版本入参
  2333. if (typeof locale !== 'string') {var _ref4 =
  2334. [
  2335. messages,
  2336. locale];locale = _ref4[0];messages = _ref4[1];
  2337. }
  2338. if (typeof locale !== 'string') {
  2339. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  2340. locale = getDefaultLocale();
  2341. }
  2342. if (typeof fallbackLocale !== 'string') {
  2343. fallbackLocale =
  2344. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  2345. LOCALE_EN;
  2346. }
  2347. var i18n = new I18n({
  2348. locale: locale,
  2349. fallbackLocale: fallbackLocale,
  2350. messages: messages,
  2351. watcher: watcher });
  2352. var _t = function t(key, values) {
  2353. if (typeof getApp !== 'function') {
  2354. // app view
  2355. /* eslint-disable no-func-assign */
  2356. _t = function t(key, values) {
  2357. return i18n.t(key, values);
  2358. };
  2359. } else
  2360. {
  2361. var isWatchedAppLocale = false;
  2362. _t = function t(key, values) {
  2363. var appVm = getApp().$vm;
  2364. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  2365. // options: {
  2366. // type: Array,
  2367. // default () {
  2368. // return [{
  2369. // icon: 'shop',
  2370. // text: t("uni-goods-nav.options.shop"),
  2371. // }, {
  2372. // icon: 'cart',
  2373. // text: t("uni-goods-nav.options.cart")
  2374. // }]
  2375. // }
  2376. // },
  2377. if (appVm) {
  2378. // 触发响应式
  2379. appVm.$locale;
  2380. if (!isWatchedAppLocale) {
  2381. isWatchedAppLocale = true;
  2382. watchAppLocale(appVm, i18n);
  2383. }
  2384. }
  2385. return i18n.t(key, values);
  2386. };
  2387. }
  2388. return _t(key, values);
  2389. };
  2390. return {
  2391. i18n: i18n,
  2392. f: function f(message, values, delimiters) {
  2393. return i18n.f(message, values, delimiters);
  2394. },
  2395. t: function t(key, values) {
  2396. return _t(key, values);
  2397. },
  2398. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  2399. return i18n.add(locale, message, override);
  2400. },
  2401. watch: function watch(fn) {
  2402. return i18n.watchLocale(fn);
  2403. },
  2404. getLocale: function getLocale() {
  2405. return i18n.getLocale();
  2406. },
  2407. setLocale: function setLocale(newLocale) {
  2408. return i18n.setLocale(newLocale);
  2409. } };
  2410. }
  2411. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  2412. var formater;
  2413. function hasI18nJson(jsonObj, delimiters) {
  2414. if (!formater) {
  2415. formater = new BaseFormatter();
  2416. }
  2417. return walkJsonObj(jsonObj, function (jsonObj, key) {
  2418. var value = jsonObj[key];
  2419. if (isString(value)) {
  2420. if (isI18nStr(value, delimiters)) {
  2421. return true;
  2422. }
  2423. } else
  2424. {
  2425. return hasI18nJson(value, delimiters);
  2426. }
  2427. });
  2428. }
  2429. function parseI18nJson(jsonObj, values, delimiters) {
  2430. if (!formater) {
  2431. formater = new BaseFormatter();
  2432. }
  2433. walkJsonObj(jsonObj, function (jsonObj, key) {
  2434. var value = jsonObj[key];
  2435. if (isString(value)) {
  2436. if (isI18nStr(value, delimiters)) {
  2437. jsonObj[key] = compileStr(value, values, delimiters);
  2438. }
  2439. } else
  2440. {
  2441. parseI18nJson(value, values, delimiters);
  2442. }
  2443. });
  2444. return jsonObj;
  2445. }
  2446. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  2447. if (!isI18nStr(jsonStr, delimiters)) {
  2448. return jsonStr;
  2449. }
  2450. if (!formater) {
  2451. formater = new BaseFormatter();
  2452. }
  2453. var localeValues = [];
  2454. Object.keys(locales).forEach(function (name) {
  2455. if (name !== locale) {
  2456. localeValues.push({
  2457. locale: name,
  2458. values: locales[name] });
  2459. }
  2460. });
  2461. localeValues.unshift({ locale: locale, values: locales[locale] });
  2462. try {
  2463. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  2464. }
  2465. catch (e) {}
  2466. return jsonStr;
  2467. }
  2468. function isI18nStr(value, delimiters) {
  2469. return value.indexOf(delimiters[0]) > -1;
  2470. }
  2471. function compileStr(value, values, delimiters) {
  2472. return formater.interpolate(value, values, delimiters).join('');
  2473. }
  2474. function compileValue(jsonObj, key, localeValues, delimiters) {
  2475. var value = jsonObj[key];
  2476. if (isString(value)) {
  2477. // 存在国际化
  2478. if (isI18nStr(value, delimiters)) {
  2479. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  2480. if (localeValues.length > 1) {
  2481. // 格式化国际化语言
  2482. var valueLocales = jsonObj[key + 'Locales'] = {};
  2483. localeValues.forEach(function (localValue) {
  2484. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  2485. });
  2486. }
  2487. }
  2488. } else
  2489. {
  2490. compileJsonObj(value, localeValues, delimiters);
  2491. }
  2492. }
  2493. function compileJsonObj(jsonObj, localeValues, delimiters) {
  2494. walkJsonObj(jsonObj, function (jsonObj, key) {
  2495. compileValue(jsonObj, key, localeValues, delimiters);
  2496. });
  2497. return jsonObj;
  2498. }
  2499. function walkJsonObj(jsonObj, walk) {
  2500. if (isArray(jsonObj)) {
  2501. for (var i = 0; i < jsonObj.length; i++) {
  2502. if (walk(jsonObj, i)) {
  2503. return true;
  2504. }
  2505. }
  2506. } else
  2507. if (isObject(jsonObj)) {
  2508. for (var key in jsonObj) {
  2509. if (walk(jsonObj, key)) {
  2510. return true;
  2511. }
  2512. }
  2513. }
  2514. return false;
  2515. }
  2516. function resolveLocale(locales) {
  2517. return function (locale) {
  2518. if (!locale) {
  2519. return locale;
  2520. }
  2521. locale = normalizeLocale(locale) || locale;
  2522. return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;});
  2523. };
  2524. }
  2525. function resolveLocaleChain(locale) {
  2526. var chain = [];
  2527. var tokens = locale.split('-');
  2528. while (tokens.length) {
  2529. chain.push(tokens.join('-'));
  2530. tokens.pop();
  2531. }
  2532. return chain;
  2533. }
  2534. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  2535. /***/ }),
  2536. /* 4 */
  2537. /*!******************************************************************************************!*\
  2538. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  2539. \******************************************************************************************/
  2540. /*! exports provided: default */
  2541. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2542. "use strict";
  2543. __webpack_require__.r(__webpack_exports__);
  2544. /* WEBPACK VAR INJECTION */(function(global) {/*!
  2545. * Vue.js v2.6.11
  2546. * (c) 2014-2022 Evan You
  2547. * Released under the MIT License.
  2548. */
  2549. /* */
  2550. var emptyObject = Object.freeze({});
  2551. // These helpers produce better VM code in JS engines due to their
  2552. // explicitness and function inlining.
  2553. function isUndef (v) {
  2554. return v === undefined || v === null
  2555. }
  2556. function isDef (v) {
  2557. return v !== undefined && v !== null
  2558. }
  2559. function isTrue (v) {
  2560. return v === true
  2561. }
  2562. function isFalse (v) {
  2563. return v === false
  2564. }
  2565. /**
  2566. * Check if value is primitive.
  2567. */
  2568. function isPrimitive (value) {
  2569. return (
  2570. typeof value === 'string' ||
  2571. typeof value === 'number' ||
  2572. // $flow-disable-line
  2573. typeof value === 'symbol' ||
  2574. typeof value === 'boolean'
  2575. )
  2576. }
  2577. /**
  2578. * Quick object check - this is primarily used to tell
  2579. * Objects from primitive values when we know the value
  2580. * is a JSON-compliant type.
  2581. */
  2582. function isObject (obj) {
  2583. return obj !== null && typeof obj === 'object'
  2584. }
  2585. /**
  2586. * Get the raw type string of a value, e.g., [object Object].
  2587. */
  2588. var _toString = Object.prototype.toString;
  2589. function toRawType (value) {
  2590. return _toString.call(value).slice(8, -1)
  2591. }
  2592. /**
  2593. * Strict object type check. Only returns true
  2594. * for plain JavaScript objects.
  2595. */
  2596. function isPlainObject (obj) {
  2597. return _toString.call(obj) === '[object Object]'
  2598. }
  2599. function isRegExp (v) {
  2600. return _toString.call(v) === '[object RegExp]'
  2601. }
  2602. /**
  2603. * Check if val is a valid array index.
  2604. */
  2605. function isValidArrayIndex (val) {
  2606. var n = parseFloat(String(val));
  2607. return n >= 0 && Math.floor(n) === n && isFinite(val)
  2608. }
  2609. function isPromise (val) {
  2610. return (
  2611. isDef(val) &&
  2612. typeof val.then === 'function' &&
  2613. typeof val.catch === 'function'
  2614. )
  2615. }
  2616. /**
  2617. * Convert a value to a string that is actually rendered.
  2618. */
  2619. function toString (val) {
  2620. return val == null
  2621. ? ''
  2622. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  2623. ? JSON.stringify(val, null, 2)
  2624. : String(val)
  2625. }
  2626. /**
  2627. * Convert an input value to a number for persistence.
  2628. * If the conversion fails, return original string.
  2629. */
  2630. function toNumber (val) {
  2631. var n = parseFloat(val);
  2632. return isNaN(n) ? val : n
  2633. }
  2634. /**
  2635. * Make a map and return a function for checking if a key
  2636. * is in that map.
  2637. */
  2638. function makeMap (
  2639. str,
  2640. expectsLowerCase
  2641. ) {
  2642. var map = Object.create(null);
  2643. var list = str.split(',');
  2644. for (var i = 0; i < list.length; i++) {
  2645. map[list[i]] = true;
  2646. }
  2647. return expectsLowerCase
  2648. ? function (val) { return map[val.toLowerCase()]; }
  2649. : function (val) { return map[val]; }
  2650. }
  2651. /**
  2652. * Check if a tag is a built-in tag.
  2653. */
  2654. var isBuiltInTag = makeMap('slot,component', true);
  2655. /**
  2656. * Check if an attribute is a reserved attribute.
  2657. */
  2658. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  2659. /**
  2660. * Remove an item from an array.
  2661. */
  2662. function remove (arr, item) {
  2663. if (arr.length) {
  2664. var index = arr.indexOf(item);
  2665. if (index > -1) {
  2666. return arr.splice(index, 1)
  2667. }
  2668. }
  2669. }
  2670. /**
  2671. * Check whether an object has the property.
  2672. */
  2673. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2674. function hasOwn (obj, key) {
  2675. return hasOwnProperty.call(obj, key)
  2676. }
  2677. /**
  2678. * Create a cached version of a pure function.
  2679. */
  2680. function cached (fn) {
  2681. var cache = Object.create(null);
  2682. return (function cachedFn (str) {
  2683. var hit = cache[str];
  2684. return hit || (cache[str] = fn(str))
  2685. })
  2686. }
  2687. /**
  2688. * Camelize a hyphen-delimited string.
  2689. */
  2690. var camelizeRE = /-(\w)/g;
  2691. var camelize = cached(function (str) {
  2692. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  2693. });
  2694. /**
  2695. * Capitalize a string.
  2696. */
  2697. var capitalize = cached(function (str) {
  2698. return str.charAt(0).toUpperCase() + str.slice(1)
  2699. });
  2700. /**
  2701. * Hyphenate a camelCase string.
  2702. */
  2703. var hyphenateRE = /\B([A-Z])/g;
  2704. var hyphenate = cached(function (str) {
  2705. return str.replace(hyphenateRE, '-$1').toLowerCase()
  2706. });
  2707. /**
  2708. * Simple bind polyfill for environments that do not support it,
  2709. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  2710. * since native bind is now performant enough in most browsers.
  2711. * But removing it would mean breaking code that was able to run in
  2712. * PhantomJS 1.x, so this must be kept for backward compatibility.
  2713. */
  2714. /* istanbul ignore next */
  2715. function polyfillBind (fn, ctx) {
  2716. function boundFn (a) {
  2717. var l = arguments.length;
  2718. return l
  2719. ? l > 1
  2720. ? fn.apply(ctx, arguments)
  2721. : fn.call(ctx, a)
  2722. : fn.call(ctx)
  2723. }
  2724. boundFn._length = fn.length;
  2725. return boundFn
  2726. }
  2727. function nativeBind (fn, ctx) {
  2728. return fn.bind(ctx)
  2729. }
  2730. var bind = Function.prototype.bind
  2731. ? nativeBind
  2732. : polyfillBind;
  2733. /**
  2734. * Convert an Array-like object to a real Array.
  2735. */
  2736. function toArray (list, start) {
  2737. start = start || 0;
  2738. var i = list.length - start;
  2739. var ret = new Array(i);
  2740. while (i--) {
  2741. ret[i] = list[i + start];
  2742. }
  2743. return ret
  2744. }
  2745. /**
  2746. * Mix properties into target object.
  2747. */
  2748. function extend (to, _from) {
  2749. for (var key in _from) {
  2750. to[key] = _from[key];
  2751. }
  2752. return to
  2753. }
  2754. /**
  2755. * Merge an Array of Objects into a single Object.
  2756. */
  2757. function toObject (arr) {
  2758. var res = {};
  2759. for (var i = 0; i < arr.length; i++) {
  2760. if (arr[i]) {
  2761. extend(res, arr[i]);
  2762. }
  2763. }
  2764. return res
  2765. }
  2766. /* eslint-disable no-unused-vars */
  2767. /**
  2768. * Perform no operation.
  2769. * Stubbing args to make Flow happy without leaving useless transpiled code
  2770. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  2771. */
  2772. function noop (a, b, c) {}
  2773. /**
  2774. * Always return false.
  2775. */
  2776. var no = function (a, b, c) { return false; };
  2777. /* eslint-enable no-unused-vars */
  2778. /**
  2779. * Return the same value.
  2780. */
  2781. var identity = function (_) { return _; };
  2782. /**
  2783. * Check if two values are loosely equal - that is,
  2784. * if they are plain objects, do they have the same shape?
  2785. */
  2786. function looseEqual (a, b) {
  2787. if (a === b) { return true }
  2788. var isObjectA = isObject(a);
  2789. var isObjectB = isObject(b);
  2790. if (isObjectA && isObjectB) {
  2791. try {
  2792. var isArrayA = Array.isArray(a);
  2793. var isArrayB = Array.isArray(b);
  2794. if (isArrayA && isArrayB) {
  2795. return a.length === b.length && a.every(function (e, i) {
  2796. return looseEqual(e, b[i])
  2797. })
  2798. } else if (a instanceof Date && b instanceof Date) {
  2799. return a.getTime() === b.getTime()
  2800. } else if (!isArrayA && !isArrayB) {
  2801. var keysA = Object.keys(a);
  2802. var keysB = Object.keys(b);
  2803. return keysA.length === keysB.length && keysA.every(function (key) {
  2804. return looseEqual(a[key], b[key])
  2805. })
  2806. } else {
  2807. /* istanbul ignore next */
  2808. return false
  2809. }
  2810. } catch (e) {
  2811. /* istanbul ignore next */
  2812. return false
  2813. }
  2814. } else if (!isObjectA && !isObjectB) {
  2815. return String(a) === String(b)
  2816. } else {
  2817. return false
  2818. }
  2819. }
  2820. /**
  2821. * Return the first index at which a loosely equal value can be
  2822. * found in the array (if value is a plain object, the array must
  2823. * contain an object of the same shape), or -1 if it is not present.
  2824. */
  2825. function looseIndexOf (arr, val) {
  2826. for (var i = 0; i < arr.length; i++) {
  2827. if (looseEqual(arr[i], val)) { return i }
  2828. }
  2829. return -1
  2830. }
  2831. /**
  2832. * Ensure a function is called only once.
  2833. */
  2834. function once (fn) {
  2835. var called = false;
  2836. return function () {
  2837. if (!called) {
  2838. called = true;
  2839. fn.apply(this, arguments);
  2840. }
  2841. }
  2842. }
  2843. var ASSET_TYPES = [
  2844. 'component',
  2845. 'directive',
  2846. 'filter'
  2847. ];
  2848. var LIFECYCLE_HOOKS = [
  2849. 'beforeCreate',
  2850. 'created',
  2851. 'beforeMount',
  2852. 'mounted',
  2853. 'beforeUpdate',
  2854. 'updated',
  2855. 'beforeDestroy',
  2856. 'destroyed',
  2857. 'activated',
  2858. 'deactivated',
  2859. 'errorCaptured',
  2860. 'serverPrefetch'
  2861. ];
  2862. /* */
  2863. var config = ({
  2864. /**
  2865. * Option merge strategies (used in core/util/options)
  2866. */
  2867. // $flow-disable-line
  2868. optionMergeStrategies: Object.create(null),
  2869. /**
  2870. * Whether to suppress warnings.
  2871. */
  2872. silent: false,
  2873. /**
  2874. * Show production mode tip message on boot?
  2875. */
  2876. productionTip: "development" !== 'production',
  2877. /**
  2878. * Whether to enable devtools
  2879. */
  2880. devtools: "development" !== 'production',
  2881. /**
  2882. * Whether to record perf
  2883. */
  2884. performance: false,
  2885. /**
  2886. * Error handler for watcher errors
  2887. */
  2888. errorHandler: null,
  2889. /**
  2890. * Warn handler for watcher warns
  2891. */
  2892. warnHandler: null,
  2893. /**
  2894. * Ignore certain custom elements
  2895. */
  2896. ignoredElements: [],
  2897. /**
  2898. * Custom user key aliases for v-on
  2899. */
  2900. // $flow-disable-line
  2901. keyCodes: Object.create(null),
  2902. /**
  2903. * Check if a tag is reserved so that it cannot be registered as a
  2904. * component. This is platform-dependent and may be overwritten.
  2905. */
  2906. isReservedTag: no,
  2907. /**
  2908. * Check if an attribute is reserved so that it cannot be used as a component
  2909. * prop. This is platform-dependent and may be overwritten.
  2910. */
  2911. isReservedAttr: no,
  2912. /**
  2913. * Check if a tag is an unknown element.
  2914. * Platform-dependent.
  2915. */
  2916. isUnknownElement: no,
  2917. /**
  2918. * Get the namespace of an element
  2919. */
  2920. getTagNamespace: noop,
  2921. /**
  2922. * Parse the real tag name for the specific platform.
  2923. */
  2924. parsePlatformTagName: identity,
  2925. /**
  2926. * Check if an attribute must be bound using property, e.g. value
  2927. * Platform-dependent.
  2928. */
  2929. mustUseProp: no,
  2930. /**
  2931. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  2932. * This will significantly reduce performance if set to false.
  2933. */
  2934. async: true,
  2935. /**
  2936. * Exposed for legacy reasons
  2937. */
  2938. _lifecycleHooks: LIFECYCLE_HOOKS
  2939. });
  2940. /* */
  2941. /**
  2942. * unicode letters used for parsing html tags, component names and property paths.
  2943. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  2944. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  2945. */
  2946. 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/;
  2947. /**
  2948. * Check if a string starts with $ or _
  2949. */
  2950. function isReserved (str) {
  2951. var c = (str + '').charCodeAt(0);
  2952. return c === 0x24 || c === 0x5F
  2953. }
  2954. /**
  2955. * Define a property.
  2956. */
  2957. function def (obj, key, val, enumerable) {
  2958. Object.defineProperty(obj, key, {
  2959. value: val,
  2960. enumerable: !!enumerable,
  2961. writable: true,
  2962. configurable: true
  2963. });
  2964. }
  2965. /**
  2966. * Parse simple path.
  2967. */
  2968. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  2969. function parsePath (path) {
  2970. if (bailRE.test(path)) {
  2971. return
  2972. }
  2973. var segments = path.split('.');
  2974. return function (obj) {
  2975. for (var i = 0; i < segments.length; i++) {
  2976. if (!obj) { return }
  2977. obj = obj[segments[i]];
  2978. }
  2979. return obj
  2980. }
  2981. }
  2982. /* */
  2983. // can we use __proto__?
  2984. var hasProto = '__proto__' in {};
  2985. // Browser environment sniffing
  2986. var inBrowser = typeof window !== 'undefined';
  2987. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  2988. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  2989. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  2990. var isIE = UA && /msie|trident/.test(UA);
  2991. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  2992. var isEdge = UA && UA.indexOf('edge/') > 0;
  2993. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  2994. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  2995. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  2996. var isPhantomJS = UA && /phantomjs/.test(UA);
  2997. var isFF = UA && UA.match(/firefox\/(\d+)/);
  2998. // Firefox has a "watch" function on Object.prototype...
  2999. var nativeWatch = ({}).watch;
  3000. if (inBrowser) {
  3001. try {
  3002. var opts = {};
  3003. Object.defineProperty(opts, 'passive', ({
  3004. get: function get () {
  3005. }
  3006. })); // https://github.com/facebook/flow/issues/285
  3007. window.addEventListener('test-passive', null, opts);
  3008. } catch (e) {}
  3009. }
  3010. // this needs to be lazy-evaled because vue may be required before
  3011. // vue-server-renderer can set VUE_ENV
  3012. var _isServer;
  3013. var isServerRendering = function () {
  3014. if (_isServer === undefined) {
  3015. /* istanbul ignore if */
  3016. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  3017. // detect presence of vue-server-renderer and avoid
  3018. // Webpack shimming the process
  3019. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  3020. } else {
  3021. _isServer = false;
  3022. }
  3023. }
  3024. return _isServer
  3025. };
  3026. // detect devtools
  3027. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3028. /* istanbul ignore next */
  3029. function isNative (Ctor) {
  3030. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  3031. }
  3032. var hasSymbol =
  3033. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  3034. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  3035. var _Set;
  3036. /* istanbul ignore if */ // $flow-disable-line
  3037. if (typeof Set !== 'undefined' && isNative(Set)) {
  3038. // use native Set when available.
  3039. _Set = Set;
  3040. } else {
  3041. // a non-standard Set polyfill that only works with primitive keys.
  3042. _Set = /*@__PURE__*/(function () {
  3043. function Set () {
  3044. this.set = Object.create(null);
  3045. }
  3046. Set.prototype.has = function has (key) {
  3047. return this.set[key] === true
  3048. };
  3049. Set.prototype.add = function add (key) {
  3050. this.set[key] = true;
  3051. };
  3052. Set.prototype.clear = function clear () {
  3053. this.set = Object.create(null);
  3054. };
  3055. return Set;
  3056. }());
  3057. }
  3058. /* */
  3059. var warn = noop;
  3060. var tip = noop;
  3061. var generateComponentTrace = (noop); // work around flow check
  3062. var formatComponentName = (noop);
  3063. if (true) {
  3064. var hasConsole = typeof console !== 'undefined';
  3065. var classifyRE = /(?:^|[-_])(\w)/g;
  3066. var classify = function (str) { return str
  3067. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  3068. .replace(/[-_]/g, ''); };
  3069. warn = function (msg, vm) {
  3070. var trace = vm ? generateComponentTrace(vm) : '';
  3071. if (config.warnHandler) {
  3072. config.warnHandler.call(null, msg, vm, trace);
  3073. } else if (hasConsole && (!config.silent)) {
  3074. console.error(("[Vue warn]: " + msg + trace));
  3075. }
  3076. };
  3077. tip = function (msg, vm) {
  3078. if (hasConsole && (!config.silent)) {
  3079. console.warn("[Vue tip]: " + msg + (
  3080. vm ? generateComponentTrace(vm) : ''
  3081. ));
  3082. }
  3083. };
  3084. formatComponentName = function (vm, includeFile) {
  3085. if (vm.$root === vm) {
  3086. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  3087. return ('') + vm.$options.__file
  3088. }
  3089. return '<Root>'
  3090. }
  3091. var options = typeof vm === 'function' && vm.cid != null
  3092. ? vm.options
  3093. : vm._isVue
  3094. ? vm.$options || vm.constructor.options
  3095. : vm;
  3096. var name = options.name || options._componentTag;
  3097. var file = options.__file;
  3098. if (!name && file) {
  3099. var match = file.match(/([^/\\]+)\.vue$/);
  3100. name = match && match[1];
  3101. }
  3102. return (
  3103. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  3104. (file && includeFile !== false ? (" at " + file) : '')
  3105. )
  3106. };
  3107. var repeat = function (str, n) {
  3108. var res = '';
  3109. while (n) {
  3110. if (n % 2 === 1) { res += str; }
  3111. if (n > 1) { str += str; }
  3112. n >>= 1;
  3113. }
  3114. return res
  3115. };
  3116. generateComponentTrace = function (vm) {
  3117. if (vm._isVue && vm.$parent) {
  3118. var tree = [];
  3119. var currentRecursiveSequence = 0;
  3120. while (vm && vm.$options.name !== 'PageBody') {
  3121. if (tree.length > 0) {
  3122. var last = tree[tree.length - 1];
  3123. if (last.constructor === vm.constructor) {
  3124. currentRecursiveSequence++;
  3125. vm = vm.$parent;
  3126. continue
  3127. } else if (currentRecursiveSequence > 0) {
  3128. tree[tree.length - 1] = [last, currentRecursiveSequence];
  3129. currentRecursiveSequence = 0;
  3130. }
  3131. }
  3132. !vm.$options.isReserved && tree.push(vm);
  3133. vm = vm.$parent;
  3134. }
  3135. return '\n\nfound in\n\n' + tree
  3136. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  3137. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  3138. : formatComponentName(vm))); })
  3139. .join('\n')
  3140. } else {
  3141. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  3142. }
  3143. };
  3144. }
  3145. /* */
  3146. var uid = 0;
  3147. /**
  3148. * A dep is an observable that can have multiple
  3149. * directives subscribing to it.
  3150. */
  3151. var Dep = function Dep () {
  3152. this.id = uid++;
  3153. this.subs = [];
  3154. };
  3155. Dep.prototype.addSub = function addSub (sub) {
  3156. this.subs.push(sub);
  3157. };
  3158. Dep.prototype.removeSub = function removeSub (sub) {
  3159. remove(this.subs, sub);
  3160. };
  3161. Dep.prototype.depend = function depend () {
  3162. if (Dep.SharedObject.target) {
  3163. Dep.SharedObject.target.addDep(this);
  3164. }
  3165. };
  3166. Dep.prototype.notify = function notify () {
  3167. // stabilize the subscriber list first
  3168. var subs = this.subs.slice();
  3169. if ( true && !config.async) {
  3170. // subs aren't sorted in scheduler if not running async
  3171. // we need to sort them now to make sure they fire in correct
  3172. // order
  3173. subs.sort(function (a, b) { return a.id - b.id; });
  3174. }
  3175. for (var i = 0, l = subs.length; i < l; i++) {
  3176. subs[i].update();
  3177. }
  3178. };
  3179. // The current target watcher being evaluated.
  3180. // This is globally unique because only one watcher
  3181. // can be evaluated at a time.
  3182. // fixed by xxxxxx (nvue shared vuex)
  3183. /* eslint-disable no-undef */
  3184. Dep.SharedObject = {};
  3185. Dep.SharedObject.target = null;
  3186. Dep.SharedObject.targetStack = [];
  3187. function pushTarget (target) {
  3188. Dep.SharedObject.targetStack.push(target);
  3189. Dep.SharedObject.target = target;
  3190. Dep.target = target;
  3191. }
  3192. function popTarget () {
  3193. Dep.SharedObject.targetStack.pop();
  3194. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  3195. Dep.target = Dep.SharedObject.target;
  3196. }
  3197. /* */
  3198. var VNode = function VNode (
  3199. tag,
  3200. data,
  3201. children,
  3202. text,
  3203. elm,
  3204. context,
  3205. componentOptions,
  3206. asyncFactory
  3207. ) {
  3208. this.tag = tag;
  3209. this.data = data;
  3210. this.children = children;
  3211. this.text = text;
  3212. this.elm = elm;
  3213. this.ns = undefined;
  3214. this.context = context;
  3215. this.fnContext = undefined;
  3216. this.fnOptions = undefined;
  3217. this.fnScopeId = undefined;
  3218. this.key = data && data.key;
  3219. this.componentOptions = componentOptions;
  3220. this.componentInstance = undefined;
  3221. this.parent = undefined;
  3222. this.raw = false;
  3223. this.isStatic = false;
  3224. this.isRootInsert = true;
  3225. this.isComment = false;
  3226. this.isCloned = false;
  3227. this.isOnce = false;
  3228. this.asyncFactory = asyncFactory;
  3229. this.asyncMeta = undefined;
  3230. this.isAsyncPlaceholder = false;
  3231. };
  3232. var prototypeAccessors = { child: { configurable: true } };
  3233. // DEPRECATED: alias for componentInstance for backwards compat.
  3234. /* istanbul ignore next */
  3235. prototypeAccessors.child.get = function () {
  3236. return this.componentInstance
  3237. };
  3238. Object.defineProperties( VNode.prototype, prototypeAccessors );
  3239. var createEmptyVNode = function (text) {
  3240. if ( text === void 0 ) text = '';
  3241. var node = new VNode();
  3242. node.text = text;
  3243. node.isComment = true;
  3244. return node
  3245. };
  3246. function createTextVNode (val) {
  3247. return new VNode(undefined, undefined, undefined, String(val))
  3248. }
  3249. // optimized shallow clone
  3250. // used for static nodes and slot nodes because they may be reused across
  3251. // multiple renders, cloning them avoids errors when DOM manipulations rely
  3252. // on their elm reference.
  3253. function cloneVNode (vnode) {
  3254. var cloned = new VNode(
  3255. vnode.tag,
  3256. vnode.data,
  3257. // #7975
  3258. // clone children array to avoid mutating original in case of cloning
  3259. // a child.
  3260. vnode.children && vnode.children.slice(),
  3261. vnode.text,
  3262. vnode.elm,
  3263. vnode.context,
  3264. vnode.componentOptions,
  3265. vnode.asyncFactory
  3266. );
  3267. cloned.ns = vnode.ns;
  3268. cloned.isStatic = vnode.isStatic;
  3269. cloned.key = vnode.key;
  3270. cloned.isComment = vnode.isComment;
  3271. cloned.fnContext = vnode.fnContext;
  3272. cloned.fnOptions = vnode.fnOptions;
  3273. cloned.fnScopeId = vnode.fnScopeId;
  3274. cloned.asyncMeta = vnode.asyncMeta;
  3275. cloned.isCloned = true;
  3276. return cloned
  3277. }
  3278. /*
  3279. * not type checking this file because flow doesn't play well with
  3280. * dynamically accessing methods on Array prototype
  3281. */
  3282. var arrayProto = Array.prototype;
  3283. var arrayMethods = Object.create(arrayProto);
  3284. var methodsToPatch = [
  3285. 'push',
  3286. 'pop',
  3287. 'shift',
  3288. 'unshift',
  3289. 'splice',
  3290. 'sort',
  3291. 'reverse'
  3292. ];
  3293. /**
  3294. * Intercept mutating methods and emit events
  3295. */
  3296. methodsToPatch.forEach(function (method) {
  3297. // cache original method
  3298. var original = arrayProto[method];
  3299. def(arrayMethods, method, function mutator () {
  3300. var args = [], len = arguments.length;
  3301. while ( len-- ) args[ len ] = arguments[ len ];
  3302. var result = original.apply(this, args);
  3303. var ob = this.__ob__;
  3304. var inserted;
  3305. switch (method) {
  3306. case 'push':
  3307. case 'unshift':
  3308. inserted = args;
  3309. break
  3310. case 'splice':
  3311. inserted = args.slice(2);
  3312. break
  3313. }
  3314. if (inserted) { ob.observeArray(inserted); }
  3315. // notify change
  3316. ob.dep.notify();
  3317. return result
  3318. });
  3319. });
  3320. /* */
  3321. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  3322. /**
  3323. * In some cases we may want to disable observation inside a component's
  3324. * update computation.
  3325. */
  3326. var shouldObserve = true;
  3327. function toggleObserving (value) {
  3328. shouldObserve = value;
  3329. }
  3330. /**
  3331. * Observer class that is attached to each observed
  3332. * object. Once attached, the observer converts the target
  3333. * object's property keys into getter/setters that
  3334. * collect dependencies and dispatch updates.
  3335. */
  3336. var Observer = function Observer (value) {
  3337. this.value = value;
  3338. this.dep = new Dep();
  3339. this.vmCount = 0;
  3340. def(value, '__ob__', this);
  3341. if (Array.isArray(value)) {
  3342. if (hasProto) {
  3343. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  3344. if(value.push !== value.__proto__.push){
  3345. copyAugment(value, arrayMethods, arrayKeys);
  3346. } else {
  3347. protoAugment(value, arrayMethods);
  3348. }
  3349. }
  3350. } else {
  3351. copyAugment(value, arrayMethods, arrayKeys);
  3352. }
  3353. this.observeArray(value);
  3354. } else {
  3355. this.walk(value);
  3356. }
  3357. };
  3358. /**
  3359. * Walk through all properties and convert them into
  3360. * getter/setters. This method should only be called when
  3361. * value type is Object.
  3362. */
  3363. Observer.prototype.walk = function walk (obj) {
  3364. var keys = Object.keys(obj);
  3365. for (var i = 0; i < keys.length; i++) {
  3366. defineReactive$$1(obj, keys[i]);
  3367. }
  3368. };
  3369. /**
  3370. * Observe a list of Array items.
  3371. */
  3372. Observer.prototype.observeArray = function observeArray (items) {
  3373. for (var i = 0, l = items.length; i < l; i++) {
  3374. observe(items[i]);
  3375. }
  3376. };
  3377. // helpers
  3378. /**
  3379. * Augment a target Object or Array by intercepting
  3380. * the prototype chain using __proto__
  3381. */
  3382. function protoAugment (target, src) {
  3383. /* eslint-disable no-proto */
  3384. target.__proto__ = src;
  3385. /* eslint-enable no-proto */
  3386. }
  3387. /**
  3388. * Augment a target Object or Array by defining
  3389. * hidden properties.
  3390. */
  3391. /* istanbul ignore next */
  3392. function copyAugment (target, src, keys) {
  3393. for (var i = 0, l = keys.length; i < l; i++) {
  3394. var key = keys[i];
  3395. def(target, key, src[key]);
  3396. }
  3397. }
  3398. /**
  3399. * Attempt to create an observer instance for a value,
  3400. * returns the new observer if successfully observed,
  3401. * or the existing observer if the value already has one.
  3402. */
  3403. function observe (value, asRootData) {
  3404. if (!isObject(value) || value instanceof VNode) {
  3405. return
  3406. }
  3407. var ob;
  3408. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  3409. ob = value.__ob__;
  3410. } else if (
  3411. shouldObserve &&
  3412. !isServerRendering() &&
  3413. (Array.isArray(value) || isPlainObject(value)) &&
  3414. Object.isExtensible(value) &&
  3415. !value._isVue
  3416. ) {
  3417. ob = new Observer(value);
  3418. }
  3419. if (asRootData && ob) {
  3420. ob.vmCount++;
  3421. }
  3422. return ob
  3423. }
  3424. /**
  3425. * Define a reactive property on an Object.
  3426. */
  3427. function defineReactive$$1 (
  3428. obj,
  3429. key,
  3430. val,
  3431. customSetter,
  3432. shallow
  3433. ) {
  3434. var dep = new Dep();
  3435. var property = Object.getOwnPropertyDescriptor(obj, key);
  3436. if (property && property.configurable === false) {
  3437. return
  3438. }
  3439. // cater for pre-defined getter/setters
  3440. var getter = property && property.get;
  3441. var setter = property && property.set;
  3442. if ((!getter || setter) && arguments.length === 2) {
  3443. val = obj[key];
  3444. }
  3445. var childOb = !shallow && observe(val);
  3446. Object.defineProperty(obj, key, {
  3447. enumerable: true,
  3448. configurable: true,
  3449. get: function reactiveGetter () {
  3450. var value = getter ? getter.call(obj) : val;
  3451. if (Dep.SharedObject.target) { // fixed by xxxxxx
  3452. dep.depend();
  3453. if (childOb) {
  3454. childOb.dep.depend();
  3455. if (Array.isArray(value)) {
  3456. dependArray(value);
  3457. }
  3458. }
  3459. }
  3460. return value
  3461. },
  3462. set: function reactiveSetter (newVal) {
  3463. var value = getter ? getter.call(obj) : val;
  3464. /* eslint-disable no-self-compare */
  3465. if (newVal === value || (newVal !== newVal && value !== value)) {
  3466. return
  3467. }
  3468. /* eslint-enable no-self-compare */
  3469. if ( true && customSetter) {
  3470. customSetter();
  3471. }
  3472. // #7981: for accessor properties without setter
  3473. if (getter && !setter) { return }
  3474. if (setter) {
  3475. setter.call(obj, newVal);
  3476. } else {
  3477. val = newVal;
  3478. }
  3479. childOb = !shallow && observe(newVal);
  3480. dep.notify();
  3481. }
  3482. });
  3483. }
  3484. /**
  3485. * Set a property on an object. Adds the new property and
  3486. * triggers change notification if the property doesn't
  3487. * already exist.
  3488. */
  3489. function set (target, key, val) {
  3490. if ( true &&
  3491. (isUndef(target) || isPrimitive(target))
  3492. ) {
  3493. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  3494. }
  3495. if (Array.isArray(target) && isValidArrayIndex(key)) {
  3496. target.length = Math.max(target.length, key);
  3497. target.splice(key, 1, val);
  3498. return val
  3499. }
  3500. if (key in target && !(key in Object.prototype)) {
  3501. target[key] = val;
  3502. return val
  3503. }
  3504. var ob = (target).__ob__;
  3505. if (target._isVue || (ob && ob.vmCount)) {
  3506. true && warn(
  3507. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  3508. 'at runtime - declare it upfront in the data option.'
  3509. );
  3510. return val
  3511. }
  3512. if (!ob) {
  3513. target[key] = val;
  3514. return val
  3515. }
  3516. defineReactive$$1(ob.value, key, val);
  3517. ob.dep.notify();
  3518. return val
  3519. }
  3520. /**
  3521. * Delete a property and trigger change if necessary.
  3522. */
  3523. function del (target, key) {
  3524. if ( true &&
  3525. (isUndef(target) || isPrimitive(target))
  3526. ) {
  3527. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  3528. }
  3529. if (Array.isArray(target) && isValidArrayIndex(key)) {
  3530. target.splice(key, 1);
  3531. return
  3532. }
  3533. var ob = (target).__ob__;
  3534. if (target._isVue || (ob && ob.vmCount)) {
  3535. true && warn(
  3536. 'Avoid deleting properties on a Vue instance or its root $data ' +
  3537. '- just set it to null.'
  3538. );
  3539. return
  3540. }
  3541. if (!hasOwn(target, key)) {
  3542. return
  3543. }
  3544. delete target[key];
  3545. if (!ob) {
  3546. return
  3547. }
  3548. ob.dep.notify();
  3549. }
  3550. /**
  3551. * Collect dependencies on array elements when the array is touched, since
  3552. * we cannot intercept array element access like property getters.
  3553. */
  3554. function dependArray (value) {
  3555. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  3556. e = value[i];
  3557. e && e.__ob__ && e.__ob__.dep.depend();
  3558. if (Array.isArray(e)) {
  3559. dependArray(e);
  3560. }
  3561. }
  3562. }
  3563. /* */
  3564. /**
  3565. * Option overwriting strategies are functions that handle
  3566. * how to merge a parent option value and a child option
  3567. * value into the final value.
  3568. */
  3569. var strats = config.optionMergeStrategies;
  3570. /**
  3571. * Options with restrictions
  3572. */
  3573. if (true) {
  3574. strats.el = strats.propsData = function (parent, child, vm, key) {
  3575. if (!vm) {
  3576. warn(
  3577. "option \"" + key + "\" can only be used during instance " +
  3578. 'creation with the `new` keyword.'
  3579. );
  3580. }
  3581. return defaultStrat(parent, child)
  3582. };
  3583. }
  3584. /**
  3585. * Helper that recursively merges two data objects together.
  3586. */
  3587. function mergeData (to, from) {
  3588. if (!from) { return to }
  3589. var key, toVal, fromVal;
  3590. var keys = hasSymbol
  3591. ? Reflect.ownKeys(from)
  3592. : Object.keys(from);
  3593. for (var i = 0; i < keys.length; i++) {
  3594. key = keys[i];
  3595. // in case the object is already observed...
  3596. if (key === '__ob__') { continue }
  3597. toVal = to[key];
  3598. fromVal = from[key];
  3599. if (!hasOwn(to, key)) {
  3600. set(to, key, fromVal);
  3601. } else if (
  3602. toVal !== fromVal &&
  3603. isPlainObject(toVal) &&
  3604. isPlainObject(fromVal)
  3605. ) {
  3606. mergeData(toVal, fromVal);
  3607. }
  3608. }
  3609. return to
  3610. }
  3611. /**
  3612. * Data
  3613. */
  3614. function mergeDataOrFn (
  3615. parentVal,
  3616. childVal,
  3617. vm
  3618. ) {
  3619. if (!vm) {
  3620. // in a Vue.extend merge, both should be functions
  3621. if (!childVal) {
  3622. return parentVal
  3623. }
  3624. if (!parentVal) {
  3625. return childVal
  3626. }
  3627. // when parentVal & childVal are both present,
  3628. // we need to return a function that returns the
  3629. // merged result of both functions... no need to
  3630. // check if parentVal is a function here because
  3631. // it has to be a function to pass previous merges.
  3632. return function mergedDataFn () {
  3633. return mergeData(
  3634. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  3635. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  3636. )
  3637. }
  3638. } else {
  3639. return function mergedInstanceDataFn () {
  3640. // instance merge
  3641. var instanceData = typeof childVal === 'function'
  3642. ? childVal.call(vm, vm)
  3643. : childVal;
  3644. var defaultData = typeof parentVal === 'function'
  3645. ? parentVal.call(vm, vm)
  3646. : parentVal;
  3647. if (instanceData) {
  3648. return mergeData(instanceData, defaultData)
  3649. } else {
  3650. return defaultData
  3651. }
  3652. }
  3653. }
  3654. }
  3655. strats.data = function (
  3656. parentVal,
  3657. childVal,
  3658. vm
  3659. ) {
  3660. if (!vm) {
  3661. if (childVal && typeof childVal !== 'function') {
  3662. true && warn(
  3663. 'The "data" option should be a function ' +
  3664. 'that returns a per-instance value in component ' +
  3665. 'definitions.',
  3666. vm
  3667. );
  3668. return parentVal
  3669. }
  3670. return mergeDataOrFn(parentVal, childVal)
  3671. }
  3672. return mergeDataOrFn(parentVal, childVal, vm)
  3673. };
  3674. /**
  3675. * Hooks and props are merged as arrays.
  3676. */
  3677. function mergeHook (
  3678. parentVal,
  3679. childVal
  3680. ) {
  3681. var res = childVal
  3682. ? parentVal
  3683. ? parentVal.concat(childVal)
  3684. : Array.isArray(childVal)
  3685. ? childVal
  3686. : [childVal]
  3687. : parentVal;
  3688. return res
  3689. ? dedupeHooks(res)
  3690. : res
  3691. }
  3692. function dedupeHooks (hooks) {
  3693. var res = [];
  3694. for (var i = 0; i < hooks.length; i++) {
  3695. if (res.indexOf(hooks[i]) === -1) {
  3696. res.push(hooks[i]);
  3697. }
  3698. }
  3699. return res
  3700. }
  3701. LIFECYCLE_HOOKS.forEach(function (hook) {
  3702. strats[hook] = mergeHook;
  3703. });
  3704. /**
  3705. * Assets
  3706. *
  3707. * When a vm is present (instance creation), we need to do
  3708. * a three-way merge between constructor options, instance
  3709. * options and parent options.
  3710. */
  3711. function mergeAssets (
  3712. parentVal,
  3713. childVal,
  3714. vm,
  3715. key
  3716. ) {
  3717. var res = Object.create(parentVal || null);
  3718. if (childVal) {
  3719. true && assertObjectType(key, childVal, vm);
  3720. return extend(res, childVal)
  3721. } else {
  3722. return res
  3723. }
  3724. }
  3725. ASSET_TYPES.forEach(function (type) {
  3726. strats[type + 's'] = mergeAssets;
  3727. });
  3728. /**
  3729. * Watchers.
  3730. *
  3731. * Watchers hashes should not overwrite one
  3732. * another, so we merge them as arrays.
  3733. */
  3734. strats.watch = function (
  3735. parentVal,
  3736. childVal,
  3737. vm,
  3738. key
  3739. ) {
  3740. // work around Firefox's Object.prototype.watch...
  3741. if (parentVal === nativeWatch) { parentVal = undefined; }
  3742. if (childVal === nativeWatch) { childVal = undefined; }
  3743. /* istanbul ignore if */
  3744. if (!childVal) { return Object.create(parentVal || null) }
  3745. if (true) {
  3746. assertObjectType(key, childVal, vm);
  3747. }
  3748. if (!parentVal) { return childVal }
  3749. var ret = {};
  3750. extend(ret, parentVal);
  3751. for (var key$1 in childVal) {
  3752. var parent = ret[key$1];
  3753. var child = childVal[key$1];
  3754. if (parent && !Array.isArray(parent)) {
  3755. parent = [parent];
  3756. }
  3757. ret[key$1] = parent
  3758. ? parent.concat(child)
  3759. : Array.isArray(child) ? child : [child];
  3760. }
  3761. return ret
  3762. };
  3763. /**
  3764. * Other object hashes.
  3765. */
  3766. strats.props =
  3767. strats.methods =
  3768. strats.inject =
  3769. strats.computed = function (
  3770. parentVal,
  3771. childVal,
  3772. vm,
  3773. key
  3774. ) {
  3775. if (childVal && "development" !== 'production') {
  3776. assertObjectType(key, childVal, vm);
  3777. }
  3778. if (!parentVal) { return childVal }
  3779. var ret = Object.create(null);
  3780. extend(ret, parentVal);
  3781. if (childVal) { extend(ret, childVal); }
  3782. return ret
  3783. };
  3784. strats.provide = mergeDataOrFn;
  3785. /**
  3786. * Default strategy.
  3787. */
  3788. var defaultStrat = function (parentVal, childVal) {
  3789. return childVal === undefined
  3790. ? parentVal
  3791. : childVal
  3792. };
  3793. /**
  3794. * Validate component names
  3795. */
  3796. function checkComponents (options) {
  3797. for (var key in options.components) {
  3798. validateComponentName(key);
  3799. }
  3800. }
  3801. function validateComponentName (name) {
  3802. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  3803. warn(
  3804. 'Invalid component name: "' + name + '". Component names ' +
  3805. 'should conform to valid custom element name in html5 specification.'
  3806. );
  3807. }
  3808. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  3809. warn(
  3810. 'Do not use built-in or reserved HTML elements as component ' +
  3811. 'id: ' + name
  3812. );
  3813. }
  3814. }
  3815. /**
  3816. * Ensure all props option syntax are normalized into the
  3817. * Object-based format.
  3818. */
  3819. function normalizeProps (options, vm) {
  3820. var props = options.props;
  3821. if (!props) { return }
  3822. var res = {};
  3823. var i, val, name;
  3824. if (Array.isArray(props)) {
  3825. i = props.length;
  3826. while (i--) {
  3827. val = props[i];
  3828. if (typeof val === 'string') {
  3829. name = camelize(val);
  3830. res[name] = { type: null };
  3831. } else if (true) {
  3832. warn('props must be strings when using array syntax.');
  3833. }
  3834. }
  3835. } else if (isPlainObject(props)) {
  3836. for (var key in props) {
  3837. val = props[key];
  3838. name = camelize(key);
  3839. res[name] = isPlainObject(val)
  3840. ? val
  3841. : { type: val };
  3842. }
  3843. } else if (true) {
  3844. warn(
  3845. "Invalid value for option \"props\": expected an Array or an Object, " +
  3846. "but got " + (toRawType(props)) + ".",
  3847. vm
  3848. );
  3849. }
  3850. options.props = res;
  3851. }
  3852. /**
  3853. * Normalize all injections into Object-based format
  3854. */
  3855. function normalizeInject (options, vm) {
  3856. var inject = options.inject;
  3857. if (!inject) { return }
  3858. var normalized = options.inject = {};
  3859. if (Array.isArray(inject)) {
  3860. for (var i = 0; i < inject.length; i++) {
  3861. normalized[inject[i]] = { from: inject[i] };
  3862. }
  3863. } else if (isPlainObject(inject)) {
  3864. for (var key in inject) {
  3865. var val = inject[key];
  3866. normalized[key] = isPlainObject(val)
  3867. ? extend({ from: key }, val)
  3868. : { from: val };
  3869. }
  3870. } else if (true) {
  3871. warn(
  3872. "Invalid value for option \"inject\": expected an Array or an Object, " +
  3873. "but got " + (toRawType(inject)) + ".",
  3874. vm
  3875. );
  3876. }
  3877. }
  3878. /**
  3879. * Normalize raw function directives into object format.
  3880. */
  3881. function normalizeDirectives (options) {
  3882. var dirs = options.directives;
  3883. if (dirs) {
  3884. for (var key in dirs) {
  3885. var def$$1 = dirs[key];
  3886. if (typeof def$$1 === 'function') {
  3887. dirs[key] = { bind: def$$1, update: def$$1 };
  3888. }
  3889. }
  3890. }
  3891. }
  3892. function assertObjectType (name, value, vm) {
  3893. if (!isPlainObject(value)) {
  3894. warn(
  3895. "Invalid value for option \"" + name + "\": expected an Object, " +
  3896. "but got " + (toRawType(value)) + ".",
  3897. vm
  3898. );
  3899. }
  3900. }
  3901. /**
  3902. * Merge two option objects into a new one.
  3903. * Core utility used in both instantiation and inheritance.
  3904. */
  3905. function mergeOptions (
  3906. parent,
  3907. child,
  3908. vm
  3909. ) {
  3910. if (true) {
  3911. checkComponents(child);
  3912. }
  3913. if (typeof child === 'function') {
  3914. child = child.options;
  3915. }
  3916. normalizeProps(child, vm);
  3917. normalizeInject(child, vm);
  3918. normalizeDirectives(child);
  3919. // Apply extends and mixins on the child options,
  3920. // but only if it is a raw options object that isn't
  3921. // the result of another mergeOptions call.
  3922. // Only merged options has the _base property.
  3923. if (!child._base) {
  3924. if (child.extends) {
  3925. parent = mergeOptions(parent, child.extends, vm);
  3926. }
  3927. if (child.mixins) {
  3928. for (var i = 0, l = child.mixins.length; i < l; i++) {
  3929. parent = mergeOptions(parent, child.mixins[i], vm);
  3930. }
  3931. }
  3932. }
  3933. var options = {};
  3934. var key;
  3935. for (key in parent) {
  3936. mergeField(key);
  3937. }
  3938. for (key in child) {
  3939. if (!hasOwn(parent, key)) {
  3940. mergeField(key);
  3941. }
  3942. }
  3943. function mergeField (key) {
  3944. var strat = strats[key] || defaultStrat;
  3945. options[key] = strat(parent[key], child[key], vm, key);
  3946. }
  3947. return options
  3948. }
  3949. /**
  3950. * Resolve an asset.
  3951. * This function is used because child instances need access
  3952. * to assets defined in its ancestor chain.
  3953. */
  3954. function resolveAsset (
  3955. options,
  3956. type,
  3957. id,
  3958. warnMissing
  3959. ) {
  3960. /* istanbul ignore if */
  3961. if (typeof id !== 'string') {
  3962. return
  3963. }
  3964. var assets = options[type];
  3965. // check local registration variations first
  3966. if (hasOwn(assets, id)) { return assets[id] }
  3967. var camelizedId = camelize(id);
  3968. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  3969. var PascalCaseId = capitalize(camelizedId);
  3970. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  3971. // fallback to prototype chain
  3972. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  3973. if ( true && warnMissing && !res) {
  3974. warn(
  3975. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  3976. options
  3977. );
  3978. }
  3979. return res
  3980. }
  3981. /* */
  3982. function validateProp (
  3983. key,
  3984. propOptions,
  3985. propsData,
  3986. vm
  3987. ) {
  3988. var prop = propOptions[key];
  3989. var absent = !hasOwn(propsData, key);
  3990. var value = propsData[key];
  3991. // boolean casting
  3992. var booleanIndex = getTypeIndex(Boolean, prop.type);
  3993. if (booleanIndex > -1) {
  3994. if (absent && !hasOwn(prop, 'default')) {
  3995. value = false;
  3996. } else if (value === '' || value === hyphenate(key)) {
  3997. // only cast empty string / same name to boolean if
  3998. // boolean has higher priority
  3999. var stringIndex = getTypeIndex(String, prop.type);
  4000. if (stringIndex < 0 || booleanIndex < stringIndex) {
  4001. value = true;
  4002. }
  4003. }
  4004. }
  4005. // check default value
  4006. if (value === undefined) {
  4007. value = getPropDefaultValue(vm, prop, key);
  4008. // since the default value is a fresh copy,
  4009. // make sure to observe it.
  4010. var prevShouldObserve = shouldObserve;
  4011. toggleObserving(true);
  4012. observe(value);
  4013. toggleObserving(prevShouldObserve);
  4014. }
  4015. if (
  4016. true
  4017. ) {
  4018. assertProp(prop, key, value, vm, absent);
  4019. }
  4020. return value
  4021. }
  4022. /**
  4023. * Get the default value of a prop.
  4024. */
  4025. function getPropDefaultValue (vm, prop, key) {
  4026. // no default, return undefined
  4027. if (!hasOwn(prop, 'default')) {
  4028. return undefined
  4029. }
  4030. var def = prop.default;
  4031. // warn against non-factory defaults for Object & Array
  4032. if ( true && isObject(def)) {
  4033. warn(
  4034. 'Invalid default value for prop "' + key + '": ' +
  4035. 'Props with type Object/Array must use a factory function ' +
  4036. 'to return the default value.',
  4037. vm
  4038. );
  4039. }
  4040. // the raw prop value was also undefined from previous render,
  4041. // return previous default value to avoid unnecessary watcher trigger
  4042. if (vm && vm.$options.propsData &&
  4043. vm.$options.propsData[key] === undefined &&
  4044. vm._props[key] !== undefined
  4045. ) {
  4046. return vm._props[key]
  4047. }
  4048. // call factory function for non-Function types
  4049. // a value is Function if its prototype is function even across different execution context
  4050. return typeof def === 'function' && getType(prop.type) !== 'Function'
  4051. ? def.call(vm)
  4052. : def
  4053. }
  4054. /**
  4055. * Assert whether a prop is valid.
  4056. */
  4057. function assertProp (
  4058. prop,
  4059. name,
  4060. value,
  4061. vm,
  4062. absent
  4063. ) {
  4064. if (prop.required && absent) {
  4065. warn(
  4066. 'Missing required prop: "' + name + '"',
  4067. vm
  4068. );
  4069. return
  4070. }
  4071. if (value == null && !prop.required) {
  4072. return
  4073. }
  4074. var type = prop.type;
  4075. var valid = !type || type === true;
  4076. var expectedTypes = [];
  4077. if (type) {
  4078. if (!Array.isArray(type)) {
  4079. type = [type];
  4080. }
  4081. for (var i = 0; i < type.length && !valid; i++) {
  4082. var assertedType = assertType(value, type[i]);
  4083. expectedTypes.push(assertedType.expectedType || '');
  4084. valid = assertedType.valid;
  4085. }
  4086. }
  4087. if (!valid) {
  4088. warn(
  4089. getInvalidTypeMessage(name, value, expectedTypes),
  4090. vm
  4091. );
  4092. return
  4093. }
  4094. var validator = prop.validator;
  4095. if (validator) {
  4096. if (!validator(value)) {
  4097. warn(
  4098. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  4099. vm
  4100. );
  4101. }
  4102. }
  4103. }
  4104. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  4105. function assertType (value, type) {
  4106. var valid;
  4107. var expectedType = getType(type);
  4108. if (simpleCheckRE.test(expectedType)) {
  4109. var t = typeof value;
  4110. valid = t === expectedType.toLowerCase();
  4111. // for primitive wrapper objects
  4112. if (!valid && t === 'object') {
  4113. valid = value instanceof type;
  4114. }
  4115. } else if (expectedType === 'Object') {
  4116. valid = isPlainObject(value);
  4117. } else if (expectedType === 'Array') {
  4118. valid = Array.isArray(value);
  4119. } else {
  4120. valid = value instanceof type;
  4121. }
  4122. return {
  4123. valid: valid,
  4124. expectedType: expectedType
  4125. }
  4126. }
  4127. /**
  4128. * Use function string name to check built-in types,
  4129. * because a simple equality check will fail when running
  4130. * across different vms / iframes.
  4131. */
  4132. function getType (fn) {
  4133. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  4134. return match ? match[1] : ''
  4135. }
  4136. function isSameType (a, b) {
  4137. return getType(a) === getType(b)
  4138. }
  4139. function getTypeIndex (type, expectedTypes) {
  4140. if (!Array.isArray(expectedTypes)) {
  4141. return isSameType(expectedTypes, type) ? 0 : -1
  4142. }
  4143. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  4144. if (isSameType(expectedTypes[i], type)) {
  4145. return i
  4146. }
  4147. }
  4148. return -1
  4149. }
  4150. function getInvalidTypeMessage (name, value, expectedTypes) {
  4151. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  4152. " Expected " + (expectedTypes.map(capitalize).join(', '));
  4153. var expectedType = expectedTypes[0];
  4154. var receivedType = toRawType(value);
  4155. var expectedValue = styleValue(value, expectedType);
  4156. var receivedValue = styleValue(value, receivedType);
  4157. // check if we need to specify expected value
  4158. if (expectedTypes.length === 1 &&
  4159. isExplicable(expectedType) &&
  4160. !isBoolean(expectedType, receivedType)) {
  4161. message += " with value " + expectedValue;
  4162. }
  4163. message += ", got " + receivedType + " ";
  4164. // check if we need to specify received value
  4165. if (isExplicable(receivedType)) {
  4166. message += "with value " + receivedValue + ".";
  4167. }
  4168. return message
  4169. }
  4170. function styleValue (value, type) {
  4171. if (type === 'String') {
  4172. return ("\"" + value + "\"")
  4173. } else if (type === 'Number') {
  4174. return ("" + (Number(value)))
  4175. } else {
  4176. return ("" + value)
  4177. }
  4178. }
  4179. function isExplicable (value) {
  4180. var explicitTypes = ['string', 'number', 'boolean'];
  4181. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  4182. }
  4183. function isBoolean () {
  4184. var args = [], len = arguments.length;
  4185. while ( len-- ) args[ len ] = arguments[ len ];
  4186. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  4187. }
  4188. /* */
  4189. function handleError (err, vm, info) {
  4190. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  4191. // See: https://github.com/vuejs/vuex/issues/1505
  4192. pushTarget();
  4193. try {
  4194. if (vm) {
  4195. var cur = vm;
  4196. while ((cur = cur.$parent)) {
  4197. var hooks = cur.$options.errorCaptured;
  4198. if (hooks) {
  4199. for (var i = 0; i < hooks.length; i++) {
  4200. try {
  4201. var capture = hooks[i].call(cur, err, vm, info) === false;
  4202. if (capture) { return }
  4203. } catch (e) {
  4204. globalHandleError(e, cur, 'errorCaptured hook');
  4205. }
  4206. }
  4207. }
  4208. }
  4209. }
  4210. globalHandleError(err, vm, info);
  4211. } finally {
  4212. popTarget();
  4213. }
  4214. }
  4215. function invokeWithErrorHandling (
  4216. handler,
  4217. context,
  4218. args,
  4219. vm,
  4220. info
  4221. ) {
  4222. var res;
  4223. try {
  4224. res = args ? handler.apply(context, args) : handler.call(context);
  4225. if (res && !res._isVue && isPromise(res) && !res._handled) {
  4226. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  4227. // issue #9511
  4228. // avoid catch triggering multiple times when nested calls
  4229. res._handled = true;
  4230. }
  4231. } catch (e) {
  4232. handleError(e, vm, info);
  4233. }
  4234. return res
  4235. }
  4236. function globalHandleError (err, vm, info) {
  4237. if (config.errorHandler) {
  4238. try {
  4239. return config.errorHandler.call(null, err, vm, info)
  4240. } catch (e) {
  4241. // if the user intentionally throws the original error in the handler,
  4242. // do not log it twice
  4243. if (e !== err) {
  4244. logError(e, null, 'config.errorHandler');
  4245. }
  4246. }
  4247. }
  4248. logError(err, vm, info);
  4249. }
  4250. function logError (err, vm, info) {
  4251. if (true) {
  4252. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  4253. }
  4254. /* istanbul ignore else */
  4255. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  4256. console.error(err);
  4257. } else {
  4258. throw err
  4259. }
  4260. }
  4261. /* */
  4262. var callbacks = [];
  4263. var pending = false;
  4264. function flushCallbacks () {
  4265. pending = false;
  4266. var copies = callbacks.slice(0);
  4267. callbacks.length = 0;
  4268. for (var i = 0; i < copies.length; i++) {
  4269. copies[i]();
  4270. }
  4271. }
  4272. // Here we have async deferring wrappers using microtasks.
  4273. // In 2.5 we used (macro) tasks (in combination with microtasks).
  4274. // However, it has subtle problems when state is changed right before repaint
  4275. // (e.g. #6813, out-in transitions).
  4276. // Also, using (macro) tasks in event handler would cause some weird behaviors
  4277. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  4278. // So we now use microtasks everywhere, again.
  4279. // A major drawback of this tradeoff is that there are some scenarios
  4280. // where microtasks have too high a priority and fire in between supposedly
  4281. // sequential events (e.g. #4521, #6690, which have workarounds)
  4282. // or even between bubbling of the same event (#6566).
  4283. var timerFunc;
  4284. // The nextTick behavior leverages the microtask queue, which can be accessed
  4285. // via either native Promise.then or MutationObserver.
  4286. // MutationObserver has wider support, however it is seriously bugged in
  4287. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  4288. // completely stops working after triggering a few times... so, if native
  4289. // Promise is available, we will use it:
  4290. /* istanbul ignore next, $flow-disable-line */
  4291. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  4292. var p = Promise.resolve();
  4293. timerFunc = function () {
  4294. p.then(flushCallbacks);
  4295. // In problematic UIWebViews, Promise.then doesn't completely break, but
  4296. // it can get stuck in a weird state where callbacks are pushed into the
  4297. // microtask queue but the queue isn't being flushed, until the browser
  4298. // needs to do some other work, e.g. handle a timer. Therefore we can
  4299. // "force" the microtask queue to be flushed by adding an empty timer.
  4300. if (isIOS) { setTimeout(noop); }
  4301. };
  4302. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  4303. isNative(MutationObserver) ||
  4304. // PhantomJS and iOS 7.x
  4305. MutationObserver.toString() === '[object MutationObserverConstructor]'
  4306. )) {
  4307. // Use MutationObserver where native Promise is not available,
  4308. // e.g. PhantomJS, iOS7, Android 4.4
  4309. // (#6466 MutationObserver is unreliable in IE11)
  4310. var counter = 1;
  4311. var observer = new MutationObserver(flushCallbacks);
  4312. var textNode = document.createTextNode(String(counter));
  4313. observer.observe(textNode, {
  4314. characterData: true
  4315. });
  4316. timerFunc = function () {
  4317. counter = (counter + 1) % 2;
  4318. textNode.data = String(counter);
  4319. };
  4320. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  4321. // Fallback to setImmediate.
  4322. // Technically it leverages the (macro) task queue,
  4323. // but it is still a better choice than setTimeout.
  4324. timerFunc = function () {
  4325. setImmediate(flushCallbacks);
  4326. };
  4327. } else {
  4328. // Fallback to setTimeout.
  4329. timerFunc = function () {
  4330. setTimeout(flushCallbacks, 0);
  4331. };
  4332. }
  4333. function nextTick (cb, ctx) {
  4334. var _resolve;
  4335. callbacks.push(function () {
  4336. if (cb) {
  4337. try {
  4338. cb.call(ctx);
  4339. } catch (e) {
  4340. handleError(e, ctx, 'nextTick');
  4341. }
  4342. } else if (_resolve) {
  4343. _resolve(ctx);
  4344. }
  4345. });
  4346. if (!pending) {
  4347. pending = true;
  4348. timerFunc();
  4349. }
  4350. // $flow-disable-line
  4351. if (!cb && typeof Promise !== 'undefined') {
  4352. return new Promise(function (resolve) {
  4353. _resolve = resolve;
  4354. })
  4355. }
  4356. }
  4357. /* */
  4358. /* not type checking this file because flow doesn't play well with Proxy */
  4359. var initProxy;
  4360. if (true) {
  4361. var allowedGlobals = makeMap(
  4362. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  4363. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  4364. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  4365. 'require' // for Webpack/Browserify
  4366. );
  4367. var warnNonPresent = function (target, key) {
  4368. warn(
  4369. "Property or method \"" + key + "\" is not defined on the instance but " +
  4370. 'referenced during render. Make sure that this property is reactive, ' +
  4371. 'either in the data option, or for class-based components, by ' +
  4372. 'initializing the property. ' +
  4373. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  4374. target
  4375. );
  4376. };
  4377. var warnReservedPrefix = function (target, key) {
  4378. warn(
  4379. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  4380. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  4381. 'prevent conflicts with Vue internals. ' +
  4382. 'See: https://vuejs.org/v2/api/#data',
  4383. target
  4384. );
  4385. };
  4386. var hasProxy =
  4387. typeof Proxy !== 'undefined' && isNative(Proxy);
  4388. if (hasProxy) {
  4389. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  4390. config.keyCodes = new Proxy(config.keyCodes, {
  4391. set: function set (target, key, value) {
  4392. if (isBuiltInModifier(key)) {
  4393. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  4394. return false
  4395. } else {
  4396. target[key] = value;
  4397. return true
  4398. }
  4399. }
  4400. });
  4401. }
  4402. var hasHandler = {
  4403. has: function has (target, key) {
  4404. var has = key in target;
  4405. var isAllowed = allowedGlobals(key) ||
  4406. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  4407. if (!has && !isAllowed) {
  4408. if (key in target.$data) { warnReservedPrefix(target, key); }
  4409. else { warnNonPresent(target, key); }
  4410. }
  4411. return has || !isAllowed
  4412. }
  4413. };
  4414. var getHandler = {
  4415. get: function get (target, key) {
  4416. if (typeof key === 'string' && !(key in target)) {
  4417. if (key in target.$data) { warnReservedPrefix(target, key); }
  4418. else { warnNonPresent(target, key); }
  4419. }
  4420. return target[key]
  4421. }
  4422. };
  4423. initProxy = function initProxy (vm) {
  4424. if (hasProxy) {
  4425. // determine which proxy handler to use
  4426. var options = vm.$options;
  4427. var handlers = options.render && options.render._withStripped
  4428. ? getHandler
  4429. : hasHandler;
  4430. vm._renderProxy = new Proxy(vm, handlers);
  4431. } else {
  4432. vm._renderProxy = vm;
  4433. }
  4434. };
  4435. }
  4436. /* */
  4437. var seenObjects = new _Set();
  4438. /**
  4439. * Recursively traverse an object to evoke all converted
  4440. * getters, so that every nested property inside the object
  4441. * is collected as a "deep" dependency.
  4442. */
  4443. function traverse (val) {
  4444. _traverse(val, seenObjects);
  4445. seenObjects.clear();
  4446. }
  4447. function _traverse (val, seen) {
  4448. var i, keys;
  4449. var isA = Array.isArray(val);
  4450. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  4451. return
  4452. }
  4453. if (val.__ob__) {
  4454. var depId = val.__ob__.dep.id;
  4455. if (seen.has(depId)) {
  4456. return
  4457. }
  4458. seen.add(depId);
  4459. }
  4460. if (isA) {
  4461. i = val.length;
  4462. while (i--) { _traverse(val[i], seen); }
  4463. } else {
  4464. keys = Object.keys(val);
  4465. i = keys.length;
  4466. while (i--) { _traverse(val[keys[i]], seen); }
  4467. }
  4468. }
  4469. var mark;
  4470. var measure;
  4471. if (true) {
  4472. var perf = inBrowser && window.performance;
  4473. /* istanbul ignore if */
  4474. if (
  4475. perf &&
  4476. perf.mark &&
  4477. perf.measure &&
  4478. perf.clearMarks &&
  4479. perf.clearMeasures
  4480. ) {
  4481. mark = function (tag) { return perf.mark(tag); };
  4482. measure = function (name, startTag, endTag) {
  4483. perf.measure(name, startTag, endTag);
  4484. perf.clearMarks(startTag);
  4485. perf.clearMarks(endTag);
  4486. // perf.clearMeasures(name)
  4487. };
  4488. }
  4489. }
  4490. /* */
  4491. var normalizeEvent = cached(function (name) {
  4492. var passive = name.charAt(0) === '&';
  4493. name = passive ? name.slice(1) : name;
  4494. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  4495. name = once$$1 ? name.slice(1) : name;
  4496. var capture = name.charAt(0) === '!';
  4497. name = capture ? name.slice(1) : name;
  4498. return {
  4499. name: name,
  4500. once: once$$1,
  4501. capture: capture,
  4502. passive: passive
  4503. }
  4504. });
  4505. function createFnInvoker (fns, vm) {
  4506. function invoker () {
  4507. var arguments$1 = arguments;
  4508. var fns = invoker.fns;
  4509. if (Array.isArray(fns)) {
  4510. var cloned = fns.slice();
  4511. for (var i = 0; i < cloned.length; i++) {
  4512. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  4513. }
  4514. } else {
  4515. // return handler return value for single handlers
  4516. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  4517. }
  4518. }
  4519. invoker.fns = fns;
  4520. return invoker
  4521. }
  4522. function updateListeners (
  4523. on,
  4524. oldOn,
  4525. add,
  4526. remove$$1,
  4527. createOnceHandler,
  4528. vm
  4529. ) {
  4530. var name, def$$1, cur, old, event;
  4531. for (name in on) {
  4532. def$$1 = cur = on[name];
  4533. old = oldOn[name];
  4534. event = normalizeEvent(name);
  4535. if (isUndef(cur)) {
  4536. true && warn(
  4537. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  4538. vm
  4539. );
  4540. } else if (isUndef(old)) {
  4541. if (isUndef(cur.fns)) {
  4542. cur = on[name] = createFnInvoker(cur, vm);
  4543. }
  4544. if (isTrue(event.once)) {
  4545. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  4546. }
  4547. add(event.name, cur, event.capture, event.passive, event.params);
  4548. } else if (cur !== old) {
  4549. old.fns = cur;
  4550. on[name] = old;
  4551. }
  4552. }
  4553. for (name in oldOn) {
  4554. if (isUndef(on[name])) {
  4555. event = normalizeEvent(name);
  4556. remove$$1(event.name, oldOn[name], event.capture);
  4557. }
  4558. }
  4559. }
  4560. /* */
  4561. /* */
  4562. // fixed by xxxxxx (mp properties)
  4563. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  4564. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  4565. if (isUndef(propOptions)) {
  4566. return res
  4567. }
  4568. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  4569. var attrs = data.attrs;
  4570. var props = data.props;
  4571. if (isDef(attrs) || isDef(props)) {
  4572. for (var key in propOptions) {
  4573. var altKey = hyphenate(key);
  4574. var result = checkProp(res, props, key, altKey, true) ||
  4575. checkProp(res, attrs, key, altKey, false);
  4576. // externalClass
  4577. if (
  4578. result &&
  4579. res[key] &&
  4580. externalClasses.indexOf(altKey) !== -1 &&
  4581. context[camelize(res[key])]
  4582. ) {
  4583. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  4584. res[key] = context[camelize(res[key])];
  4585. }
  4586. }
  4587. }
  4588. return res
  4589. }
  4590. function extractPropsFromVNodeData (
  4591. data,
  4592. Ctor,
  4593. tag,
  4594. context// fixed by xxxxxx
  4595. ) {
  4596. // we are only extracting raw values here.
  4597. // validation and default values are handled in the child
  4598. // component itself.
  4599. var propOptions = Ctor.options.props;
  4600. if (isUndef(propOptions)) {
  4601. // fixed by xxxxxx
  4602. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  4603. }
  4604. var res = {};
  4605. var attrs = data.attrs;
  4606. var props = data.props;
  4607. if (isDef(attrs) || isDef(props)) {
  4608. for (var key in propOptions) {
  4609. var altKey = hyphenate(key);
  4610. if (true) {
  4611. var keyInLowerCase = key.toLowerCase();
  4612. if (
  4613. key !== keyInLowerCase &&
  4614. attrs && hasOwn(attrs, keyInLowerCase)
  4615. ) {
  4616. tip(
  4617. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  4618. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  4619. " \"" + key + "\". " +
  4620. "Note that HTML attributes are case-insensitive and camelCased " +
  4621. "props need to use their kebab-case equivalents when using in-DOM " +
  4622. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  4623. );
  4624. }
  4625. }
  4626. checkProp(res, props, key, altKey, true) ||
  4627. checkProp(res, attrs, key, altKey, false);
  4628. }
  4629. }
  4630. // fixed by xxxxxx
  4631. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  4632. }
  4633. function checkProp (
  4634. res,
  4635. hash,
  4636. key,
  4637. altKey,
  4638. preserve
  4639. ) {
  4640. if (isDef(hash)) {
  4641. if (hasOwn(hash, key)) {
  4642. res[key] = hash[key];
  4643. if (!preserve) {
  4644. delete hash[key];
  4645. }
  4646. return true
  4647. } else if (hasOwn(hash, altKey)) {
  4648. res[key] = hash[altKey];
  4649. if (!preserve) {
  4650. delete hash[altKey];
  4651. }
  4652. return true
  4653. }
  4654. }
  4655. return false
  4656. }
  4657. /* */
  4658. // The template compiler attempts to minimize the need for normalization by
  4659. // statically analyzing the template at compile time.
  4660. //
  4661. // For plain HTML markup, normalization can be completely skipped because the
  4662. // generated render function is guaranteed to return Array<VNode>. There are
  4663. // two cases where extra normalization is needed:
  4664. // 1. When the children contains components - because a functional component
  4665. // may return an Array instead of a single root. In this case, just a simple
  4666. // normalization is needed - if any child is an Array, we flatten the whole
  4667. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  4668. // because functional components already normalize their own children.
  4669. function simpleNormalizeChildren (children) {
  4670. for (var i = 0; i < children.length; i++) {
  4671. if (Array.isArray(children[i])) {
  4672. return Array.prototype.concat.apply([], children)
  4673. }
  4674. }
  4675. return children
  4676. }
  4677. // 2. When the children contains constructs that always generated nested Arrays,
  4678. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  4679. // with hand-written render functions / JSX. In such cases a full normalization
  4680. // is needed to cater to all possible types of children values.
  4681. function normalizeChildren (children) {
  4682. return isPrimitive(children)
  4683. ? [createTextVNode(children)]
  4684. : Array.isArray(children)
  4685. ? normalizeArrayChildren(children)
  4686. : undefined
  4687. }
  4688. function isTextNode (node) {
  4689. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  4690. }
  4691. function normalizeArrayChildren (children, nestedIndex) {
  4692. var res = [];
  4693. var i, c, lastIndex, last;
  4694. for (i = 0; i < children.length; i++) {
  4695. c = children[i];
  4696. if (isUndef(c) || typeof c === 'boolean') { continue }
  4697. lastIndex = res.length - 1;
  4698. last = res[lastIndex];
  4699. // nested
  4700. if (Array.isArray(c)) {
  4701. if (c.length > 0) {
  4702. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  4703. // merge adjacent text nodes
  4704. if (isTextNode(c[0]) && isTextNode(last)) {
  4705. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  4706. c.shift();
  4707. }
  4708. res.push.apply(res, c);
  4709. }
  4710. } else if (isPrimitive(c)) {
  4711. if (isTextNode(last)) {
  4712. // merge adjacent text nodes
  4713. // this is necessary for SSR hydration because text nodes are
  4714. // essentially merged when rendered to HTML strings
  4715. res[lastIndex] = createTextVNode(last.text + c);
  4716. } else if (c !== '') {
  4717. // convert primitive to vnode
  4718. res.push(createTextVNode(c));
  4719. }
  4720. } else {
  4721. if (isTextNode(c) && isTextNode(last)) {
  4722. // merge adjacent text nodes
  4723. res[lastIndex] = createTextVNode(last.text + c.text);
  4724. } else {
  4725. // default key for nested array children (likely generated by v-for)
  4726. if (isTrue(children._isVList) &&
  4727. isDef(c.tag) &&
  4728. isUndef(c.key) &&
  4729. isDef(nestedIndex)) {
  4730. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  4731. }
  4732. res.push(c);
  4733. }
  4734. }
  4735. }
  4736. return res
  4737. }
  4738. /* */
  4739. function initProvide (vm) {
  4740. var provide = vm.$options.provide;
  4741. if (provide) {
  4742. vm._provided = typeof provide === 'function'
  4743. ? provide.call(vm)
  4744. : provide;
  4745. }
  4746. }
  4747. function initInjections (vm) {
  4748. var result = resolveInject(vm.$options.inject, vm);
  4749. if (result) {
  4750. toggleObserving(false);
  4751. Object.keys(result).forEach(function (key) {
  4752. /* istanbul ignore else */
  4753. if (true) {
  4754. defineReactive$$1(vm, key, result[key], function () {
  4755. warn(
  4756. "Avoid mutating an injected value directly since the changes will be " +
  4757. "overwritten whenever the provided component re-renders. " +
  4758. "injection being mutated: \"" + key + "\"",
  4759. vm
  4760. );
  4761. });
  4762. } else {}
  4763. });
  4764. toggleObserving(true);
  4765. }
  4766. }
  4767. function resolveInject (inject, vm) {
  4768. if (inject) {
  4769. // inject is :any because flow is not smart enough to figure out cached
  4770. var result = Object.create(null);
  4771. var keys = hasSymbol
  4772. ? Reflect.ownKeys(inject)
  4773. : Object.keys(inject);
  4774. for (var i = 0; i < keys.length; i++) {
  4775. var key = keys[i];
  4776. // #6574 in case the inject object is observed...
  4777. if (key === '__ob__') { continue }
  4778. var provideKey = inject[key].from;
  4779. var source = vm;
  4780. while (source) {
  4781. if (source._provided && hasOwn(source._provided, provideKey)) {
  4782. result[key] = source._provided[provideKey];
  4783. break
  4784. }
  4785. source = source.$parent;
  4786. }
  4787. if (!source) {
  4788. if ('default' in inject[key]) {
  4789. var provideDefault = inject[key].default;
  4790. result[key] = typeof provideDefault === 'function'
  4791. ? provideDefault.call(vm)
  4792. : provideDefault;
  4793. } else if (true) {
  4794. warn(("Injection \"" + key + "\" not found"), vm);
  4795. }
  4796. }
  4797. }
  4798. return result
  4799. }
  4800. }
  4801. /* */
  4802. /**
  4803. * Runtime helper for resolving raw children VNodes into a slot object.
  4804. */
  4805. function resolveSlots (
  4806. children,
  4807. context
  4808. ) {
  4809. if (!children || !children.length) {
  4810. return {}
  4811. }
  4812. var slots = {};
  4813. for (var i = 0, l = children.length; i < l; i++) {
  4814. var child = children[i];
  4815. var data = child.data;
  4816. // remove slot attribute if the node is resolved as a Vue slot node
  4817. if (data && data.attrs && data.attrs.slot) {
  4818. delete data.attrs.slot;
  4819. }
  4820. // named slots should only be respected if the vnode was rendered in the
  4821. // same context.
  4822. if ((child.context === context || child.fnContext === context) &&
  4823. data && data.slot != null
  4824. ) {
  4825. var name = data.slot;
  4826. var slot = (slots[name] || (slots[name] = []));
  4827. if (child.tag === 'template') {
  4828. slot.push.apply(slot, child.children || []);
  4829. } else {
  4830. slot.push(child);
  4831. }
  4832. } else {
  4833. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  4834. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  4835. (slots['page'] || (slots['page'] = [])).push(child);
  4836. }else{
  4837. (slots.default || (slots.default = [])).push(child);
  4838. }
  4839. }
  4840. }
  4841. // ignore slots that contains only whitespace
  4842. for (var name$1 in slots) {
  4843. if (slots[name$1].every(isWhitespace)) {
  4844. delete slots[name$1];
  4845. }
  4846. }
  4847. return slots
  4848. }
  4849. function isWhitespace (node) {
  4850. return (node.isComment && !node.asyncFactory) || node.text === ' '
  4851. }
  4852. /* */
  4853. function normalizeScopedSlots (
  4854. slots,
  4855. normalSlots,
  4856. prevSlots
  4857. ) {
  4858. var res;
  4859. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  4860. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  4861. var key = slots && slots.$key;
  4862. if (!slots) {
  4863. res = {};
  4864. } else if (slots._normalized) {
  4865. // fast path 1: child component re-render only, parent did not change
  4866. return slots._normalized
  4867. } else if (
  4868. isStable &&
  4869. prevSlots &&
  4870. prevSlots !== emptyObject &&
  4871. key === prevSlots.$key &&
  4872. !hasNormalSlots &&
  4873. !prevSlots.$hasNormal
  4874. ) {
  4875. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  4876. // only need to normalize once
  4877. return prevSlots
  4878. } else {
  4879. res = {};
  4880. for (var key$1 in slots) {
  4881. if (slots[key$1] && key$1[0] !== '$') {
  4882. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  4883. }
  4884. }
  4885. }
  4886. // expose normal slots on scopedSlots
  4887. for (var key$2 in normalSlots) {
  4888. if (!(key$2 in res)) {
  4889. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  4890. }
  4891. }
  4892. // avoriaz seems to mock a non-extensible $scopedSlots object
  4893. // and when that is passed down this would cause an error
  4894. if (slots && Object.isExtensible(slots)) {
  4895. (slots)._normalized = res;
  4896. }
  4897. def(res, '$stable', isStable);
  4898. def(res, '$key', key);
  4899. def(res, '$hasNormal', hasNormalSlots);
  4900. return res
  4901. }
  4902. function normalizeScopedSlot(normalSlots, key, fn) {
  4903. var normalized = function () {
  4904. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  4905. res = res && typeof res === 'object' && !Array.isArray(res)
  4906. ? [res] // single vnode
  4907. : normalizeChildren(res);
  4908. return res && (
  4909. res.length === 0 ||
  4910. (res.length === 1 && res[0].isComment) // #9658
  4911. ) ? undefined
  4912. : res
  4913. };
  4914. // this is a slot using the new v-slot syntax without scope. although it is
  4915. // compiled as a scoped slot, render fn users would expect it to be present
  4916. // on this.$slots because the usage is semantically a normal slot.
  4917. if (fn.proxy) {
  4918. Object.defineProperty(normalSlots, key, {
  4919. get: normalized,
  4920. enumerable: true,
  4921. configurable: true
  4922. });
  4923. }
  4924. return normalized
  4925. }
  4926. function proxyNormalSlot(slots, key) {
  4927. return function () { return slots[key]; }
  4928. }
  4929. /* */
  4930. /**
  4931. * Runtime helper for rendering v-for lists.
  4932. */
  4933. function renderList (
  4934. val,
  4935. render
  4936. ) {
  4937. var ret, i, l, keys, key;
  4938. if (Array.isArray(val) || typeof val === 'string') {
  4939. ret = new Array(val.length);
  4940. for (i = 0, l = val.length; i < l; i++) {
  4941. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  4942. }
  4943. } else if (typeof val === 'number') {
  4944. ret = new Array(val);
  4945. for (i = 0; i < val; i++) {
  4946. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  4947. }
  4948. } else if (isObject(val)) {
  4949. if (hasSymbol && val[Symbol.iterator]) {
  4950. ret = [];
  4951. var iterator = val[Symbol.iterator]();
  4952. var result = iterator.next();
  4953. while (!result.done) {
  4954. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  4955. result = iterator.next();
  4956. }
  4957. } else {
  4958. keys = Object.keys(val);
  4959. ret = new Array(keys.length);
  4960. for (i = 0, l = keys.length; i < l; i++) {
  4961. key = keys[i];
  4962. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  4963. }
  4964. }
  4965. }
  4966. if (!isDef(ret)) {
  4967. ret = [];
  4968. }
  4969. (ret)._isVList = true;
  4970. return ret
  4971. }
  4972. /* */
  4973. /**
  4974. * Runtime helper for rendering <slot>
  4975. */
  4976. function renderSlot (
  4977. name,
  4978. fallback,
  4979. props,
  4980. bindObject
  4981. ) {
  4982. var scopedSlotFn = this.$scopedSlots[name];
  4983. var nodes;
  4984. if (scopedSlotFn) { // scoped slot
  4985. props = props || {};
  4986. if (bindObject) {
  4987. if ( true && !isObject(bindObject)) {
  4988. warn(
  4989. 'slot v-bind without argument expects an Object',
  4990. this
  4991. );
  4992. }
  4993. props = extend(extend({}, bindObject), props);
  4994. }
  4995. // fixed by xxxxxx app-plus scopedSlot
  4996. nodes = scopedSlotFn(props, this, props._i) || fallback;
  4997. } else {
  4998. nodes = this.$slots[name] || fallback;
  4999. }
  5000. var target = props && props.slot;
  5001. if (target) {
  5002. return this.$createElement('template', { slot: target }, nodes)
  5003. } else {
  5004. return nodes
  5005. }
  5006. }
  5007. /* */
  5008. /**
  5009. * Runtime helper for resolving filters
  5010. */
  5011. function resolveFilter (id) {
  5012. return resolveAsset(this.$options, 'filters', id, true) || identity
  5013. }
  5014. /* */
  5015. function isKeyNotMatch (expect, actual) {
  5016. if (Array.isArray(expect)) {
  5017. return expect.indexOf(actual) === -1
  5018. } else {
  5019. return expect !== actual
  5020. }
  5021. }
  5022. /**
  5023. * Runtime helper for checking keyCodes from config.
  5024. * exposed as Vue.prototype._k
  5025. * passing in eventKeyName as last argument separately for backwards compat
  5026. */
  5027. function checkKeyCodes (
  5028. eventKeyCode,
  5029. key,
  5030. builtInKeyCode,
  5031. eventKeyName,
  5032. builtInKeyName
  5033. ) {
  5034. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  5035. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  5036. return isKeyNotMatch(builtInKeyName, eventKeyName)
  5037. } else if (mappedKeyCode) {
  5038. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  5039. } else if (eventKeyName) {
  5040. return hyphenate(eventKeyName) !== key
  5041. }
  5042. }
  5043. /* */
  5044. /**
  5045. * Runtime helper for merging v-bind="object" into a VNode's data.
  5046. */
  5047. function bindObjectProps (
  5048. data,
  5049. tag,
  5050. value,
  5051. asProp,
  5052. isSync
  5053. ) {
  5054. if (value) {
  5055. if (!isObject(value)) {
  5056. true && warn(
  5057. 'v-bind without argument expects an Object or Array value',
  5058. this
  5059. );
  5060. } else {
  5061. if (Array.isArray(value)) {
  5062. value = toObject(value);
  5063. }
  5064. var hash;
  5065. var loop = function ( key ) {
  5066. if (
  5067. key === 'class' ||
  5068. key === 'style' ||
  5069. isReservedAttribute(key)
  5070. ) {
  5071. hash = data;
  5072. } else {
  5073. var type = data.attrs && data.attrs.type;
  5074. hash = asProp || config.mustUseProp(tag, type, key)
  5075. ? data.domProps || (data.domProps = {})
  5076. : data.attrs || (data.attrs = {});
  5077. }
  5078. var camelizedKey = camelize(key);
  5079. var hyphenatedKey = hyphenate(key);
  5080. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  5081. hash[key] = value[key];
  5082. if (isSync) {
  5083. var on = data.on || (data.on = {});
  5084. on[("update:" + key)] = function ($event) {
  5085. value[key] = $event;
  5086. };
  5087. }
  5088. }
  5089. };
  5090. for (var key in value) loop( key );
  5091. }
  5092. }
  5093. return data
  5094. }
  5095. /* */
  5096. /**
  5097. * Runtime helper for rendering static trees.
  5098. */
  5099. function renderStatic (
  5100. index,
  5101. isInFor
  5102. ) {
  5103. var cached = this._staticTrees || (this._staticTrees = []);
  5104. var tree = cached[index];
  5105. // if has already-rendered static tree and not inside v-for,
  5106. // we can reuse the same tree.
  5107. if (tree && !isInFor) {
  5108. return tree
  5109. }
  5110. // otherwise, render a fresh tree.
  5111. tree = cached[index] = this.$options.staticRenderFns[index].call(
  5112. this._renderProxy,
  5113. null,
  5114. this // for render fns generated for functional component templates
  5115. );
  5116. markStatic(tree, ("__static__" + index), false);
  5117. return tree
  5118. }
  5119. /**
  5120. * Runtime helper for v-once.
  5121. * Effectively it means marking the node as static with a unique key.
  5122. */
  5123. function markOnce (
  5124. tree,
  5125. index,
  5126. key
  5127. ) {
  5128. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  5129. return tree
  5130. }
  5131. function markStatic (
  5132. tree,
  5133. key,
  5134. isOnce
  5135. ) {
  5136. if (Array.isArray(tree)) {
  5137. for (var i = 0; i < tree.length; i++) {
  5138. if (tree[i] && typeof tree[i] !== 'string') {
  5139. markStaticNode(tree[i], (key + "_" + i), isOnce);
  5140. }
  5141. }
  5142. } else {
  5143. markStaticNode(tree, key, isOnce);
  5144. }
  5145. }
  5146. function markStaticNode (node, key, isOnce) {
  5147. node.isStatic = true;
  5148. node.key = key;
  5149. node.isOnce = isOnce;
  5150. }
  5151. /* */
  5152. function bindObjectListeners (data, value) {
  5153. if (value) {
  5154. if (!isPlainObject(value)) {
  5155. true && warn(
  5156. 'v-on without argument expects an Object value',
  5157. this
  5158. );
  5159. } else {
  5160. var on = data.on = data.on ? extend({}, data.on) : {};
  5161. for (var key in value) {
  5162. var existing = on[key];
  5163. var ours = value[key];
  5164. on[key] = existing ? [].concat(existing, ours) : ours;
  5165. }
  5166. }
  5167. }
  5168. return data
  5169. }
  5170. /* */
  5171. function resolveScopedSlots (
  5172. fns, // see flow/vnode
  5173. res,
  5174. // the following are added in 2.6
  5175. hasDynamicKeys,
  5176. contentHashKey
  5177. ) {
  5178. res = res || { $stable: !hasDynamicKeys };
  5179. for (var i = 0; i < fns.length; i++) {
  5180. var slot = fns[i];
  5181. if (Array.isArray(slot)) {
  5182. resolveScopedSlots(slot, res, hasDynamicKeys);
  5183. } else if (slot) {
  5184. // marker for reverse proxying v-slot without scope on this.$slots
  5185. if (slot.proxy) {
  5186. slot.fn.proxy = true;
  5187. }
  5188. res[slot.key] = slot.fn;
  5189. }
  5190. }
  5191. if (contentHashKey) {
  5192. (res).$key = contentHashKey;
  5193. }
  5194. return res
  5195. }
  5196. /* */
  5197. function bindDynamicKeys (baseObj, values) {
  5198. for (var i = 0; i < values.length; i += 2) {
  5199. var key = values[i];
  5200. if (typeof key === 'string' && key) {
  5201. baseObj[values[i]] = values[i + 1];
  5202. } else if ( true && key !== '' && key !== null) {
  5203. // null is a special value for explicitly removing a binding
  5204. warn(
  5205. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  5206. this
  5207. );
  5208. }
  5209. }
  5210. return baseObj
  5211. }
  5212. // helper to dynamically append modifier runtime markers to event names.
  5213. // ensure only append when value is already string, otherwise it will be cast
  5214. // to string and cause the type check to miss.
  5215. function prependModifier (value, symbol) {
  5216. return typeof value === 'string' ? symbol + value : value
  5217. }
  5218. /* */
  5219. function installRenderHelpers (target) {
  5220. target._o = markOnce;
  5221. target._n = toNumber;
  5222. target._s = toString;
  5223. target._l = renderList;
  5224. target._t = renderSlot;
  5225. target._q = looseEqual;
  5226. target._i = looseIndexOf;
  5227. target._m = renderStatic;
  5228. target._f = resolveFilter;
  5229. target._k = checkKeyCodes;
  5230. target._b = bindObjectProps;
  5231. target._v = createTextVNode;
  5232. target._e = createEmptyVNode;
  5233. target._u = resolveScopedSlots;
  5234. target._g = bindObjectListeners;
  5235. target._d = bindDynamicKeys;
  5236. target._p = prependModifier;
  5237. }
  5238. /* */
  5239. function FunctionalRenderContext (
  5240. data,
  5241. props,
  5242. children,
  5243. parent,
  5244. Ctor
  5245. ) {
  5246. var this$1 = this;
  5247. var options = Ctor.options;
  5248. // ensure the createElement function in functional components
  5249. // gets a unique context - this is necessary for correct named slot check
  5250. var contextVm;
  5251. if (hasOwn(parent, '_uid')) {
  5252. contextVm = Object.create(parent);
  5253. // $flow-disable-line
  5254. contextVm._original = parent;
  5255. } else {
  5256. // the context vm passed in is a functional context as well.
  5257. // in this case we want to make sure we are able to get a hold to the
  5258. // real context instance.
  5259. contextVm = parent;
  5260. // $flow-disable-line
  5261. parent = parent._original;
  5262. }
  5263. var isCompiled = isTrue(options._compiled);
  5264. var needNormalization = !isCompiled;
  5265. this.data = data;
  5266. this.props = props;
  5267. this.children = children;
  5268. this.parent = parent;
  5269. this.listeners = data.on || emptyObject;
  5270. this.injections = resolveInject(options.inject, parent);
  5271. this.slots = function () {
  5272. if (!this$1.$slots) {
  5273. normalizeScopedSlots(
  5274. data.scopedSlots,
  5275. this$1.$slots = resolveSlots(children, parent)
  5276. );
  5277. }
  5278. return this$1.$slots
  5279. };
  5280. Object.defineProperty(this, 'scopedSlots', ({
  5281. enumerable: true,
  5282. get: function get () {
  5283. return normalizeScopedSlots(data.scopedSlots, this.slots())
  5284. }
  5285. }));
  5286. // support for compiled functional template
  5287. if (isCompiled) {
  5288. // exposing $options for renderStatic()
  5289. this.$options = options;
  5290. // pre-resolve slots for renderSlot()
  5291. this.$slots = this.slots();
  5292. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  5293. }
  5294. if (options._scopeId) {
  5295. this._c = function (a, b, c, d) {
  5296. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  5297. if (vnode && !Array.isArray(vnode)) {
  5298. vnode.fnScopeId = options._scopeId;
  5299. vnode.fnContext = parent;
  5300. }
  5301. return vnode
  5302. };
  5303. } else {
  5304. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  5305. }
  5306. }
  5307. installRenderHelpers(FunctionalRenderContext.prototype);
  5308. function createFunctionalComponent (
  5309. Ctor,
  5310. propsData,
  5311. data,
  5312. contextVm,
  5313. children
  5314. ) {
  5315. var options = Ctor.options;
  5316. var props = {};
  5317. var propOptions = options.props;
  5318. if (isDef(propOptions)) {
  5319. for (var key in propOptions) {
  5320. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  5321. }
  5322. } else {
  5323. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  5324. if (isDef(data.props)) { mergeProps(props, data.props); }
  5325. }
  5326. var renderContext = new FunctionalRenderContext(
  5327. data,
  5328. props,
  5329. children,
  5330. contextVm,
  5331. Ctor
  5332. );
  5333. var vnode = options.render.call(null, renderContext._c, renderContext);
  5334. if (vnode instanceof VNode) {
  5335. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  5336. } else if (Array.isArray(vnode)) {
  5337. var vnodes = normalizeChildren(vnode) || [];
  5338. var res = new Array(vnodes.length);
  5339. for (var i = 0; i < vnodes.length; i++) {
  5340. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  5341. }
  5342. return res
  5343. }
  5344. }
  5345. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  5346. // #7817 clone node before setting fnContext, otherwise if the node is reused
  5347. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  5348. // that should not be matched to match.
  5349. var clone = cloneVNode(vnode);
  5350. clone.fnContext = contextVm;
  5351. clone.fnOptions = options;
  5352. if (true) {
  5353. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  5354. }
  5355. if (data.slot) {
  5356. (clone.data || (clone.data = {})).slot = data.slot;
  5357. }
  5358. return clone
  5359. }
  5360. function mergeProps (to, from) {
  5361. for (var key in from) {
  5362. to[camelize(key)] = from[key];
  5363. }
  5364. }
  5365. /* */
  5366. /* */
  5367. /* */
  5368. /* */
  5369. // inline hooks to be invoked on component VNodes during patch
  5370. var componentVNodeHooks = {
  5371. init: function init (vnode, hydrating) {
  5372. if (
  5373. vnode.componentInstance &&
  5374. !vnode.componentInstance._isDestroyed &&
  5375. vnode.data.keepAlive
  5376. ) {
  5377. // kept-alive components, treat as a patch
  5378. var mountedNode = vnode; // work around flow
  5379. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  5380. } else {
  5381. var child = vnode.componentInstance = createComponentInstanceForVnode(
  5382. vnode,
  5383. activeInstance
  5384. );
  5385. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  5386. }
  5387. },
  5388. prepatch: function prepatch (oldVnode, vnode) {
  5389. var options = vnode.componentOptions;
  5390. var child = vnode.componentInstance = oldVnode.componentInstance;
  5391. updateChildComponent(
  5392. child,
  5393. options.propsData, // updated props
  5394. options.listeners, // updated listeners
  5395. vnode, // new parent vnode
  5396. options.children // new children
  5397. );
  5398. },
  5399. insert: function insert (vnode) {
  5400. var context = vnode.context;
  5401. var componentInstance = vnode.componentInstance;
  5402. if (!componentInstance._isMounted) {
  5403. callHook(componentInstance, 'onServiceCreated');
  5404. callHook(componentInstance, 'onServiceAttached');
  5405. componentInstance._isMounted = true;
  5406. callHook(componentInstance, 'mounted');
  5407. }
  5408. if (vnode.data.keepAlive) {
  5409. if (context._isMounted) {
  5410. // vue-router#1212
  5411. // During updates, a kept-alive component's child components may
  5412. // change, so directly walking the tree here may call activated hooks
  5413. // on incorrect children. Instead we push them into a queue which will
  5414. // be processed after the whole patch process ended.
  5415. queueActivatedComponent(componentInstance);
  5416. } else {
  5417. activateChildComponent(componentInstance, true /* direct */);
  5418. }
  5419. }
  5420. },
  5421. destroy: function destroy (vnode) {
  5422. var componentInstance = vnode.componentInstance;
  5423. if (!componentInstance._isDestroyed) {
  5424. if (!vnode.data.keepAlive) {
  5425. componentInstance.$destroy();
  5426. } else {
  5427. deactivateChildComponent(componentInstance, true /* direct */);
  5428. }
  5429. }
  5430. }
  5431. };
  5432. var hooksToMerge = Object.keys(componentVNodeHooks);
  5433. function createComponent (
  5434. Ctor,
  5435. data,
  5436. context,
  5437. children,
  5438. tag
  5439. ) {
  5440. if (isUndef(Ctor)) {
  5441. return
  5442. }
  5443. var baseCtor = context.$options._base;
  5444. // plain options object: turn it into a constructor
  5445. if (isObject(Ctor)) {
  5446. Ctor = baseCtor.extend(Ctor);
  5447. }
  5448. // if at this stage it's not a constructor or an async component factory,
  5449. // reject.
  5450. if (typeof Ctor !== 'function') {
  5451. if (true) {
  5452. warn(("Invalid Component definition: " + (String(Ctor))), context);
  5453. }
  5454. return
  5455. }
  5456. // async component
  5457. var asyncFactory;
  5458. if (isUndef(Ctor.cid)) {
  5459. asyncFactory = Ctor;
  5460. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  5461. if (Ctor === undefined) {
  5462. // return a placeholder node for async component, which is rendered
  5463. // as a comment node but preserves all the raw information for the node.
  5464. // the information will be used for async server-rendering and hydration.
  5465. return createAsyncPlaceholder(
  5466. asyncFactory,
  5467. data,
  5468. context,
  5469. children,
  5470. tag
  5471. )
  5472. }
  5473. }
  5474. data = data || {};
  5475. // resolve constructor options in case global mixins are applied after
  5476. // component constructor creation
  5477. resolveConstructorOptions(Ctor);
  5478. // transform component v-model data into props & events
  5479. if (isDef(data.model)) {
  5480. transformModel(Ctor.options, data);
  5481. }
  5482. // extract props
  5483. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  5484. // functional component
  5485. if (isTrue(Ctor.options.functional)) {
  5486. return createFunctionalComponent(Ctor, propsData, data, context, children)
  5487. }
  5488. // extract listeners, since these needs to be treated as
  5489. // child component listeners instead of DOM listeners
  5490. var listeners = data.on;
  5491. // replace with listeners with .native modifier
  5492. // so it gets processed during parent component patch.
  5493. data.on = data.nativeOn;
  5494. if (isTrue(Ctor.options.abstract)) {
  5495. // abstract components do not keep anything
  5496. // other than props & listeners & slot
  5497. // work around flow
  5498. var slot = data.slot;
  5499. data = {};
  5500. if (slot) {
  5501. data.slot = slot;
  5502. }
  5503. }
  5504. // install component management hooks onto the placeholder node
  5505. installComponentHooks(data);
  5506. // return a placeholder vnode
  5507. var name = Ctor.options.name || tag;
  5508. var vnode = new VNode(
  5509. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  5510. data, undefined, undefined, undefined, context,
  5511. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  5512. asyncFactory
  5513. );
  5514. return vnode
  5515. }
  5516. function createComponentInstanceForVnode (
  5517. vnode, // we know it's MountedComponentVNode but flow doesn't
  5518. parent // activeInstance in lifecycle state
  5519. ) {
  5520. var options = {
  5521. _isComponent: true,
  5522. _parentVnode: vnode,
  5523. parent: parent
  5524. };
  5525. // check inline-template render functions
  5526. var inlineTemplate = vnode.data.inlineTemplate;
  5527. if (isDef(inlineTemplate)) {
  5528. options.render = inlineTemplate.render;
  5529. options.staticRenderFns = inlineTemplate.staticRenderFns;
  5530. }
  5531. return new vnode.componentOptions.Ctor(options)
  5532. }
  5533. function installComponentHooks (data) {
  5534. var hooks = data.hook || (data.hook = {});
  5535. for (var i = 0; i < hooksToMerge.length; i++) {
  5536. var key = hooksToMerge[i];
  5537. var existing = hooks[key];
  5538. var toMerge = componentVNodeHooks[key];
  5539. if (existing !== toMerge && !(existing && existing._merged)) {
  5540. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  5541. }
  5542. }
  5543. }
  5544. function mergeHook$1 (f1, f2) {
  5545. var merged = function (a, b) {
  5546. // flow complains about extra args which is why we use any
  5547. f1(a, b);
  5548. f2(a, b);
  5549. };
  5550. merged._merged = true;
  5551. return merged
  5552. }
  5553. // transform component v-model info (value and callback) into
  5554. // prop and event handler respectively.
  5555. function transformModel (options, data) {
  5556. var prop = (options.model && options.model.prop) || 'value';
  5557. var event = (options.model && options.model.event) || 'input'
  5558. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  5559. var on = data.on || (data.on = {});
  5560. var existing = on[event];
  5561. var callback = data.model.callback;
  5562. if (isDef(existing)) {
  5563. if (
  5564. Array.isArray(existing)
  5565. ? existing.indexOf(callback) === -1
  5566. : existing !== callback
  5567. ) {
  5568. on[event] = [callback].concat(existing);
  5569. }
  5570. } else {
  5571. on[event] = callback;
  5572. }
  5573. }
  5574. /* */
  5575. var SIMPLE_NORMALIZE = 1;
  5576. var ALWAYS_NORMALIZE = 2;
  5577. // wrapper function for providing a more flexible interface
  5578. // without getting yelled at by flow
  5579. function createElement (
  5580. context,
  5581. tag,
  5582. data,
  5583. children,
  5584. normalizationType,
  5585. alwaysNormalize
  5586. ) {
  5587. if (Array.isArray(data) || isPrimitive(data)) {
  5588. normalizationType = children;
  5589. children = data;
  5590. data = undefined;
  5591. }
  5592. if (isTrue(alwaysNormalize)) {
  5593. normalizationType = ALWAYS_NORMALIZE;
  5594. }
  5595. return _createElement(context, tag, data, children, normalizationType)
  5596. }
  5597. function _createElement (
  5598. context,
  5599. tag,
  5600. data,
  5601. children,
  5602. normalizationType
  5603. ) {
  5604. if (isDef(data) && isDef((data).__ob__)) {
  5605. true && warn(
  5606. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  5607. 'Always create fresh vnode data objects in each render!',
  5608. context
  5609. );
  5610. return createEmptyVNode()
  5611. }
  5612. // object syntax in v-bind
  5613. if (isDef(data) && isDef(data.is)) {
  5614. tag = data.is;
  5615. }
  5616. if (!tag) {
  5617. // in case of component :is set to falsy value
  5618. return createEmptyVNode()
  5619. }
  5620. // warn against non-primitive key
  5621. if ( true &&
  5622. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  5623. ) {
  5624. {
  5625. warn(
  5626. 'Avoid using non-primitive value as key, ' +
  5627. 'use string/number value instead.',
  5628. context
  5629. );
  5630. }
  5631. }
  5632. // support single function children as default scoped slot
  5633. if (Array.isArray(children) &&
  5634. typeof children[0] === 'function'
  5635. ) {
  5636. data = data || {};
  5637. data.scopedSlots = { default: children[0] };
  5638. children.length = 0;
  5639. }
  5640. if (normalizationType === ALWAYS_NORMALIZE) {
  5641. children = normalizeChildren(children);
  5642. } else if (normalizationType === SIMPLE_NORMALIZE) {
  5643. children = simpleNormalizeChildren(children);
  5644. }
  5645. var vnode, ns;
  5646. if (typeof tag === 'string') {
  5647. var Ctor;
  5648. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  5649. if (config.isReservedTag(tag)) {
  5650. // platform built-in elements
  5651. if ( true && isDef(data) && isDef(data.nativeOn)) {
  5652. warn(
  5653. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  5654. context
  5655. );
  5656. }
  5657. vnode = new VNode(
  5658. config.parsePlatformTagName(tag), data, children,
  5659. undefined, undefined, context
  5660. );
  5661. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  5662. // component
  5663. vnode = createComponent(Ctor, data, context, children, tag);
  5664. } else {
  5665. // unknown or unlisted namespaced elements
  5666. // check at runtime because it may get assigned a namespace when its
  5667. // parent normalizes children
  5668. vnode = new VNode(
  5669. tag, data, children,
  5670. undefined, undefined, context
  5671. );
  5672. }
  5673. } else {
  5674. // direct component options / constructor
  5675. vnode = createComponent(tag, data, context, children);
  5676. }
  5677. if (Array.isArray(vnode)) {
  5678. return vnode
  5679. } else if (isDef(vnode)) {
  5680. if (isDef(ns)) { applyNS(vnode, ns); }
  5681. if (isDef(data)) { registerDeepBindings(data); }
  5682. return vnode
  5683. } else {
  5684. return createEmptyVNode()
  5685. }
  5686. }
  5687. function applyNS (vnode, ns, force) {
  5688. vnode.ns = ns;
  5689. if (vnode.tag === 'foreignObject') {
  5690. // use default namespace inside foreignObject
  5691. ns = undefined;
  5692. force = true;
  5693. }
  5694. if (isDef(vnode.children)) {
  5695. for (var i = 0, l = vnode.children.length; i < l; i++) {
  5696. var child = vnode.children[i];
  5697. if (isDef(child.tag) && (
  5698. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  5699. applyNS(child, ns, force);
  5700. }
  5701. }
  5702. }
  5703. }
  5704. // ref #5318
  5705. // necessary to ensure parent re-render when deep bindings like :style and
  5706. // :class are used on slot nodes
  5707. function registerDeepBindings (data) {
  5708. if (isObject(data.style)) {
  5709. traverse(data.style);
  5710. }
  5711. if (isObject(data.class)) {
  5712. traverse(data.class);
  5713. }
  5714. }
  5715. /* */
  5716. function initRender (vm) {
  5717. vm._vnode = null; // the root of the child tree
  5718. vm._staticTrees = null; // v-once cached trees
  5719. var options = vm.$options;
  5720. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  5721. var renderContext = parentVnode && parentVnode.context;
  5722. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  5723. vm.$scopedSlots = emptyObject;
  5724. // bind the createElement fn to this instance
  5725. // so that we get proper render context inside it.
  5726. // args order: tag, data, children, normalizationType, alwaysNormalize
  5727. // internal version is used by render functions compiled from templates
  5728. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  5729. // normalization is always applied for the public version, used in
  5730. // user-written render functions.
  5731. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  5732. // $attrs & $listeners are exposed for easier HOC creation.
  5733. // they need to be reactive so that HOCs using them are always updated
  5734. var parentData = parentVnode && parentVnode.data;
  5735. /* istanbul ignore else */
  5736. if (true) {
  5737. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  5738. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  5739. }, true);
  5740. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  5741. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  5742. }, true);
  5743. } else {}
  5744. }
  5745. var currentRenderingInstance = null;
  5746. function renderMixin (Vue) {
  5747. // install runtime convenience helpers
  5748. installRenderHelpers(Vue.prototype);
  5749. Vue.prototype.$nextTick = function (fn) {
  5750. return nextTick(fn, this)
  5751. };
  5752. Vue.prototype._render = function () {
  5753. var vm = this;
  5754. var ref = vm.$options;
  5755. var render = ref.render;
  5756. var _parentVnode = ref._parentVnode;
  5757. if (_parentVnode) {
  5758. vm.$scopedSlots = normalizeScopedSlots(
  5759. _parentVnode.data.scopedSlots,
  5760. vm.$slots,
  5761. vm.$scopedSlots
  5762. );
  5763. }
  5764. // set parent vnode. this allows render functions to have access
  5765. // to the data on the placeholder node.
  5766. vm.$vnode = _parentVnode;
  5767. // render self
  5768. var vnode;
  5769. try {
  5770. // There's no need to maintain a stack because all render fns are called
  5771. // separately from one another. Nested component's render fns are called
  5772. // when parent component is patched.
  5773. currentRenderingInstance = vm;
  5774. vnode = render.call(vm._renderProxy, vm.$createElement);
  5775. } catch (e) {
  5776. handleError(e, vm, "render");
  5777. // return error render result,
  5778. // or previous vnode to prevent render error causing blank component
  5779. /* istanbul ignore else */
  5780. if ( true && vm.$options.renderError) {
  5781. try {
  5782. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  5783. } catch (e) {
  5784. handleError(e, vm, "renderError");
  5785. vnode = vm._vnode;
  5786. }
  5787. } else {
  5788. vnode = vm._vnode;
  5789. }
  5790. } finally {
  5791. currentRenderingInstance = null;
  5792. }
  5793. // if the returned array contains only a single node, allow it
  5794. if (Array.isArray(vnode) && vnode.length === 1) {
  5795. vnode = vnode[0];
  5796. }
  5797. // return empty vnode in case the render function errored out
  5798. if (!(vnode instanceof VNode)) {
  5799. if ( true && Array.isArray(vnode)) {
  5800. warn(
  5801. 'Multiple root nodes returned from render function. Render function ' +
  5802. 'should return a single root node.',
  5803. vm
  5804. );
  5805. }
  5806. vnode = createEmptyVNode();
  5807. }
  5808. // set parent
  5809. vnode.parent = _parentVnode;
  5810. return vnode
  5811. };
  5812. }
  5813. /* */
  5814. function ensureCtor (comp, base) {
  5815. if (
  5816. comp.__esModule ||
  5817. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  5818. ) {
  5819. comp = comp.default;
  5820. }
  5821. return isObject(comp)
  5822. ? base.extend(comp)
  5823. : comp
  5824. }
  5825. function createAsyncPlaceholder (
  5826. factory,
  5827. data,
  5828. context,
  5829. children,
  5830. tag
  5831. ) {
  5832. var node = createEmptyVNode();
  5833. node.asyncFactory = factory;
  5834. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  5835. return node
  5836. }
  5837. function resolveAsyncComponent (
  5838. factory,
  5839. baseCtor
  5840. ) {
  5841. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  5842. return factory.errorComp
  5843. }
  5844. if (isDef(factory.resolved)) {
  5845. return factory.resolved
  5846. }
  5847. var owner = currentRenderingInstance;
  5848. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  5849. // already pending
  5850. factory.owners.push(owner);
  5851. }
  5852. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  5853. return factory.loadingComp
  5854. }
  5855. if (owner && !isDef(factory.owners)) {
  5856. var owners = factory.owners = [owner];
  5857. var sync = true;
  5858. var timerLoading = null;
  5859. var timerTimeout = null
  5860. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  5861. var forceRender = function (renderCompleted) {
  5862. for (var i = 0, l = owners.length; i < l; i++) {
  5863. (owners[i]).$forceUpdate();
  5864. }
  5865. if (renderCompleted) {
  5866. owners.length = 0;
  5867. if (timerLoading !== null) {
  5868. clearTimeout(timerLoading);
  5869. timerLoading = null;
  5870. }
  5871. if (timerTimeout !== null) {
  5872. clearTimeout(timerTimeout);
  5873. timerTimeout = null;
  5874. }
  5875. }
  5876. };
  5877. var resolve = once(function (res) {
  5878. // cache resolved
  5879. factory.resolved = ensureCtor(res, baseCtor);
  5880. // invoke callbacks only if this is not a synchronous resolve
  5881. // (async resolves are shimmed as synchronous during SSR)
  5882. if (!sync) {
  5883. forceRender(true);
  5884. } else {
  5885. owners.length = 0;
  5886. }
  5887. });
  5888. var reject = once(function (reason) {
  5889. true && warn(
  5890. "Failed to resolve async component: " + (String(factory)) +
  5891. (reason ? ("\nReason: " + reason) : '')
  5892. );
  5893. if (isDef(factory.errorComp)) {
  5894. factory.error = true;
  5895. forceRender(true);
  5896. }
  5897. });
  5898. var res = factory(resolve, reject);
  5899. if (isObject(res)) {
  5900. if (isPromise(res)) {
  5901. // () => Promise
  5902. if (isUndef(factory.resolved)) {
  5903. res.then(resolve, reject);
  5904. }
  5905. } else if (isPromise(res.component)) {
  5906. res.component.then(resolve, reject);
  5907. if (isDef(res.error)) {
  5908. factory.errorComp = ensureCtor(res.error, baseCtor);
  5909. }
  5910. if (isDef(res.loading)) {
  5911. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  5912. if (res.delay === 0) {
  5913. factory.loading = true;
  5914. } else {
  5915. timerLoading = setTimeout(function () {
  5916. timerLoading = null;
  5917. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  5918. factory.loading = true;
  5919. forceRender(false);
  5920. }
  5921. }, res.delay || 200);
  5922. }
  5923. }
  5924. if (isDef(res.timeout)) {
  5925. timerTimeout = setTimeout(function () {
  5926. timerTimeout = null;
  5927. if (isUndef(factory.resolved)) {
  5928. reject(
  5929. true
  5930. ? ("timeout (" + (res.timeout) + "ms)")
  5931. : undefined
  5932. );
  5933. }
  5934. }, res.timeout);
  5935. }
  5936. }
  5937. }
  5938. sync = false;
  5939. // return in case resolved synchronously
  5940. return factory.loading
  5941. ? factory.loadingComp
  5942. : factory.resolved
  5943. }
  5944. }
  5945. /* */
  5946. function isAsyncPlaceholder (node) {
  5947. return node.isComment && node.asyncFactory
  5948. }
  5949. /* */
  5950. function getFirstComponentChild (children) {
  5951. if (Array.isArray(children)) {
  5952. for (var i = 0; i < children.length; i++) {
  5953. var c = children[i];
  5954. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  5955. return c
  5956. }
  5957. }
  5958. }
  5959. }
  5960. /* */
  5961. /* */
  5962. function initEvents (vm) {
  5963. vm._events = Object.create(null);
  5964. vm._hasHookEvent = false;
  5965. // init parent attached events
  5966. var listeners = vm.$options._parentListeners;
  5967. if (listeners) {
  5968. updateComponentListeners(vm, listeners);
  5969. }
  5970. }
  5971. var target;
  5972. function add (event, fn) {
  5973. target.$on(event, fn);
  5974. }
  5975. function remove$1 (event, fn) {
  5976. target.$off(event, fn);
  5977. }
  5978. function createOnceHandler (event, fn) {
  5979. var _target = target;
  5980. return function onceHandler () {
  5981. var res = fn.apply(null, arguments);
  5982. if (res !== null) {
  5983. _target.$off(event, onceHandler);
  5984. }
  5985. }
  5986. }
  5987. function updateComponentListeners (
  5988. vm,
  5989. listeners,
  5990. oldListeners
  5991. ) {
  5992. target = vm;
  5993. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  5994. target = undefined;
  5995. }
  5996. function eventsMixin (Vue) {
  5997. var hookRE = /^hook:/;
  5998. Vue.prototype.$on = function (event, fn) {
  5999. var vm = this;
  6000. if (Array.isArray(event)) {
  6001. for (var i = 0, l = event.length; i < l; i++) {
  6002. vm.$on(event[i], fn);
  6003. }
  6004. } else {
  6005. (vm._events[event] || (vm._events[event] = [])).push(fn);
  6006. // optimize hook:event cost by using a boolean flag marked at registration
  6007. // instead of a hash lookup
  6008. if (hookRE.test(event)) {
  6009. vm._hasHookEvent = true;
  6010. }
  6011. }
  6012. return vm
  6013. };
  6014. Vue.prototype.$once = function (event, fn) {
  6015. var vm = this;
  6016. function on () {
  6017. vm.$off(event, on);
  6018. fn.apply(vm, arguments);
  6019. }
  6020. on.fn = fn;
  6021. vm.$on(event, on);
  6022. return vm
  6023. };
  6024. Vue.prototype.$off = function (event, fn) {
  6025. var vm = this;
  6026. // all
  6027. if (!arguments.length) {
  6028. vm._events = Object.create(null);
  6029. return vm
  6030. }
  6031. // array of events
  6032. if (Array.isArray(event)) {
  6033. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  6034. vm.$off(event[i$1], fn);
  6035. }
  6036. return vm
  6037. }
  6038. // specific event
  6039. var cbs = vm._events[event];
  6040. if (!cbs) {
  6041. return vm
  6042. }
  6043. if (!fn) {
  6044. vm._events[event] = null;
  6045. return vm
  6046. }
  6047. // specific handler
  6048. var cb;
  6049. var i = cbs.length;
  6050. while (i--) {
  6051. cb = cbs[i];
  6052. if (cb === fn || cb.fn === fn) {
  6053. cbs.splice(i, 1);
  6054. break
  6055. }
  6056. }
  6057. return vm
  6058. };
  6059. Vue.prototype.$emit = function (event) {
  6060. var vm = this;
  6061. if (true) {
  6062. var lowerCaseEvent = event.toLowerCase();
  6063. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  6064. tip(
  6065. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  6066. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  6067. "Note that HTML attributes are case-insensitive and you cannot use " +
  6068. "v-on to listen to camelCase events when using in-DOM templates. " +
  6069. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  6070. );
  6071. }
  6072. }
  6073. var cbs = vm._events[event];
  6074. if (cbs) {
  6075. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  6076. var args = toArray(arguments, 1);
  6077. var info = "event handler for \"" + event + "\"";
  6078. for (var i = 0, l = cbs.length; i < l; i++) {
  6079. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  6080. }
  6081. }
  6082. return vm
  6083. };
  6084. }
  6085. /* */
  6086. var activeInstance = null;
  6087. var isUpdatingChildComponent = false;
  6088. function setActiveInstance(vm) {
  6089. var prevActiveInstance = activeInstance;
  6090. activeInstance = vm;
  6091. return function () {
  6092. activeInstance = prevActiveInstance;
  6093. }
  6094. }
  6095. function initLifecycle (vm) {
  6096. var options = vm.$options;
  6097. // locate first non-abstract parent
  6098. var parent = options.parent;
  6099. if (parent && !options.abstract) {
  6100. while (parent.$options.abstract && parent.$parent) {
  6101. parent = parent.$parent;
  6102. }
  6103. parent.$children.push(vm);
  6104. }
  6105. vm.$parent = parent;
  6106. vm.$root = parent ? parent.$root : vm;
  6107. vm.$children = [];
  6108. vm.$refs = {};
  6109. vm._watcher = null;
  6110. vm._inactive = null;
  6111. vm._directInactive = false;
  6112. vm._isMounted = false;
  6113. vm._isDestroyed = false;
  6114. vm._isBeingDestroyed = false;
  6115. }
  6116. function lifecycleMixin (Vue) {
  6117. Vue.prototype._update = function (vnode, hydrating) {
  6118. var vm = this;
  6119. var prevEl = vm.$el;
  6120. var prevVnode = vm._vnode;
  6121. var restoreActiveInstance = setActiveInstance(vm);
  6122. vm._vnode = vnode;
  6123. // Vue.prototype.__patch__ is injected in entry points
  6124. // based on the rendering backend used.
  6125. if (!prevVnode) {
  6126. // initial render
  6127. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  6128. } else {
  6129. // updates
  6130. vm.$el = vm.__patch__(prevVnode, vnode);
  6131. }
  6132. restoreActiveInstance();
  6133. // update __vue__ reference
  6134. if (prevEl) {
  6135. prevEl.__vue__ = null;
  6136. }
  6137. if (vm.$el) {
  6138. vm.$el.__vue__ = vm;
  6139. }
  6140. // if parent is an HOC, update its $el as well
  6141. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  6142. vm.$parent.$el = vm.$el;
  6143. }
  6144. // updated hook is called by the scheduler to ensure that children are
  6145. // updated in a parent's updated hook.
  6146. };
  6147. Vue.prototype.$forceUpdate = function () {
  6148. var vm = this;
  6149. if (vm._watcher) {
  6150. vm._watcher.update();
  6151. }
  6152. };
  6153. Vue.prototype.$destroy = function () {
  6154. var vm = this;
  6155. if (vm._isBeingDestroyed) {
  6156. return
  6157. }
  6158. callHook(vm, 'beforeDestroy');
  6159. vm._isBeingDestroyed = true;
  6160. // remove self from parent
  6161. var parent = vm.$parent;
  6162. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  6163. remove(parent.$children, vm);
  6164. }
  6165. // teardown watchers
  6166. if (vm._watcher) {
  6167. vm._watcher.teardown();
  6168. }
  6169. var i = vm._watchers.length;
  6170. while (i--) {
  6171. vm._watchers[i].teardown();
  6172. }
  6173. // remove reference from data ob
  6174. // frozen object may not have observer.
  6175. if (vm._data.__ob__) {
  6176. vm._data.__ob__.vmCount--;
  6177. }
  6178. // call the last hook...
  6179. vm._isDestroyed = true;
  6180. // invoke destroy hooks on current rendered tree
  6181. vm.__patch__(vm._vnode, null);
  6182. // fire destroyed hook
  6183. callHook(vm, 'destroyed');
  6184. // turn off all instance listeners.
  6185. vm.$off();
  6186. // remove __vue__ reference
  6187. if (vm.$el) {
  6188. vm.$el.__vue__ = null;
  6189. }
  6190. // release circular reference (#6759)
  6191. if (vm.$vnode) {
  6192. vm.$vnode.parent = null;
  6193. }
  6194. };
  6195. }
  6196. function updateChildComponent (
  6197. vm,
  6198. propsData,
  6199. listeners,
  6200. parentVnode,
  6201. renderChildren
  6202. ) {
  6203. if (true) {
  6204. isUpdatingChildComponent = true;
  6205. }
  6206. // determine whether component has slot children
  6207. // we need to do this before overwriting $options._renderChildren.
  6208. // check if there are dynamic scopedSlots (hand-written or compiled but with
  6209. // dynamic slot names). Static scoped slots compiled from template has the
  6210. // "$stable" marker.
  6211. var newScopedSlots = parentVnode.data.scopedSlots;
  6212. var oldScopedSlots = vm.$scopedSlots;
  6213. var hasDynamicScopedSlot = !!(
  6214. (newScopedSlots && !newScopedSlots.$stable) ||
  6215. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  6216. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  6217. );
  6218. // Any static slot children from the parent may have changed during parent's
  6219. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  6220. // update is necessary to ensure correctness.
  6221. var needsForceUpdate = !!(
  6222. renderChildren || // has new static slots
  6223. vm.$options._renderChildren || // has old static slots
  6224. hasDynamicScopedSlot
  6225. );
  6226. vm.$options._parentVnode = parentVnode;
  6227. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  6228. if (vm._vnode) { // update child tree's parent
  6229. vm._vnode.parent = parentVnode;
  6230. }
  6231. vm.$options._renderChildren = renderChildren;
  6232. // update $attrs and $listeners hash
  6233. // these are also reactive so they may trigger child update if the child
  6234. // used them during render
  6235. vm.$attrs = parentVnode.data.attrs || emptyObject;
  6236. vm.$listeners = listeners || emptyObject;
  6237. // update props
  6238. if (propsData && vm.$options.props) {
  6239. toggleObserving(false);
  6240. var props = vm._props;
  6241. var propKeys = vm.$options._propKeys || [];
  6242. for (var i = 0; i < propKeys.length; i++) {
  6243. var key = propKeys[i];
  6244. var propOptions = vm.$options.props; // wtf flow?
  6245. props[key] = validateProp(key, propOptions, propsData, vm);
  6246. }
  6247. toggleObserving(true);
  6248. // keep a copy of raw propsData
  6249. vm.$options.propsData = propsData;
  6250. }
  6251. // fixed by xxxxxx update properties(mp runtime)
  6252. vm._$updateProperties && vm._$updateProperties(vm);
  6253. // update listeners
  6254. listeners = listeners || emptyObject;
  6255. var oldListeners = vm.$options._parentListeners;
  6256. vm.$options._parentListeners = listeners;
  6257. updateComponentListeners(vm, listeners, oldListeners);
  6258. // resolve slots + force update if has children
  6259. if (needsForceUpdate) {
  6260. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  6261. vm.$forceUpdate();
  6262. }
  6263. if (true) {
  6264. isUpdatingChildComponent = false;
  6265. }
  6266. }
  6267. function isInInactiveTree (vm) {
  6268. while (vm && (vm = vm.$parent)) {
  6269. if (vm._inactive) { return true }
  6270. }
  6271. return false
  6272. }
  6273. function activateChildComponent (vm, direct) {
  6274. if (direct) {
  6275. vm._directInactive = false;
  6276. if (isInInactiveTree(vm)) {
  6277. return
  6278. }
  6279. } else if (vm._directInactive) {
  6280. return
  6281. }
  6282. if (vm._inactive || vm._inactive === null) {
  6283. vm._inactive = false;
  6284. for (var i = 0; i < vm.$children.length; i++) {
  6285. activateChildComponent(vm.$children[i]);
  6286. }
  6287. callHook(vm, 'activated');
  6288. }
  6289. }
  6290. function deactivateChildComponent (vm, direct) {
  6291. if (direct) {
  6292. vm._directInactive = true;
  6293. if (isInInactiveTree(vm)) {
  6294. return
  6295. }
  6296. }
  6297. if (!vm._inactive) {
  6298. vm._inactive = true;
  6299. for (var i = 0; i < vm.$children.length; i++) {
  6300. deactivateChildComponent(vm.$children[i]);
  6301. }
  6302. callHook(vm, 'deactivated');
  6303. }
  6304. }
  6305. function callHook (vm, hook) {
  6306. // #7573 disable dep collection when invoking lifecycle hooks
  6307. pushTarget();
  6308. var handlers = vm.$options[hook];
  6309. var info = hook + " hook";
  6310. if (handlers) {
  6311. for (var i = 0, j = handlers.length; i < j; i++) {
  6312. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  6313. }
  6314. }
  6315. if (vm._hasHookEvent) {
  6316. vm.$emit('hook:' + hook);
  6317. }
  6318. popTarget();
  6319. }
  6320. /* */
  6321. var MAX_UPDATE_COUNT = 100;
  6322. var queue = [];
  6323. var activatedChildren = [];
  6324. var has = {};
  6325. var circular = {};
  6326. var waiting = false;
  6327. var flushing = false;
  6328. var index = 0;
  6329. /**
  6330. * Reset the scheduler's state.
  6331. */
  6332. function resetSchedulerState () {
  6333. index = queue.length = activatedChildren.length = 0;
  6334. has = {};
  6335. if (true) {
  6336. circular = {};
  6337. }
  6338. waiting = flushing = false;
  6339. }
  6340. // Async edge case #6566 requires saving the timestamp when event listeners are
  6341. // attached. However, calling performance.now() has a perf overhead especially
  6342. // if the page has thousands of event listeners. Instead, we take a timestamp
  6343. // every time the scheduler flushes and use that for all event listeners
  6344. // attached during that flush.
  6345. var currentFlushTimestamp = 0;
  6346. // Async edge case fix requires storing an event listener's attach timestamp.
  6347. var getNow = Date.now;
  6348. // Determine what event timestamp the browser is using. Annoyingly, the
  6349. // timestamp can either be hi-res (relative to page load) or low-res
  6350. // (relative to UNIX epoch), so in order to compare time we have to use the
  6351. // same timestamp type when saving the flush timestamp.
  6352. // All IE versions use low-res event timestamps, and have problematic clock
  6353. // implementations (#9632)
  6354. if (inBrowser && !isIE) {
  6355. var performance = window.performance;
  6356. if (
  6357. performance &&
  6358. typeof performance.now === 'function' &&
  6359. getNow() > document.createEvent('Event').timeStamp
  6360. ) {
  6361. // if the event timestamp, although evaluated AFTER the Date.now(), is
  6362. // smaller than it, it means the event is using a hi-res timestamp,
  6363. // and we need to use the hi-res version for event listener timestamps as
  6364. // well.
  6365. getNow = function () { return performance.now(); };
  6366. }
  6367. }
  6368. /**
  6369. * Flush both queues and run the watchers.
  6370. */
  6371. function flushSchedulerQueue () {
  6372. currentFlushTimestamp = getNow();
  6373. flushing = true;
  6374. var watcher, id;
  6375. // Sort queue before flush.
  6376. // This ensures that:
  6377. // 1. Components are updated from parent to child. (because parent is always
  6378. // created before the child)
  6379. // 2. A component's user watchers are run before its render watcher (because
  6380. // user watchers are created before the render watcher)
  6381. // 3. If a component is destroyed during a parent component's watcher run,
  6382. // its watchers can be skipped.
  6383. queue.sort(function (a, b) { return a.id - b.id; });
  6384. // do not cache length because more watchers might be pushed
  6385. // as we run existing watchers
  6386. for (index = 0; index < queue.length; index++) {
  6387. watcher = queue[index];
  6388. if (watcher.before) {
  6389. watcher.before();
  6390. }
  6391. id = watcher.id;
  6392. has[id] = null;
  6393. watcher.run();
  6394. // in dev build, check and stop circular updates.
  6395. if ( true && has[id] != null) {
  6396. circular[id] = (circular[id] || 0) + 1;
  6397. if (circular[id] > MAX_UPDATE_COUNT) {
  6398. warn(
  6399. 'You may have an infinite update loop ' + (
  6400. watcher.user
  6401. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  6402. : "in a component render function."
  6403. ),
  6404. watcher.vm
  6405. );
  6406. break
  6407. }
  6408. }
  6409. }
  6410. // keep copies of post queues before resetting state
  6411. var activatedQueue = activatedChildren.slice();
  6412. var updatedQueue = queue.slice();
  6413. resetSchedulerState();
  6414. // call component updated and activated hooks
  6415. callActivatedHooks(activatedQueue);
  6416. callUpdatedHooks(updatedQueue);
  6417. // devtool hook
  6418. /* istanbul ignore if */
  6419. if (devtools && config.devtools) {
  6420. devtools.emit('flush');
  6421. }
  6422. }
  6423. function callUpdatedHooks (queue) {
  6424. var i = queue.length;
  6425. while (i--) {
  6426. var watcher = queue[i];
  6427. var vm = watcher.vm;
  6428. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  6429. callHook(vm, 'updated');
  6430. }
  6431. }
  6432. }
  6433. /**
  6434. * Queue a kept-alive component that was activated during patch.
  6435. * The queue will be processed after the entire tree has been patched.
  6436. */
  6437. function queueActivatedComponent (vm) {
  6438. // setting _inactive to false here so that a render function can
  6439. // rely on checking whether it's in an inactive tree (e.g. router-view)
  6440. vm._inactive = false;
  6441. activatedChildren.push(vm);
  6442. }
  6443. function callActivatedHooks (queue) {
  6444. for (var i = 0; i < queue.length; i++) {
  6445. queue[i]._inactive = true;
  6446. activateChildComponent(queue[i], true /* true */);
  6447. }
  6448. }
  6449. /**
  6450. * Push a watcher into the watcher queue.
  6451. * Jobs with duplicate IDs will be skipped unless it's
  6452. * pushed when the queue is being flushed.
  6453. */
  6454. function queueWatcher (watcher) {
  6455. var id = watcher.id;
  6456. if (has[id] == null) {
  6457. has[id] = true;
  6458. if (!flushing) {
  6459. queue.push(watcher);
  6460. } else {
  6461. // if already flushing, splice the watcher based on its id
  6462. // if already past its id, it will be run next immediately.
  6463. var i = queue.length - 1;
  6464. while (i > index && queue[i].id > watcher.id) {
  6465. i--;
  6466. }
  6467. queue.splice(i + 1, 0, watcher);
  6468. }
  6469. // queue the flush
  6470. if (!waiting) {
  6471. waiting = true;
  6472. if ( true && !config.async) {
  6473. flushSchedulerQueue();
  6474. return
  6475. }
  6476. nextTick(flushSchedulerQueue);
  6477. }
  6478. }
  6479. }
  6480. /* */
  6481. var uid$2 = 0;
  6482. /**
  6483. * A watcher parses an expression, collects dependencies,
  6484. * and fires callback when the expression value changes.
  6485. * This is used for both the $watch() api and directives.
  6486. */
  6487. var Watcher = function Watcher (
  6488. vm,
  6489. expOrFn,
  6490. cb,
  6491. options,
  6492. isRenderWatcher
  6493. ) {
  6494. this.vm = vm;
  6495. if (isRenderWatcher) {
  6496. vm._watcher = this;
  6497. }
  6498. vm._watchers.push(this);
  6499. // options
  6500. if (options) {
  6501. this.deep = !!options.deep;
  6502. this.user = !!options.user;
  6503. this.lazy = !!options.lazy;
  6504. this.sync = !!options.sync;
  6505. this.before = options.before;
  6506. } else {
  6507. this.deep = this.user = this.lazy = this.sync = false;
  6508. }
  6509. this.cb = cb;
  6510. this.id = ++uid$2; // uid for batching
  6511. this.active = true;
  6512. this.dirty = this.lazy; // for lazy watchers
  6513. this.deps = [];
  6514. this.newDeps = [];
  6515. this.depIds = new _Set();
  6516. this.newDepIds = new _Set();
  6517. this.expression = true
  6518. ? expOrFn.toString()
  6519. : undefined;
  6520. // parse expression for getter
  6521. if (typeof expOrFn === 'function') {
  6522. this.getter = expOrFn;
  6523. } else {
  6524. this.getter = parsePath(expOrFn);
  6525. if (!this.getter) {
  6526. this.getter = noop;
  6527. true && warn(
  6528. "Failed watching path: \"" + expOrFn + "\" " +
  6529. 'Watcher only accepts simple dot-delimited paths. ' +
  6530. 'For full control, use a function instead.',
  6531. vm
  6532. );
  6533. }
  6534. }
  6535. this.value = this.lazy
  6536. ? undefined
  6537. : this.get();
  6538. };
  6539. /**
  6540. * Evaluate the getter, and re-collect dependencies.
  6541. */
  6542. Watcher.prototype.get = function get () {
  6543. pushTarget(this);
  6544. var value;
  6545. var vm = this.vm;
  6546. try {
  6547. value = this.getter.call(vm, vm);
  6548. } catch (e) {
  6549. if (this.user) {
  6550. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  6551. } else {
  6552. throw e
  6553. }
  6554. } finally {
  6555. // "touch" every property so they are all tracked as
  6556. // dependencies for deep watching
  6557. if (this.deep) {
  6558. traverse(value);
  6559. }
  6560. popTarget();
  6561. this.cleanupDeps();
  6562. }
  6563. return value
  6564. };
  6565. /**
  6566. * Add a dependency to this directive.
  6567. */
  6568. Watcher.prototype.addDep = function addDep (dep) {
  6569. var id = dep.id;
  6570. if (!this.newDepIds.has(id)) {
  6571. this.newDepIds.add(id);
  6572. this.newDeps.push(dep);
  6573. if (!this.depIds.has(id)) {
  6574. dep.addSub(this);
  6575. }
  6576. }
  6577. };
  6578. /**
  6579. * Clean up for dependency collection.
  6580. */
  6581. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  6582. var i = this.deps.length;
  6583. while (i--) {
  6584. var dep = this.deps[i];
  6585. if (!this.newDepIds.has(dep.id)) {
  6586. dep.removeSub(this);
  6587. }
  6588. }
  6589. var tmp = this.depIds;
  6590. this.depIds = this.newDepIds;
  6591. this.newDepIds = tmp;
  6592. this.newDepIds.clear();
  6593. tmp = this.deps;
  6594. this.deps = this.newDeps;
  6595. this.newDeps = tmp;
  6596. this.newDeps.length = 0;
  6597. };
  6598. /**
  6599. * Subscriber interface.
  6600. * Will be called when a dependency changes.
  6601. */
  6602. Watcher.prototype.update = function update () {
  6603. /* istanbul ignore else */
  6604. if (this.lazy) {
  6605. this.dirty = true;
  6606. } else if (this.sync) {
  6607. this.run();
  6608. } else {
  6609. queueWatcher(this);
  6610. }
  6611. };
  6612. /**
  6613. * Scheduler job interface.
  6614. * Will be called by the scheduler.
  6615. */
  6616. Watcher.prototype.run = function run () {
  6617. if (this.active) {
  6618. var value = this.get();
  6619. if (
  6620. value !== this.value ||
  6621. // Deep watchers and watchers on Object/Arrays should fire even
  6622. // when the value is the same, because the value may
  6623. // have mutated.
  6624. isObject(value) ||
  6625. this.deep
  6626. ) {
  6627. // set new value
  6628. var oldValue = this.value;
  6629. this.value = value;
  6630. if (this.user) {
  6631. try {
  6632. this.cb.call(this.vm, value, oldValue);
  6633. } catch (e) {
  6634. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  6635. }
  6636. } else {
  6637. this.cb.call(this.vm, value, oldValue);
  6638. }
  6639. }
  6640. }
  6641. };
  6642. /**
  6643. * Evaluate the value of the watcher.
  6644. * This only gets called for lazy watchers.
  6645. */
  6646. Watcher.prototype.evaluate = function evaluate () {
  6647. this.value = this.get();
  6648. this.dirty = false;
  6649. };
  6650. /**
  6651. * Depend on all deps collected by this watcher.
  6652. */
  6653. Watcher.prototype.depend = function depend () {
  6654. var i = this.deps.length;
  6655. while (i--) {
  6656. this.deps[i].depend();
  6657. }
  6658. };
  6659. /**
  6660. * Remove self from all dependencies' subscriber list.
  6661. */
  6662. Watcher.prototype.teardown = function teardown () {
  6663. if (this.active) {
  6664. // remove self from vm's watcher list
  6665. // this is a somewhat expensive operation so we skip it
  6666. // if the vm is being destroyed.
  6667. if (!this.vm._isBeingDestroyed) {
  6668. remove(this.vm._watchers, this);
  6669. }
  6670. var i = this.deps.length;
  6671. while (i--) {
  6672. this.deps[i].removeSub(this);
  6673. }
  6674. this.active = false;
  6675. }
  6676. };
  6677. /* */
  6678. var sharedPropertyDefinition = {
  6679. enumerable: true,
  6680. configurable: true,
  6681. get: noop,
  6682. set: noop
  6683. };
  6684. function proxy (target, sourceKey, key) {
  6685. sharedPropertyDefinition.get = function proxyGetter () {
  6686. return this[sourceKey][key]
  6687. };
  6688. sharedPropertyDefinition.set = function proxySetter (val) {
  6689. this[sourceKey][key] = val;
  6690. };
  6691. Object.defineProperty(target, key, sharedPropertyDefinition);
  6692. }
  6693. function initState (vm) {
  6694. vm._watchers = [];
  6695. var opts = vm.$options;
  6696. if (opts.props) { initProps(vm, opts.props); }
  6697. if (opts.methods) { initMethods(vm, opts.methods); }
  6698. if (opts.data) {
  6699. initData(vm);
  6700. } else {
  6701. observe(vm._data = {}, true /* asRootData */);
  6702. }
  6703. if (opts.computed) { initComputed(vm, opts.computed); }
  6704. if (opts.watch && opts.watch !== nativeWatch) {
  6705. initWatch(vm, opts.watch);
  6706. }
  6707. }
  6708. function initProps (vm, propsOptions) {
  6709. var propsData = vm.$options.propsData || {};
  6710. var props = vm._props = {};
  6711. // cache prop keys so that future props updates can iterate using Array
  6712. // instead of dynamic object key enumeration.
  6713. var keys = vm.$options._propKeys = [];
  6714. var isRoot = !vm.$parent;
  6715. // root instance props should be converted
  6716. if (!isRoot) {
  6717. toggleObserving(false);
  6718. }
  6719. var loop = function ( key ) {
  6720. keys.push(key);
  6721. var value = validateProp(key, propsOptions, propsData, vm);
  6722. /* istanbul ignore else */
  6723. if (true) {
  6724. var hyphenatedKey = hyphenate(key);
  6725. if (isReservedAttribute(hyphenatedKey) ||
  6726. config.isReservedAttr(hyphenatedKey)) {
  6727. warn(
  6728. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  6729. vm
  6730. );
  6731. }
  6732. defineReactive$$1(props, key, value, function () {
  6733. if (!isRoot && !isUpdatingChildComponent) {
  6734. {
  6735. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  6736. return
  6737. }
  6738. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  6739. if(
  6740. key === 'value' &&
  6741. Array.isArray(vm.$options.behaviors) &&
  6742. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  6743. ){
  6744. return
  6745. }
  6746. if(vm._getFormData){
  6747. return
  6748. }
  6749. var $parent = vm.$parent;
  6750. while($parent){
  6751. if($parent.__next_tick_pending){
  6752. return
  6753. }
  6754. $parent = $parent.$parent;
  6755. }
  6756. }
  6757. warn(
  6758. "Avoid mutating a prop directly since the value will be " +
  6759. "overwritten whenever the parent component re-renders. " +
  6760. "Instead, use a data or computed property based on the prop's " +
  6761. "value. Prop being mutated: \"" + key + "\"",
  6762. vm
  6763. );
  6764. }
  6765. });
  6766. } else {}
  6767. // static props are already proxied on the component's prototype
  6768. // during Vue.extend(). We only need to proxy props defined at
  6769. // instantiation here.
  6770. if (!(key in vm)) {
  6771. proxy(vm, "_props", key);
  6772. }
  6773. };
  6774. for (var key in propsOptions) loop( key );
  6775. toggleObserving(true);
  6776. }
  6777. function initData (vm) {
  6778. var data = vm.$options.data;
  6779. data = vm._data = typeof data === 'function'
  6780. ? getData(data, vm)
  6781. : data || {};
  6782. if (!isPlainObject(data)) {
  6783. data = {};
  6784. true && warn(
  6785. 'data functions should return an object:\n' +
  6786. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  6787. vm
  6788. );
  6789. }
  6790. // proxy data on instance
  6791. var keys = Object.keys(data);
  6792. var props = vm.$options.props;
  6793. var methods = vm.$options.methods;
  6794. var i = keys.length;
  6795. while (i--) {
  6796. var key = keys[i];
  6797. if (true) {
  6798. if (methods && hasOwn(methods, key)) {
  6799. warn(
  6800. ("Method \"" + key + "\" has already been defined as a data property."),
  6801. vm
  6802. );
  6803. }
  6804. }
  6805. if (props && hasOwn(props, key)) {
  6806. true && warn(
  6807. "The data property \"" + key + "\" is already declared as a prop. " +
  6808. "Use prop default value instead.",
  6809. vm
  6810. );
  6811. } else if (!isReserved(key)) {
  6812. proxy(vm, "_data", key);
  6813. }
  6814. }
  6815. // observe data
  6816. observe(data, true /* asRootData */);
  6817. }
  6818. function getData (data, vm) {
  6819. // #7573 disable dep collection when invoking data getters
  6820. pushTarget();
  6821. try {
  6822. return data.call(vm, vm)
  6823. } catch (e) {
  6824. handleError(e, vm, "data()");
  6825. return {}
  6826. } finally {
  6827. popTarget();
  6828. }
  6829. }
  6830. var computedWatcherOptions = { lazy: true };
  6831. function initComputed (vm, computed) {
  6832. // $flow-disable-line
  6833. var watchers = vm._computedWatchers = Object.create(null);
  6834. // computed properties are just getters during SSR
  6835. var isSSR = isServerRendering();
  6836. for (var key in computed) {
  6837. var userDef = computed[key];
  6838. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  6839. if ( true && getter == null) {
  6840. warn(
  6841. ("Getter is missing for computed property \"" + key + "\"."),
  6842. vm
  6843. );
  6844. }
  6845. if (!isSSR) {
  6846. // create internal watcher for the computed property.
  6847. watchers[key] = new Watcher(
  6848. vm,
  6849. getter || noop,
  6850. noop,
  6851. computedWatcherOptions
  6852. );
  6853. }
  6854. // component-defined computed properties are already defined on the
  6855. // component prototype. We only need to define computed properties defined
  6856. // at instantiation here.
  6857. if (!(key in vm)) {
  6858. defineComputed(vm, key, userDef);
  6859. } else if (true) {
  6860. if (key in vm.$data) {
  6861. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  6862. } else if (vm.$options.props && key in vm.$options.props) {
  6863. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  6864. }
  6865. }
  6866. }
  6867. }
  6868. function defineComputed (
  6869. target,
  6870. key,
  6871. userDef
  6872. ) {
  6873. var shouldCache = !isServerRendering();
  6874. if (typeof userDef === 'function') {
  6875. sharedPropertyDefinition.get = shouldCache
  6876. ? createComputedGetter(key)
  6877. : createGetterInvoker(userDef);
  6878. sharedPropertyDefinition.set = noop;
  6879. } else {
  6880. sharedPropertyDefinition.get = userDef.get
  6881. ? shouldCache && userDef.cache !== false
  6882. ? createComputedGetter(key)
  6883. : createGetterInvoker(userDef.get)
  6884. : noop;
  6885. sharedPropertyDefinition.set = userDef.set || noop;
  6886. }
  6887. if ( true &&
  6888. sharedPropertyDefinition.set === noop) {
  6889. sharedPropertyDefinition.set = function () {
  6890. warn(
  6891. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  6892. this
  6893. );
  6894. };
  6895. }
  6896. Object.defineProperty(target, key, sharedPropertyDefinition);
  6897. }
  6898. function createComputedGetter (key) {
  6899. return function computedGetter () {
  6900. var watcher = this._computedWatchers && this._computedWatchers[key];
  6901. if (watcher) {
  6902. if (watcher.dirty) {
  6903. watcher.evaluate();
  6904. }
  6905. if (Dep.SharedObject.target) {// fixed by xxxxxx
  6906. watcher.depend();
  6907. }
  6908. return watcher.value
  6909. }
  6910. }
  6911. }
  6912. function createGetterInvoker(fn) {
  6913. return function computedGetter () {
  6914. return fn.call(this, this)
  6915. }
  6916. }
  6917. function initMethods (vm, methods) {
  6918. var props = vm.$options.props;
  6919. for (var key in methods) {
  6920. if (true) {
  6921. if (typeof methods[key] !== 'function') {
  6922. warn(
  6923. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  6924. "Did you reference the function correctly?",
  6925. vm
  6926. );
  6927. }
  6928. if (props && hasOwn(props, key)) {
  6929. warn(
  6930. ("Method \"" + key + "\" has already been defined as a prop."),
  6931. vm
  6932. );
  6933. }
  6934. if ((key in vm) && isReserved(key)) {
  6935. warn(
  6936. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  6937. "Avoid defining component methods that start with _ or $."
  6938. );
  6939. }
  6940. }
  6941. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  6942. }
  6943. }
  6944. function initWatch (vm, watch) {
  6945. for (var key in watch) {
  6946. var handler = watch[key];
  6947. if (Array.isArray(handler)) {
  6948. for (var i = 0; i < handler.length; i++) {
  6949. createWatcher(vm, key, handler[i]);
  6950. }
  6951. } else {
  6952. createWatcher(vm, key, handler);
  6953. }
  6954. }
  6955. }
  6956. function createWatcher (
  6957. vm,
  6958. expOrFn,
  6959. handler,
  6960. options
  6961. ) {
  6962. if (isPlainObject(handler)) {
  6963. options = handler;
  6964. handler = handler.handler;
  6965. }
  6966. if (typeof handler === 'string') {
  6967. handler = vm[handler];
  6968. }
  6969. return vm.$watch(expOrFn, handler, options)
  6970. }
  6971. function stateMixin (Vue) {
  6972. // flow somehow has problems with directly declared definition object
  6973. // when using Object.defineProperty, so we have to procedurally build up
  6974. // the object here.
  6975. var dataDef = {};
  6976. dataDef.get = function () { return this._data };
  6977. var propsDef = {};
  6978. propsDef.get = function () { return this._props };
  6979. if (true) {
  6980. dataDef.set = function () {
  6981. warn(
  6982. 'Avoid replacing instance root $data. ' +
  6983. 'Use nested data properties instead.',
  6984. this
  6985. );
  6986. };
  6987. propsDef.set = function () {
  6988. warn("$props is readonly.", this);
  6989. };
  6990. }
  6991. Object.defineProperty(Vue.prototype, '$data', dataDef);
  6992. Object.defineProperty(Vue.prototype, '$props', propsDef);
  6993. Vue.prototype.$set = set;
  6994. Vue.prototype.$delete = del;
  6995. Vue.prototype.$watch = function (
  6996. expOrFn,
  6997. cb,
  6998. options
  6999. ) {
  7000. var vm = this;
  7001. if (isPlainObject(cb)) {
  7002. return createWatcher(vm, expOrFn, cb, options)
  7003. }
  7004. options = options || {};
  7005. options.user = true;
  7006. var watcher = new Watcher(vm, expOrFn, cb, options);
  7007. if (options.immediate) {
  7008. try {
  7009. cb.call(vm, watcher.value);
  7010. } catch (error) {
  7011. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  7012. }
  7013. }
  7014. return function unwatchFn () {
  7015. watcher.teardown();
  7016. }
  7017. };
  7018. }
  7019. /* */
  7020. var uid$3 = 0;
  7021. function initMixin (Vue) {
  7022. Vue.prototype._init = function (options) {
  7023. var vm = this;
  7024. // a uid
  7025. vm._uid = uid$3++;
  7026. var startTag, endTag;
  7027. /* istanbul ignore if */
  7028. if ( true && config.performance && mark) {
  7029. startTag = "vue-perf-start:" + (vm._uid);
  7030. endTag = "vue-perf-end:" + (vm._uid);
  7031. mark(startTag);
  7032. }
  7033. // a flag to avoid this being observed
  7034. vm._isVue = true;
  7035. // merge options
  7036. if (options && options._isComponent) {
  7037. // optimize internal component instantiation
  7038. // since dynamic options merging is pretty slow, and none of the
  7039. // internal component options needs special treatment.
  7040. initInternalComponent(vm, options);
  7041. } else {
  7042. vm.$options = mergeOptions(
  7043. resolveConstructorOptions(vm.constructor),
  7044. options || {},
  7045. vm
  7046. );
  7047. }
  7048. /* istanbul ignore else */
  7049. if (true) {
  7050. initProxy(vm);
  7051. } else {}
  7052. // expose real self
  7053. vm._self = vm;
  7054. initLifecycle(vm);
  7055. initEvents(vm);
  7056. initRender(vm);
  7057. callHook(vm, 'beforeCreate');
  7058. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  7059. initState(vm);
  7060. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  7061. !vm._$fallback && callHook(vm, 'created');
  7062. /* istanbul ignore if */
  7063. if ( true && config.performance && mark) {
  7064. vm._name = formatComponentName(vm, false);
  7065. mark(endTag);
  7066. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  7067. }
  7068. if (vm.$options.el) {
  7069. vm.$mount(vm.$options.el);
  7070. }
  7071. };
  7072. }
  7073. function initInternalComponent (vm, options) {
  7074. var opts = vm.$options = Object.create(vm.constructor.options);
  7075. // doing this because it's faster than dynamic enumeration.
  7076. var parentVnode = options._parentVnode;
  7077. opts.parent = options.parent;
  7078. opts._parentVnode = parentVnode;
  7079. var vnodeComponentOptions = parentVnode.componentOptions;
  7080. opts.propsData = vnodeComponentOptions.propsData;
  7081. opts._parentListeners = vnodeComponentOptions.listeners;
  7082. opts._renderChildren = vnodeComponentOptions.children;
  7083. opts._componentTag = vnodeComponentOptions.tag;
  7084. if (options.render) {
  7085. opts.render = options.render;
  7086. opts.staticRenderFns = options.staticRenderFns;
  7087. }
  7088. }
  7089. function resolveConstructorOptions (Ctor) {
  7090. var options = Ctor.options;
  7091. if (Ctor.super) {
  7092. var superOptions = resolveConstructorOptions(Ctor.super);
  7093. var cachedSuperOptions = Ctor.superOptions;
  7094. if (superOptions !== cachedSuperOptions) {
  7095. // super option changed,
  7096. // need to resolve new options.
  7097. Ctor.superOptions = superOptions;
  7098. // check if there are any late-modified/attached options (#4976)
  7099. var modifiedOptions = resolveModifiedOptions(Ctor);
  7100. // update base extend options
  7101. if (modifiedOptions) {
  7102. extend(Ctor.extendOptions, modifiedOptions);
  7103. }
  7104. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  7105. if (options.name) {
  7106. options.components[options.name] = Ctor;
  7107. }
  7108. }
  7109. }
  7110. return options
  7111. }
  7112. function resolveModifiedOptions (Ctor) {
  7113. var modified;
  7114. var latest = Ctor.options;
  7115. var sealed = Ctor.sealedOptions;
  7116. for (var key in latest) {
  7117. if (latest[key] !== sealed[key]) {
  7118. if (!modified) { modified = {}; }
  7119. modified[key] = latest[key];
  7120. }
  7121. }
  7122. return modified
  7123. }
  7124. function Vue (options) {
  7125. if ( true &&
  7126. !(this instanceof Vue)
  7127. ) {
  7128. warn('Vue is a constructor and should be called with the `new` keyword');
  7129. }
  7130. this._init(options);
  7131. }
  7132. initMixin(Vue);
  7133. stateMixin(Vue);
  7134. eventsMixin(Vue);
  7135. lifecycleMixin(Vue);
  7136. renderMixin(Vue);
  7137. /* */
  7138. function initUse (Vue) {
  7139. Vue.use = function (plugin) {
  7140. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  7141. if (installedPlugins.indexOf(plugin) > -1) {
  7142. return this
  7143. }
  7144. // additional parameters
  7145. var args = toArray(arguments, 1);
  7146. args.unshift(this);
  7147. if (typeof plugin.install === 'function') {
  7148. plugin.install.apply(plugin, args);
  7149. } else if (typeof plugin === 'function') {
  7150. plugin.apply(null, args);
  7151. }
  7152. installedPlugins.push(plugin);
  7153. return this
  7154. };
  7155. }
  7156. /* */
  7157. function initMixin$1 (Vue) {
  7158. Vue.mixin = function (mixin) {
  7159. this.options = mergeOptions(this.options, mixin);
  7160. return this
  7161. };
  7162. }
  7163. /* */
  7164. function initExtend (Vue) {
  7165. /**
  7166. * Each instance constructor, including Vue, has a unique
  7167. * cid. This enables us to create wrapped "child
  7168. * constructors" for prototypal inheritance and cache them.
  7169. */
  7170. Vue.cid = 0;
  7171. var cid = 1;
  7172. /**
  7173. * Class inheritance
  7174. */
  7175. Vue.extend = function (extendOptions) {
  7176. extendOptions = extendOptions || {};
  7177. var Super = this;
  7178. var SuperId = Super.cid;
  7179. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  7180. if (cachedCtors[SuperId]) {
  7181. return cachedCtors[SuperId]
  7182. }
  7183. var name = extendOptions.name || Super.options.name;
  7184. if ( true && name) {
  7185. validateComponentName(name);
  7186. }
  7187. var Sub = function VueComponent (options) {
  7188. this._init(options);
  7189. };
  7190. Sub.prototype = Object.create(Super.prototype);
  7191. Sub.prototype.constructor = Sub;
  7192. Sub.cid = cid++;
  7193. Sub.options = mergeOptions(
  7194. Super.options,
  7195. extendOptions
  7196. );
  7197. Sub['super'] = Super;
  7198. // For props and computed properties, we define the proxy getters on
  7199. // the Vue instances at extension time, on the extended prototype. This
  7200. // avoids Object.defineProperty calls for each instance created.
  7201. if (Sub.options.props) {
  7202. initProps$1(Sub);
  7203. }
  7204. if (Sub.options.computed) {
  7205. initComputed$1(Sub);
  7206. }
  7207. // allow further extension/mixin/plugin usage
  7208. Sub.extend = Super.extend;
  7209. Sub.mixin = Super.mixin;
  7210. Sub.use = Super.use;
  7211. // create asset registers, so extended classes
  7212. // can have their private assets too.
  7213. ASSET_TYPES.forEach(function (type) {
  7214. Sub[type] = Super[type];
  7215. });
  7216. // enable recursive self-lookup
  7217. if (name) {
  7218. Sub.options.components[name] = Sub;
  7219. }
  7220. // keep a reference to the super options at extension time.
  7221. // later at instantiation we can check if Super's options have
  7222. // been updated.
  7223. Sub.superOptions = Super.options;
  7224. Sub.extendOptions = extendOptions;
  7225. Sub.sealedOptions = extend({}, Sub.options);
  7226. // cache constructor
  7227. cachedCtors[SuperId] = Sub;
  7228. return Sub
  7229. };
  7230. }
  7231. function initProps$1 (Comp) {
  7232. var props = Comp.options.props;
  7233. for (var key in props) {
  7234. proxy(Comp.prototype, "_props", key);
  7235. }
  7236. }
  7237. function initComputed$1 (Comp) {
  7238. var computed = Comp.options.computed;
  7239. for (var key in computed) {
  7240. defineComputed(Comp.prototype, key, computed[key]);
  7241. }
  7242. }
  7243. /* */
  7244. function initAssetRegisters (Vue) {
  7245. /**
  7246. * Create asset registration methods.
  7247. */
  7248. ASSET_TYPES.forEach(function (type) {
  7249. Vue[type] = function (
  7250. id,
  7251. definition
  7252. ) {
  7253. if (!definition) {
  7254. return this.options[type + 's'][id]
  7255. } else {
  7256. /* istanbul ignore if */
  7257. if ( true && type === 'component') {
  7258. validateComponentName(id);
  7259. }
  7260. if (type === 'component' && isPlainObject(definition)) {
  7261. definition.name = definition.name || id;
  7262. definition = this.options._base.extend(definition);
  7263. }
  7264. if (type === 'directive' && typeof definition === 'function') {
  7265. definition = { bind: definition, update: definition };
  7266. }
  7267. this.options[type + 's'][id] = definition;
  7268. return definition
  7269. }
  7270. };
  7271. });
  7272. }
  7273. /* */
  7274. function getComponentName (opts) {
  7275. return opts && (opts.Ctor.options.name || opts.tag)
  7276. }
  7277. function matches (pattern, name) {
  7278. if (Array.isArray(pattern)) {
  7279. return pattern.indexOf(name) > -1
  7280. } else if (typeof pattern === 'string') {
  7281. return pattern.split(',').indexOf(name) > -1
  7282. } else if (isRegExp(pattern)) {
  7283. return pattern.test(name)
  7284. }
  7285. /* istanbul ignore next */
  7286. return false
  7287. }
  7288. function pruneCache (keepAliveInstance, filter) {
  7289. var cache = keepAliveInstance.cache;
  7290. var keys = keepAliveInstance.keys;
  7291. var _vnode = keepAliveInstance._vnode;
  7292. for (var key in cache) {
  7293. var cachedNode = cache[key];
  7294. if (cachedNode) {
  7295. var name = getComponentName(cachedNode.componentOptions);
  7296. if (name && !filter(name)) {
  7297. pruneCacheEntry(cache, key, keys, _vnode);
  7298. }
  7299. }
  7300. }
  7301. }
  7302. function pruneCacheEntry (
  7303. cache,
  7304. key,
  7305. keys,
  7306. current
  7307. ) {
  7308. var cached$$1 = cache[key];
  7309. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  7310. cached$$1.componentInstance.$destroy();
  7311. }
  7312. cache[key] = null;
  7313. remove(keys, key);
  7314. }
  7315. var patternTypes = [String, RegExp, Array];
  7316. var KeepAlive = {
  7317. name: 'keep-alive',
  7318. abstract: true,
  7319. props: {
  7320. include: patternTypes,
  7321. exclude: patternTypes,
  7322. max: [String, Number]
  7323. },
  7324. created: function created () {
  7325. this.cache = Object.create(null);
  7326. this.keys = [];
  7327. },
  7328. destroyed: function destroyed () {
  7329. for (var key in this.cache) {
  7330. pruneCacheEntry(this.cache, key, this.keys);
  7331. }
  7332. },
  7333. mounted: function mounted () {
  7334. var this$1 = this;
  7335. this.$watch('include', function (val) {
  7336. pruneCache(this$1, function (name) { return matches(val, name); });
  7337. });
  7338. this.$watch('exclude', function (val) {
  7339. pruneCache(this$1, function (name) { return !matches(val, name); });
  7340. });
  7341. },
  7342. render: function render () {
  7343. var slot = this.$slots.default;
  7344. var vnode = getFirstComponentChild(slot);
  7345. var componentOptions = vnode && vnode.componentOptions;
  7346. if (componentOptions) {
  7347. // check pattern
  7348. var name = getComponentName(componentOptions);
  7349. var ref = this;
  7350. var include = ref.include;
  7351. var exclude = ref.exclude;
  7352. if (
  7353. // not included
  7354. (include && (!name || !matches(include, name))) ||
  7355. // excluded
  7356. (exclude && name && matches(exclude, name))
  7357. ) {
  7358. return vnode
  7359. }
  7360. var ref$1 = this;
  7361. var cache = ref$1.cache;
  7362. var keys = ref$1.keys;
  7363. var key = vnode.key == null
  7364. // same constructor may get registered as different local components
  7365. // so cid alone is not enough (#3269)
  7366. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  7367. : vnode.key;
  7368. if (cache[key]) {
  7369. vnode.componentInstance = cache[key].componentInstance;
  7370. // make current key freshest
  7371. remove(keys, key);
  7372. keys.push(key);
  7373. } else {
  7374. cache[key] = vnode;
  7375. keys.push(key);
  7376. // prune oldest entry
  7377. if (this.max && keys.length > parseInt(this.max)) {
  7378. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  7379. }
  7380. }
  7381. vnode.data.keepAlive = true;
  7382. }
  7383. return vnode || (slot && slot[0])
  7384. }
  7385. };
  7386. var builtInComponents = {
  7387. KeepAlive: KeepAlive
  7388. };
  7389. /* */
  7390. function initGlobalAPI (Vue) {
  7391. // config
  7392. var configDef = {};
  7393. configDef.get = function () { return config; };
  7394. if (true) {
  7395. configDef.set = function () {
  7396. warn(
  7397. 'Do not replace the Vue.config object, set individual fields instead.'
  7398. );
  7399. };
  7400. }
  7401. Object.defineProperty(Vue, 'config', configDef);
  7402. // exposed util methods.
  7403. // NOTE: these are not considered part of the public API - avoid relying on
  7404. // them unless you are aware of the risk.
  7405. Vue.util = {
  7406. warn: warn,
  7407. extend: extend,
  7408. mergeOptions: mergeOptions,
  7409. defineReactive: defineReactive$$1
  7410. };
  7411. Vue.set = set;
  7412. Vue.delete = del;
  7413. Vue.nextTick = nextTick;
  7414. // 2.6 explicit observable API
  7415. Vue.observable = function (obj) {
  7416. observe(obj);
  7417. return obj
  7418. };
  7419. Vue.options = Object.create(null);
  7420. ASSET_TYPES.forEach(function (type) {
  7421. Vue.options[type + 's'] = Object.create(null);
  7422. });
  7423. // this is used to identify the "base" constructor to extend all plain-object
  7424. // components with in Weex's multi-instance scenarios.
  7425. Vue.options._base = Vue;
  7426. extend(Vue.options.components, builtInComponents);
  7427. initUse(Vue);
  7428. initMixin$1(Vue);
  7429. initExtend(Vue);
  7430. initAssetRegisters(Vue);
  7431. }
  7432. initGlobalAPI(Vue);
  7433. Object.defineProperty(Vue.prototype, '$isServer', {
  7434. get: isServerRendering
  7435. });
  7436. Object.defineProperty(Vue.prototype, '$ssrContext', {
  7437. get: function get () {
  7438. /* istanbul ignore next */
  7439. return this.$vnode && this.$vnode.ssrContext
  7440. }
  7441. });
  7442. // expose FunctionalRenderContext for ssr runtime helper installation
  7443. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  7444. value: FunctionalRenderContext
  7445. });
  7446. Vue.version = '2.6.11';
  7447. /**
  7448. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  7449. */
  7450. var ARRAYTYPE = '[object Array]';
  7451. var OBJECTTYPE = '[object Object]';
  7452. // const FUNCTIONTYPE = '[object Function]'
  7453. function diff(current, pre) {
  7454. var result = {};
  7455. syncKeys(current, pre);
  7456. _diff(current, pre, '', result);
  7457. return result
  7458. }
  7459. function syncKeys(current, pre) {
  7460. if (current === pre) { return }
  7461. var rootCurrentType = type(current);
  7462. var rootPreType = type(pre);
  7463. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  7464. if(Object.keys(current).length >= Object.keys(pre).length){
  7465. for (var key in pre) {
  7466. var currentValue = current[key];
  7467. if (currentValue === undefined) {
  7468. current[key] = null;
  7469. } else {
  7470. syncKeys(currentValue, pre[key]);
  7471. }
  7472. }
  7473. }
  7474. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  7475. if (current.length >= pre.length) {
  7476. pre.forEach(function (item, index) {
  7477. syncKeys(current[index], item);
  7478. });
  7479. }
  7480. }
  7481. }
  7482. function _diff(current, pre, path, result) {
  7483. if (current === pre) { return }
  7484. var rootCurrentType = type(current);
  7485. var rootPreType = type(pre);
  7486. if (rootCurrentType == OBJECTTYPE) {
  7487. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  7488. setResult(result, path, current);
  7489. } else {
  7490. var loop = function ( key ) {
  7491. var currentValue = current[key];
  7492. var preValue = pre[key];
  7493. var currentType = type(currentValue);
  7494. var preType = type(preValue);
  7495. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  7496. if (currentValue !== pre[key]) {
  7497. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7498. }
  7499. } else if (currentType == ARRAYTYPE) {
  7500. if (preType != ARRAYTYPE) {
  7501. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7502. } else {
  7503. if (currentValue.length < preValue.length) {
  7504. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7505. } else {
  7506. currentValue.forEach(function (item, index) {
  7507. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  7508. });
  7509. }
  7510. }
  7511. } else if (currentType == OBJECTTYPE) {
  7512. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  7513. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7514. } else {
  7515. for (var subKey in currentValue) {
  7516. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  7517. }
  7518. }
  7519. }
  7520. };
  7521. for (var key in current) loop( key );
  7522. }
  7523. } else if (rootCurrentType == ARRAYTYPE) {
  7524. if (rootPreType != ARRAYTYPE) {
  7525. setResult(result, path, current);
  7526. } else {
  7527. if (current.length < pre.length) {
  7528. setResult(result, path, current);
  7529. } else {
  7530. current.forEach(function (item, index) {
  7531. _diff(item, pre[index], path + '[' + index + ']', result);
  7532. });
  7533. }
  7534. }
  7535. } else {
  7536. setResult(result, path, current);
  7537. }
  7538. }
  7539. function setResult(result, k, v) {
  7540. // if (type(v) != FUNCTIONTYPE) {
  7541. result[k] = v;
  7542. // }
  7543. }
  7544. function type(obj) {
  7545. return Object.prototype.toString.call(obj)
  7546. }
  7547. /* */
  7548. function flushCallbacks$1(vm) {
  7549. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  7550. if (Object({"VUE_APP_NAME":"mdapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  7551. var mpInstance = vm.$scope;
  7552. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  7553. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  7554. }
  7555. var copies = vm.__next_tick_callbacks.slice(0);
  7556. vm.__next_tick_callbacks.length = 0;
  7557. for (var i = 0; i < copies.length; i++) {
  7558. copies[i]();
  7559. }
  7560. }
  7561. }
  7562. function hasRenderWatcher(vm) {
  7563. return queue.find(function (watcher) { return vm._watcher === watcher; })
  7564. }
  7565. function nextTick$1(vm, cb) {
  7566. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  7567. //2.nextTick 之前存在 render watcher
  7568. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  7569. if(Object({"VUE_APP_NAME":"mdapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  7570. var mpInstance = vm.$scope;
  7571. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  7572. ']:nextVueTick');
  7573. }
  7574. return nextTick(cb, vm)
  7575. }else{
  7576. if(Object({"VUE_APP_NAME":"mdapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  7577. var mpInstance$1 = vm.$scope;
  7578. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  7579. ']:nextMPTick');
  7580. }
  7581. }
  7582. var _resolve;
  7583. if (!vm.__next_tick_callbacks) {
  7584. vm.__next_tick_callbacks = [];
  7585. }
  7586. vm.__next_tick_callbacks.push(function () {
  7587. if (cb) {
  7588. try {
  7589. cb.call(vm);
  7590. } catch (e) {
  7591. handleError(e, vm, 'nextTick');
  7592. }
  7593. } else if (_resolve) {
  7594. _resolve(vm);
  7595. }
  7596. });
  7597. // $flow-disable-line
  7598. if (!cb && typeof Promise !== 'undefined') {
  7599. return new Promise(function (resolve) {
  7600. _resolve = resolve;
  7601. })
  7602. }
  7603. }
  7604. /* */
  7605. function cloneWithData(vm) {
  7606. // 确保当前 vm 所有数据被同步
  7607. var ret = Object.create(null);
  7608. var dataKeys = [].concat(
  7609. Object.keys(vm._data || {}),
  7610. Object.keys(vm._computedWatchers || {}));
  7611. dataKeys.reduce(function(ret, key) {
  7612. ret[key] = vm[key];
  7613. return ret
  7614. }, ret);
  7615. // vue-composition-api
  7616. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  7617. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  7618. if (rawBindings) {
  7619. Object.keys(rawBindings).forEach(function (key) {
  7620. ret[key] = vm[key];
  7621. });
  7622. }
  7623. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  7624. Object.assign(ret, vm.$mp.data || {});
  7625. if (
  7626. Array.isArray(vm.$options.behaviors) &&
  7627. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7628. ) { //form-field
  7629. ret['name'] = vm.name;
  7630. ret['value'] = vm.value;
  7631. }
  7632. return JSON.parse(JSON.stringify(ret))
  7633. }
  7634. var patch = function(oldVnode, vnode) {
  7635. var this$1 = this;
  7636. if (vnode === null) { //destroy
  7637. return
  7638. }
  7639. if (this.mpType === 'page' || this.mpType === 'component') {
  7640. var mpInstance = this.$scope;
  7641. var data = Object.create(null);
  7642. try {
  7643. data = cloneWithData(this);
  7644. } catch (err) {
  7645. console.error(err);
  7646. }
  7647. data.__webviewId__ = mpInstance.data.__webviewId__;
  7648. var mpData = Object.create(null);
  7649. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  7650. mpData[key] = mpInstance.data[key];
  7651. });
  7652. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  7653. if (Object.keys(diffData).length) {
  7654. if (Object({"VUE_APP_NAME":"mdapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  7655. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  7656. ']差量更新',
  7657. JSON.stringify(diffData));
  7658. }
  7659. this.__next_tick_pending = true;
  7660. mpInstance.setData(diffData, function () {
  7661. this$1.__next_tick_pending = false;
  7662. flushCallbacks$1(this$1);
  7663. });
  7664. } else {
  7665. flushCallbacks$1(this);
  7666. }
  7667. }
  7668. };
  7669. /* */
  7670. function createEmptyRender() {
  7671. }
  7672. function mountComponent$1(
  7673. vm,
  7674. el,
  7675. hydrating
  7676. ) {
  7677. if (!vm.mpType) {//main.js 中的 new Vue
  7678. return vm
  7679. }
  7680. if (vm.mpType === 'app') {
  7681. vm.$options.render = createEmptyRender;
  7682. }
  7683. if (!vm.$options.render) {
  7684. vm.$options.render = createEmptyRender;
  7685. if (true) {
  7686. /* istanbul ignore if */
  7687. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  7688. vm.$options.el || el) {
  7689. warn(
  7690. 'You are using the runtime-only build of Vue where the template ' +
  7691. 'compiler is not available. Either pre-compile the templates into ' +
  7692. 'render functions, or use the compiler-included build.',
  7693. vm
  7694. );
  7695. } else {
  7696. warn(
  7697. 'Failed to mount component: template or render function not defined.',
  7698. vm
  7699. );
  7700. }
  7701. }
  7702. }
  7703. !vm._$fallback && callHook(vm, 'beforeMount');
  7704. var updateComponent = function () {
  7705. vm._update(vm._render(), hydrating);
  7706. };
  7707. // we set this to vm._watcher inside the watcher's constructor
  7708. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  7709. // component's mounted hook), which relies on vm._watcher being already defined
  7710. new Watcher(vm, updateComponent, noop, {
  7711. before: function before() {
  7712. if (vm._isMounted && !vm._isDestroyed) {
  7713. callHook(vm, 'beforeUpdate');
  7714. }
  7715. }
  7716. }, true /* isRenderWatcher */);
  7717. hydrating = false;
  7718. return vm
  7719. }
  7720. /* */
  7721. function renderClass (
  7722. staticClass,
  7723. dynamicClass
  7724. ) {
  7725. if (isDef(staticClass) || isDef(dynamicClass)) {
  7726. return concat(staticClass, stringifyClass(dynamicClass))
  7727. }
  7728. /* istanbul ignore next */
  7729. return ''
  7730. }
  7731. function concat (a, b) {
  7732. return a ? b ? (a + ' ' + b) : a : (b || '')
  7733. }
  7734. function stringifyClass (value) {
  7735. if (Array.isArray(value)) {
  7736. return stringifyArray(value)
  7737. }
  7738. if (isObject(value)) {
  7739. return stringifyObject(value)
  7740. }
  7741. if (typeof value === 'string') {
  7742. return value
  7743. }
  7744. /* istanbul ignore next */
  7745. return ''
  7746. }
  7747. function stringifyArray (value) {
  7748. var res = '';
  7749. var stringified;
  7750. for (var i = 0, l = value.length; i < l; i++) {
  7751. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  7752. if (res) { res += ' '; }
  7753. res += stringified;
  7754. }
  7755. }
  7756. return res
  7757. }
  7758. function stringifyObject (value) {
  7759. var res = '';
  7760. for (var key in value) {
  7761. if (value[key]) {
  7762. if (res) { res += ' '; }
  7763. res += key;
  7764. }
  7765. }
  7766. return res
  7767. }
  7768. /* */
  7769. var parseStyleText = cached(function (cssText) {
  7770. var res = {};
  7771. var listDelimiter = /;(?![^(]*\))/g;
  7772. var propertyDelimiter = /:(.+)/;
  7773. cssText.split(listDelimiter).forEach(function (item) {
  7774. if (item) {
  7775. var tmp = item.split(propertyDelimiter);
  7776. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  7777. }
  7778. });
  7779. return res
  7780. });
  7781. // normalize possible array / string values into Object
  7782. function normalizeStyleBinding (bindingStyle) {
  7783. if (Array.isArray(bindingStyle)) {
  7784. return toObject(bindingStyle)
  7785. }
  7786. if (typeof bindingStyle === 'string') {
  7787. return parseStyleText(bindingStyle)
  7788. }
  7789. return bindingStyle
  7790. }
  7791. /* */
  7792. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  7793. function getTarget(obj, path) {
  7794. var parts = path.split('.');
  7795. var key = parts[0];
  7796. if (key.indexOf('__$n') === 0) { //number index
  7797. key = parseInt(key.replace('__$n', ''));
  7798. }
  7799. if (parts.length === 1) {
  7800. return obj[key]
  7801. }
  7802. return getTarget(obj[key], parts.slice(1).join('.'))
  7803. }
  7804. function internalMixin(Vue) {
  7805. Vue.config.errorHandler = function(err, vm, info) {
  7806. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  7807. console.error(err);
  7808. /* eslint-disable no-undef */
  7809. var app = typeof getApp === 'function' && getApp();
  7810. if (app && app.onError) {
  7811. app.onError(err);
  7812. }
  7813. };
  7814. var oldEmit = Vue.prototype.$emit;
  7815. Vue.prototype.$emit = function(event) {
  7816. if (this.$scope && event) {
  7817. (this.$scope['_triggerEvent'] || this.$scope['triggerEvent']).call(this.$scope, event, {
  7818. __args__: toArray(arguments, 1)
  7819. });
  7820. }
  7821. return oldEmit.apply(this, arguments)
  7822. };
  7823. Vue.prototype.$nextTick = function(fn) {
  7824. return nextTick$1(this, fn)
  7825. };
  7826. MP_METHODS.forEach(function (method) {
  7827. Vue.prototype[method] = function(args) {
  7828. if (this.$scope && this.$scope[method]) {
  7829. return this.$scope[method](args)
  7830. }
  7831. // mp-alipay
  7832. if (typeof my === 'undefined') {
  7833. return
  7834. }
  7835. if (method === 'createSelectorQuery') {
  7836. /* eslint-disable no-undef */
  7837. return my.createSelectorQuery(args)
  7838. } else if (method === 'createIntersectionObserver') {
  7839. /* eslint-disable no-undef */
  7840. return my.createIntersectionObserver(args)
  7841. }
  7842. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  7843. };
  7844. });
  7845. Vue.prototype.__init_provide = initProvide;
  7846. Vue.prototype.__init_injections = initInjections;
  7847. Vue.prototype.__call_hook = function(hook, args) {
  7848. var vm = this;
  7849. // #7573 disable dep collection when invoking lifecycle hooks
  7850. pushTarget();
  7851. var handlers = vm.$options[hook];
  7852. var info = hook + " hook";
  7853. var ret;
  7854. if (handlers) {
  7855. for (var i = 0, j = handlers.length; i < j; i++) {
  7856. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  7857. }
  7858. }
  7859. if (vm._hasHookEvent) {
  7860. vm.$emit('hook:' + hook, args);
  7861. }
  7862. popTarget();
  7863. return ret
  7864. };
  7865. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  7866. if (Array.isArray(modifiers)) {
  7867. if (modifiers.indexOf('trim') !== -1) {
  7868. value = value.trim();
  7869. }
  7870. if (modifiers.indexOf('number') !== -1) {
  7871. value = this._n(value);
  7872. }
  7873. }
  7874. if (!target) {
  7875. target = this;
  7876. }
  7877. // 解决动态属性添加
  7878. Vue.set(target, key, value);
  7879. };
  7880. Vue.prototype.__set_sync = function(target, key, value) {
  7881. if (!target) {
  7882. target = this;
  7883. }
  7884. // 解决动态属性添加
  7885. Vue.set(target, key, value);
  7886. };
  7887. Vue.prototype.__get_orig = function(item) {
  7888. if (isPlainObject(item)) {
  7889. return item['$orig'] || item
  7890. }
  7891. return item
  7892. };
  7893. Vue.prototype.__get_value = function(dataPath, target) {
  7894. return getTarget(target || this, dataPath)
  7895. };
  7896. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  7897. return renderClass(staticClass, dynamicClass)
  7898. };
  7899. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  7900. if (!dynamicStyle && !staticStyle) {
  7901. return ''
  7902. }
  7903. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  7904. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  7905. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  7906. };
  7907. Vue.prototype.__map = function(val, iteratee) {
  7908. //TODO 暂不考虑 string
  7909. var ret, i, l, keys, key;
  7910. if (Array.isArray(val)) {
  7911. ret = new Array(val.length);
  7912. for (i = 0, l = val.length; i < l; i++) {
  7913. ret[i] = iteratee(val[i], i);
  7914. }
  7915. return ret
  7916. } else if (isObject(val)) {
  7917. keys = Object.keys(val);
  7918. ret = Object.create(null);
  7919. for (i = 0, l = keys.length; i < l; i++) {
  7920. key = keys[i];
  7921. ret[key] = iteratee(val[key], key, i);
  7922. }
  7923. return ret
  7924. } else if (typeof val === 'number') {
  7925. ret = new Array(val);
  7926. for (i = 0, l = val; i < l; i++) {
  7927. // 第一个参数暂时仍和小程序一致
  7928. ret[i] = iteratee(i, i);
  7929. }
  7930. return ret
  7931. }
  7932. return []
  7933. };
  7934. }
  7935. /* */
  7936. var LIFECYCLE_HOOKS$1 = [
  7937. //App
  7938. 'onLaunch',
  7939. 'onShow',
  7940. 'onHide',
  7941. 'onUniNViewMessage',
  7942. 'onPageNotFound',
  7943. 'onThemeChange',
  7944. 'onError',
  7945. 'onUnhandledRejection',
  7946. //Page
  7947. 'onInit',
  7948. 'onLoad',
  7949. // 'onShow',
  7950. 'onReady',
  7951. // 'onHide',
  7952. 'onUnload',
  7953. 'onPullDownRefresh',
  7954. 'onReachBottom',
  7955. 'onTabItemTap',
  7956. 'onAddToFavorites',
  7957. 'onShareTimeline',
  7958. 'onShareAppMessage',
  7959. 'onResize',
  7960. 'onPageScroll',
  7961. 'onNavigationBarButtonTap',
  7962. 'onBackPress',
  7963. 'onNavigationBarSearchInputChanged',
  7964. 'onNavigationBarSearchInputConfirmed',
  7965. 'onNavigationBarSearchInputClicked',
  7966. //Component
  7967. // 'onReady', // 兼容旧版本,应该移除该事件
  7968. 'onPageShow',
  7969. 'onPageHide',
  7970. 'onPageResize'
  7971. ];
  7972. function lifecycleMixin$1(Vue) {
  7973. //fixed vue-class-component
  7974. var oldExtend = Vue.extend;
  7975. Vue.extend = function(extendOptions) {
  7976. extendOptions = extendOptions || {};
  7977. var methods = extendOptions.methods;
  7978. if (methods) {
  7979. Object.keys(methods).forEach(function (methodName) {
  7980. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  7981. extendOptions[methodName] = methods[methodName];
  7982. delete methods[methodName];
  7983. }
  7984. });
  7985. }
  7986. return oldExtend.call(this, extendOptions)
  7987. };
  7988. var strategies = Vue.config.optionMergeStrategies;
  7989. var mergeHook = strategies.created;
  7990. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  7991. strategies[hook] = mergeHook;
  7992. });
  7993. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  7994. }
  7995. /* */
  7996. // install platform patch function
  7997. Vue.prototype.__patch__ = patch;
  7998. // public mount method
  7999. Vue.prototype.$mount = function(
  8000. el ,
  8001. hydrating
  8002. ) {
  8003. return mountComponent$1(this, el, hydrating)
  8004. };
  8005. lifecycleMixin$1(Vue);
  8006. internalMixin(Vue);
  8007. /* */
  8008. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  8009. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  8010. /***/ }),
  8011. /* 5 */
  8012. /*!*********************************!*\
  8013. !*** E:/fp/md/mdapp/pages.json ***!
  8014. \*********************************/
  8015. /*! no static exports found */
  8016. /***/ (function(module, exports) {
  8017. /***/ }),
  8018. /* 6 */,
  8019. /* 7 */,
  8020. /* 8 */,
  8021. /* 9 */,
  8022. /* 10 */,
  8023. /* 11 */
  8024. /*!**********************************************************************************************************!*\
  8025. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  8026. \**********************************************************************************************************/
  8027. /*! exports provided: default */
  8028. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8029. "use strict";
  8030. __webpack_require__.r(__webpack_exports__);
  8031. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  8032. /* globals __VUE_SSR_CONTEXT__ */
  8033. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  8034. // This module is a runtime utility for cleaner component module output and will
  8035. // be included in the final webpack user bundle.
  8036. function normalizeComponent (
  8037. scriptExports,
  8038. render,
  8039. staticRenderFns,
  8040. functionalTemplate,
  8041. injectStyles,
  8042. scopeId,
  8043. moduleIdentifier, /* server only */
  8044. shadowMode, /* vue-cli only */
  8045. components, // fixed by xxxxxx auto components
  8046. renderjs // fixed by xxxxxx renderjs
  8047. ) {
  8048. // Vue.extend constructor export interop
  8049. var options = typeof scriptExports === 'function'
  8050. ? scriptExports.options
  8051. : scriptExports
  8052. // fixed by xxxxxx auto components
  8053. if (components) {
  8054. if (!options.components) {
  8055. options.components = {}
  8056. }
  8057. var hasOwn = Object.prototype.hasOwnProperty
  8058. for (var name in components) {
  8059. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  8060. options.components[name] = components[name]
  8061. }
  8062. }
  8063. }
  8064. // fixed by xxxxxx renderjs
  8065. if (renderjs) {
  8066. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  8067. this[renderjs.__module] = this
  8068. });
  8069. (options.mixins || (options.mixins = [])).push(renderjs)
  8070. }
  8071. // render functions
  8072. if (render) {
  8073. options.render = render
  8074. options.staticRenderFns = staticRenderFns
  8075. options._compiled = true
  8076. }
  8077. // functional template
  8078. if (functionalTemplate) {
  8079. options.functional = true
  8080. }
  8081. // scopedId
  8082. if (scopeId) {
  8083. options._scopeId = 'data-v-' + scopeId
  8084. }
  8085. var hook
  8086. if (moduleIdentifier) { // server build
  8087. hook = function (context) {
  8088. // 2.3 injection
  8089. context =
  8090. context || // cached call
  8091. (this.$vnode && this.$vnode.ssrContext) || // stateful
  8092. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  8093. // 2.2 with runInNewContext: true
  8094. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  8095. context = __VUE_SSR_CONTEXT__
  8096. }
  8097. // inject component styles
  8098. if (injectStyles) {
  8099. injectStyles.call(this, context)
  8100. }
  8101. // register component module identifier for async chunk inferrence
  8102. if (context && context._registeredComponents) {
  8103. context._registeredComponents.add(moduleIdentifier)
  8104. }
  8105. }
  8106. // used by ssr in case component is cached and beforeCreate
  8107. // never gets called
  8108. options._ssrRegister = hook
  8109. } else if (injectStyles) {
  8110. hook = shadowMode
  8111. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  8112. : injectStyles
  8113. }
  8114. if (hook) {
  8115. if (options.functional) {
  8116. // for template-only hot-reload because in that case the render fn doesn't
  8117. // go through the normalizer
  8118. options._injectStyles = hook
  8119. // register for functioal component in vue file
  8120. var originalRender = options.render
  8121. options.render = function renderWithStyleInjection (h, context) {
  8122. hook.call(context)
  8123. return originalRender(h, context)
  8124. }
  8125. } else {
  8126. // inject component registration as beforeCreate hook
  8127. var existing = options.beforeCreate
  8128. options.beforeCreate = existing
  8129. ? [].concat(existing, hook)
  8130. : [hook]
  8131. }
  8132. }
  8133. return {
  8134. exports: scriptExports,
  8135. options: options
  8136. }
  8137. }
  8138. /***/ }),
  8139. /* 12 */
  8140. /*!*******************************************************!*\
  8141. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/index.js ***!
  8142. \*******************************************************/
  8143. /*! no static exports found */
  8144. /***/ (function(module, exports, __webpack_require__) {
  8145. "use strict";
  8146. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  8147. var _mixin = _interopRequireDefault(__webpack_require__(/*! ./libs/mixin/mixin.js */ 13));
  8148. var _request = _interopRequireDefault(__webpack_require__(/*! ./libs/request */ 14));
  8149. var _queryParams = _interopRequireDefault(__webpack_require__(/*! ./libs/function/queryParams.js */ 18));
  8150. var _route = _interopRequireDefault(__webpack_require__(/*! ./libs/function/route.js */ 19));
  8151. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFormat.js */ 23));
  8152. var _timeFrom = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFrom.js */ 24));
  8153. var _colorGradient = _interopRequireDefault(__webpack_require__(/*! ./libs/function/colorGradient.js */ 25));
  8154. var _guid = _interopRequireDefault(__webpack_require__(/*! ./libs/function/guid.js */ 26));
  8155. var _color = _interopRequireDefault(__webpack_require__(/*! ./libs/function/color.js */ 27));
  8156. var _type2icon = _interopRequireDefault(__webpack_require__(/*! ./libs/function/type2icon.js */ 28));
  8157. var _randomArray = _interopRequireDefault(__webpack_require__(/*! ./libs/function/randomArray.js */ 29));
  8158. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepClone.js */ 16));
  8159. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepMerge.js */ 15));
  8160. var _addUnit = _interopRequireDefault(__webpack_require__(/*! ./libs/function/addUnit.js */ 30));
  8161. var _test = _interopRequireDefault(__webpack_require__(/*! ./libs/function/test.js */ 17));
  8162. var _random = _interopRequireDefault(__webpack_require__(/*! ./libs/function/random.js */ 31));
  8163. var _trim = _interopRequireDefault(__webpack_require__(/*! ./libs/function/trim.js */ 32));
  8164. var _toast = _interopRequireDefault(__webpack_require__(/*! ./libs/function/toast.js */ 33));
  8165. var _getParent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/getParent.js */ 34));
  8166. var _$parent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/$parent.js */ 35));
  8167. var _sys = __webpack_require__(/*! ./libs/function/sys.js */ 36);
  8168. var _debounce = _interopRequireDefault(__webpack_require__(/*! ./libs/function/debounce.js */ 37));
  8169. var _throttle = _interopRequireDefault(__webpack_require__(/*! ./libs/function/throttle.js */ 38));
  8170. var _config = _interopRequireDefault(__webpack_require__(/*! ./libs/config/config.js */ 39));
  8171. var _zIndex = _interopRequireDefault(__webpack_require__(/*! ./libs/config/zIndex.js */ 40));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // 引入全局mixin
  8172. // 引入关于是否mixin集成小程序分享的配置
  8173. // import wxshare from './libs/mixin/mpShare.js'
  8174. // 全局挂载引入http相关请求拦截插件
  8175. function wranning(str) {// 开发环境进行信息输出,主要是一些报错信息
  8176. // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
  8177. // https://uniapp.dcloud.io/frame?id=%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83%e5%92%8c%e7%94%9f%e4%ba%a7%e7%8e%af%e5%a2%83
  8178. if (true) {console.warn(str);}} // 尝试判断在根目录的/store中是否有$u.mixin.js,此文件uView默认为需要挂在到全局的vuex的state变量
  8179. // HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式,
  8180. // let vuexStore = {};
  8181. // try {
  8182. // vuexStore = require("@/store/$u.mixin.js");
  8183. // } catch (e) {
  8184. // //TODO handle the exception
  8185. // }
  8186. // post类型对象参数转为get类型url参数
  8187. var $u = { queryParams: _queryParams.default, route: _route.default, timeFormat: _timeFormat.default, date: _timeFormat.default, // 另名date
  8188. timeFrom: _timeFrom.default, colorGradient: _colorGradient.default.colorGradient, colorToRgba: _colorGradient.default.colorToRgba, guid: _guid.default, color: _color.default, sys: _sys.sys, os: _sys.os, type2icon: _type2icon.default, randomArray: _randomArray.default, wranning: wranning, get: _request.default.get,
  8189. post: _request.default.post,
  8190. put: _request.default.put,
  8191. 'delete': _request.default.delete,
  8192. hexToRgb: _colorGradient.default.hexToRgb,
  8193. rgbToHex: _colorGradient.default.rgbToHex,
  8194. test: _test.default,
  8195. random: _random.default,
  8196. deepClone: _deepClone.default,
  8197. deepMerge: _deepMerge.default,
  8198. getParent: _getParent.default,
  8199. $parent: _$parent.default,
  8200. addUnit: _addUnit.default,
  8201. trim: _trim.default,
  8202. type: ['primary', 'success', 'error', 'warning', 'info'],
  8203. http: _request.default,
  8204. toast: _toast.default,
  8205. config: _config.default, // uView配置信息相关,比如版本号
  8206. zIndex: _zIndex.default,
  8207. debounce: _debounce.default,
  8208. throttle: _throttle.default };
  8209. // $u挂载到uni对象上
  8210. uni.$u = $u;
  8211. var install = function install(Vue) {
  8212. Vue.mixin(_mixin.default);
  8213. if (Vue.prototype.openShare) {
  8214. Vue.mixin(mpShare);
  8215. }
  8216. // Vue.mixin(vuexStore);
  8217. // 时间格式化,同时两个名称,date和timeFormat
  8218. Vue.filter('timeFormat', function (timestamp, format) {
  8219. return (0, _timeFormat.default)(timestamp, format);
  8220. });
  8221. Vue.filter('date', function (timestamp, format) {
  8222. return (0, _timeFormat.default)(timestamp, format);
  8223. });
  8224. // 将多久以前的方法,注入到全局过滤器
  8225. Vue.filter('timeFrom', function (timestamp, format) {
  8226. return (0, _timeFrom.default)(timestamp, format);
  8227. });
  8228. Vue.prototype.$u = $u;
  8229. };var _default =
  8230. {
  8231. install: install };exports.default = _default;
  8232. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8233. /***/ }),
  8234. /* 13 */
  8235. /*!******************************************************************!*\
  8236. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/mixin/mixin.js ***!
  8237. \******************************************************************/
  8238. /*! no static exports found */
  8239. /***/ (function(module, exports, __webpack_require__) {
  8240. "use strict";
  8241. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  8242. data: function data() {
  8243. return {};
  8244. },
  8245. onLoad: function onLoad() {
  8246. // getRect挂载到$u上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出
  8247. this.$u.getRect = this.$uGetRect;
  8248. },
  8249. methods: {
  8250. // 查询节点信息
  8251. // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
  8252. // 解决办法为在组件根部再套一个没有任何作用的view元素
  8253. $uGetRect: function $uGetRect(selector, all) {var _this = this;
  8254. return new Promise(function (resolve) {
  8255. uni.createSelectorQuery().
  8256. in(_this)[all ? 'selectAll' : 'select'](selector).
  8257. boundingClientRect(function (rect) {
  8258. if (all && Array.isArray(rect) && rect.length) {
  8259. resolve(rect);
  8260. }
  8261. if (!all && rect) {
  8262. resolve(rect);
  8263. }
  8264. }).
  8265. exec();
  8266. });
  8267. },
  8268. getParentData: function getParentData() {var _this2 = this;var parentName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  8269. // 避免在created中去定义parent变量
  8270. if (!this.parent) this.parent = false;
  8271. // 这里的本质原理是,通过获取父组件实例(也即u-radio-group的this)
  8272. // 将父组件this中对应的参数,赋值给本组件(u-radio的this)的parentData对象中对应的属性
  8273. // 之所以需要这么做,是因为所有端中,头条小程序不支持通过this.parent.xxx去监听父组件参数的变化
  8274. this.parent = this.$u.$parent.call(this, parentName);
  8275. if (this.parent) {
  8276. // 历遍parentData中的属性,将parent中的同名属性赋值给parentData
  8277. Object.keys(this.parentData).map(function (key) {
  8278. _this2.parentData[key] = _this2.parent[key];
  8279. });
  8280. }
  8281. },
  8282. // 阻止事件冒泡
  8283. preventEvent: function preventEvent(e) {
  8284. e && e.stopPropagation && e.stopPropagation();
  8285. } },
  8286. onReachBottom: function onReachBottom() {
  8287. uni.$emit('uOnReachBottom');
  8288. },
  8289. beforeDestroy: function beforeDestroy() {var _this3 = this;
  8290. // 判断当前页面是否存在parent和chldren,一般在checkbox和checkbox-group父子联动的场景会有此情况
  8291. // 组件销毁时,移除子组件在父组件children数组中的实例,释放资源,避免数据混乱
  8292. if (this.parent && uni.$u.test.array(this.parent.children)) {
  8293. // 组件销毁时,移除父组件中的children数组中对应的实例
  8294. var childrenList = this.parent.children;
  8295. childrenList.map(function (child, index) {
  8296. // 如果相等,则移除
  8297. if (child === _this3) {
  8298. childrenList.splice(index, 1);
  8299. }
  8300. });
  8301. }
  8302. } };exports.default = _default;
  8303. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8304. /***/ }),
  8305. /* 14 */
  8306. /*!********************************************************************!*\
  8307. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/request/index.js ***!
  8308. \********************************************************************/
  8309. /*! no static exports found */
  8310. /***/ (function(module, exports, __webpack_require__) {
  8311. "use strict";
  8312. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ../function/deepMerge */ 15));
  8313. var _test = _interopRequireDefault(__webpack_require__(/*! ../function/test */ 17));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: 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
  8314. Request = /*#__PURE__*/function () {_createClass(Request, [{ key: "setConfig",
  8315. // 设置全局默认配置
  8316. value: function setConfig(customConfig) {
  8317. // 深度合并对象,否则会造成对象深层属性丢失
  8318. this.config = (0, _deepMerge.default)(this.config, customConfig);
  8319. }
  8320. // 主要请求部分
  8321. }, { key: "request", value: function request() {var _this = this;var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  8322. // 检查请求拦截
  8323. if (this.interceptor.request && typeof this.interceptor.request === 'function') {
  8324. var tmpConfig = {};
  8325. var interceptorRequest = this.interceptor.request(options);
  8326. if (interceptorRequest === false) {
  8327. // 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调
  8328. return new Promise(function () {});
  8329. }
  8330. this.options = interceptorRequest;
  8331. }
  8332. options.dataType = options.dataType || this.config.dataType;
  8333. options.responseType = options.responseType || this.config.responseType;
  8334. options.url = options.url || '';
  8335. options.params = options.params || {};
  8336. options.header = Object.assign({}, this.config.header, options.header);
  8337. options.method = options.method || this.config.method;
  8338. return new Promise(function (resolve, reject) {
  8339. options.complete = function (response) {
  8340. // 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)
  8341. uni.hideLoading();
  8342. // 清除定时器,如果请求回来了,就无需loading
  8343. clearTimeout(_this.config.timer);
  8344. _this.config.timer = null;
  8345. // 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
  8346. if (_this.config.originalData) {
  8347. // 判断是否存在拦截器
  8348. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  8349. var resInterceptors = _this.interceptor.response(response);
  8350. // 如果拦截器不返回false,就将拦截器返回的内容给this.$u.post的then回调
  8351. if (resInterceptors !== false) {
  8352. resolve(resInterceptors);
  8353. } else {
  8354. // 如果拦截器返回false,意味着拦截器定义者认为返回有问题,直接接入catch回调
  8355. reject(response);
  8356. }
  8357. } else {
  8358. // 如果要求返回原始数据,就算没有拦截器,也返回最原始的数据
  8359. resolve(response);
  8360. }
  8361. } else {
  8362. if (response.statusCode == 200) {
  8363. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  8364. var _resInterceptors = _this.interceptor.response(response.data);
  8365. if (_resInterceptors !== false) {
  8366. resolve(_resInterceptors);
  8367. } else {
  8368. reject(response.data);
  8369. }
  8370. } else {
  8371. // 如果不是返回原始数据(originalData=false),且没有拦截器的情况下,返回纯数据给then回调
  8372. resolve(response.data);
  8373. }
  8374. } else {
  8375. // 不返回原始数据的情况下,服务器状态码不为200,modal弹框提示
  8376. // if(response.errMsg) {
  8377. // uni.showModal({
  8378. // title: response.errMsg
  8379. // });
  8380. // }
  8381. reject(response);
  8382. }
  8383. }
  8384. };
  8385. // 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
  8386. options.url = _test.default.url(options.url) ? options.url : _this.config.baseUrl + (options.url.indexOf('/') == 0 ?
  8387. options.url : '/' + options.url);
  8388. // 是否显示loading
  8389. // 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id
  8390. // 而没有清除前者的定时器,导致前者超时,一直显示loading
  8391. if (_this.config.showLoading && !_this.config.timer) {
  8392. _this.config.timer = setTimeout(function () {
  8393. uni.showLoading({
  8394. title: _this.config.loadingText,
  8395. mask: _this.config.loadingMask });
  8396. _this.config.timer = null;
  8397. }, _this.config.loadingTime);
  8398. }
  8399. uni.request(options);
  8400. });
  8401. // .catch(res => {
  8402. // // 如果返回reject(),不让其进入this.$u.post().then().catch()后面的catct()
  8403. // // 因为很多人都会忘了写后面的catch(),导致报错捕获不到catch
  8404. // return new Promise(()=>{});
  8405. // })
  8406. } }]);
  8407. function Request() {var _this2 = this;_classCallCheck(this, Request);
  8408. this.config = {
  8409. baseUrl: '', // 请求的根域名
  8410. // 默认的请求头
  8411. header: {},
  8412. method: 'POST',
  8413. // 设置为json,返回后uni.request会对数据进行一次JSON.parse
  8414. dataType: 'json',
  8415. // 此参数无需处理,因为5+和支付宝小程序不支持,默认为text即可
  8416. responseType: 'text',
  8417. showLoading: true, // 是否显示请求中的loading
  8418. loadingText: '请求中...',
  8419. loadingTime: 800, // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
  8420. timer: null, // 定时器
  8421. originalData: false, // 是否在拦截器中返回服务端的原始数据,见文档说明
  8422. loadingMask: true // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
  8423. };
  8424. // 拦截器
  8425. this.interceptor = {
  8426. // 请求前的拦截
  8427. request: null,
  8428. // 请求后的拦截
  8429. response: null };
  8430. // get请求
  8431. this.get = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  8432. return _this2.request({
  8433. method: 'GET',
  8434. url: url,
  8435. header: header,
  8436. data: data });
  8437. };
  8438. // post请求
  8439. this.post = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  8440. return _this2.request({
  8441. url: url,
  8442. method: 'POST',
  8443. header: header,
  8444. data: data });
  8445. };
  8446. // put请求,不支持支付宝小程序(HX2.6.15)
  8447. this.put = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  8448. return _this2.request({
  8449. url: url,
  8450. method: 'PUT',
  8451. header: header,
  8452. data: data });
  8453. };
  8454. // delete请求,不支持支付宝和头条小程序(HX2.6.15)
  8455. this.delete = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  8456. return _this2.request({
  8457. url: url,
  8458. method: 'DELETE',
  8459. header: header,
  8460. data: data });
  8461. };
  8462. }return Request;}();var _default =
  8463. new Request();exports.default = _default;
  8464. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8465. /***/ }),
  8466. /* 15 */
  8467. /*!*************************************************************************!*\
  8468. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/deepMerge.js ***!
  8469. \*************************************************************************/
  8470. /*! no static exports found */
  8471. /***/ (function(module, exports, __webpack_require__) {
  8472. "use strict";
  8473. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./deepClone */ 16));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  8474. // JS对象深度合并
  8475. function deepMerge() {var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  8476. target = (0, _deepClone.default)(target);
  8477. if (typeof target !== 'object' || typeof source !== 'object') return false;
  8478. for (var prop in source) {
  8479. if (!source.hasOwnProperty(prop)) continue;
  8480. if (prop in target) {
  8481. if (typeof target[prop] !== 'object') {
  8482. target[prop] = source[prop];
  8483. } else {
  8484. if (typeof source[prop] !== 'object') {
  8485. target[prop] = source[prop];
  8486. } else {
  8487. if (target[prop].concat && source[prop].concat) {
  8488. target[prop] = target[prop].concat(source[prop]);
  8489. } else {
  8490. target[prop] = deepMerge(target[prop], source[prop]);
  8491. }
  8492. }
  8493. }
  8494. } else {
  8495. target[prop] = source[prop];
  8496. }
  8497. }
  8498. return target;
  8499. }var _default =
  8500. deepMerge;exports.default = _default;
  8501. /***/ }),
  8502. /* 16 */
  8503. /*!*************************************************************************!*\
  8504. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/deepClone.js ***!
  8505. \*************************************************************************/
  8506. /*! no static exports found */
  8507. /***/ (function(module, exports, __webpack_require__) {
  8508. "use strict";
  8509. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 判断arr是否为一个数组,返回一个bool值
  8510. function isArray(arr) {
  8511. return Object.prototype.toString.call(arr) === '[object Array]';
  8512. }
  8513. // 深度克隆
  8514. function deepClone(obj) {
  8515. // 对常见的“非”值,直接返回原来值
  8516. if ([null, undefined, NaN, false].includes(obj)) return obj;
  8517. if (typeof obj !== "object" && typeof obj !== 'function') {
  8518. //原始类型直接返回
  8519. return obj;
  8520. }
  8521. var o = isArray(obj) ? [] : {};
  8522. for (var i in obj) {
  8523. if (obj.hasOwnProperty(i)) {
  8524. o[i] = typeof obj[i] === "object" ? deepClone(obj[i]) : obj[i];
  8525. }
  8526. }
  8527. return o;
  8528. }var _default =
  8529. deepClone;exports.default = _default;
  8530. /***/ }),
  8531. /* 17 */
  8532. /*!********************************************************************!*\
  8533. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/test.js ***!
  8534. \********************************************************************/
  8535. /*! no static exports found */
  8536. /***/ (function(module, exports, __webpack_require__) {
  8537. "use strict";
  8538. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  8539. * 验证电子邮箱格式
  8540. */
  8541. function email(value) {
  8542. return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
  8543. }
  8544. /**
  8545. * 验证手机格式
  8546. */
  8547. function mobile(value) {
  8548. return /^1[23456789]\d{9}$/.test(value);
  8549. }
  8550. /**
  8551. * 验证URL格式
  8552. */
  8553. function url(value) {
  8554. return /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/.test(value);
  8555. }
  8556. /**
  8557. * 验证日期格式
  8558. */
  8559. function date(value) {
  8560. return !/Invalid|NaN/.test(new Date(value).toString());
  8561. }
  8562. /**
  8563. * 验证ISO类型的日期格式
  8564. */
  8565. function dateISO(value) {
  8566. return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
  8567. }
  8568. /**
  8569. * 验证十进制数字
  8570. */
  8571. function number(value) {
  8572. return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
  8573. }
  8574. /**
  8575. * 验证整数
  8576. */
  8577. function digits(value) {
  8578. return /^\d+$/.test(value);
  8579. }
  8580. /**
  8581. * 验证身份证号码
  8582. */
  8583. function idCard(value) {
  8584. return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(
  8585. value);
  8586. }
  8587. /**
  8588. * 是否车牌号
  8589. */
  8590. function carNo(value) {
  8591. // 新能源车牌
  8592. var xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
  8593. // 旧车牌
  8594. var creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
  8595. if (value.length === 7) {
  8596. return creg.test(value);
  8597. } else if (value.length === 8) {
  8598. return xreg.test(value);
  8599. } else {
  8600. return false;
  8601. }
  8602. }
  8603. /**
  8604. * 金额,只允许2位小数
  8605. */
  8606. function amount(value) {
  8607. //金额,只允许保留两位小数
  8608. return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
  8609. }
  8610. /**
  8611. * 中文
  8612. */
  8613. function chinese(value) {
  8614. var reg = /^[\u4e00-\u9fa5]+$/gi;
  8615. return reg.test(value);
  8616. }
  8617. /**
  8618. * 只能输入字母
  8619. */
  8620. function letter(value) {
  8621. return /^[a-zA-Z]*$/.test(value);
  8622. }
  8623. /**
  8624. * 只能是字母或者数字
  8625. */
  8626. function enOrNum(value) {
  8627. //英文或者数字
  8628. var reg = /^[0-9a-zA-Z]*$/g;
  8629. return reg.test(value);
  8630. }
  8631. /**
  8632. * 验证是否包含某个值
  8633. */
  8634. function contains(value, param) {
  8635. return value.indexOf(param) >= 0;
  8636. }
  8637. /**
  8638. * 验证一个值范围[min, max]
  8639. */
  8640. function range(value, param) {
  8641. return value >= param[0] && value <= param[1];
  8642. }
  8643. /**
  8644. * 验证一个长度范围[min, max]
  8645. */
  8646. function rangeLength(value, param) {
  8647. return value.length >= param[0] && value.length <= param[1];
  8648. }
  8649. /**
  8650. * 是否固定电话
  8651. */
  8652. function landline(value) {
  8653. var reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
  8654. return reg.test(value);
  8655. }
  8656. /**
  8657. * 判断是否为空
  8658. */
  8659. function empty(value) {
  8660. switch (typeof value) {
  8661. case 'undefined':
  8662. return true;
  8663. case 'string':
  8664. if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
  8665. break;
  8666. case 'boolean':
  8667. if (!value) return true;
  8668. break;
  8669. case 'number':
  8670. if (0 === value || isNaN(value)) return true;
  8671. break;
  8672. case 'object':
  8673. if (null === value || value.length === 0) return true;
  8674. for (var i in value) {
  8675. return false;
  8676. }
  8677. return true;}
  8678. return false;
  8679. }
  8680. /**
  8681. * 是否json字符串
  8682. */
  8683. function jsonString(value) {
  8684. if (typeof value == 'string') {
  8685. try {
  8686. var obj = JSON.parse(value);
  8687. if (typeof obj == 'object' && obj) {
  8688. return true;
  8689. } else {
  8690. return false;
  8691. }
  8692. } catch (e) {
  8693. return false;
  8694. }
  8695. }
  8696. return false;
  8697. }
  8698. /**
  8699. * 是否数组
  8700. */
  8701. function array(value) {
  8702. if (typeof Array.isArray === "function") {
  8703. return Array.isArray(value);
  8704. } else {
  8705. return Object.prototype.toString.call(value) === "[object Array]";
  8706. }
  8707. }
  8708. /**
  8709. * 是否对象
  8710. */
  8711. function object(value) {
  8712. return Object.prototype.toString.call(value) === '[object Object]';
  8713. }
  8714. /**
  8715. * 是否短信验证码
  8716. */
  8717. function code(value) {var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
  8718. return new RegExp("^\\d{".concat(len, "}$")).test(value);
  8719. }var _default =
  8720. {
  8721. email: email,
  8722. mobile: mobile,
  8723. url: url,
  8724. date: date,
  8725. dateISO: dateISO,
  8726. number: number,
  8727. digits: digits,
  8728. idCard: idCard,
  8729. carNo: carNo,
  8730. amount: amount,
  8731. chinese: chinese,
  8732. letter: letter,
  8733. enOrNum: enOrNum,
  8734. contains: contains,
  8735. range: range,
  8736. rangeLength: rangeLength,
  8737. empty: empty,
  8738. isEmpty: empty,
  8739. jsonString: jsonString,
  8740. landline: landline,
  8741. object: object,
  8742. array: array,
  8743. code: code };exports.default = _default;
  8744. /***/ }),
  8745. /* 18 */
  8746. /*!***************************************************************************!*\
  8747. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/queryParams.js ***!
  8748. \***************************************************************************/
  8749. /*! no static exports found */
  8750. /***/ (function(module, exports, __webpack_require__) {
  8751. "use strict";
  8752. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  8753. * 对象转url参数
  8754. * @param {*} data,对象
  8755. * @param {*} isPrefix,是否自动加上"?"
  8756. */
  8757. function queryParams() {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var isPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var arrayFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'brackets';
  8758. var prefix = isPrefix ? '?' : '';
  8759. var _result = [];
  8760. if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets';var _loop = function _loop(
  8761. key) {
  8762. var value = data[key];
  8763. // 去掉为空的参数
  8764. if (['', undefined, null].indexOf(value) >= 0) {
  8765. return "continue";
  8766. }
  8767. // 如果值为数组,另行处理
  8768. if (value.constructor === Array) {
  8769. // e.g. {ids: [1, 2, 3]}
  8770. switch (arrayFormat) {
  8771. case 'indices':
  8772. // 结果: ids[0]=1&ids[1]=2&ids[2]=3
  8773. for (var i = 0; i < value.length; i++) {
  8774. _result.push(key + '[' + i + ']=' + value[i]);
  8775. }
  8776. break;
  8777. case 'brackets':
  8778. // 结果: ids[]=1&ids[]=2&ids[]=3
  8779. value.forEach(function (_value) {
  8780. _result.push(key + '[]=' + _value);
  8781. });
  8782. break;
  8783. case 'repeat':
  8784. // 结果: ids=1&ids=2&ids=3
  8785. value.forEach(function (_value) {
  8786. _result.push(key + '=' + _value);
  8787. });
  8788. break;
  8789. case 'comma':
  8790. // 结果: ids=1,2,3
  8791. var commaStr = "";
  8792. value.forEach(function (_value) {
  8793. commaStr += (commaStr ? "," : "") + _value;
  8794. });
  8795. _result.push(key + '=' + commaStr);
  8796. break;
  8797. default:
  8798. value.forEach(function (_value) {
  8799. _result.push(key + '[]=' + _value);
  8800. });}
  8801. } else {
  8802. _result.push(key + '=' + value);
  8803. }};for (var key in data) {var _ret = _loop(key);if (_ret === "continue") continue;
  8804. }
  8805. return _result.length ? prefix + _result.join('&') : '';
  8806. }var _default =
  8807. queryParams;exports.default = _default;
  8808. /***/ }),
  8809. /* 19 */
  8810. /*!*********************************************************************!*\
  8811. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/route.js ***!
  8812. \*********************************************************************/
  8813. /*! no static exports found */
  8814. /***/ (function(module, exports, __webpack_require__) {
  8815. "use strict";
  8816. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 20));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}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;} /**
  8817. * 路由跳转方法,该方法相对于直接使用uni.xxx的好处是使用更加简单快捷
  8818. * 并且带有路由拦截功能
  8819. */var
  8820. Router = /*#__PURE__*/function () {
  8821. function Router() {_classCallCheck(this, Router);
  8822. // 原始属性定义
  8823. this.config = {
  8824. type: 'navigateTo',
  8825. url: '',
  8826. delta: 1, // navigateBack页面后退时,回退的层数
  8827. params: {}, // 传递的参数
  8828. animationType: 'pop-in', // 窗口动画,只在APP有效
  8829. animationDuration: 300, // 窗口动画持续时间,单位毫秒,只在APP有效
  8830. intercept: false // 是否需要拦截
  8831. };
  8832. // 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
  8833. // 这里在构造函数中进行this绑定
  8834. this.route = this.route.bind(this);
  8835. }
  8836. // 判断url前面是否有"/",如果没有则加上,否则无法跳转
  8837. _createClass(Router, [{ key: "addRootPath", value: function addRootPath(url) {
  8838. return url[0] === '/' ? url : "/".concat(url);
  8839. }
  8840. // 整合路由参数
  8841. }, { key: "mixinParam", value: function mixinParam(url, params) {
  8842. url = url && this.addRootPath(url);
  8843. // 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
  8844. // 如果有url中有get参数,转换后无需带上"?"
  8845. var query = '';
  8846. if (/.*\/.*\?.*=.*/.test(url)) {
  8847. // object对象转为get类型的参数
  8848. query = uni.$u.queryParams(params, false);
  8849. // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
  8850. return url += "&" + query;
  8851. } else {
  8852. // 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
  8853. query = uni.$u.queryParams(params);
  8854. return url += query;
  8855. }
  8856. }
  8857. // 对外的方法名称
  8858. }, { key: "route", value: function () {var _route = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var options,params,mergeConfig,isNext,_args = arguments;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
  8859. // 合并用户的配置和内部的默认配置
  8860. mergeConfig = {};
  8861. if (typeof options === 'string') {
  8862. // 如果options为字符串,则为route(url, params)的形式
  8863. mergeConfig.url = this.mixinParam(options, params);
  8864. mergeConfig.type = 'navigateTo';
  8865. } else {
  8866. mergeConfig = uni.$u.deepClone(options, this.config);
  8867. // 否则正常使用mergeConfig中的url和params进行拼接
  8868. mergeConfig.url = this.mixinParam(options.url, options.params);
  8869. }
  8870. if (params.intercept) {
  8871. this.config.intercept = params.intercept;
  8872. }
  8873. // params参数也带给拦截器
  8874. mergeConfig.params = params;
  8875. // 合并内外部参数
  8876. mergeConfig = uni.$u.deepMerge(this.config, mergeConfig);
  8877. // 判断用户是否定义了拦截器
  8878. if (!(typeof uni.$u.routeIntercept === 'function')) {_context.next = 14;break;}_context.next = 10;return (
  8879. new Promise(function (resolve, reject) {
  8880. uni.$u.routeIntercept(mergeConfig, resolve);
  8881. }));case 10:isNext = _context.sent;
  8882. // 如果isNext为true,则执行路由跳转
  8883. isNext && this.openPage(mergeConfig);_context.next = 15;break;case 14:
  8884. this.openPage(mergeConfig);case 15:case "end":return _context.stop();}}}, _callee, this);}));function route() {return _route.apply(this, arguments);}return route;}()
  8885. // 执行路由跳转
  8886. }, { key: "openPage", value: function openPage(config) {
  8887. // 解构参数
  8888. var
  8889. url =
  8890. config.url,type = config.type,delta = config.delta,animationType = config.animationType,animationDuration = config.animationDuration;
  8891. if (config.type == 'navigateTo' || config.type == 'to') {
  8892. uni.navigateTo({
  8893. url: url,
  8894. animationType: animationType,
  8895. animationDuration: animationDuration });
  8896. }
  8897. if (config.type == 'redirectTo' || config.type == 'redirect') {
  8898. uni.redirectTo({
  8899. url: url });
  8900. }
  8901. if (config.type == 'switchTab' || config.type == 'tab') {
  8902. uni.switchTab({
  8903. url: url });
  8904. }
  8905. if (config.type == 'reLaunch' || config.type == 'launch') {
  8906. uni.reLaunch({
  8907. url: url });
  8908. }
  8909. if (config.type == 'navigateBack' || config.type == 'back') {
  8910. uni.navigateBack({
  8911. delta: delta });
  8912. }
  8913. } }]);return Router;}();var _default =
  8914. new Router().route;exports.default = _default;
  8915. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8916. /***/ }),
  8917. /* 20 */
  8918. /*!**********************************************************!*\
  8919. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  8920. \**********************************************************/
  8921. /*! no static exports found */
  8922. /***/ (function(module, exports, __webpack_require__) {
  8923. module.exports = __webpack_require__(/*! regenerator-runtime */ 21);
  8924. /***/ }),
  8925. /* 21 */
  8926. /*!************************************************************!*\
  8927. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  8928. \************************************************************/
  8929. /*! no static exports found */
  8930. /***/ (function(module, exports, __webpack_require__) {
  8931. /**
  8932. * Copyright (c) 2014-present, Facebook, Inc.
  8933. *
  8934. * This source code is licensed under the MIT license found in the
  8935. * LICENSE file in the root directory of this source tree.
  8936. */
  8937. // This method of obtaining a reference to the global object needs to be
  8938. // kept identical to the way it is obtained in runtime.js
  8939. var g = (function() {
  8940. return this || (typeof self === "object" && self);
  8941. })() || Function("return this")();
  8942. // Use `getOwnPropertyNames` because not all browsers support calling
  8943. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  8944. var hadRuntime = g.regeneratorRuntime &&
  8945. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  8946. // Save the old regeneratorRuntime in case it needs to be restored later.
  8947. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  8948. // Force reevalutation of runtime.js.
  8949. g.regeneratorRuntime = undefined;
  8950. module.exports = __webpack_require__(/*! ./runtime */ 22);
  8951. if (hadRuntime) {
  8952. // Restore the original runtime.
  8953. g.regeneratorRuntime = oldRuntime;
  8954. } else {
  8955. // Remove the global property added by runtime.js.
  8956. try {
  8957. delete g.regeneratorRuntime;
  8958. } catch(e) {
  8959. g.regeneratorRuntime = undefined;
  8960. }
  8961. }
  8962. /***/ }),
  8963. /* 22 */
  8964. /*!*****************************************************!*\
  8965. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  8966. \*****************************************************/
  8967. /*! no static exports found */
  8968. /***/ (function(module, exports) {
  8969. /**
  8970. * Copyright (c) 2014-present, Facebook, Inc.
  8971. *
  8972. * This source code is licensed under the MIT license found in the
  8973. * LICENSE file in the root directory of this source tree.
  8974. */
  8975. !(function(global) {
  8976. "use strict";
  8977. var Op = Object.prototype;
  8978. var hasOwn = Op.hasOwnProperty;
  8979. var undefined; // More compressible than void 0.
  8980. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  8981. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  8982. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  8983. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  8984. var inModule = typeof module === "object";
  8985. var runtime = global.regeneratorRuntime;
  8986. if (runtime) {
  8987. if (inModule) {
  8988. // If regeneratorRuntime is defined globally and we're in a module,
  8989. // make the exports object identical to regeneratorRuntime.
  8990. module.exports = runtime;
  8991. }
  8992. // Don't bother evaluating the rest of this file if the runtime was
  8993. // already defined globally.
  8994. return;
  8995. }
  8996. // Define the runtime globally (as expected by generated code) as either
  8997. // module.exports (if we're in a module) or a new, empty object.
  8998. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  8999. function wrap(innerFn, outerFn, self, tryLocsList) {
  9000. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  9001. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  9002. var generator = Object.create(protoGenerator.prototype);
  9003. var context = new Context(tryLocsList || []);
  9004. // The ._invoke method unifies the implementations of the .next,
  9005. // .throw, and .return methods.
  9006. generator._invoke = makeInvokeMethod(innerFn, self, context);
  9007. return generator;
  9008. }
  9009. runtime.wrap = wrap;
  9010. // Try/catch helper to minimize deoptimizations. Returns a completion
  9011. // record like context.tryEntries[i].completion. This interface could
  9012. // have been (and was previously) designed to take a closure to be
  9013. // invoked without arguments, but in all the cases we care about we
  9014. // already have an existing method we want to call, so there's no need
  9015. // to create a new function object. We can even get away with assuming
  9016. // the method takes exactly one argument, since that happens to be true
  9017. // in every case, so we don't have to touch the arguments object. The
  9018. // only additional allocation required is the completion record, which
  9019. // has a stable shape and so hopefully should be cheap to allocate.
  9020. function tryCatch(fn, obj, arg) {
  9021. try {
  9022. return { type: "normal", arg: fn.call(obj, arg) };
  9023. } catch (err) {
  9024. return { type: "throw", arg: err };
  9025. }
  9026. }
  9027. var GenStateSuspendedStart = "suspendedStart";
  9028. var GenStateSuspendedYield = "suspendedYield";
  9029. var GenStateExecuting = "executing";
  9030. var GenStateCompleted = "completed";
  9031. // Returning this object from the innerFn has the same effect as
  9032. // breaking out of the dispatch switch statement.
  9033. var ContinueSentinel = {};
  9034. // Dummy constructor functions that we use as the .constructor and
  9035. // .constructor.prototype properties for functions that return Generator
  9036. // objects. For full spec compliance, you may wish to configure your
  9037. // minifier not to mangle the names of these two functions.
  9038. function Generator() {}
  9039. function GeneratorFunction() {}
  9040. function GeneratorFunctionPrototype() {}
  9041. // This is a polyfill for %IteratorPrototype% for environments that
  9042. // don't natively support it.
  9043. var IteratorPrototype = {};
  9044. IteratorPrototype[iteratorSymbol] = function () {
  9045. return this;
  9046. };
  9047. var getProto = Object.getPrototypeOf;
  9048. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  9049. if (NativeIteratorPrototype &&
  9050. NativeIteratorPrototype !== Op &&
  9051. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  9052. // This environment has a native %IteratorPrototype%; use it instead
  9053. // of the polyfill.
  9054. IteratorPrototype = NativeIteratorPrototype;
  9055. }
  9056. var Gp = GeneratorFunctionPrototype.prototype =
  9057. Generator.prototype = Object.create(IteratorPrototype);
  9058. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  9059. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  9060. GeneratorFunctionPrototype[toStringTagSymbol] =
  9061. GeneratorFunction.displayName = "GeneratorFunction";
  9062. // Helper for defining the .next, .throw, and .return methods of the
  9063. // Iterator interface in terms of a single ._invoke method.
  9064. function defineIteratorMethods(prototype) {
  9065. ["next", "throw", "return"].forEach(function(method) {
  9066. prototype[method] = function(arg) {
  9067. return this._invoke(method, arg);
  9068. };
  9069. });
  9070. }
  9071. runtime.isGeneratorFunction = function(genFun) {
  9072. var ctor = typeof genFun === "function" && genFun.constructor;
  9073. return ctor
  9074. ? ctor === GeneratorFunction ||
  9075. // For the native GeneratorFunction constructor, the best we can
  9076. // do is to check its .name property.
  9077. (ctor.displayName || ctor.name) === "GeneratorFunction"
  9078. : false;
  9079. };
  9080. runtime.mark = function(genFun) {
  9081. if (Object.setPrototypeOf) {
  9082. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  9083. } else {
  9084. genFun.__proto__ = GeneratorFunctionPrototype;
  9085. if (!(toStringTagSymbol in genFun)) {
  9086. genFun[toStringTagSymbol] = "GeneratorFunction";
  9087. }
  9088. }
  9089. genFun.prototype = Object.create(Gp);
  9090. return genFun;
  9091. };
  9092. // Within the body of any async function, `await x` is transformed to
  9093. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  9094. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  9095. // meant to be awaited.
  9096. runtime.awrap = function(arg) {
  9097. return { __await: arg };
  9098. };
  9099. function AsyncIterator(generator) {
  9100. function invoke(method, arg, resolve, reject) {
  9101. var record = tryCatch(generator[method], generator, arg);
  9102. if (record.type === "throw") {
  9103. reject(record.arg);
  9104. } else {
  9105. var result = record.arg;
  9106. var value = result.value;
  9107. if (value &&
  9108. typeof value === "object" &&
  9109. hasOwn.call(value, "__await")) {
  9110. return Promise.resolve(value.__await).then(function(value) {
  9111. invoke("next", value, resolve, reject);
  9112. }, function(err) {
  9113. invoke("throw", err, resolve, reject);
  9114. });
  9115. }
  9116. return Promise.resolve(value).then(function(unwrapped) {
  9117. // When a yielded Promise is resolved, its final value becomes
  9118. // the .value of the Promise<{value,done}> result for the
  9119. // current iteration.
  9120. result.value = unwrapped;
  9121. resolve(result);
  9122. }, function(error) {
  9123. // If a rejected Promise was yielded, throw the rejection back
  9124. // into the async generator function so it can be handled there.
  9125. return invoke("throw", error, resolve, reject);
  9126. });
  9127. }
  9128. }
  9129. var previousPromise;
  9130. function enqueue(method, arg) {
  9131. function callInvokeWithMethodAndArg() {
  9132. return new Promise(function(resolve, reject) {
  9133. invoke(method, arg, resolve, reject);
  9134. });
  9135. }
  9136. return previousPromise =
  9137. // If enqueue has been called before, then we want to wait until
  9138. // all previous Promises have been resolved before calling invoke,
  9139. // so that results are always delivered in the correct order. If
  9140. // enqueue has not been called before, then it is important to
  9141. // call invoke immediately, without waiting on a callback to fire,
  9142. // so that the async generator function has the opportunity to do
  9143. // any necessary setup in a predictable way. This predictability
  9144. // is why the Promise constructor synchronously invokes its
  9145. // executor callback, and why async functions synchronously
  9146. // execute code before the first await. Since we implement simple
  9147. // async functions in terms of async generators, it is especially
  9148. // important to get this right, even though it requires care.
  9149. previousPromise ? previousPromise.then(
  9150. callInvokeWithMethodAndArg,
  9151. // Avoid propagating failures to Promises returned by later
  9152. // invocations of the iterator.
  9153. callInvokeWithMethodAndArg
  9154. ) : callInvokeWithMethodAndArg();
  9155. }
  9156. // Define the unified helper method that is used to implement .next,
  9157. // .throw, and .return (see defineIteratorMethods).
  9158. this._invoke = enqueue;
  9159. }
  9160. defineIteratorMethods(AsyncIterator.prototype);
  9161. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  9162. return this;
  9163. };
  9164. runtime.AsyncIterator = AsyncIterator;
  9165. // Note that simple async functions are implemented on top of
  9166. // AsyncIterator objects; they just return a Promise for the value of
  9167. // the final result produced by the iterator.
  9168. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  9169. var iter = new AsyncIterator(
  9170. wrap(innerFn, outerFn, self, tryLocsList)
  9171. );
  9172. return runtime.isGeneratorFunction(outerFn)
  9173. ? iter // If outerFn is a generator, return the full iterator.
  9174. : iter.next().then(function(result) {
  9175. return result.done ? result.value : iter.next();
  9176. });
  9177. };
  9178. function makeInvokeMethod(innerFn, self, context) {
  9179. var state = GenStateSuspendedStart;
  9180. return function invoke(method, arg) {
  9181. if (state === GenStateExecuting) {
  9182. throw new Error("Generator is already running");
  9183. }
  9184. if (state === GenStateCompleted) {
  9185. if (method === "throw") {
  9186. throw arg;
  9187. }
  9188. // Be forgiving, per 25.3.3.3.3 of the spec:
  9189. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  9190. return doneResult();
  9191. }
  9192. context.method = method;
  9193. context.arg = arg;
  9194. while (true) {
  9195. var delegate = context.delegate;
  9196. if (delegate) {
  9197. var delegateResult = maybeInvokeDelegate(delegate, context);
  9198. if (delegateResult) {
  9199. if (delegateResult === ContinueSentinel) continue;
  9200. return delegateResult;
  9201. }
  9202. }
  9203. if (context.method === "next") {
  9204. // Setting context._sent for legacy support of Babel's
  9205. // function.sent implementation.
  9206. context.sent = context._sent = context.arg;
  9207. } else if (context.method === "throw") {
  9208. if (state === GenStateSuspendedStart) {
  9209. state = GenStateCompleted;
  9210. throw context.arg;
  9211. }
  9212. context.dispatchException(context.arg);
  9213. } else if (context.method === "return") {
  9214. context.abrupt("return", context.arg);
  9215. }
  9216. state = GenStateExecuting;
  9217. var record = tryCatch(innerFn, self, context);
  9218. if (record.type === "normal") {
  9219. // If an exception is thrown from innerFn, we leave state ===
  9220. // GenStateExecuting and loop back for another invocation.
  9221. state = context.done
  9222. ? GenStateCompleted
  9223. : GenStateSuspendedYield;
  9224. if (record.arg === ContinueSentinel) {
  9225. continue;
  9226. }
  9227. return {
  9228. value: record.arg,
  9229. done: context.done
  9230. };
  9231. } else if (record.type === "throw") {
  9232. state = GenStateCompleted;
  9233. // Dispatch the exception by looping back around to the
  9234. // context.dispatchException(context.arg) call above.
  9235. context.method = "throw";
  9236. context.arg = record.arg;
  9237. }
  9238. }
  9239. };
  9240. }
  9241. // Call delegate.iterator[context.method](context.arg) and handle the
  9242. // result, either by returning a { value, done } result from the
  9243. // delegate iterator, or by modifying context.method and context.arg,
  9244. // setting context.delegate to null, and returning the ContinueSentinel.
  9245. function maybeInvokeDelegate(delegate, context) {
  9246. var method = delegate.iterator[context.method];
  9247. if (method === undefined) {
  9248. // A .throw or .return when the delegate iterator has no .throw
  9249. // method always terminates the yield* loop.
  9250. context.delegate = null;
  9251. if (context.method === "throw") {
  9252. if (delegate.iterator.return) {
  9253. // If the delegate iterator has a return method, give it a
  9254. // chance to clean up.
  9255. context.method = "return";
  9256. context.arg = undefined;
  9257. maybeInvokeDelegate(delegate, context);
  9258. if (context.method === "throw") {
  9259. // If maybeInvokeDelegate(context) changed context.method from
  9260. // "return" to "throw", let that override the TypeError below.
  9261. return ContinueSentinel;
  9262. }
  9263. }
  9264. context.method = "throw";
  9265. context.arg = new TypeError(
  9266. "The iterator does not provide a 'throw' method");
  9267. }
  9268. return ContinueSentinel;
  9269. }
  9270. var record = tryCatch(method, delegate.iterator, context.arg);
  9271. if (record.type === "throw") {
  9272. context.method = "throw";
  9273. context.arg = record.arg;
  9274. context.delegate = null;
  9275. return ContinueSentinel;
  9276. }
  9277. var info = record.arg;
  9278. if (! info) {
  9279. context.method = "throw";
  9280. context.arg = new TypeError("iterator result is not an object");
  9281. context.delegate = null;
  9282. return ContinueSentinel;
  9283. }
  9284. if (info.done) {
  9285. // Assign the result of the finished delegate to the temporary
  9286. // variable specified by delegate.resultName (see delegateYield).
  9287. context[delegate.resultName] = info.value;
  9288. // Resume execution at the desired location (see delegateYield).
  9289. context.next = delegate.nextLoc;
  9290. // If context.method was "throw" but the delegate handled the
  9291. // exception, let the outer generator proceed normally. If
  9292. // context.method was "next", forget context.arg since it has been
  9293. // "consumed" by the delegate iterator. If context.method was
  9294. // "return", allow the original .return call to continue in the
  9295. // outer generator.
  9296. if (context.method !== "return") {
  9297. context.method = "next";
  9298. context.arg = undefined;
  9299. }
  9300. } else {
  9301. // Re-yield the result returned by the delegate method.
  9302. return info;
  9303. }
  9304. // The delegate iterator is finished, so forget it and continue with
  9305. // the outer generator.
  9306. context.delegate = null;
  9307. return ContinueSentinel;
  9308. }
  9309. // Define Generator.prototype.{next,throw,return} in terms of the
  9310. // unified ._invoke helper method.
  9311. defineIteratorMethods(Gp);
  9312. Gp[toStringTagSymbol] = "Generator";
  9313. // A Generator should always return itself as the iterator object when the
  9314. // @@iterator function is called on it. Some browsers' implementations of the
  9315. // iterator prototype chain incorrectly implement this, causing the Generator
  9316. // object to not be returned from this call. This ensures that doesn't happen.
  9317. // See https://github.com/facebook/regenerator/issues/274 for more details.
  9318. Gp[iteratorSymbol] = function() {
  9319. return this;
  9320. };
  9321. Gp.toString = function() {
  9322. return "[object Generator]";
  9323. };
  9324. function pushTryEntry(locs) {
  9325. var entry = { tryLoc: locs[0] };
  9326. if (1 in locs) {
  9327. entry.catchLoc = locs[1];
  9328. }
  9329. if (2 in locs) {
  9330. entry.finallyLoc = locs[2];
  9331. entry.afterLoc = locs[3];
  9332. }
  9333. this.tryEntries.push(entry);
  9334. }
  9335. function resetTryEntry(entry) {
  9336. var record = entry.completion || {};
  9337. record.type = "normal";
  9338. delete record.arg;
  9339. entry.completion = record;
  9340. }
  9341. function Context(tryLocsList) {
  9342. // The root entry object (effectively a try statement without a catch
  9343. // or a finally block) gives us a place to store values thrown from
  9344. // locations where there is no enclosing try statement.
  9345. this.tryEntries = [{ tryLoc: "root" }];
  9346. tryLocsList.forEach(pushTryEntry, this);
  9347. this.reset(true);
  9348. }
  9349. runtime.keys = function(object) {
  9350. var keys = [];
  9351. for (var key in object) {
  9352. keys.push(key);
  9353. }
  9354. keys.reverse();
  9355. // Rather than returning an object with a next method, we keep
  9356. // things simple and return the next function itself.
  9357. return function next() {
  9358. while (keys.length) {
  9359. var key = keys.pop();
  9360. if (key in object) {
  9361. next.value = key;
  9362. next.done = false;
  9363. return next;
  9364. }
  9365. }
  9366. // To avoid creating an additional object, we just hang the .value
  9367. // and .done properties off the next function object itself. This
  9368. // also ensures that the minifier will not anonymize the function.
  9369. next.done = true;
  9370. return next;
  9371. };
  9372. };
  9373. function values(iterable) {
  9374. if (iterable) {
  9375. var iteratorMethod = iterable[iteratorSymbol];
  9376. if (iteratorMethod) {
  9377. return iteratorMethod.call(iterable);
  9378. }
  9379. if (typeof iterable.next === "function") {
  9380. return iterable;
  9381. }
  9382. if (!isNaN(iterable.length)) {
  9383. var i = -1, next = function next() {
  9384. while (++i < iterable.length) {
  9385. if (hasOwn.call(iterable, i)) {
  9386. next.value = iterable[i];
  9387. next.done = false;
  9388. return next;
  9389. }
  9390. }
  9391. next.value = undefined;
  9392. next.done = true;
  9393. return next;
  9394. };
  9395. return next.next = next;
  9396. }
  9397. }
  9398. // Return an iterator with no values.
  9399. return { next: doneResult };
  9400. }
  9401. runtime.values = values;
  9402. function doneResult() {
  9403. return { value: undefined, done: true };
  9404. }
  9405. Context.prototype = {
  9406. constructor: Context,
  9407. reset: function(skipTempReset) {
  9408. this.prev = 0;
  9409. this.next = 0;
  9410. // Resetting context._sent for legacy support of Babel's
  9411. // function.sent implementation.
  9412. this.sent = this._sent = undefined;
  9413. this.done = false;
  9414. this.delegate = null;
  9415. this.method = "next";
  9416. this.arg = undefined;
  9417. this.tryEntries.forEach(resetTryEntry);
  9418. if (!skipTempReset) {
  9419. for (var name in this) {
  9420. // Not sure about the optimal order of these conditions:
  9421. if (name.charAt(0) === "t" &&
  9422. hasOwn.call(this, name) &&
  9423. !isNaN(+name.slice(1))) {
  9424. this[name] = undefined;
  9425. }
  9426. }
  9427. }
  9428. },
  9429. stop: function() {
  9430. this.done = true;
  9431. var rootEntry = this.tryEntries[0];
  9432. var rootRecord = rootEntry.completion;
  9433. if (rootRecord.type === "throw") {
  9434. throw rootRecord.arg;
  9435. }
  9436. return this.rval;
  9437. },
  9438. dispatchException: function(exception) {
  9439. if (this.done) {
  9440. throw exception;
  9441. }
  9442. var context = this;
  9443. function handle(loc, caught) {
  9444. record.type = "throw";
  9445. record.arg = exception;
  9446. context.next = loc;
  9447. if (caught) {
  9448. // If the dispatched exception was caught by a catch block,
  9449. // then let that catch block handle the exception normally.
  9450. context.method = "next";
  9451. context.arg = undefined;
  9452. }
  9453. return !! caught;
  9454. }
  9455. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9456. var entry = this.tryEntries[i];
  9457. var record = entry.completion;
  9458. if (entry.tryLoc === "root") {
  9459. // Exception thrown outside of any try block that could handle
  9460. // it, so set the completion value of the entire function to
  9461. // throw the exception.
  9462. return handle("end");
  9463. }
  9464. if (entry.tryLoc <= this.prev) {
  9465. var hasCatch = hasOwn.call(entry, "catchLoc");
  9466. var hasFinally = hasOwn.call(entry, "finallyLoc");
  9467. if (hasCatch && hasFinally) {
  9468. if (this.prev < entry.catchLoc) {
  9469. return handle(entry.catchLoc, true);
  9470. } else if (this.prev < entry.finallyLoc) {
  9471. return handle(entry.finallyLoc);
  9472. }
  9473. } else if (hasCatch) {
  9474. if (this.prev < entry.catchLoc) {
  9475. return handle(entry.catchLoc, true);
  9476. }
  9477. } else if (hasFinally) {
  9478. if (this.prev < entry.finallyLoc) {
  9479. return handle(entry.finallyLoc);
  9480. }
  9481. } else {
  9482. throw new Error("try statement without catch or finally");
  9483. }
  9484. }
  9485. }
  9486. },
  9487. abrupt: function(type, arg) {
  9488. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9489. var entry = this.tryEntries[i];
  9490. if (entry.tryLoc <= this.prev &&
  9491. hasOwn.call(entry, "finallyLoc") &&
  9492. this.prev < entry.finallyLoc) {
  9493. var finallyEntry = entry;
  9494. break;
  9495. }
  9496. }
  9497. if (finallyEntry &&
  9498. (type === "break" ||
  9499. type === "continue") &&
  9500. finallyEntry.tryLoc <= arg &&
  9501. arg <= finallyEntry.finallyLoc) {
  9502. // Ignore the finally entry if control is not jumping to a
  9503. // location outside the try/catch block.
  9504. finallyEntry = null;
  9505. }
  9506. var record = finallyEntry ? finallyEntry.completion : {};
  9507. record.type = type;
  9508. record.arg = arg;
  9509. if (finallyEntry) {
  9510. this.method = "next";
  9511. this.next = finallyEntry.finallyLoc;
  9512. return ContinueSentinel;
  9513. }
  9514. return this.complete(record);
  9515. },
  9516. complete: function(record, afterLoc) {
  9517. if (record.type === "throw") {
  9518. throw record.arg;
  9519. }
  9520. if (record.type === "break" ||
  9521. record.type === "continue") {
  9522. this.next = record.arg;
  9523. } else if (record.type === "return") {
  9524. this.rval = this.arg = record.arg;
  9525. this.method = "return";
  9526. this.next = "end";
  9527. } else if (record.type === "normal" && afterLoc) {
  9528. this.next = afterLoc;
  9529. }
  9530. return ContinueSentinel;
  9531. },
  9532. finish: function(finallyLoc) {
  9533. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9534. var entry = this.tryEntries[i];
  9535. if (entry.finallyLoc === finallyLoc) {
  9536. this.complete(entry.completion, entry.afterLoc);
  9537. resetTryEntry(entry);
  9538. return ContinueSentinel;
  9539. }
  9540. }
  9541. },
  9542. "catch": function(tryLoc) {
  9543. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9544. var entry = this.tryEntries[i];
  9545. if (entry.tryLoc === tryLoc) {
  9546. var record = entry.completion;
  9547. if (record.type === "throw") {
  9548. var thrown = record.arg;
  9549. resetTryEntry(entry);
  9550. }
  9551. return thrown;
  9552. }
  9553. }
  9554. // The context.catch method must only be called with a location
  9555. // argument that corresponds to a known catch block.
  9556. throw new Error("illegal catch attempt");
  9557. },
  9558. delegateYield: function(iterable, resultName, nextLoc) {
  9559. this.delegate = {
  9560. iterator: values(iterable),
  9561. resultName: resultName,
  9562. nextLoc: nextLoc
  9563. };
  9564. if (this.method === "next") {
  9565. // Deliberately forget the last sent value so that we don't
  9566. // accidentally pass it on to the delegate.
  9567. this.arg = undefined;
  9568. }
  9569. return ContinueSentinel;
  9570. }
  9571. };
  9572. })(
  9573. // In sloppy mode, unbound `this` refers to the global object, fallback to
  9574. // Function constructor if we're in global strict mode. That is sadly a form
  9575. // of indirect eval which violates Content Security Policy.
  9576. (function() {
  9577. return this || (typeof self === "object" && self);
  9578. })() || Function("return this")()
  9579. );
  9580. /***/ }),
  9581. /* 23 */
  9582. /*!**************************************************************************!*\
  9583. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/timeFormat.js ***!
  9584. \**************************************************************************/
  9585. /*! no static exports found */
  9586. /***/ (function(module, exports, __webpack_require__) {
  9587. "use strict";
  9588. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
  9589. // 所以这里做一个兼容polyfill的兼容处理
  9590. if (!String.prototype.padStart) {
  9591. // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
  9592. String.prototype.padStart = function (maxLength) {var fillString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
  9593. if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError(
  9594. 'fillString must be String');
  9595. var str = this;
  9596. // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
  9597. if (str.length >= maxLength) return String(str);
  9598. var fillLength = maxLength - str.length,
  9599. times = Math.ceil(fillLength / fillString.length);
  9600. while (times >>= 1) {
  9601. fillString += fillString;
  9602. if (times === 1) {
  9603. fillString += fillString;
  9604. }
  9605. }
  9606. return fillString.slice(0, fillLength) + str;
  9607. };
  9608. }
  9609. // 其他更多是格式化有如下:
  9610. // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
  9611. function timeFormat() {var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;var fmt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  9612. // 如果为null,则格式化当前时间
  9613. if (!dateTime) dateTime = Number(new Date());
  9614. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  9615. if (dateTime.toString().length == 10) dateTime *= 1000;
  9616. var date = new Date(dateTime);
  9617. var ret;
  9618. var opt = {
  9619. "y+": date.getFullYear().toString(), // 年
  9620. "m+": (date.getMonth() + 1).toString(), // 月
  9621. "d+": date.getDate().toString(), // 日
  9622. "h+": date.getHours().toString(), // 时
  9623. "M+": date.getMinutes().toString(), // 分
  9624. "s+": date.getSeconds().toString() // 秒
  9625. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  9626. };
  9627. for (var k in opt) {
  9628. ret = new RegExp("(" + k + ")").exec(fmt);
  9629. if (ret) {
  9630. fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
  9631. };
  9632. };
  9633. return fmt;
  9634. }var _default =
  9635. timeFormat;exports.default = _default;
  9636. /***/ }),
  9637. /* 24 */
  9638. /*!************************************************************************!*\
  9639. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/timeFrom.js ***!
  9640. \************************************************************************/
  9641. /*! no static exports found */
  9642. /***/ (function(module, exports, __webpack_require__) {
  9643. "use strict";
  9644. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ../../libs/function/timeFormat.js */ 23));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  9645. /**
  9646. * 时间戳转为多久之前
  9647. * @param String timestamp 时间戳
  9648. * @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
  9649. * 如果为布尔值false,无论什么时间,都返回多久以前的格式
  9650. */
  9651. function timeFrom() {var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  9652. // 如果为null,则格式化当前时间
  9653. if (!dateTime) dateTime = Number(new Date());
  9654. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  9655. if (dateTime.toString().length == 10) dateTime *= 1000;
  9656. var timestamp = +new Date(Number(dateTime));
  9657. var timer = (Number(new Date()) - timestamp) / 1000;
  9658. // 如果小于5分钟,则返回"刚刚",其他以此类推
  9659. var tips = '';
  9660. switch (true) {
  9661. case timer < 300:
  9662. tips = '刚刚';
  9663. break;
  9664. case timer >= 300 && timer < 3600:
  9665. tips = parseInt(timer / 60) + '分钟前';
  9666. break;
  9667. case timer >= 3600 && timer < 86400:
  9668. tips = parseInt(timer / 3600) + '小时前';
  9669. break;
  9670. case timer >= 86400 && timer < 2592000:
  9671. tips = parseInt(timer / 86400) + '天前';
  9672. break;
  9673. default:
  9674. // 如果format为false,则无论什么时间戳,都显示xx之前
  9675. if (format === false) {
  9676. if (timer >= 2592000 && timer < 365 * 86400) {
  9677. tips = parseInt(timer / (86400 * 30)) + '个月前';
  9678. } else {
  9679. tips = parseInt(timer / (86400 * 365)) + '年前';
  9680. }
  9681. } else {
  9682. tips = (0, _timeFormat.default)(timestamp, format);
  9683. }}
  9684. return tips;
  9685. }var _default =
  9686. timeFrom;exports.default = _default;
  9687. /***/ }),
  9688. /* 25 */
  9689. /*!*****************************************************************************!*\
  9690. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/colorGradient.js ***!
  9691. \*****************************************************************************/
  9692. /*! no static exports found */
  9693. /***/ (function(module, exports, __webpack_require__) {
  9694. "use strict";
  9695. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  9696. * 求两个颜色之间的渐变值
  9697. * @param {string} startColor 开始的颜色
  9698. * @param {string} endColor 结束的颜色
  9699. * @param {number} step 颜色等分的份额
  9700. * */
  9701. function colorGradient() {var startColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rgb(0, 0, 0)';var endColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rgb(255, 255, 255)';var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
  9702. var startRGB = hexToRgb(startColor, false); //转换为rgb数组模式
  9703. var startR = startRGB[0];
  9704. var startG = startRGB[1];
  9705. var startB = startRGB[2];
  9706. var endRGB = hexToRgb(endColor, false);
  9707. var endR = endRGB[0];
  9708. var endG = endRGB[1];
  9709. var endB = endRGB[2];
  9710. var sR = (endR - startR) / step; //总差值
  9711. var sG = (endG - startG) / step;
  9712. var sB = (endB - startB) / step;
  9713. var colorArr = [];
  9714. for (var i = 0; i < step; i++) {
  9715. //计算每一步的hex值
  9716. var hex = rgbToHex('rgb(' + Math.round(sR * i + startR) + ',' + Math.round(sG * i + startG) + ',' + Math.round(sB *
  9717. i + startB) + ')');
  9718. colorArr.push(hex);
  9719. }
  9720. return colorArr;
  9721. }
  9722. // 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式)
  9723. function hexToRgb(sColor) {var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  9724. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  9725. sColor = sColor.toLowerCase();
  9726. if (sColor && reg.test(sColor)) {
  9727. if (sColor.length === 4) {
  9728. var sColorNew = "#";
  9729. for (var i = 1; i < 4; i += 1) {
  9730. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  9731. }
  9732. sColor = sColorNew;
  9733. }
  9734. //处理六位的颜色值
  9735. var sColorChange = [];
  9736. for (var _i = 1; _i < 7; _i += 2) {
  9737. sColorChange.push(parseInt("0x" + sColor.slice(_i, _i + 2)));
  9738. }
  9739. if (!str) {
  9740. return sColorChange;
  9741. } else {
  9742. return "rgb(".concat(sColorChange[0], ",").concat(sColorChange[1], ",").concat(sColorChange[2], ")");
  9743. }
  9744. } else if (/^(rgb|RGB)/.test(sColor)) {
  9745. var arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  9746. return arr.map(function (val) {return Number(val);});
  9747. } else {
  9748. return sColor;
  9749. }
  9750. };
  9751. // 将rgb表示方式转换为hex表示方式
  9752. function rgbToHex(rgb) {
  9753. var _this = rgb;
  9754. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  9755. if (/^(rgb|RGB)/.test(_this)) {
  9756. var aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  9757. var strHex = "#";
  9758. for (var i = 0; i < aColor.length; i++) {
  9759. var hex = Number(aColor[i]).toString(16);
  9760. hex = String(hex).length == 1 ? 0 + '' + hex : hex; // 保证每个rgb的值为2位
  9761. if (hex === "0") {
  9762. hex += hex;
  9763. }
  9764. strHex += hex;
  9765. }
  9766. if (strHex.length !== 7) {
  9767. strHex = _this;
  9768. }
  9769. return strHex;
  9770. } else if (reg.test(_this)) {
  9771. var aNum = _this.replace(/#/, "").split("");
  9772. if (aNum.length === 6) {
  9773. return _this;
  9774. } else if (aNum.length === 3) {
  9775. var numHex = "#";
  9776. for (var _i2 = 0; _i2 < aNum.length; _i2 += 1) {
  9777. numHex += aNum[_i2] + aNum[_i2];
  9778. }
  9779. return numHex;
  9780. }
  9781. } else {
  9782. return _this;
  9783. }
  9784. }
  9785. /**
  9786. * JS颜色十六进制转换为rgb或rgba,返回的格式为 rgba(255,255,255,0.5)字符串
  9787. * sHex为传入的十六进制的色值
  9788. * alpha为rgba的透明度
  9789. */
  9790. function colorToRgba(color) {var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.3;
  9791. color = rgbToHex(color);
  9792. // 十六进制颜色值的正则表达式
  9793. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  9794. /* 16进制颜色转为RGB格式 */
  9795. var sColor = color.toLowerCase();
  9796. if (sColor && reg.test(sColor)) {
  9797. if (sColor.length === 4) {
  9798. var sColorNew = '#';
  9799. for (var i = 1; i < 4; i += 1) {
  9800. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  9801. }
  9802. sColor = sColorNew;
  9803. }
  9804. // 处理六位的颜色值
  9805. var sColorChange = [];
  9806. for (var _i3 = 1; _i3 < 7; _i3 += 2) {
  9807. sColorChange.push(parseInt('0x' + sColor.slice(_i3, _i3 + 2)));
  9808. }
  9809. // return sColorChange.join(',')
  9810. return 'rgba(' + sColorChange.join(',') + ',' + alpha + ')';
  9811. } else
  9812. {
  9813. return sColor;
  9814. }
  9815. }var _default =
  9816. {
  9817. colorGradient: colorGradient,
  9818. hexToRgb: hexToRgb,
  9819. rgbToHex: rgbToHex,
  9820. colorToRgba: colorToRgba };exports.default = _default;
  9821. /***/ }),
  9822. /* 26 */
  9823. /*!********************************************************************!*\
  9824. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/guid.js ***!
  9825. \********************************************************************/
  9826. /*! no static exports found */
  9827. /***/ (function(module, exports, __webpack_require__) {
  9828. "use strict";
  9829. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  9830. * 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85
  9831. * 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier)
  9832. * 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题
  9833. * 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱
  9834. * v-for的时候,推荐使用后端返回的id而不是循环的index
  9835. * @param {Number} len uuid的长度
  9836. * @param {Boolean} firstU 将返回的首字母置为"u"
  9837. * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
  9838. */
  9839. function guid() {var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;var firstU = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var radix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  9840. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  9841. var uuid = [];
  9842. radix = radix || chars.length;
  9843. if (len) {
  9844. // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
  9845. for (var i = 0; i < len; i++) {uuid[i] = chars[0 | Math.random() * radix];}
  9846. } else {
  9847. var r;
  9848. // rfc4122标准要求返回的uuid中,某些位为固定的字符
  9849. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  9850. uuid[14] = '4';
  9851. for (var _i = 0; _i < 36; _i++) {
  9852. if (!uuid[_i]) {
  9853. r = 0 | Math.random() * 16;
  9854. uuid[_i] = chars[_i == 19 ? r & 0x3 | 0x8 : r];
  9855. }
  9856. }
  9857. }
  9858. // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
  9859. if (firstU) {
  9860. uuid.shift();
  9861. return 'u' + uuid.join('');
  9862. } else {
  9863. return uuid.join('');
  9864. }
  9865. }var _default =
  9866. guid;exports.default = _default;
  9867. /***/ }),
  9868. /* 27 */
  9869. /*!*********************************************************************!*\
  9870. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/color.js ***!
  9871. \*********************************************************************/
  9872. /*! no static exports found */
  9873. /***/ (function(module, exports, __webpack_require__) {
  9874. "use strict";
  9875. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
  9876. // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
  9877. var color = {
  9878. primary: "#2979ff",
  9879. primaryDark: "#2b85e4",
  9880. primaryDisabled: "#a0cfff",
  9881. primaryLight: "#ecf5ff",
  9882. bgColor: "#f3f4f6",
  9883. info: "#909399",
  9884. infoDark: "#82848a",
  9885. infoDisabled: "#c8c9cc",
  9886. infoLight: "#f4f4f5",
  9887. warning: "#ff9900",
  9888. warningDark: "#f29100",
  9889. warningDisabled: "#fcbd71",
  9890. warningLight: "#fdf6ec",
  9891. error: "#fa3534",
  9892. errorDark: "#dd6161",
  9893. errorDisabled: "#fab6b6",
  9894. errorLight: "#fef0f0",
  9895. success: "#19be6b",
  9896. successDark: "#18b566",
  9897. successDisabled: "#71d5a1",
  9898. successLight: "#dbf1e1",
  9899. mainColor: "#303133",
  9900. contentColor: "#606266",
  9901. tipsColor: "#909399",
  9902. lightColor: "#c0c4cc",
  9903. borderColor: "#e4e7ed" };var _default =
  9904. color;exports.default = _default;
  9905. /***/ }),
  9906. /* 28 */
  9907. /*!*************************************************************************!*\
  9908. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/type2icon.js ***!
  9909. \*************************************************************************/
  9910. /*! no static exports found */
  9911. /***/ (function(module, exports, __webpack_require__) {
  9912. "use strict";
  9913. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  9914. * 根据主题type值,获取对应的图标
  9915. * @param String type 主题名称,primary|info|error|warning|success
  9916. * @param String fill 是否使用fill填充实体的图标
  9917. */
  9918. function type2icon() {var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'success';var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  9919. // 如果非预置值,默认为success
  9920. if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success';
  9921. var iconName = '';
  9922. // 目前(2019-12-12),info和primary使用同一个图标
  9923. switch (type) {
  9924. case 'primary':
  9925. iconName = 'info-circle';
  9926. break;
  9927. case 'info':
  9928. iconName = 'info-circle';
  9929. break;
  9930. case 'error':
  9931. iconName = 'close-circle';
  9932. break;
  9933. case 'warning':
  9934. iconName = 'error-circle';
  9935. break;
  9936. case 'success':
  9937. iconName = 'checkmark-circle';
  9938. break;
  9939. default:
  9940. iconName = 'checkmark-circle';}
  9941. // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
  9942. if (fill) iconName += '-fill';
  9943. return iconName;
  9944. }var _default =
  9945. type2icon;exports.default = _default;
  9946. /***/ }),
  9947. /* 29 */
  9948. /*!***************************************************************************!*\
  9949. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/randomArray.js ***!
  9950. \***************************************************************************/
  9951. /*! no static exports found */
  9952. /***/ (function(module, exports, __webpack_require__) {
  9953. "use strict";
  9954. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 打乱数组
  9955. function randomArray() {var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  9956. // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
  9957. return array.sort(function () {return Math.random() - 0.5;});
  9958. }var _default =
  9959. randomArray;exports.default = _default;
  9960. /***/ }),
  9961. /* 30 */
  9962. /*!***********************************************************************!*\
  9963. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/addUnit.js ***!
  9964. \***********************************************************************/
  9965. /*! no static exports found */
  9966. /***/ (function(module, exports, __webpack_require__) {
  9967. "use strict";
  9968. Object.defineProperty(exports, "__esModule", { value: true });exports.default = addUnit;var _test = _interopRequireDefault(__webpack_require__(/*! ./test.js */ 17));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  9969. // 添加单位,如果有rpx,%,px等单位结尾或者值为auto,直接返回,否则加上rpx单位结尾
  9970. function addUnit() {var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'auto';var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rpx';
  9971. value = String(value);
  9972. // 用uView内置验证规则中的number判断是否为数值
  9973. return _test.default.number(value) ? "".concat(value).concat(unit) : value;
  9974. }
  9975. /***/ }),
  9976. /* 31 */
  9977. /*!**********************************************************************!*\
  9978. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/random.js ***!
  9979. \**********************************************************************/
  9980. /*! no static exports found */
  9981. /***/ (function(module, exports, __webpack_require__) {
  9982. "use strict";
  9983. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function random(min, max) {
  9984. if (min >= 0 && max > 0 && max >= min) {
  9985. var gab = max - min + 1;
  9986. return Math.floor(Math.random() * gab + min);
  9987. } else {
  9988. return 0;
  9989. }
  9990. }var _default =
  9991. random;exports.default = _default;
  9992. /***/ }),
  9993. /* 32 */
  9994. /*!********************************************************************!*\
  9995. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/trim.js ***!
  9996. \********************************************************************/
  9997. /*! no static exports found */
  9998. /***/ (function(module, exports, __webpack_require__) {
  9999. "use strict";
  10000. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function trim(str) {var pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'both';
  10001. if (pos == 'both') {
  10002. return str.replace(/^\s+|\s+$/g, "");
  10003. } else if (pos == "left") {
  10004. return str.replace(/^\s*/, '');
  10005. } else if (pos == 'right') {
  10006. return str.replace(/(\s*$)/g, "");
  10007. } else if (pos == 'all') {
  10008. return str.replace(/\s+/g, "");
  10009. } else {
  10010. return str;
  10011. }
  10012. }var _default =
  10013. trim;exports.default = _default;
  10014. /***/ }),
  10015. /* 33 */
  10016. /*!*********************************************************************!*\
  10017. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/toast.js ***!
  10018. \*********************************************************************/
  10019. /*! no static exports found */
  10020. /***/ (function(module, exports, __webpack_require__) {
  10021. "use strict";
  10022. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function toast(title) {var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1500;
  10023. uni.showToast({
  10024. title: title,
  10025. icon: 'none',
  10026. duration: duration });
  10027. }var _default =
  10028. toast;exports.default = _default;
  10029. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10030. /***/ }),
  10031. /* 34 */
  10032. /*!*************************************************************************!*\
  10033. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/getParent.js ***!
  10034. \*************************************************************************/
  10035. /*! no static exports found */
  10036. /***/ (function(module, exports, __webpack_require__) {
  10037. "use strict";
  10038. Object.defineProperty(exports, "__esModule", { value: true });exports.default = getParent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  10039. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  10040. function getParent(name, keys) {
  10041. var parent = this.$parent;
  10042. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  10043. while (parent) {
  10044. // 父组件
  10045. if (parent.$options.name !== name) {
  10046. // 如果组件的name不相等,继续上一级寻找
  10047. parent = parent.$parent;
  10048. } else {var _ret = function () {
  10049. var data = {};
  10050. // 判断keys是否数组,如果传过来的是一个数组,那么直接使用数组元素值当做键值去父组件寻找
  10051. if (Array.isArray(keys)) {
  10052. keys.map(function (val) {
  10053. data[val] = parent[val] ? parent[val] : '';
  10054. });
  10055. } else {
  10056. // 历遍传过来的对象参数
  10057. for (var i in keys) {
  10058. // 如果子组件有此值则用,无此值则用父组件的值
  10059. // 判断是否空数组,如果是,则用父组件的值,否则用子组件的值
  10060. if (Array.isArray(keys[i])) {
  10061. if (keys[i].length) {
  10062. data[i] = keys[i];
  10063. } else {
  10064. data[i] = parent[i];
  10065. }
  10066. } else if (keys[i].constructor === Object) {
  10067. // 判断是否对象,如果是对象,且有属性,那么使用子组件的值,否则使用父组件的值
  10068. if (Object.keys(keys[i]).length) {
  10069. data[i] = keys[i];
  10070. } else {
  10071. data[i] = parent[i];
  10072. }
  10073. } else {
  10074. // 只要子组件有传值,即使是false值,也是“传值”了,也需要覆盖父组件的同名参数
  10075. data[i] = keys[i] || keys[i] === false ? keys[i] : parent[i];
  10076. }
  10077. }
  10078. }
  10079. return { v: data };}();if (typeof _ret === "object") return _ret.v;
  10080. }
  10081. }
  10082. return {};
  10083. }
  10084. /***/ }),
  10085. /* 35 */
  10086. /*!***********************************************************************!*\
  10087. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/$parent.js ***!
  10088. \***********************************************************************/
  10089. /*! no static exports found */
  10090. /***/ (function(module, exports, __webpack_require__) {
  10091. "use strict";
  10092. Object.defineProperty(exports, "__esModule", { value: true });exports.default = $parent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  10093. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  10094. // 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
  10095. // 值(默认为undefined),就是查找最顶层的$parent
  10096. function $parent() {var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  10097. var parent = this.$parent;
  10098. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  10099. while (parent) {
  10100. // 父组件
  10101. if (parent.$options && parent.$options.name !== name) {
  10102. // 如果组件的name不相等,继续上一级寻找
  10103. parent = parent.$parent;
  10104. } else {
  10105. return parent;
  10106. }
  10107. }
  10108. return false;
  10109. }
  10110. /***/ }),
  10111. /* 36 */
  10112. /*!*******************************************************************!*\
  10113. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/sys.js ***!
  10114. \*******************************************************************/
  10115. /*! no static exports found */
  10116. /***/ (function(module, exports, __webpack_require__) {
  10117. "use strict";
  10118. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.os = os;exports.sys = sys;function os() {
  10119. return uni.getSystemInfoSync().platform;
  10120. };
  10121. function sys() {
  10122. return uni.getSystemInfoSync();
  10123. }
  10124. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10125. /***/ }),
  10126. /* 37 */
  10127. /*!************************************************************************!*\
  10128. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/debounce.js ***!
  10129. \************************************************************************/
  10130. /*! no static exports found */
  10131. /***/ (function(module, exports, __webpack_require__) {
  10132. "use strict";
  10133. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timeout = null;
  10134. /**
  10135. * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
  10136. *
  10137. * @param {Function} func 要执行的回调函数
  10138. * @param {Number} wait 延时的时间
  10139. * @param {Boolean} immediate 是否立即执行
  10140. * @return null
  10141. */
  10142. function debounce(func) {var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  10143. // 清除定时器
  10144. if (timeout !== null) clearTimeout(timeout);
  10145. // 立即执行,此类情况一般用不到
  10146. if (immediate) {
  10147. var callNow = !timeout;
  10148. timeout = setTimeout(function () {
  10149. timeout = null;
  10150. }, wait);
  10151. if (callNow) typeof func === 'function' && func();
  10152. } else {
  10153. // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
  10154. timeout = setTimeout(function () {
  10155. typeof func === 'function' && func();
  10156. }, wait);
  10157. }
  10158. }var _default =
  10159. debounce;exports.default = _default;
  10160. /***/ }),
  10161. /* 38 */
  10162. /*!************************************************************************!*\
  10163. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/throttle.js ***!
  10164. \************************************************************************/
  10165. /*! no static exports found */
  10166. /***/ (function(module, exports, __webpack_require__) {
  10167. "use strict";
  10168. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timeoutArr = [];
  10169. var flagArr = [];
  10170. /**
  10171. * 节流函数
  10172. * 节流原理:在一定时间内,只能触发一次
  10173. * @param {Function} fn 要执行的回调函数
  10174. * @param {Number} time 延时的时间
  10175. * @param {Boolean} isImmediate 是否立即执行
  10176. * @param {String} timeoutName 定时器ID
  10177. * @return null
  10178. */
  10179. function throttle(fn) {var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;var isImmediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;var timeoutName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "default";
  10180. if (!timeoutArr[timeoutName]) timeoutArr[timeoutName] = null;
  10181. if (isImmediate) {
  10182. if (!flagArr[timeoutName]) {
  10183. flagArr[timeoutName] = true;
  10184. // 如果是立即执行,则在time毫秒内开始时执行
  10185. if (typeof fn === 'function') fn();
  10186. timeoutArr[timeoutName] = setTimeout(function () {
  10187. flagArr[timeoutName] = false;
  10188. }, time);
  10189. }
  10190. } else {
  10191. if (!flagArr[timeoutName]) {
  10192. flagArr[timeoutName] = true;
  10193. // 如果是非立即执行,则在time毫秒内的结束处执行
  10194. timeoutArr[timeoutName] = setTimeout(function () {
  10195. flagArr[timeoutName] = false;
  10196. if (typeof fn === 'function') fn();
  10197. }, time);
  10198. }
  10199. }
  10200. };var _default =
  10201. throttle;exports.default = _default;
  10202. /***/ }),
  10203. /* 39 */
  10204. /*!********************************************************************!*\
  10205. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/config/config.js ***!
  10206. \********************************************************************/
  10207. /*! no static exports found */
  10208. /***/ (function(module, exports, __webpack_require__) {
  10209. "use strict";
  10210. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 第一版 1.10.1 版本发布于2021-11-18
  10211. var version = '1.10.1';var _default =
  10212. {
  10213. v: version,
  10214. version: version,
  10215. // 主题名称
  10216. type: [
  10217. 'primary',
  10218. 'success',
  10219. 'info',
  10220. 'error',
  10221. 'warning'] };exports.default = _default;
  10222. /***/ }),
  10223. /* 40 */
  10224. /*!********************************************************************!*\
  10225. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/config/zIndex.js ***!
  10226. \********************************************************************/
  10227. /*! no static exports found */
  10228. /***/ (function(module, exports, __webpack_require__) {
  10229. "use strict";
  10230. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // uniapp在H5中各API的z-index值如下:
  10231. /**
  10232. * actionsheet: 999
  10233. * modal: 999
  10234. * navigate: 998
  10235. * tabbar: 998
  10236. * toast: 999
  10237. */var _default =
  10238. {
  10239. toast: 10090,
  10240. noNetwork: 10080,
  10241. // popup包含popup,actionsheet,keyboard,picker的值
  10242. popup: 10075,
  10243. mask: 10070,
  10244. navbar: 980,
  10245. topTips: 975,
  10246. sticky: 970,
  10247. indexListSticky: 965 };exports.default = _default;
  10248. /***/ }),
  10249. /* 41 */
  10250. /*!***********************************!*\
  10251. !*** E:/fp/md/mdapp/api/index.js ***!
  10252. \***********************************/
  10253. /*! no static exports found */
  10254. /***/ (function(module, exports, __webpack_require__) {
  10255. "use strict";
  10256. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ 42));
  10257. var _estate = _interopRequireDefault(__webpack_require__(/*! ./estate */ 45));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _default =
  10258. {
  10259. base: _base.default,
  10260. estate: _estate.default };exports.default = _default;
  10261. /***/ }),
  10262. /* 42 */
  10263. /*!**********************************!*\
  10264. !*** E:/fp/md/mdapp/api/base.js ***!
  10265. \**********************************/
  10266. /*! no static exports found */
  10267. /***/ (function(module, exports, __webpack_require__) {
  10268. "use strict";
  10269. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _http = __webpack_require__(/*! @/utils/http */ 43);var _default =
  10270. {
  10271. apilogin: function apilogin(params) {// 登录
  10272. return (0, _http.request)('api/login', params, 'loading');
  10273. },
  10274. apiregister: function apiregister(params) {// 注册
  10275. return (0, _http.request)('api/register', params, 'loading');
  10276. },
  10277. apisendsms: function apisendsms(params) {// 发送短信
  10278. return (0, _http.request)('api/send/sms', params, 'loading');
  10279. },
  10280. apicaptcha: function apicaptcha(params) {// 验证码图片
  10281. return (0, _http.request)('api/captcha', params, 'loading');
  10282. },
  10283. apicheckcaptcha: function apicheckcaptcha(params) {// 检查手机号
  10284. return (0, _http.request)('api/check/captcha', params);
  10285. } };exports.default = _default;
  10286. /***/ }),
  10287. /* 43 */
  10288. /*!************************************!*\
  10289. !*** E:/fp/md/mdapp/utils/http.js ***!
  10290. \************************************/
  10291. /*! no static exports found */
  10292. /***/ (function(module, exports, __webpack_require__) {
  10293. "use strict";
  10294. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.request = request;var _utils = __webpack_require__(/*! @utils */ 44);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;}
  10295. var Http = function Http() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { data: {} };
  10296. return new Promise(function (resolve, reject) {
  10297. if (options.loadingStr === 'loading') {
  10298. uni.showLoading({
  10299. mask: true,
  10300. title: '加载中..' });
  10301. }
  10302. var token = uni.getStorageSync('MD_token') || '';
  10303. var header = {
  10304. 'Content-Type': 'application/json',
  10305. 'token': token
  10306. // 'Content-Type': 'application/x-www-form-urlencoded'
  10307. };
  10308. var params = _objectSpread({}, options.data);
  10309. if (uni.getStorageSync('APP_token')) params.token = uni.getStorageSync('APP_token');
  10310. for (var key in options.data) {
  10311. if (options.data[key] === undefined || options.data[key] === 'undefined') {
  10312. params[key] = '';
  10313. }
  10314. }
  10315. var url = uni.baseUrl + options.url;
  10316. // let url = options.url
  10317. if (options.queryData) {
  10318. var qStr = '';
  10319. for (var k in options.queryData) {
  10320. qStr += "".concat(k, "=").concat(options.queryData[k], "&");
  10321. }
  10322. qStr = qStr.substr(0, qStr.length - 1);
  10323. url += "?".concat(qStr);
  10324. }
  10325. uni.request({
  10326. url: url,
  10327. data: _objectSpread({},
  10328. params),
  10329. header: header,
  10330. method: options.method || 'POST',
  10331. complete: function complete(res) {
  10332. if (options.loadingStr === 'loading') {
  10333. uni.hideLoading();
  10334. }
  10335. },
  10336. success: function success(res) {var
  10337. cData = res.data;
  10338. var code = cData.errno;
  10339. switch (code) {
  10340. case 0:
  10341. return resolve((0, _utils.noEmpty)(cData.data) ? cData.data : cData);
  10342. break;
  10343. case 401:
  10344. case 404:
  10345. case 405:
  10346. uni.removeStorageSync('MD_userInfo');
  10347. uni.removeStorageSync('MD_token');
  10348. uni.navigateTo({
  10349. url: '/pages/user/login/login' });
  10350. break;
  10351. default:
  10352. uni.showModal({
  10353. title: '提示',
  10354. content: "".concat(cData.errmsg, "(").concat(code, ")") });
  10355. return reject(cData);}
  10356. // resolve()
  10357. },
  10358. fail: function fail(err) {
  10359. console.log(err);
  10360. reject(err);
  10361. } });
  10362. });
  10363. };
  10364. // export default Http
  10365. function request(url, data, loadingStr, queryData) {
  10366. return Http({
  10367. url: url,
  10368. data: data,
  10369. loadingStr: loadingStr,
  10370. queryData: queryData });
  10371. }
  10372. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10373. /***/ }),
  10374. /* 44 */
  10375. /*!*************************************!*\
  10376. !*** E:/fp/md/mdapp/utils/index.js ***!
  10377. \*************************************/
  10378. /*! no static exports found */
  10379. /***/ (function(module, exports, __webpack_require__) {
  10380. "use strict";
  10381. Object.defineProperty(exports, "__esModule", { value: true });exports.strTrim = strTrim;exports.numFormat3 = numFormat3;exports.arrToObj = arrToObj;exports.noEmpty = noEmpty;exports.comGetTime = comGetTime; /**
  10382. * @param {string} str
  10383. * @returns {string}
  10384. */
  10385. function strTrim(str) {
  10386. return str.replace(/(^\s*)|(\s*$)/g, '');
  10387. }
  10388. /**
  10389. * @param {Number} num
  10390. * @returns {string}
  10391. */
  10392. function numFormat3(num) {var dotNum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  10393. var numArr = Number(num).toFixed(dotNum).toString().split('.');
  10394. var arr = numArr[0].split('').reverse();
  10395. var res = [];
  10396. for (var i = 0; i < arr.length; i++) {
  10397. if (i % 3 === 0 && i !== 0) {
  10398. res.push(',');
  10399. }
  10400. res.push(arr[i]);
  10401. }
  10402. res.reverse();
  10403. if (numArr[1]) {
  10404. res = res.join('').concat('.' + numArr[1]);
  10405. } else {
  10406. res = res.join('');
  10407. }
  10408. // let res = num.toString().replace(/\d+/, function(n){
  10409. // return n.replace(/(\d)(?=(\d{3})+$)/g,function($1){
  10410. // return $1 + ","
  10411. // })
  10412. // })
  10413. // toLocaleString()
  10414. return res;
  10415. }
  10416. /**
  10417. * @param {Array} arr
  10418. * @returns {Object}
  10419. */
  10420. function arrToObj(arr) {
  10421. var obj = {};
  10422. if (Object.prototype.toString.call(arr) === '[object Array]') {
  10423. if (arr.length > 0) {
  10424. arr.forEach(function (item) {
  10425. obj[item.val] = item.key;
  10426. });
  10427. }
  10428. }
  10429. return obj;
  10430. }
  10431. /**
  10432. * @param {any} val
  10433. * @returns {Boolean}
  10434. */
  10435. function noEmpty(val) {
  10436. if (val === null || val === undefined || val === '') {
  10437. return false;
  10438. } else {
  10439. return true;
  10440. }
  10441. }
  10442. /**
  10443. * @param {Number} date
  10444. * @param {Boolean} onlyDate
  10445. * @returns {String}
  10446. * function time(time = +new Date()) {
  10447. var date = new Date(time + 8 * 3600 * 1000); // 增加8小时
  10448. return date.toJSON().substr(0, 19).replace('T', ' ');
  10449. }
  10450. */
  10451. function comGetTime() {var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();var onlyDate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  10452. var year = date.getFullYear();
  10453. var month = date.getMonth() + 1;
  10454. month = month > 9 ? month : '0' + month;
  10455. var day = date.getDate();
  10456. day = day > 9 ? day : '0' + day;
  10457. var hour = date.getHours();
  10458. hour = hour > 9 ? hour : '0' + hour;
  10459. var minute = date.getMinutes();
  10460. minute = minute > 9 ? minute : '0' + minute;
  10461. var second = date.getSeconds();
  10462. second = second > 9 ? second : '0' + second;
  10463. var milli = date.getMilliseconds();
  10464. milli = milli > 100 ? milli : milli > 10 ? '0' + milli : '00' + milli;
  10465. return onlyDate ? "".concat(year, "-").concat(month, "-").concat(day) : "".concat(year).concat(month).concat(day).concat(hour).concat(minute).concat(second).concat(milli);
  10466. }
  10467. /***/ }),
  10468. /* 45 */
  10469. /*!************************************!*\
  10470. !*** E:/fp/md/mdapp/api/estate.js ***!
  10471. \************************************/
  10472. /*! no static exports found */
  10473. /***/ (function(module, exports, __webpack_require__) {
  10474. "use strict";
  10475. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _http = __webpack_require__(/*! @/utils/http */ 43);var _default =
  10476. {
  10477. apiestatelist: function apiestatelist(params) {// 楼盘列表
  10478. return (0, _http.request)('api/estate/list', params, 'loading');
  10479. },
  10480. apireportadd: function apireportadd(params) {// 报备 - 添加报备
  10481. return (0, _http.request)('api/report/add', params, 'loading');
  10482. },
  10483. apireportlist: function apireportlist(params) {// 报备 - 报备列表
  10484. return (0, _http.request)('api/report/list', params, 'loading');
  10485. },
  10486. apireportdetail: function apireportdetail(params) {// 报备 - 报备详情
  10487. return (0, _http.request)('api/report/detail', params, 'loading');
  10488. } };exports.default = _default;
  10489. /***/ }),
  10490. /* 46 */
  10491. /*!************************************!*\
  10492. !*** E:/fp/md/mdapp/utils/tool.js ***!
  10493. \************************************/
  10494. /*! no static exports found */
  10495. /***/ (function(module, exports, __webpack_require__) {
  10496. "use strict";
  10497. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.getRandomNum = exports.confirmMsgFn = exports.msgBase = void 0;var getRandomNum = function getRandomNum(len, radix) {
  10498. // getRandomNum(24, 16)
  10499. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  10500. var uuid = [];
  10501. radix = radix || chars.length;
  10502. if (len) {
  10503. // Compact form
  10504. for (var i = 0; i < len; i++) {uuid[i] = chars[0 | Math.random() * radix];}
  10505. } else {
  10506. // rfc4122, version 4 form
  10507. var r;
  10508. // rfc4122 requires these characters
  10509. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  10510. uuid[14] = '4';
  10511. // Fill in random data.  At i==19 set the high bits of clock sequence as
  10512. // per rfc4122, sec. 4.1.5
  10513. for (var _i = 0; _i < 36; _i++) {
  10514. if (!uuid[_i]) {
  10515. r = 0 | Math.random() * 16;
  10516. uuid[_i] = chars[_i === 19 ? r & 0x3 | 0x8 : r];
  10517. }
  10518. }
  10519. }
  10520. return uuid.join('') + new Date().getTime();
  10521. };exports.getRandomNum = getRandomNum;
  10522. var msgBase = function msgBase(msgText, bc) {
  10523. uni.showToast({
  10524. title: msgText,
  10525. icon: 'none',
  10526. duration: 2000 }).
  10527. then(function () {
  10528. if (bc) bc();
  10529. });
  10530. };exports.msgBase = msgBase;
  10531. var confirmMsgFn = function confirmMsgFn(msgText, successBc, errorBc) {var title = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '提示';
  10532. uni.showModal({
  10533. title: title,
  10534. content: msgText,
  10535. success: function success(res) {
  10536. if (res.confirm) {
  10537. if (successBc) successBc();
  10538. } else if (res.cancel) {
  10539. if (errorBc) errorBc();
  10540. }
  10541. } });
  10542. };exports.confirmMsgFn = confirmMsgFn;
  10543. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10544. /***/ }),
  10545. /* 47 */,
  10546. /* 48 */,
  10547. /* 49 */,
  10548. /* 50 */,
  10549. /* 51 */,
  10550. /* 52 */,
  10551. /* 53 */,
  10552. /* 54 */,
  10553. /* 55 */,
  10554. /* 56 */,
  10555. /* 57 */,
  10556. /* 58 */,
  10557. /* 59 */,
  10558. /* 60 */,
  10559. /* 61 */,
  10560. /* 62 */,
  10561. /* 63 */,
  10562. /* 64 */,
  10563. /* 65 */,
  10564. /* 66 */,
  10565. /* 67 */,
  10566. /* 68 */,
  10567. /* 69 */,
  10568. /* 70 */,
  10569. /* 71 */,
  10570. /* 72 */,
  10571. /* 73 */,
  10572. /* 74 */,
  10573. /* 75 */,
  10574. /* 76 */,
  10575. /* 77 */,
  10576. /* 78 */,
  10577. /* 79 */,
  10578. /* 80 */,
  10579. /* 81 */,
  10580. /* 82 */,
  10581. /* 83 */,
  10582. /* 84 */,
  10583. /* 85 */,
  10584. /* 86 */,
  10585. /* 87 */,
  10586. /* 88 */,
  10587. /* 89 */,
  10588. /* 90 */,
  10589. /* 91 */,
  10590. /* 92 */,
  10591. /* 93 */,
  10592. /* 94 */,
  10593. /* 95 */,
  10594. /* 96 */,
  10595. /* 97 */,
  10596. /* 98 */,
  10597. /* 99 */,
  10598. /* 100 */,
  10599. /* 101 */,
  10600. /* 102 */,
  10601. /* 103 */,
  10602. /* 104 */,
  10603. /* 105 */,
  10604. /* 106 */,
  10605. /* 107 */,
  10606. /* 108 */,
  10607. /* 109 */,
  10608. /* 110 */,
  10609. /* 111 */,
  10610. /* 112 */,
  10611. /* 113 */,
  10612. /* 114 */,
  10613. /* 115 */,
  10614. /* 116 */,
  10615. /* 117 */,
  10616. /* 118 */,
  10617. /* 119 */,
  10618. /* 120 */,
  10619. /* 121 */,
  10620. /* 122 */,
  10621. /* 123 */,
  10622. /* 124 */,
  10623. /* 125 */,
  10624. /* 126 */,
  10625. /* 127 */,
  10626. /* 128 */,
  10627. /* 129 */,
  10628. /* 130 */,
  10629. /* 131 */,
  10630. /* 132 */,
  10631. /* 133 */,
  10632. /* 134 */,
  10633. /* 135 */,
  10634. /* 136 */,
  10635. /* 137 */,
  10636. /* 138 */,
  10637. /* 139 */,
  10638. /* 140 */,
  10639. /* 141 */,
  10640. /* 142 */,
  10641. /* 143 */,
  10642. /* 144 */,
  10643. /* 145 */,
  10644. /* 146 */,
  10645. /* 147 */,
  10646. /* 148 */,
  10647. /* 149 */
  10648. /*!**************************************************************************************!*\
  10649. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/MpHtmlParser.js ***!
  10650. \**************************************************************************************/
  10651. /*! no static exports found */
  10652. /***/ (function(module, exports, __webpack_require__) {
  10653. "use strict";
  10654. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  10655. var _config = _interopRequireDefault(__webpack_require__(/*! ./config.js */ 150));
  10656. var _CssHandler = _interopRequireDefault(__webpack_require__(/*! ./CssHandler.js */ 151));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} /**
  10657. * html 解析器
  10658. * @tutorial https://github.com/jin-yufeng/Parser
  10659. * @version 20201029
  10660. * @author JinYufeng
  10661. * @listens MIT
  10662. */var blankChar = _config.default.blankChar;var windowWidth = uni.getSystemInfoSync().windowWidth;var emoji;function MpHtmlParser(data) {var _this = this;var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10663. this.attrs = {};
  10664. this.CssHandler = new _CssHandler.default(options.tagStyle, windowWidth);
  10665. this.data = data;
  10666. this.domain = options.domain;
  10667. this.DOM = [];
  10668. this.i = this.start = this.audioNum = this.imgNum = this.videoNum = 0;
  10669. options.prot = (this.domain || '').includes('://') ? this.domain.split('://')[0] : 'http';
  10670. this.options = options;
  10671. this.state = this.Text;
  10672. this.STACK = [];
  10673. // 工具函数
  10674. this.bubble = function () {
  10675. for (var i = _this.STACK.length, item; item = _this.STACK[--i];) {
  10676. if (_config.default.richOnlyTags[item.name]) return false;
  10677. item.c = 1;
  10678. }
  10679. return true;
  10680. };
  10681. this.decode = function (val, amp) {
  10682. var i = -1,
  10683. j,en;
  10684. while (1) {
  10685. if ((i = val.indexOf('&', i + 1)) == -1) break;
  10686. if ((j = val.indexOf(';', i + 2)) == -1) break;
  10687. if (val[i + 1] == '#') {
  10688. en = parseInt((val[i + 2] == 'x' ? '0' : '') + val.substring(i + 2, j));
  10689. if (!isNaN(en)) val = val.substr(0, i) + String.fromCharCode(en) + val.substr(j + 1);
  10690. } else {
  10691. en = val.substring(i + 1, j);
  10692. if (_config.default.entities[en] || en == amp)
  10693. val = val.substr(0, i) + (_config.default.entities[en] || '&') + val.substr(j + 1);
  10694. }
  10695. }
  10696. return val;
  10697. };
  10698. this.getUrl = function (url) {
  10699. if (url[0] == '/') {
  10700. if (url[1] == '/') url = _this.options.prot + ':' + url;else
  10701. if (_this.domain) url = _this.domain + url;
  10702. } else if (_this.domain && url.indexOf('data:') != 0 && !url.includes('://'))
  10703. url = _this.domain + '/' + url;
  10704. return url;
  10705. };
  10706. this.isClose = function () {return _this.data[_this.i] == '>' || _this.data[_this.i] == '/' && _this.data[_this.i + 1] == '>';};
  10707. this.section = function () {return _this.data.substring(_this.start, _this.i);};
  10708. this.parent = function () {return _this.STACK[_this.STACK.length - 1];};
  10709. this.siblings = function () {return _this.STACK.length ? _this.parent().children : _this.DOM;};
  10710. }
  10711. MpHtmlParser.prototype.parse = function () {
  10712. if (emoji) this.data = emoji.parseEmoji(this.data);
  10713. for (var c; c = this.data[this.i]; this.i++) {
  10714. this.state(c);}
  10715. if (this.state == this.Text) this.setText();
  10716. while (this.STACK.length) {this.popNode(this.STACK.pop());}
  10717. return this.DOM;
  10718. };
  10719. // 设置属性
  10720. MpHtmlParser.prototype.setAttr = function () {
  10721. var name = this.attrName.toLowerCase(),
  10722. val = this.attrVal;
  10723. if (_config.default.boolAttrs[name]) this.attrs[name] = 'T';else
  10724. if (val) {
  10725. if (name == 'src' || name == 'data-src' && !this.attrs.src) this.attrs.src = this.getUrl(this.decode(val, 'amp'));else
  10726. if (name == 'href' || name == 'style') this.attrs[name] = this.decode(val, 'amp');else
  10727. if (name.substr(0, 5) != 'data-') this.attrs[name] = val;
  10728. }
  10729. this.attrVal = '';
  10730. while (blankChar[this.data[this.i]]) {this.i++;}
  10731. if (this.isClose()) this.setNode();else
  10732. {
  10733. this.start = this.i;
  10734. this.state = this.AttrName;
  10735. }
  10736. };
  10737. // 设置文本节点
  10738. MpHtmlParser.prototype.setText = function () {
  10739. var back,text = this.section();
  10740. if (!text) return;
  10741. text = _config.default.onText && _config.default.onText(text, function () {return back = true;}) || text;
  10742. if (back) {
  10743. this.data = this.data.substr(0, this.start) + text + this.data.substr(this.i);
  10744. var j = this.start + text.length;
  10745. for (this.i = this.start; this.i < j; this.i++) {this.state(this.data[this.i]);}
  10746. return;
  10747. }
  10748. if (!this.pre) {
  10749. // 合并空白符
  10750. var flag,tmp = [];
  10751. for (var i = text.length, c; c = text[--i];) {
  10752. if (!blankChar[c]) {
  10753. tmp.unshift(c);
  10754. if (!flag) flag = 1;
  10755. } else {
  10756. if (tmp[0] != ' ') tmp.unshift(' ');
  10757. if (c == '\n' && flag == void 0) flag = 0;
  10758. }}
  10759. if (flag == 0) return;
  10760. text = tmp.join('');
  10761. }
  10762. this.siblings().push({
  10763. type: 'text',
  10764. text: this.decode(text) });
  10765. };
  10766. // 设置元素节点
  10767. MpHtmlParser.prototype.setNode = function () {
  10768. var node = {
  10769. name: this.tagName.toLowerCase(),
  10770. attrs: this.attrs },
  10771. close = _config.default.selfClosingTags[node.name];
  10772. if (this.options.nodes.length) node.type = 'node';
  10773. this.attrs = {};
  10774. if (!_config.default.ignoreTags[node.name]) {
  10775. // 处理属性
  10776. var attrs = node.attrs,
  10777. style = this.CssHandler.match(node.name, attrs, node) + (attrs.style || ''),
  10778. styleObj = {};
  10779. if (attrs.id) {
  10780. if (this.options.compress & 1) attrs.id = void 0;else
  10781. if (this.options.useAnchor) this.bubble();
  10782. }
  10783. if (this.options.compress & 2 && attrs.class) attrs.class = void 0;
  10784. switch (node.name) {
  10785. case 'a':
  10786. case 'ad':
  10787. this.bubble();
  10788. break;
  10789. case 'font':
  10790. if (attrs.color) {
  10791. styleObj['color'] = attrs.color;
  10792. attrs.color = void 0;
  10793. }
  10794. if (attrs.face) {
  10795. styleObj['font-family'] = attrs.face;
  10796. attrs.face = void 0;
  10797. }
  10798. if (attrs.size) {
  10799. var size = parseInt(attrs.size);
  10800. if (size < 1) size = 1;else
  10801. if (size > 7) size = 7;
  10802. var map = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'];
  10803. styleObj['font-size'] = map[size - 1];
  10804. attrs.size = void 0;
  10805. }
  10806. break;
  10807. case 'embed':
  10808. var src = node.attrs.src || '',
  10809. type = node.attrs.type || '';
  10810. if (type.includes('video') || src.includes('.mp4') || src.includes('.3gp') || src.includes('.m3u8'))
  10811. node.name = 'video';else
  10812. if (type.includes('audio') || src.includes('.m4a') || src.includes('.wav') || src.includes('.mp3') || src.includes(
  10813. '.aac'))
  10814. node.name = 'audio';else
  10815. break;
  10816. if (node.attrs.autostart)
  10817. node.attrs.autoplay = 'T';
  10818. node.attrs.controls = 'T';
  10819. case 'video':
  10820. case 'audio':
  10821. if (!attrs.id) attrs.id = node.name + ++this["".concat(node.name, "Num")];else
  10822. this["".concat(node.name, "Num")]++;
  10823. if (node.name == 'video') {
  10824. if (this.videoNum > 3)
  10825. node.lazyLoad = 1;
  10826. if (attrs.width) {
  10827. styleObj.width = parseFloat(attrs.width) + (attrs.width.includes('%') ? '%' : 'px');
  10828. attrs.width = void 0;
  10829. }
  10830. if (attrs.height) {
  10831. styleObj.height = parseFloat(attrs.height) + (attrs.height.includes('%') ? '%' : 'px');
  10832. attrs.height = void 0;
  10833. }
  10834. }
  10835. if (!attrs.controls && !attrs.autoplay) attrs.controls = 'T';
  10836. attrs.source = [];
  10837. if (attrs.src) {
  10838. attrs.source.push(attrs.src);
  10839. attrs.src = void 0;
  10840. }
  10841. this.bubble();
  10842. break;
  10843. case 'td':
  10844. case 'th':
  10845. if (attrs.colspan || attrs.rowspan)
  10846. for (var k = this.STACK.length, item; item = this.STACK[--k];) {
  10847. if (item.name == 'table') {
  10848. item.flag = 1;
  10849. break;
  10850. }}}
  10851. if (attrs.align) {
  10852. if (node.name == 'table') {
  10853. if (attrs.align == 'center') styleObj['margin-inline-start'] = styleObj['margin-inline-end'] = 'auto';else
  10854. styleObj['float'] = attrs.align;
  10855. } else styleObj['text-align'] = attrs.align;
  10856. attrs.align = void 0;
  10857. }
  10858. // 压缩 style
  10859. var styles = style.split(';');
  10860. style = '';
  10861. for (var i = 0, len = styles.length; i < len; i++) {
  10862. var info = styles[i].split(':');
  10863. if (info.length < 2) continue;
  10864. var _key = info[0].trim().toLowerCase(),
  10865. _value = info.slice(1).join(':').trim();
  10866. if (_value[0] == '-' || _value.includes('safe'))
  10867. style += ";".concat(_key, ":").concat(_value);else
  10868. if (!styleObj[_key] || _value.includes('import') || !styleObj[_key].includes('import'))
  10869. styleObj[_key] = _value;
  10870. }
  10871. if (node.name == 'img') {
  10872. if (attrs.src && !attrs.ignore) {
  10873. if (this.bubble())
  10874. attrs.i = (this.imgNum++).toString();else
  10875. attrs.ignore = 'T';
  10876. }
  10877. if (attrs.ignore) {
  10878. style += ';-webkit-touch-callout:none';
  10879. styleObj['max-width'] = '100%';
  10880. }
  10881. var width;
  10882. if (styleObj.width) width = styleObj.width;else
  10883. if (attrs.width) width = attrs.width.includes('%') ? attrs.width : parseFloat(attrs.width) + 'px';
  10884. if (width) {
  10885. styleObj.width = width;
  10886. attrs.width = '100%';
  10887. if (parseInt(width) > windowWidth) {
  10888. styleObj.height = '';
  10889. if (attrs.height) attrs.height = void 0;
  10890. }
  10891. }
  10892. if (styleObj.height) {
  10893. attrs.height = styleObj.height;
  10894. styleObj.height = '';
  10895. } else if (attrs.height && !attrs.height.includes('%'))
  10896. attrs.height = parseFloat(attrs.height) + 'px';
  10897. }
  10898. for (var key in styleObj) {
  10899. var value = styleObj[key];
  10900. if (!value) continue;
  10901. if (key.includes('flex') || key == 'order' || key == 'self-align') node.c = 1;
  10902. // 填充链接
  10903. if (value.includes('url')) {
  10904. var j = value.indexOf('(');
  10905. if (j++ != -1) {
  10906. while (value[j] == '"' || value[j] == "'" || blankChar[value[j]]) {j++;}
  10907. value = value.substr(0, j) + this.getUrl(value.substr(j));
  10908. }
  10909. }
  10910. // 转换 rpx
  10911. else if (value.includes('rpx'))
  10912. value = value.replace(/[0-9.]+\s*rpx/g, function ($) {return parseFloat($) * windowWidth / 750 + 'px';});else
  10913. if (key == 'white-space' && value.includes('pre') && !close)
  10914. this.pre = node.pre = true;
  10915. style += ";".concat(key, ":").concat(value);
  10916. }
  10917. style = style.substr(1);
  10918. if (style) attrs.style = style;
  10919. if (!close) {
  10920. node.children = [];
  10921. if (node.name == 'pre' && _config.default.highlight) {
  10922. this.remove(node);
  10923. this.pre = node.pre = true;
  10924. }
  10925. this.siblings().push(node);
  10926. this.STACK.push(node);
  10927. } else if (!_config.default.filter || _config.default.filter(node, this) != false)
  10928. this.siblings().push(node);
  10929. } else {
  10930. if (!close) this.remove(node);else
  10931. if (node.name == 'source') {
  10932. var parent = this.parent();
  10933. if (parent && (parent.name == 'video' || parent.name == 'audio') && node.attrs.src)
  10934. parent.attrs.source.push(node.attrs.src);
  10935. } else if (node.name == 'base' && !this.domain) this.domain = node.attrs.href;
  10936. }
  10937. if (this.data[this.i] == '/') this.i++;
  10938. this.start = this.i + 1;
  10939. this.state = this.Text;
  10940. };
  10941. // 移除标签
  10942. MpHtmlParser.prototype.remove = function (node) {var _this2 = this;
  10943. var name = node.name,
  10944. j = this.i;
  10945. // 处理 svg
  10946. var handleSvg = function handleSvg() {
  10947. var src = _this2.data.substring(j, _this2.i + 1);
  10948. node.attrs.xmlns = 'http://www.w3.org/2000/svg';
  10949. for (var key in node.attrs) {
  10950. if (key == 'viewbox') src = " viewBox=\"".concat(node.attrs.viewbox, "\"") + src;else
  10951. if (key != 'style') src = " ".concat(key, "=\"").concat(node.attrs[key], "\"") + src;
  10952. }
  10953. src = '<svg' + src;
  10954. var parent = _this2.parent();
  10955. if (node.attrs.width == '100%' && parent && (parent.attrs.style || '').includes('inline'))
  10956. parent.attrs.style = 'width:300px;max-width:100%;' + parent.attrs.style;
  10957. _this2.siblings().push({
  10958. name: 'img',
  10959. attrs: {
  10960. src: 'data:image/svg+xml;utf8,' + src.replace(/#/g, '%23'),
  10961. style: node.attrs.style,
  10962. ignore: 'T' } });
  10963. };
  10964. if (node.name == 'svg' && this.data[j] == '/') return handleSvg(this.i++);
  10965. while (1) {
  10966. if ((this.i = this.data.indexOf('</', this.i + 1)) == -1) {
  10967. if (name == 'pre' || name == 'svg') this.i = j;else
  10968. this.i = this.data.length;
  10969. return;
  10970. }
  10971. this.start = this.i += 2;
  10972. while (!blankChar[this.data[this.i]] && !this.isClose()) {this.i++;}
  10973. if (this.section().toLowerCase() == name) {
  10974. // 代码块高亮
  10975. if (name == 'pre') {
  10976. this.data = this.data.substr(0, j + 1) + _config.default.highlight(this.data.substring(j + 1, this.i - 5), node.attrs) + this.data.
  10977. substr(this.i - 5);
  10978. return this.i = j;
  10979. } else if (name == 'style')
  10980. this.CssHandler.getStyle(this.data.substring(j + 1, this.i - 7));else
  10981. if (name == 'title')
  10982. this.DOM.title = this.data.substring(j + 1, this.i - 7);
  10983. if ((this.i = this.data.indexOf('>', this.i)) == -1) this.i = this.data.length;
  10984. if (name == 'svg') handleSvg();
  10985. return;
  10986. }
  10987. }
  10988. };
  10989. // 节点出栈处理
  10990. MpHtmlParser.prototype.popNode = function (node) {
  10991. // 空白符处理
  10992. if (node.pre) {
  10993. node.pre = this.pre = void 0;
  10994. for (var i = this.STACK.length; i--;) {
  10995. if (this.STACK[i].pre)
  10996. this.pre = true;}
  10997. }
  10998. var siblings = this.siblings(),
  10999. len = siblings.length,
  11000. childs = node.children;
  11001. if (node.name == 'head' || _config.default.filter && _config.default.filter(node, this) == false)
  11002. return siblings.pop();
  11003. var attrs = node.attrs;
  11004. // 替换一些标签名
  11005. if (_config.default.blockTags[node.name]) node.name = 'div';else
  11006. if (!_config.default.trustTags[node.name]) node.name = 'span';
  11007. // 处理列表
  11008. if (node.c && (node.name == 'ul' || node.name == 'ol')) {
  11009. if ((node.attrs.style || '').includes('list-style:none')) {
  11010. for (var _i = 0, child; child = childs[_i++];) {
  11011. if (child.name == 'li')
  11012. child.name = 'div';}
  11013. } else if (node.name == 'ul') {
  11014. var floor = 1;
  11015. for (var _i2 = this.STACK.length; _i2--;) {
  11016. if (this.STACK[_i2].name == 'ul') floor++;}
  11017. if (floor != 1)
  11018. for (var _i3 = childs.length; _i3--;) {
  11019. childs[_i3].floor = floor;}
  11020. } else {
  11021. for (var _i4 = 0, num = 1, _child; _child = childs[_i4++];) {
  11022. if (_child.name == 'li') {
  11023. _child.type = 'ol';
  11024. _child.num = function (num, type) {
  11025. if (type == 'a') return String.fromCharCode(97 + (num - 1) % 26);
  11026. if (type == 'A') return String.fromCharCode(65 + (num - 1) % 26);
  11027. if (type == 'i' || type == 'I') {
  11028. num = (num - 1) % 99 + 1;
  11029. var one = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'],
  11030. ten = ['X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'],
  11031. res = (ten[Math.floor(num / 10) - 1] || '') + (one[num % 10 - 1] || '');
  11032. if (type == 'i') return res.toLowerCase();
  11033. return res;
  11034. }
  11035. return num;
  11036. }(num++, attrs.type) + '.';
  11037. }}
  11038. }
  11039. }
  11040. // 处理表格
  11041. if (node.name == 'table') {
  11042. var padding = parseFloat(attrs.cellpadding),
  11043. spacing = parseFloat(attrs.cellspacing),
  11044. border = parseFloat(attrs.border);
  11045. if (node.c) {
  11046. if (isNaN(padding)) padding = 2;
  11047. if (isNaN(spacing)) spacing = 2;
  11048. }
  11049. if (border) attrs.style = "border:".concat(border, "px solid gray;").concat(attrs.style || '');
  11050. if (node.flag && node.c) {
  11051. // 有 colspan 或 rowspan 且含有链接的表格转为 grid 布局实现
  11052. attrs.style = "".concat(attrs.style || '', ";").concat(spacing ? ";grid-gap:".concat(spacing, "px") : ';border-left:0;border-top:0');
  11053. var row = 1,
  11054. col = 1,
  11055. colNum,
  11056. trs = [],
  11057. children = [],
  11058. map = {};
  11059. (function f(ns) {
  11060. for (var i = 0; i < ns.length; i++) {
  11061. if (ns[i].name == 'tr') trs.push(ns[i]);else
  11062. f(ns[i].children || []);
  11063. }
  11064. })(node.children);
  11065. for (var _i5 = 0; _i5 < trs.length; _i5++) {
  11066. for (var j = 0, td; td = trs[_i5].children[j]; j++) {
  11067. if (td.name == 'td' || td.name == 'th') {
  11068. while (map[row + '.' + col]) {col++;}
  11069. var cell = {
  11070. name: 'div',
  11071. c: 1,
  11072. attrs: {
  11073. style: (td.attrs.style || '') + (border ? ";border:".concat(border, "px solid gray") + (spacing ? '' :
  11074. ';border-right:0;border-bottom:0') : '') + (padding ? ";padding:".concat(padding, "px") : '') },
  11075. children: td.children };
  11076. if (td.attrs.colspan) {
  11077. cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + parseInt(td.attrs.colspan));
  11078. if (!td.attrs.rowspan) cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + 1);
  11079. col += parseInt(td.attrs.colspan) - 1;
  11080. }
  11081. if (td.attrs.rowspan) {
  11082. cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + parseInt(td.attrs.rowspan));
  11083. if (!td.attrs.colspan) cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + 1);
  11084. for (var k = 1; k < td.attrs.rowspan; k++) {map[row + k + '.' + col] = 1;}
  11085. }
  11086. children.push(cell);
  11087. col++;
  11088. }
  11089. }
  11090. if (!colNum) {
  11091. colNum = col - 1;
  11092. attrs.style += ";grid-template-columns:repeat(".concat(colNum, ",auto)");
  11093. }
  11094. col = 1;
  11095. row++;
  11096. }
  11097. node.children = children;
  11098. } else {
  11099. attrs.style = "border-spacing:".concat(spacing, "px;").concat(attrs.style || '');
  11100. if (border || padding)
  11101. (function f(ns) {
  11102. for (var i = 0, n; n = ns[i]; i++) {
  11103. if (n.name == 'th' || n.name == 'td') {
  11104. if (border) n.attrs.style = "border:".concat(border, "px solid gray;").concat(n.attrs.style || '');
  11105. if (padding) n.attrs.style = "padding:".concat(padding, "px;").concat(n.attrs.style || '');
  11106. } else f(n.children || []);
  11107. }
  11108. })(childs);
  11109. }
  11110. if (this.options.autoscroll) {
  11111. var table = Object.assign({}, node);
  11112. node.name = 'div';
  11113. node.attrs = {
  11114. style: 'overflow:scroll' };
  11115. node.children = [table];
  11116. }
  11117. }
  11118. this.CssHandler.pop && this.CssHandler.pop(node);
  11119. // 自动压缩
  11120. if (node.name == 'div' && !Object.keys(attrs).length && childs.length == 1 && childs[0].name == 'div')
  11121. siblings[len - 1] = childs[0];
  11122. };
  11123. // 状态机
  11124. MpHtmlParser.prototype.Text = function (c) {
  11125. if (c == '<') {
  11126. var next = this.data[this.i + 1],
  11127. isLetter = function isLetter(c) {return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';};
  11128. if (isLetter(next)) {
  11129. this.setText();
  11130. this.start = this.i + 1;
  11131. this.state = this.TagName;
  11132. } else if (next == '/') {
  11133. this.setText();
  11134. if (isLetter(this.data[++this.i + 1])) {
  11135. this.start = this.i + 1;
  11136. this.state = this.EndTag;
  11137. } else this.Comment();
  11138. } else if (next == '!' || next == '?') {
  11139. this.setText();
  11140. this.Comment();
  11141. }
  11142. }
  11143. };
  11144. MpHtmlParser.prototype.Comment = function () {
  11145. var key;
  11146. if (this.data.substring(this.i + 2, this.i + 4) == '--') key = '-->';else
  11147. if (this.data.substring(this.i + 2, this.i + 9) == '[CDATA[') key = ']]>';else
  11148. key = '>';
  11149. if ((this.i = this.data.indexOf(key, this.i + 2)) == -1) this.i = this.data.length;else
  11150. this.i += key.length - 1;
  11151. this.start = this.i + 1;
  11152. this.state = this.Text;
  11153. };
  11154. MpHtmlParser.prototype.TagName = function (c) {
  11155. if (blankChar[c]) {
  11156. this.tagName = this.section();
  11157. while (blankChar[this.data[this.i]]) {this.i++;}
  11158. if (this.isClose()) this.setNode();else
  11159. {
  11160. this.start = this.i;
  11161. this.state = this.AttrName;
  11162. }
  11163. } else if (this.isClose()) {
  11164. this.tagName = this.section();
  11165. this.setNode();
  11166. }
  11167. };
  11168. MpHtmlParser.prototype.AttrName = function (c) {
  11169. if (c == '=' || blankChar[c] || this.isClose()) {
  11170. this.attrName = this.section();
  11171. if (blankChar[c])
  11172. while (blankChar[this.data[++this.i]]) {;}
  11173. if (this.data[this.i] == '=') {
  11174. while (blankChar[this.data[++this.i]]) {;}
  11175. this.start = this.i--;
  11176. this.state = this.AttrValue;
  11177. } else this.setAttr();
  11178. }
  11179. };
  11180. MpHtmlParser.prototype.AttrValue = function (c) {
  11181. if (c == '"' || c == "'") {
  11182. this.start++;
  11183. if ((this.i = this.data.indexOf(c, this.i + 1)) == -1) return this.i = this.data.length;
  11184. this.attrVal = this.section();
  11185. this.i++;
  11186. } else {
  11187. for (; !blankChar[this.data[this.i]] && !this.isClose(); this.i++) {;}
  11188. this.attrVal = this.section();
  11189. }
  11190. this.setAttr();
  11191. };
  11192. MpHtmlParser.prototype.EndTag = function (c) {
  11193. if (blankChar[c] || c == '>' || c == '/') {
  11194. var name = this.section().toLowerCase();
  11195. for (var i = this.STACK.length; i--;) {
  11196. if (this.STACK[i].name == name) break;}
  11197. if (i != -1) {
  11198. var node;
  11199. while ((node = this.STACK.pop()).name != name) {this.popNode(node);}
  11200. this.popNode(node);
  11201. } else if (name == 'p' || name == 'br')
  11202. this.siblings().push({
  11203. name: name,
  11204. attrs: {} });
  11205. this.i = this.data.indexOf('>', this.i);
  11206. this.start = this.i + 1;
  11207. if (this.i == -1) this.i = this.data.length;else
  11208. this.state = this.Text;
  11209. }
  11210. };var _default =
  11211. MpHtmlParser;exports.default = _default;
  11212. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  11213. /***/ }),
  11214. /* 150 */
  11215. /*!********************************************************************************!*\
  11216. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/config.js ***!
  11217. \********************************************************************************/
  11218. /*! no static exports found */
  11219. /***/ (function(module, exports, __webpack_require__) {
  11220. "use strict";
  11221. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /* 配置文件 */
  11222. var cfg = {
  11223. // 出错占位图
  11224. errorImg: null,
  11225. // 过滤器函数
  11226. filter: null,
  11227. // 代码高亮函数
  11228. highlight: null,
  11229. // 文本处理函数
  11230. onText: null,
  11231. // 实体编码列表
  11232. entities: {
  11233. quot: '"',
  11234. apos: "'",
  11235. semi: ';',
  11236. nbsp: '\xA0',
  11237. ensp: "\u2002",
  11238. emsp: "\u2003",
  11239. ndash: '–',
  11240. mdash: '—',
  11241. middot: '·',
  11242. lsquo: '‘',
  11243. rsquo: '’',
  11244. ldquo: '“',
  11245. rdquo: '”',
  11246. bull: '•',
  11247. hellip: '…' },
  11248. blankChar: makeMap(' ,\xA0,\t,\r,\n,\f'),
  11249. boolAttrs: makeMap('allowfullscreen,autoplay,autostart,controls,ignore,loop,muted'),
  11250. // 块级标签,将被转为 div
  11251. blockTags: makeMap('address,article,aside,body,caption,center,cite,footer,header,html,nav,pre,section'),
  11252. // 将被移除的标签
  11253. ignoreTags: makeMap('area,base,canvas,frame,iframe,input,link,map,meta,param,script,source,style,svg,textarea,title,track,wbr'),
  11254. // 只能被 rich-text 显示的标签
  11255. richOnlyTags: makeMap('a,colgroup,fieldset,legend'),
  11256. // 自闭合的标签
  11257. selfClosingTags: makeMap('area,base,br,col,circle,ellipse,embed,frame,hr,img,input,line,link,meta,param,path,polygon,rect,source,track,use,wbr'),
  11258. // 信任的标签
  11259. trustTags: makeMap('a,abbr,ad,audio,b,blockquote,br,code,col,colgroup,dd,del,dl,dt,div,em,fieldset,h1,h2,h3,h4,h5,h6,hr,i,img,ins,label,legend,li,ol,p,q,source,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,title,ul,video'),
  11260. // 默认的标签样式
  11261. userAgentStyles: {
  11262. address: 'font-style:italic',
  11263. big: 'display:inline;font-size:1.2em',
  11264. blockquote: 'background-color:#f6f6f6;border-left:3px solid #dbdbdb;color:#6c6c6c;padding:5px 0 5px 10px',
  11265. caption: 'display:table-caption;text-align:center',
  11266. center: 'text-align:center',
  11267. cite: 'font-style:italic',
  11268. dd: 'margin-left:40px',
  11269. mark: 'background-color:yellow',
  11270. pre: 'font-family:monospace;white-space:pre;overflow:scroll',
  11271. s: 'text-decoration:line-through',
  11272. small: 'display:inline;font-size:0.8em',
  11273. u: 'text-decoration:underline' } };
  11274. function makeMap(str) {
  11275. var map = Object.create(null),
  11276. list = str.split(',');
  11277. for (var i = list.length; i--;) {
  11278. map[list[i]] = true;}
  11279. return map;
  11280. }
  11281. if (wx.canIUse('editor')) {
  11282. cfg.blockTags.pre = void 0;
  11283. cfg.ignoreTags.rp = true;
  11284. Object.assign(cfg.richOnlyTags, makeMap('bdi,bdo,caption,rt,ruby'));
  11285. Object.assign(cfg.trustTags, makeMap('bdi,bdo,caption,pre,rt,ruby'));
  11286. }var _default =
  11287. cfg;exports.default = _default;
  11288. /***/ }),
  11289. /* 151 */
  11290. /*!************************************************************************************!*\
  11291. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/CssHandler.js ***!
  11292. \************************************************************************************/
  11293. /*! no static exports found */
  11294. /***/ (function(module, exports, __webpack_require__) {
  11295. "use strict";
  11296. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _config = _interopRequireDefault(__webpack_require__(/*! ./config.js */ 150));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  11297. var isLetter = function isLetter(c) {return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';};
  11298. function CssHandler(tagStyle) {
  11299. var styles = Object.assign(Object.create(null), _config.default.userAgentStyles);
  11300. for (var item in tagStyle) {
  11301. styles[item] = (styles[item] ? styles[item] + ';' : '') + tagStyle[item];}
  11302. this.styles = styles;
  11303. }
  11304. CssHandler.prototype.getStyle = function (data) {
  11305. this.styles = new parser(data, this.styles).parse();
  11306. };
  11307. CssHandler.prototype.match = function (name, attrs) {
  11308. var tmp,matched = (tmp = this.styles[name]) ? tmp + ';' : '';
  11309. if (attrs.class) {
  11310. var items = attrs.class.split(' ');
  11311. for (var i = 0, item; item = items[i]; i++) {
  11312. if (tmp = this.styles['.' + item])
  11313. matched += tmp + ';';}
  11314. }
  11315. if (tmp = this.styles['#' + attrs.id])
  11316. matched += tmp + ';';
  11317. return matched;
  11318. };var _default =
  11319. CssHandler;exports.default = _default;
  11320. function parser(data, init) {
  11321. this.data = data;
  11322. this.floor = 0;
  11323. this.i = 0;
  11324. this.list = [];
  11325. this.res = init;
  11326. this.state = this.Space;
  11327. }
  11328. parser.prototype.parse = function () {
  11329. for (var c; c = this.data[this.i]; this.i++) {
  11330. this.state(c);}
  11331. return this.res;
  11332. };
  11333. parser.prototype.section = function () {
  11334. return this.data.substring(this.start, this.i);
  11335. };
  11336. // 状态机
  11337. parser.prototype.Space = function (c) {
  11338. if (c == '.' || c == '#' || isLetter(c)) {
  11339. this.start = this.i;
  11340. this.state = this.Name;
  11341. } else if (c == '/' && this.data[this.i + 1] == '*')
  11342. this.Comment();else
  11343. if (!_config.default.blankChar[c] && c != ';')
  11344. this.state = this.Ignore;
  11345. };
  11346. parser.prototype.Comment = function () {
  11347. this.i = this.data.indexOf('*/', this.i) + 1;
  11348. if (!this.i) this.i = this.data.length;
  11349. this.state = this.Space;
  11350. };
  11351. parser.prototype.Ignore = function (c) {
  11352. if (c == '{') this.floor++;else
  11353. if (c == '}' && ! --this.floor) {
  11354. this.list = [];
  11355. this.state = this.Space;
  11356. }
  11357. };
  11358. parser.prototype.Name = function (c) {
  11359. if (_config.default.blankChar[c]) {
  11360. this.list.push(this.section());
  11361. this.state = this.NameSpace;
  11362. } else if (c == '{') {
  11363. this.list.push(this.section());
  11364. this.Content();
  11365. } else if (c == ',') {
  11366. this.list.push(this.section());
  11367. this.Comma();
  11368. } else if (!isLetter(c) && (c < '0' || c > '9') && c != '-' && c != '_')
  11369. this.state = this.Ignore;
  11370. };
  11371. parser.prototype.NameSpace = function (c) {
  11372. if (c == '{') this.Content();else
  11373. if (c == ',') this.Comma();else
  11374. if (!_config.default.blankChar[c]) this.state = this.Ignore;
  11375. };
  11376. parser.prototype.Comma = function () {
  11377. while (_config.default.blankChar[this.data[++this.i]]) {;}
  11378. if (this.data[this.i] == '{') this.Content();else
  11379. {
  11380. this.start = this.i--;
  11381. this.state = this.Name;
  11382. }
  11383. };
  11384. parser.prototype.Content = function () {
  11385. this.start = ++this.i;
  11386. if ((this.i = this.data.indexOf('}', this.i)) == -1) this.i = this.data.length;
  11387. var content = this.section();
  11388. for (var i = 0, item; item = this.list[i++];) {
  11389. if (this.res[item]) this.res[item] += ';' + content;else
  11390. this.res[item] = content;}
  11391. this.list = [];
  11392. this.state = this.Space;
  11393. };
  11394. /***/ }),
  11395. /* 152 */,
  11396. /* 153 */,
  11397. /* 154 */,
  11398. /* 155 */,
  11399. /* 156 */,
  11400. /* 157 */,
  11401. /* 158 */,
  11402. /* 159 */,
  11403. /* 160 */,
  11404. /* 161 */,
  11405. /* 162 */,
  11406. /* 163 */,
  11407. /* 164 */,
  11408. /* 165 */,
  11409. /* 166 */,
  11410. /* 167 */,
  11411. /* 168 */,
  11412. /* 169 */,
  11413. /* 170 */,
  11414. /* 171 */,
  11415. /* 172 */,
  11416. /* 173 */,
  11417. /* 174 */,
  11418. /* 175 */,
  11419. /* 176 */,
  11420. /* 177 */,
  11421. /* 178 */,
  11422. /* 179 */,
  11423. /* 180 */
  11424. /*!*******************************************************************!*\
  11425. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/util/emitter.js ***!
  11426. \*******************************************************************/
  11427. /*! no static exports found */
  11428. /***/ (function(module, exports, __webpack_require__) {
  11429. "use strict";
  11430. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  11431. * 递归使用 call 方式this指向
  11432. * @param componentName // 需要找的组件的名称
  11433. * @param eventName // 事件名称
  11434. * @param params // 需要传递的参数
  11435. */
  11436. function _broadcast(componentName, eventName, params) {
  11437. // 循环子节点找到名称一样的子节点 否则 递归 当前子节点
  11438. var $children;
  11439. $children = this.$children;
  11440. $children.map(function (child) {
  11441. if (componentName === child.$options.name) {
  11442. child.$emit.apply(child, [eventName].concat(params));
  11443. } else {
  11444. _broadcast.apply(child, [componentName, eventName].concat(params));
  11445. }
  11446. });
  11447. }var _default =
  11448. {
  11449. methods: {
  11450. /**
  11451. * 派发 (向上查找) (一个)
  11452. * @param componentName // 需要找的组件的名称
  11453. * @param eventName // 事件名称
  11454. * @param params // 需要传递的参数
  11455. */
  11456. dispatch: function dispatch(componentName, eventName, params) {
  11457. var parent = this.$parent || this.$root; //$parent 找到最近的父节点 $root 根节点
  11458. var name = parent.$options.name; // 获取当前组件实例的name
  11459. // 如果当前有节点 && 当前没名称 且 当前名称等于需要传进来的名称的时候就去查找当前的节点
  11460. // 循环出当前名称的一样的组件实例
  11461. while (parent && (!name || name !== componentName)) {
  11462. parent = parent.$parent;
  11463. if (parent) {
  11464. name = parent.$options.name;
  11465. }
  11466. }
  11467. // 有节点表示当前找到了name一样的实例
  11468. if (parent) {
  11469. parent.$emit.apply(parent, [eventName].concat(params));
  11470. }
  11471. },
  11472. /**
  11473. * 广播 (向下查找) (广播多个)
  11474. * @param componentName // 需要找的组件的名称
  11475. * @param eventName // 事件名称
  11476. * @param params // 需要传递的参数
  11477. */
  11478. broadcast: function broadcast(componentName, eventName, params) {
  11479. _broadcast.call(this, componentName, eventName, params);
  11480. } } };exports.default = _default;
  11481. /***/ }),
  11482. /* 181 */
  11483. /*!***************************************************************************!*\
  11484. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/util/async-validator.js ***!
  11485. \***************************************************************************/
  11486. /*! no static exports found */
  11487. /***/ (function(module, exports, __webpack_require__) {
  11488. "use strict";
  11489. /* WEBPACK VAR INJECTION */(function(process) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function _extends() {
  11490. _extends = Object.assign || function (target) {
  11491. for (var i = 1; i < arguments.length; i++) {
  11492. var source = arguments[i];
  11493. for (var key in source) {
  11494. if (Object.prototype.hasOwnProperty.call(source, key)) {
  11495. target[key] = source[key];
  11496. }
  11497. }
  11498. }
  11499. return target;
  11500. };
  11501. return _extends.apply(this, arguments);
  11502. }
  11503. /* eslint no-console:0 */
  11504. var formatRegExp = /%[sdj%]/g;
  11505. var warning = function warning() {}; // don't print warning message when in production env or node runtime
  11506. if (typeof process !== 'undefined' && Object({"VUE_APP_NAME":"mdapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}) && "development" !== 'production' && typeof window !==
  11507. 'undefined' && typeof document !== 'undefined') {
  11508. warning = function warning(type, errors) {
  11509. if (typeof console !== 'undefined' && console.warn) {
  11510. if (errors.every(function (e) {
  11511. return typeof e === 'string';
  11512. })) {
  11513. console.warn(type, errors);
  11514. }
  11515. }
  11516. };
  11517. }
  11518. function convertFieldsError(errors) {
  11519. if (!errors || !errors.length) return null;
  11520. var fields = {};
  11521. errors.forEach(function (error) {
  11522. var field = error.field;
  11523. fields[field] = fields[field] || [];
  11524. fields[field].push(error);
  11525. });
  11526. return fields;
  11527. }
  11528. function format() {
  11529. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  11530. args[_key] = arguments[_key];
  11531. }
  11532. var i = 1;
  11533. var f = args[0];
  11534. var len = args.length;
  11535. if (typeof f === 'function') {
  11536. return f.apply(null, args.slice(1));
  11537. }
  11538. if (typeof f === 'string') {
  11539. var str = String(f).replace(formatRegExp, function (x) {
  11540. if (x === '%%') {
  11541. return '%';
  11542. }
  11543. if (i >= len) {
  11544. return x;
  11545. }
  11546. switch (x) {
  11547. case '%s':
  11548. return String(args[i++]);
  11549. case '%d':
  11550. return Number(args[i++]);
  11551. case '%j':
  11552. try {
  11553. return JSON.stringify(args[i++]);
  11554. } catch (_) {
  11555. return '[Circular]';
  11556. }
  11557. break;
  11558. default:
  11559. return x;}
  11560. });
  11561. for (var arg = args[i]; i < len; arg = args[++i]) {
  11562. str += " " + arg;
  11563. }
  11564. return str;
  11565. }
  11566. return f;
  11567. }
  11568. function isNativeStringType(type) {
  11569. return type === 'string' || type === 'url' || type === 'hex' || type === 'email' || type === 'pattern';
  11570. }
  11571. function isEmptyValue(value, type) {
  11572. if (value === undefined || value === null) {
  11573. return true;
  11574. }
  11575. if (type === 'array' && Array.isArray(value) && !value.length) {
  11576. return true;
  11577. }
  11578. if (isNativeStringType(type) && typeof value === 'string' && !value) {
  11579. return true;
  11580. }
  11581. return false;
  11582. }
  11583. function asyncParallelArray(arr, func, callback) {
  11584. var results = [];
  11585. var total = 0;
  11586. var arrLength = arr.length;
  11587. function count(errors) {
  11588. results.push.apply(results, errors);
  11589. total++;
  11590. if (total === arrLength) {
  11591. callback(results);
  11592. }
  11593. }
  11594. arr.forEach(function (a) {
  11595. func(a, count);
  11596. });
  11597. }
  11598. function asyncSerialArray(arr, func, callback) {
  11599. var index = 0;
  11600. var arrLength = arr.length;
  11601. function next(errors) {
  11602. if (errors && errors.length) {
  11603. callback(errors);
  11604. return;
  11605. }
  11606. var original = index;
  11607. index = index + 1;
  11608. if (original < arrLength) {
  11609. func(arr[original], next);
  11610. } else {
  11611. callback([]);
  11612. }
  11613. }
  11614. next([]);
  11615. }
  11616. function flattenObjArr(objArr) {
  11617. var ret = [];
  11618. Object.keys(objArr).forEach(function (k) {
  11619. ret.push.apply(ret, objArr[k]);
  11620. });
  11621. return ret;
  11622. }
  11623. function asyncMap(objArr, option, func, callback) {
  11624. if (option.first) {
  11625. var _pending = new Promise(function (resolve, reject) {
  11626. var next = function next(errors) {
  11627. callback(errors);
  11628. return errors.length ? reject({
  11629. errors: errors,
  11630. fields: convertFieldsError(errors) }) :
  11631. resolve();
  11632. };
  11633. var flattenArr = flattenObjArr(objArr);
  11634. asyncSerialArray(flattenArr, func, next);
  11635. });
  11636. _pending["catch"](function (e) {
  11637. return e;
  11638. });
  11639. return _pending;
  11640. }
  11641. var firstFields = option.firstFields || [];
  11642. if (firstFields === true) {
  11643. firstFields = Object.keys(objArr);
  11644. }
  11645. var objArrKeys = Object.keys(objArr);
  11646. var objArrLength = objArrKeys.length;
  11647. var total = 0;
  11648. var results = [];
  11649. var pending = new Promise(function (resolve, reject) {
  11650. var next = function next(errors) {
  11651. results.push.apply(results, errors);
  11652. total++;
  11653. if (total === objArrLength) {
  11654. callback(results);
  11655. return results.length ? reject({
  11656. errors: results,
  11657. fields: convertFieldsError(results) }) :
  11658. resolve();
  11659. }
  11660. };
  11661. if (!objArrKeys.length) {
  11662. callback(results);
  11663. resolve();
  11664. }
  11665. objArrKeys.forEach(function (key) {
  11666. var arr = objArr[key];
  11667. if (firstFields.indexOf(key) !== -1) {
  11668. asyncSerialArray(arr, func, next);
  11669. } else {
  11670. asyncParallelArray(arr, func, next);
  11671. }
  11672. });
  11673. });
  11674. pending["catch"](function (e) {
  11675. return e;
  11676. });
  11677. return pending;
  11678. }
  11679. function complementError(rule) {
  11680. return function (oe) {
  11681. if (oe && oe.message) {
  11682. oe.field = oe.field || rule.fullField;
  11683. return oe;
  11684. }
  11685. return {
  11686. message: typeof oe === 'function' ? oe() : oe,
  11687. field: oe.field || rule.fullField };
  11688. };
  11689. }
  11690. function deepMerge(target, source) {
  11691. if (source) {
  11692. for (var s in source) {
  11693. if (source.hasOwnProperty(s)) {
  11694. var value = source[s];
  11695. if (typeof value === 'object' && typeof target[s] === 'object') {
  11696. target[s] = _extends({}, target[s], {}, value);
  11697. } else {
  11698. target[s] = value;
  11699. }
  11700. }
  11701. }
  11702. }
  11703. return target;
  11704. }
  11705. /**
  11706. * Rule for validating required fields.
  11707. *
  11708. * @param rule The validation rule.
  11709. * @param value The value of the field on the source object.
  11710. * @param source The source object being validated.
  11711. * @param errors An array of errors that this rule may add
  11712. * validation errors to.
  11713. * @param options The validation options.
  11714. * @param options.messages The validation messages.
  11715. */
  11716. function required(rule, value, source, errors, options, type) {
  11717. if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) {
  11718. errors.push(format(options.messages.required, rule.fullField));
  11719. }
  11720. }
  11721. /**
  11722. * Rule for validating whitespace.
  11723. *
  11724. * @param rule The validation rule.
  11725. * @param value The value of the field on the source object.
  11726. * @param source The source object being validated.
  11727. * @param errors An array of errors that this rule may add
  11728. * validation errors to.
  11729. * @param options The validation options.
  11730. * @param options.messages The validation messages.
  11731. */
  11732. function whitespace(rule, value, source, errors, options) {
  11733. if (/^\s+$/.test(value) || value === '') {
  11734. errors.push(format(options.messages.whitespace, rule.fullField));
  11735. }
  11736. }
  11737. /* eslint max-len:0 */
  11738. var pattern = {
  11739. // http://emailregex.com/
  11740. email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
  11741. url: new RegExp(
  11742. "^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$",
  11743. 'i'),
  11744. hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i };
  11745. var types = {
  11746. integer: function integer(value) {
  11747. return types.number(value) && parseInt(value, 10) === value;
  11748. },
  11749. "float": function float(value) {
  11750. return types.number(value) && !types.integer(value);
  11751. },
  11752. array: function array(value) {
  11753. return Array.isArray(value);
  11754. },
  11755. regexp: function regexp(value) {
  11756. if (value instanceof RegExp) {
  11757. return true;
  11758. }
  11759. try {
  11760. return !!new RegExp(value);
  11761. } catch (e) {
  11762. return false;
  11763. }
  11764. },
  11765. date: function date(value) {
  11766. return typeof value.getTime === 'function' && typeof value.getMonth === 'function' && typeof value.getYear ===
  11767. 'function';
  11768. },
  11769. number: function number(value) {
  11770. if (isNaN(value)) {
  11771. return false;
  11772. }
  11773. // 修改源码,将字符串数值先转为数值
  11774. return typeof +value === 'number';
  11775. },
  11776. object: function object(value) {
  11777. return typeof value === 'object' && !types.array(value);
  11778. },
  11779. method: function method(value) {
  11780. return typeof value === 'function';
  11781. },
  11782. email: function email(value) {
  11783. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  11784. },
  11785. url: function url(value) {
  11786. return typeof value === 'string' && !!value.match(pattern.url);
  11787. },
  11788. hex: function hex(value) {
  11789. return typeof value === 'string' && !!value.match(pattern.hex);
  11790. } };
  11791. /**
  11792. * Rule for validating the type of a value.
  11793. *
  11794. * @param rule The validation rule.
  11795. * @param value The value of the field on the source object.
  11796. * @param source The source object being validated.
  11797. * @param errors An array of errors that this rule may add
  11798. * validation errors to.
  11799. * @param options The validation options.
  11800. * @param options.messages The validation messages.
  11801. */
  11802. function type(rule, value, source, errors, options) {
  11803. if (rule.required && value === undefined) {
  11804. required(rule, value, source, errors, options);
  11805. return;
  11806. }
  11807. var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];
  11808. var ruleType = rule.type;
  11809. if (custom.indexOf(ruleType) > -1) {
  11810. if (!types[ruleType](value)) {
  11811. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  11812. } // straight typeof check
  11813. } else if (ruleType && typeof value !== rule.type) {
  11814. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  11815. }
  11816. }
  11817. /**
  11818. * Rule for validating minimum and maximum allowed values.
  11819. *
  11820. * @param rule The validation rule.
  11821. * @param value The value of the field on the source object.
  11822. * @param source The source object being validated.
  11823. * @param errors An array of errors that this rule may add
  11824. * validation errors to.
  11825. * @param options The validation options.
  11826. * @param options.messages The validation messages.
  11827. */
  11828. function range(rule, value, source, errors, options) {
  11829. var len = typeof rule.len === 'number';
  11830. var min = typeof rule.min === 'number';
  11831. var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)
  11832. var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
  11833. var val = value;
  11834. var key = null;
  11835. var num = typeof value === 'number';
  11836. var str = typeof value === 'string';
  11837. var arr = Array.isArray(value);
  11838. if (num) {
  11839. key = 'number';
  11840. } else if (str) {
  11841. key = 'string';
  11842. } else if (arr) {
  11843. key = 'array';
  11844. } // if the value is not of a supported type for range validation
  11845. // the validation rule rule should use the
  11846. // type property to also test for a particular type
  11847. if (!key) {
  11848. return false;
  11849. }
  11850. if (arr) {
  11851. val = value.length;
  11852. }
  11853. if (str) {
  11854. // 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3
  11855. val = value.replace(spRegexp, '_').length;
  11856. }
  11857. if (len) {
  11858. if (val !== rule.len) {
  11859. errors.push(format(options.messages[key].len, rule.fullField, rule.len));
  11860. }
  11861. } else if (min && !max && val < rule.min) {
  11862. errors.push(format(options.messages[key].min, rule.fullField, rule.min));
  11863. } else if (max && !min && val > rule.max) {
  11864. errors.push(format(options.messages[key].max, rule.fullField, rule.max));
  11865. } else if (min && max && (val < rule.min || val > rule.max)) {
  11866. errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
  11867. }
  11868. }
  11869. var ENUM = 'enum';
  11870. /**
  11871. * Rule for validating a value exists in an enumerable list.
  11872. *
  11873. * @param rule The validation rule.
  11874. * @param value The value of the field on the source object.
  11875. * @param source The source object being validated.
  11876. * @param errors An array of errors that this rule may add
  11877. * validation errors to.
  11878. * @param options The validation options.
  11879. * @param options.messages The validation messages.
  11880. */
  11881. function enumerable(rule, value, source, errors, options) {
  11882. rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
  11883. if (rule[ENUM].indexOf(value) === -1) {
  11884. errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));
  11885. }
  11886. }
  11887. /**
  11888. * Rule for validating a regular expression pattern.
  11889. *
  11890. * @param rule The validation rule.
  11891. * @param value The value of the field on the source object.
  11892. * @param source The source object being validated.
  11893. * @param errors An array of errors that this rule may add
  11894. * validation errors to.
  11895. * @param options The validation options.
  11896. * @param options.messages The validation messages.
  11897. */
  11898. function pattern$1(rule, value, source, errors, options) {
  11899. if (rule.pattern) {
  11900. if (rule.pattern instanceof RegExp) {
  11901. // if a RegExp instance is passed, reset `lastIndex` in case its `global`
  11902. // flag is accidentally set to `true`, which in a validation scenario
  11903. // is not necessary and the result might be misleading
  11904. rule.pattern.lastIndex = 0;
  11905. if (!rule.pattern.test(value)) {
  11906. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  11907. }
  11908. } else if (typeof rule.pattern === 'string') {
  11909. var _pattern = new RegExp(rule.pattern);
  11910. if (!_pattern.test(value)) {
  11911. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  11912. }
  11913. }
  11914. }
  11915. }
  11916. var rules = {
  11917. required: required,
  11918. whitespace: whitespace,
  11919. type: type,
  11920. range: range,
  11921. "enum": enumerable,
  11922. pattern: pattern$1 };
  11923. /**
  11924. * Performs validation for string types.
  11925. *
  11926. * @param rule The validation rule.
  11927. * @param value The value of the field on the source object.
  11928. * @param callback The callback function.
  11929. * @param source The source object being validated.
  11930. * @param options The validation options.
  11931. * @param options.messages The validation messages.
  11932. */
  11933. function string(rule, value, callback, source, options) {
  11934. var errors = [];
  11935. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  11936. if (validate) {
  11937. if (isEmptyValue(value, 'string') && !rule.required) {
  11938. return callback();
  11939. }
  11940. rules.required(rule, value, source, errors, options, 'string');
  11941. if (!isEmptyValue(value, 'string')) {
  11942. rules.type(rule, value, source, errors, options);
  11943. rules.range(rule, value, source, errors, options);
  11944. rules.pattern(rule, value, source, errors, options);
  11945. if (rule.whitespace === true) {
  11946. rules.whitespace(rule, value, source, errors, options);
  11947. }
  11948. }
  11949. }
  11950. callback(errors);
  11951. }
  11952. /**
  11953. * Validates a function.
  11954. *
  11955. * @param rule The validation rule.
  11956. * @param value The value of the field on the source object.
  11957. * @param callback The callback function.
  11958. * @param source The source object being validated.
  11959. * @param options The validation options.
  11960. * @param options.messages The validation messages.
  11961. */
  11962. function method(rule, value, callback, source, options) {
  11963. var errors = [];
  11964. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  11965. if (validate) {
  11966. if (isEmptyValue(value) && !rule.required) {
  11967. return callback();
  11968. }
  11969. rules.required(rule, value, source, errors, options);
  11970. if (value !== undefined) {
  11971. rules.type(rule, value, source, errors, options);
  11972. }
  11973. }
  11974. callback(errors);
  11975. }
  11976. /**
  11977. * Validates a number.
  11978. *
  11979. * @param rule The validation rule.
  11980. * @param value The value of the field on the source object.
  11981. * @param callback The callback function.
  11982. * @param source The source object being validated.
  11983. * @param options The validation options.
  11984. * @param options.messages The validation messages.
  11985. */
  11986. function number(rule, value, callback, source, options) {
  11987. var errors = [];
  11988. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  11989. if (validate) {
  11990. if (value === '') {
  11991. value = undefined;
  11992. }
  11993. if (isEmptyValue(value) && !rule.required) {
  11994. return callback();
  11995. }
  11996. rules.required(rule, value, source, errors, options);
  11997. if (value !== undefined) {
  11998. rules.type(rule, value, source, errors, options);
  11999. rules.range(rule, value, source, errors, options);
  12000. }
  12001. }
  12002. callback(errors);
  12003. }
  12004. /**
  12005. * Validates a boolean.
  12006. *
  12007. * @param rule The validation rule.
  12008. * @param value The value of the field on the source object.
  12009. * @param callback The callback function.
  12010. * @param source The source object being validated.
  12011. * @param options The validation options.
  12012. * @param options.messages The validation messages.
  12013. */
  12014. function _boolean(rule, value, callback, source, options) {
  12015. var errors = [];
  12016. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12017. if (validate) {
  12018. if (isEmptyValue(value) && !rule.required) {
  12019. return callback();
  12020. }
  12021. rules.required(rule, value, source, errors, options);
  12022. if (value !== undefined) {
  12023. rules.type(rule, value, source, errors, options);
  12024. }
  12025. }
  12026. callback(errors);
  12027. }
  12028. /**
  12029. * Validates the regular expression type.
  12030. *
  12031. * @param rule The validation rule.
  12032. * @param value The value of the field on the source object.
  12033. * @param callback The callback function.
  12034. * @param source The source object being validated.
  12035. * @param options The validation options.
  12036. * @param options.messages The validation messages.
  12037. */
  12038. function regexp(rule, value, callback, source, options) {
  12039. var errors = [];
  12040. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12041. if (validate) {
  12042. if (isEmptyValue(value) && !rule.required) {
  12043. return callback();
  12044. }
  12045. rules.required(rule, value, source, errors, options);
  12046. if (!isEmptyValue(value)) {
  12047. rules.type(rule, value, source, errors, options);
  12048. }
  12049. }
  12050. callback(errors);
  12051. }
  12052. /**
  12053. * Validates a number is an integer.
  12054. *
  12055. * @param rule The validation rule.
  12056. * @param value The value of the field on the source object.
  12057. * @param callback The callback function.
  12058. * @param source The source object being validated.
  12059. * @param options The validation options.
  12060. * @param options.messages The validation messages.
  12061. */
  12062. function integer(rule, value, callback, source, options) {
  12063. var errors = [];
  12064. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12065. if (validate) {
  12066. if (isEmptyValue(value) && !rule.required) {
  12067. return callback();
  12068. }
  12069. rules.required(rule, value, source, errors, options);
  12070. if (value !== undefined) {
  12071. rules.type(rule, value, source, errors, options);
  12072. rules.range(rule, value, source, errors, options);
  12073. }
  12074. }
  12075. callback(errors);
  12076. }
  12077. /**
  12078. * Validates a number is a floating point number.
  12079. *
  12080. * @param rule The validation rule.
  12081. * @param value The value of the field on the source object.
  12082. * @param callback The callback function.
  12083. * @param source The source object being validated.
  12084. * @param options The validation options.
  12085. * @param options.messages The validation messages.
  12086. */
  12087. function floatFn(rule, value, callback, source, options) {
  12088. var errors = [];
  12089. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12090. if (validate) {
  12091. if (isEmptyValue(value) && !rule.required) {
  12092. return callback();
  12093. }
  12094. rules.required(rule, value, source, errors, options);
  12095. if (value !== undefined) {
  12096. rules.type(rule, value, source, errors, options);
  12097. rules.range(rule, value, source, errors, options);
  12098. }
  12099. }
  12100. callback(errors);
  12101. }
  12102. /**
  12103. * Validates an array.
  12104. *
  12105. * @param rule The validation rule.
  12106. * @param value The value of the field on the source object.
  12107. * @param callback The callback function.
  12108. * @param source The source object being validated.
  12109. * @param options The validation options.
  12110. * @param options.messages The validation messages.
  12111. */
  12112. function array(rule, value, callback, source, options) {
  12113. var errors = [];
  12114. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12115. if (validate) {
  12116. if (isEmptyValue(value, 'array') && !rule.required) {
  12117. return callback();
  12118. }
  12119. rules.required(rule, value, source, errors, options, 'array');
  12120. if (!isEmptyValue(value, 'array')) {
  12121. rules.type(rule, value, source, errors, options);
  12122. rules.range(rule, value, source, errors, options);
  12123. }
  12124. }
  12125. callback(errors);
  12126. }
  12127. /**
  12128. * Validates an object.
  12129. *
  12130. * @param rule The validation rule.
  12131. * @param value The value of the field on the source object.
  12132. * @param callback The callback function.
  12133. * @param source The source object being validated.
  12134. * @param options The validation options.
  12135. * @param options.messages The validation messages.
  12136. */
  12137. function object(rule, value, callback, source, options) {
  12138. var errors = [];
  12139. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12140. if (validate) {
  12141. if (isEmptyValue(value) && !rule.required) {
  12142. return callback();
  12143. }
  12144. rules.required(rule, value, source, errors, options);
  12145. if (value !== undefined) {
  12146. rules.type(rule, value, source, errors, options);
  12147. }
  12148. }
  12149. callback(errors);
  12150. }
  12151. var ENUM$1 = 'enum';
  12152. /**
  12153. * Validates an enumerable list.
  12154. *
  12155. * @param rule The validation rule.
  12156. * @param value The value of the field on the source object.
  12157. * @param callback The callback function.
  12158. * @param source The source object being validated.
  12159. * @param options The validation options.
  12160. * @param options.messages The validation messages.
  12161. */
  12162. function enumerable$1(rule, value, callback, source, options) {
  12163. var errors = [];
  12164. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12165. if (validate) {
  12166. if (isEmptyValue(value) && !rule.required) {
  12167. return callback();
  12168. }
  12169. rules.required(rule, value, source, errors, options);
  12170. if (value !== undefined) {
  12171. rules[ENUM$1](rule, value, source, errors, options);
  12172. }
  12173. }
  12174. callback(errors);
  12175. }
  12176. /**
  12177. * Validates a regular expression pattern.
  12178. *
  12179. * Performs validation when a rule only contains
  12180. * a pattern property but is not declared as a string type.
  12181. *
  12182. * @param rule The validation rule.
  12183. * @param value The value of the field on the source object.
  12184. * @param callback The callback function.
  12185. * @param source The source object being validated.
  12186. * @param options The validation options.
  12187. * @param options.messages The validation messages.
  12188. */
  12189. function pattern$2(rule, value, callback, source, options) {
  12190. var errors = [];
  12191. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12192. if (validate) {
  12193. if (isEmptyValue(value, 'string') && !rule.required) {
  12194. return callback();
  12195. }
  12196. rules.required(rule, value, source, errors, options);
  12197. if (!isEmptyValue(value, 'string')) {
  12198. rules.pattern(rule, value, source, errors, options);
  12199. }
  12200. }
  12201. callback(errors);
  12202. }
  12203. function date(rule, value, callback, source, options) {
  12204. var errors = [];
  12205. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12206. if (validate) {
  12207. if (isEmptyValue(value) && !rule.required) {
  12208. return callback();
  12209. }
  12210. rules.required(rule, value, source, errors, options);
  12211. if (!isEmptyValue(value)) {
  12212. var dateObject;
  12213. if (typeof value === 'number') {
  12214. dateObject = new Date(value);
  12215. } else {
  12216. dateObject = value;
  12217. }
  12218. rules.type(rule, dateObject, source, errors, options);
  12219. if (dateObject) {
  12220. rules.range(rule, dateObject.getTime(), source, errors, options);
  12221. }
  12222. }
  12223. }
  12224. callback(errors);
  12225. }
  12226. function required$1(rule, value, callback, source, options) {
  12227. var errors = [];
  12228. var type = Array.isArray(value) ? 'array' : typeof value;
  12229. rules.required(rule, value, source, errors, options, type);
  12230. callback(errors);
  12231. }
  12232. function type$1(rule, value, callback, source, options) {
  12233. var ruleType = rule.type;
  12234. var errors = [];
  12235. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12236. if (validate) {
  12237. if (isEmptyValue(value, ruleType) && !rule.required) {
  12238. return callback();
  12239. }
  12240. rules.required(rule, value, source, errors, options, ruleType);
  12241. if (!isEmptyValue(value, ruleType)) {
  12242. rules.type(rule, value, source, errors, options);
  12243. }
  12244. }
  12245. callback(errors);
  12246. }
  12247. /**
  12248. * Performs validation for any type.
  12249. *
  12250. * @param rule The validation rule.
  12251. * @param value The value of the field on the source object.
  12252. * @param callback The callback function.
  12253. * @param source The source object being validated.
  12254. * @param options The validation options.
  12255. * @param options.messages The validation messages.
  12256. */
  12257. function any(rule, value, callback, source, options) {
  12258. var errors = [];
  12259. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12260. if (validate) {
  12261. if (isEmptyValue(value) && !rule.required) {
  12262. return callback();
  12263. }
  12264. rules.required(rule, value, source, errors, options);
  12265. }
  12266. callback(errors);
  12267. }
  12268. var validators = {
  12269. string: string,
  12270. method: method,
  12271. number: number,
  12272. "boolean": _boolean,
  12273. regexp: regexp,
  12274. integer: integer,
  12275. "float": floatFn,
  12276. array: array,
  12277. object: object,
  12278. "enum": enumerable$1,
  12279. pattern: pattern$2,
  12280. date: date,
  12281. url: type$1,
  12282. hex: type$1,
  12283. email: type$1,
  12284. required: required$1,
  12285. any: any };
  12286. function newMessages() {
  12287. return {
  12288. "default": 'Validation error on field %s',
  12289. required: '%s is required',
  12290. "enum": '%s must be one of %s',
  12291. whitespace: '%s cannot be empty',
  12292. date: {
  12293. format: '%s date %s is invalid for format %s',
  12294. parse: '%s date could not be parsed, %s is invalid ',
  12295. invalid: '%s date %s is invalid' },
  12296. types: {
  12297. string: '%s is not a %s',
  12298. method: '%s is not a %s (function)',
  12299. array: '%s is not an %s',
  12300. object: '%s is not an %s',
  12301. number: '%s is not a %s',
  12302. date: '%s is not a %s',
  12303. "boolean": '%s is not a %s',
  12304. integer: '%s is not an %s',
  12305. "float": '%s is not a %s',
  12306. regexp: '%s is not a valid %s',
  12307. email: '%s is not a valid %s',
  12308. url: '%s is not a valid %s',
  12309. hex: '%s is not a valid %s' },
  12310. string: {
  12311. len: '%s must be exactly %s characters',
  12312. min: '%s must be at least %s characters',
  12313. max: '%s cannot be longer than %s characters',
  12314. range: '%s must be between %s and %s characters' },
  12315. number: {
  12316. len: '%s must equal %s',
  12317. min: '%s cannot be less than %s',
  12318. max: '%s cannot be greater than %s',
  12319. range: '%s must be between %s and %s' },
  12320. array: {
  12321. len: '%s must be exactly %s in length',
  12322. min: '%s cannot be less than %s in length',
  12323. max: '%s cannot be greater than %s in length',
  12324. range: '%s must be between %s and %s in length' },
  12325. pattern: {
  12326. mismatch: '%s value %s does not match pattern %s' },
  12327. clone: function clone() {
  12328. var cloned = JSON.parse(JSON.stringify(this));
  12329. cloned.clone = this.clone;
  12330. return cloned;
  12331. } };
  12332. }
  12333. var messages = newMessages();
  12334. /**
  12335. * Encapsulates a validation schema.
  12336. *
  12337. * @param descriptor An object declaring validation rules
  12338. * for this schema.
  12339. */
  12340. function Schema(descriptor) {
  12341. this.rules = null;
  12342. this._messages = messages;
  12343. this.define(descriptor);
  12344. }
  12345. Schema.prototype = {
  12346. messages: function messages(_messages) {
  12347. if (_messages) {
  12348. this._messages = deepMerge(newMessages(), _messages);
  12349. }
  12350. return this._messages;
  12351. },
  12352. define: function define(rules) {
  12353. if (!rules) {
  12354. throw new Error('Cannot configure a schema with no rules');
  12355. }
  12356. if (typeof rules !== 'object' || Array.isArray(rules)) {
  12357. throw new Error('Rules must be an object');
  12358. }
  12359. this.rules = {};
  12360. var z;
  12361. var item;
  12362. for (z in rules) {
  12363. if (rules.hasOwnProperty(z)) {
  12364. item = rules[z];
  12365. this.rules[z] = Array.isArray(item) ? item : [item];
  12366. }
  12367. }
  12368. },
  12369. validate: function validate(source_, o, oc) {
  12370. var _this = this;
  12371. if (o === void 0) {
  12372. o = {};
  12373. }
  12374. if (oc === void 0) {
  12375. oc = function oc() {};
  12376. }
  12377. var source = source_;
  12378. var options = o;
  12379. var callback = oc;
  12380. if (typeof options === 'function') {
  12381. callback = options;
  12382. options = {};
  12383. }
  12384. if (!this.rules || Object.keys(this.rules).length === 0) {
  12385. if (callback) {
  12386. callback();
  12387. }
  12388. return Promise.resolve();
  12389. }
  12390. function complete(results) {
  12391. var i;
  12392. var errors = [];
  12393. var fields = {};
  12394. function add(e) {
  12395. if (Array.isArray(e)) {
  12396. var _errors;
  12397. errors = (_errors = errors).concat.apply(_errors, e);
  12398. } else {
  12399. errors.push(e);
  12400. }
  12401. }
  12402. for (i = 0; i < results.length; i++) {
  12403. add(results[i]);
  12404. }
  12405. if (!errors.length) {
  12406. errors = null;
  12407. fields = null;
  12408. } else {
  12409. fields = convertFieldsError(errors);
  12410. }
  12411. callback(errors, fields);
  12412. }
  12413. if (options.messages) {
  12414. var messages$1 = this.messages();
  12415. if (messages$1 === messages) {
  12416. messages$1 = newMessages();
  12417. }
  12418. deepMerge(messages$1, options.messages);
  12419. options.messages = messages$1;
  12420. } else {
  12421. options.messages = this.messages();
  12422. }
  12423. var arr;
  12424. var value;
  12425. var series = {};
  12426. var keys = options.keys || Object.keys(this.rules);
  12427. keys.forEach(function (z) {
  12428. arr = _this.rules[z];
  12429. value = source[z];
  12430. arr.forEach(function (r) {
  12431. var rule = r;
  12432. if (typeof rule.transform === 'function') {
  12433. if (source === source_) {
  12434. source = _extends({}, source);
  12435. }
  12436. value = source[z] = rule.transform(value);
  12437. }
  12438. if (typeof rule === 'function') {
  12439. rule = {
  12440. validator: rule };
  12441. } else {
  12442. rule = _extends({}, rule);
  12443. }
  12444. rule.validator = _this.getValidationMethod(rule);
  12445. rule.field = z;
  12446. rule.fullField = rule.fullField || z;
  12447. rule.type = _this.getType(rule);
  12448. if (!rule.validator) {
  12449. return;
  12450. }
  12451. series[z] = series[z] || [];
  12452. series[z].push({
  12453. rule: rule,
  12454. value: value,
  12455. source: source,
  12456. field: z });
  12457. });
  12458. });
  12459. var errorFields = {};
  12460. return asyncMap(series, options, function (data, doIt) {
  12461. var rule = data.rule;
  12462. var deep = (rule.type === 'object' || rule.type === 'array') && (typeof rule.fields === 'object' || typeof rule.defaultField ===
  12463. 'object');
  12464. deep = deep && (rule.required || !rule.required && data.value);
  12465. rule.field = data.field;
  12466. function addFullfield(key, schema) {
  12467. return _extends({}, schema, {
  12468. fullField: rule.fullField + "." + key });
  12469. }
  12470. function cb(e) {
  12471. if (e === void 0) {
  12472. e = [];
  12473. }
  12474. var errors = e;
  12475. if (!Array.isArray(errors)) {
  12476. errors = [errors];
  12477. }
  12478. if (!options.suppressWarning && errors.length) {
  12479. Schema.warning('async-validator:', errors);
  12480. }
  12481. if (errors.length && rule.message) {
  12482. errors = [].concat(rule.message);
  12483. }
  12484. errors = errors.map(complementError(rule));
  12485. if (options.first && errors.length) {
  12486. errorFields[rule.field] = 1;
  12487. return doIt(errors);
  12488. }
  12489. if (!deep) {
  12490. doIt(errors);
  12491. } else {
  12492. // if rule is required but the target object
  12493. // does not exist fail at the rule level and don't
  12494. // go deeper
  12495. if (rule.required && !data.value) {
  12496. if (rule.message) {
  12497. errors = [].concat(rule.message).map(complementError(rule));
  12498. } else if (options.error) {
  12499. errors = [options.error(rule, format(options.messages.required, rule.field))];
  12500. } else {
  12501. errors = [];
  12502. }
  12503. return doIt(errors);
  12504. }
  12505. var fieldsSchema = {};
  12506. if (rule.defaultField) {
  12507. for (var k in data.value) {
  12508. if (data.value.hasOwnProperty(k)) {
  12509. fieldsSchema[k] = rule.defaultField;
  12510. }
  12511. }
  12512. }
  12513. fieldsSchema = _extends({}, fieldsSchema, {}, data.rule.fields);
  12514. for (var f in fieldsSchema) {
  12515. if (fieldsSchema.hasOwnProperty(f)) {
  12516. var fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]];
  12517. fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f));
  12518. }
  12519. }
  12520. var schema = new Schema(fieldsSchema);
  12521. schema.messages(options.messages);
  12522. if (data.rule.options) {
  12523. data.rule.options.messages = options.messages;
  12524. data.rule.options.error = options.error;
  12525. }
  12526. schema.validate(data.value, data.rule.options || options, function (errs) {
  12527. var finalErrors = [];
  12528. if (errors && errors.length) {
  12529. finalErrors.push.apply(finalErrors, errors);
  12530. }
  12531. if (errs && errs.length) {
  12532. finalErrors.push.apply(finalErrors, errs);
  12533. }
  12534. doIt(finalErrors.length ? finalErrors : null);
  12535. });
  12536. }
  12537. }
  12538. var res;
  12539. if (rule.asyncValidator) {
  12540. res = rule.asyncValidator(rule, data.value, cb, data.source, options);
  12541. } else if (rule.validator) {
  12542. res = rule.validator(rule, data.value, cb, data.source, options);
  12543. if (res === true) {
  12544. cb();
  12545. } else if (res === false) {
  12546. cb(rule.message || rule.field + " fails");
  12547. } else if (res instanceof Array) {
  12548. cb(res);
  12549. } else if (res instanceof Error) {
  12550. cb(res.message);
  12551. }
  12552. }
  12553. if (res && res.then) {
  12554. res.then(function () {
  12555. return cb();
  12556. }, function (e) {
  12557. return cb(e);
  12558. });
  12559. }
  12560. }, function (results) {
  12561. complete(results);
  12562. });
  12563. },
  12564. getType: function getType(rule) {
  12565. if (rule.type === undefined && rule.pattern instanceof RegExp) {
  12566. rule.type = 'pattern';
  12567. }
  12568. if (typeof rule.validator !== 'function' && rule.type && !validators.hasOwnProperty(rule.type)) {
  12569. throw new Error(format('Unknown rule type %s', rule.type));
  12570. }
  12571. return rule.type || 'string';
  12572. },
  12573. getValidationMethod: function getValidationMethod(rule) {
  12574. if (typeof rule.validator === 'function') {
  12575. return rule.validator;
  12576. }
  12577. var keys = Object.keys(rule);
  12578. var messageIndex = keys.indexOf('message');
  12579. if (messageIndex !== -1) {
  12580. keys.splice(messageIndex, 1);
  12581. }
  12582. if (keys.length === 1 && keys[0] === 'required') {
  12583. return validators.required;
  12584. }
  12585. return validators[this.getType(rule)] || false;
  12586. } };
  12587. Schema.register = function register(type, validator) {
  12588. if (typeof validator !== 'function') {
  12589. throw new Error('Cannot register a validator by type, validator is not a function');
  12590. }
  12591. validators[type] = validator;
  12592. };
  12593. Schema.warning = warning;
  12594. Schema.messages = messages;var _default =
  12595. Schema;exports.default = _default;
  12596. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/node-libs-browser/mock/process.js */ 182)))
  12597. /***/ }),
  12598. /* 182 */
  12599. /*!********************************************************!*\
  12600. !*** ./node_modules/node-libs-browser/mock/process.js ***!
  12601. \********************************************************/
  12602. /*! no static exports found */
  12603. /***/ (function(module, exports, __webpack_require__) {
  12604. exports.nextTick = function nextTick(fn) {
  12605. var args = Array.prototype.slice.call(arguments);
  12606. args.shift();
  12607. setTimeout(function () {
  12608. fn.apply(null, args);
  12609. }, 0);
  12610. };
  12611. exports.platform = exports.arch =
  12612. exports.execPath = exports.title = 'browser';
  12613. exports.pid = 1;
  12614. exports.browser = true;
  12615. exports.env = {};
  12616. exports.argv = [];
  12617. exports.binding = function (name) {
  12618. throw new Error('No such module. (Possibly not yet loaded)')
  12619. };
  12620. (function () {
  12621. var cwd = '/';
  12622. var path;
  12623. exports.cwd = function () { return cwd };
  12624. exports.chdir = function (dir) {
  12625. if (!path) path = __webpack_require__(/*! path */ 183);
  12626. cwd = path.resolve(dir, cwd);
  12627. };
  12628. })();
  12629. exports.exit = exports.kill =
  12630. exports.umask = exports.dlopen =
  12631. exports.uptime = exports.memoryUsage =
  12632. exports.uvCounters = function() {};
  12633. exports.features = {};
  12634. /***/ }),
  12635. /* 183 */
  12636. /*!***********************************************!*\
  12637. !*** ./node_modules/path-browserify/index.js ***!
  12638. \***********************************************/
  12639. /*! no static exports found */
  12640. /***/ (function(module, exports, __webpack_require__) {
  12641. /* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
  12642. // backported and transplited with Babel, with backwards-compat fixes
  12643. // Copyright Joyent, Inc. and other Node contributors.
  12644. //
  12645. // Permission is hereby granted, free of charge, to any person obtaining a
  12646. // copy of this software and associated documentation files (the
  12647. // "Software"), to deal in the Software without restriction, including
  12648. // without limitation the rights to use, copy, modify, merge, publish,
  12649. // distribute, sublicense, and/or sell copies of the Software, and to permit
  12650. // persons to whom the Software is furnished to do so, subject to the
  12651. // following conditions:
  12652. //
  12653. // The above copyright notice and this permission notice shall be included
  12654. // in all copies or substantial portions of the Software.
  12655. //
  12656. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  12657. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  12658. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  12659. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  12660. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  12661. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  12662. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  12663. // resolves . and .. elements in a path array with directory names there
  12664. // must be no slashes, empty elements, or device names (c:\) in the array
  12665. // (so also no leading and trailing slashes - it does not distinguish
  12666. // relative and absolute paths)
  12667. function normalizeArray(parts, allowAboveRoot) {
  12668. // if the path tries to go above the root, `up` ends up > 0
  12669. var up = 0;
  12670. for (var i = parts.length - 1; i >= 0; i--) {
  12671. var last = parts[i];
  12672. if (last === '.') {
  12673. parts.splice(i, 1);
  12674. } else if (last === '..') {
  12675. parts.splice(i, 1);
  12676. up++;
  12677. } else if (up) {
  12678. parts.splice(i, 1);
  12679. up--;
  12680. }
  12681. }
  12682. // if the path is allowed to go above the root, restore leading ..s
  12683. if (allowAboveRoot) {
  12684. for (; up--; up) {
  12685. parts.unshift('..');
  12686. }
  12687. }
  12688. return parts;
  12689. }
  12690. // path.resolve([from ...], to)
  12691. // posix version
  12692. exports.resolve = function() {
  12693. var resolvedPath = '',
  12694. resolvedAbsolute = false;
  12695. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  12696. var path = (i >= 0) ? arguments[i] : process.cwd();
  12697. // Skip empty and invalid entries
  12698. if (typeof path !== 'string') {
  12699. throw new TypeError('Arguments to path.resolve must be strings');
  12700. } else if (!path) {
  12701. continue;
  12702. }
  12703. resolvedPath = path + '/' + resolvedPath;
  12704. resolvedAbsolute = path.charAt(0) === '/';
  12705. }
  12706. // At this point the path should be resolved to a full absolute path, but
  12707. // handle relative paths to be safe (might happen when process.cwd() fails)
  12708. // Normalize the path
  12709. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  12710. return !!p;
  12711. }), !resolvedAbsolute).join('/');
  12712. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  12713. };
  12714. // path.normalize(path)
  12715. // posix version
  12716. exports.normalize = function(path) {
  12717. var isAbsolute = exports.isAbsolute(path),
  12718. trailingSlash = substr(path, -1) === '/';
  12719. // Normalize the path
  12720. path = normalizeArray(filter(path.split('/'), function(p) {
  12721. return !!p;
  12722. }), !isAbsolute).join('/');
  12723. if (!path && !isAbsolute) {
  12724. path = '.';
  12725. }
  12726. if (path && trailingSlash) {
  12727. path += '/';
  12728. }
  12729. return (isAbsolute ? '/' : '') + path;
  12730. };
  12731. // posix version
  12732. exports.isAbsolute = function(path) {
  12733. return path.charAt(0) === '/';
  12734. };
  12735. // posix version
  12736. exports.join = function() {
  12737. var paths = Array.prototype.slice.call(arguments, 0);
  12738. return exports.normalize(filter(paths, function(p, index) {
  12739. if (typeof p !== 'string') {
  12740. throw new TypeError('Arguments to path.join must be strings');
  12741. }
  12742. return p;
  12743. }).join('/'));
  12744. };
  12745. // path.relative(from, to)
  12746. // posix version
  12747. exports.relative = function(from, to) {
  12748. from = exports.resolve(from).substr(1);
  12749. to = exports.resolve(to).substr(1);
  12750. function trim(arr) {
  12751. var start = 0;
  12752. for (; start < arr.length; start++) {
  12753. if (arr[start] !== '') break;
  12754. }
  12755. var end = arr.length - 1;
  12756. for (; end >= 0; end--) {
  12757. if (arr[end] !== '') break;
  12758. }
  12759. if (start > end) return [];
  12760. return arr.slice(start, end - start + 1);
  12761. }
  12762. var fromParts = trim(from.split('/'));
  12763. var toParts = trim(to.split('/'));
  12764. var length = Math.min(fromParts.length, toParts.length);
  12765. var samePartsLength = length;
  12766. for (var i = 0; i < length; i++) {
  12767. if (fromParts[i] !== toParts[i]) {
  12768. samePartsLength = i;
  12769. break;
  12770. }
  12771. }
  12772. var outputParts = [];
  12773. for (var i = samePartsLength; i < fromParts.length; i++) {
  12774. outputParts.push('..');
  12775. }
  12776. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  12777. return outputParts.join('/');
  12778. };
  12779. exports.sep = '/';
  12780. exports.delimiter = ':';
  12781. exports.dirname = function (path) {
  12782. if (typeof path !== 'string') path = path + '';
  12783. if (path.length === 0) return '.';
  12784. var code = path.charCodeAt(0);
  12785. var hasRoot = code === 47 /*/*/;
  12786. var end = -1;
  12787. var matchedSlash = true;
  12788. for (var i = path.length - 1; i >= 1; --i) {
  12789. code = path.charCodeAt(i);
  12790. if (code === 47 /*/*/) {
  12791. if (!matchedSlash) {
  12792. end = i;
  12793. break;
  12794. }
  12795. } else {
  12796. // We saw the first non-path separator
  12797. matchedSlash = false;
  12798. }
  12799. }
  12800. if (end === -1) return hasRoot ? '/' : '.';
  12801. if (hasRoot && end === 1) {
  12802. // return '//';
  12803. // Backwards-compat fix:
  12804. return '/';
  12805. }
  12806. return path.slice(0, end);
  12807. };
  12808. function basename(path) {
  12809. if (typeof path !== 'string') path = path + '';
  12810. var start = 0;
  12811. var end = -1;
  12812. var matchedSlash = true;
  12813. var i;
  12814. for (i = path.length - 1; i >= 0; --i) {
  12815. if (path.charCodeAt(i) === 47 /*/*/) {
  12816. // If we reached a path separator that was not part of a set of path
  12817. // separators at the end of the string, stop now
  12818. if (!matchedSlash) {
  12819. start = i + 1;
  12820. break;
  12821. }
  12822. } else if (end === -1) {
  12823. // We saw the first non-path separator, mark this as the end of our
  12824. // path component
  12825. matchedSlash = false;
  12826. end = i + 1;
  12827. }
  12828. }
  12829. if (end === -1) return '';
  12830. return path.slice(start, end);
  12831. }
  12832. // Uses a mixed approach for backwards-compatibility, as ext behavior changed
  12833. // in new Node.js versions, so only basename() above is backported here
  12834. exports.basename = function (path, ext) {
  12835. var f = basename(path);
  12836. if (ext && f.substr(-1 * ext.length) === ext) {
  12837. f = f.substr(0, f.length - ext.length);
  12838. }
  12839. return f;
  12840. };
  12841. exports.extname = function (path) {
  12842. if (typeof path !== 'string') path = path + '';
  12843. var startDot = -1;
  12844. var startPart = 0;
  12845. var end = -1;
  12846. var matchedSlash = true;
  12847. // Track the state of characters (if any) we see before our first dot and
  12848. // after any path separator we find
  12849. var preDotState = 0;
  12850. for (var i = path.length - 1; i >= 0; --i) {
  12851. var code = path.charCodeAt(i);
  12852. if (code === 47 /*/*/) {
  12853. // If we reached a path separator that was not part of a set of path
  12854. // separators at the end of the string, stop now
  12855. if (!matchedSlash) {
  12856. startPart = i + 1;
  12857. break;
  12858. }
  12859. continue;
  12860. }
  12861. if (end === -1) {
  12862. // We saw the first non-path separator, mark this as the end of our
  12863. // extension
  12864. matchedSlash = false;
  12865. end = i + 1;
  12866. }
  12867. if (code === 46 /*.*/) {
  12868. // If this is our first dot, mark it as the start of our extension
  12869. if (startDot === -1)
  12870. startDot = i;
  12871. else if (preDotState !== 1)
  12872. preDotState = 1;
  12873. } else if (startDot !== -1) {
  12874. // We saw a non-dot and non-path separator before our dot, so we should
  12875. // have a good chance at having a non-empty extension
  12876. preDotState = -1;
  12877. }
  12878. }
  12879. if (startDot === -1 || end === -1 ||
  12880. // We saw a non-dot character immediately before the dot
  12881. preDotState === 0 ||
  12882. // The (right-most) trimmed path component is exactly '..'
  12883. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  12884. return '';
  12885. }
  12886. return path.slice(startDot, end);
  12887. };
  12888. function filter (xs, f) {
  12889. if (xs.filter) return xs.filter(f);
  12890. var res = [];
  12891. for (var i = 0; i < xs.length; i++) {
  12892. if (f(xs[i], i, xs)) res.push(xs[i]);
  12893. }
  12894. return res;
  12895. }
  12896. // String.prototype.substr - negative index don't work in IE8
  12897. var substr = 'ab'.substr(-1) === 'b'
  12898. ? function (str, start, len) { return str.substr(start, len) }
  12899. : function (str, start, len) {
  12900. if (start < 0) start = str.length + start;
  12901. return str.substr(start, len);
  12902. }
  12903. ;
  12904. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 182)))
  12905. /***/ })
  12906. ]]);
  12907. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map