vendor.js 488 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!*********************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js ***!
  5. \*********************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. Object.defineProperty(exports, "__esModule", {
  10. value: true
  11. });
  12. exports.default = void 0;
  13. var objectKeys = ['qy', 'env', 'error', 'version', 'lanDebug', 'cloud', 'serviceMarket', 'router', 'worklet'];
  14. var singlePageDisableKey = ['lanDebug', 'router', 'worklet'];
  15. var target = typeof globalThis !== 'undefined' ? globalThis : function () {
  16. return this;
  17. }();
  18. var key = ['w', 'x'].join('');
  19. var oldWx = target[key];
  20. var launchOption = oldWx.getLaunchOptionsSync ? oldWx.getLaunchOptionsSync() : null;
  21. function isWxKey(key) {
  22. if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
  23. return false;
  24. }
  25. return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function';
  26. }
  27. function initWx() {
  28. var newWx = {};
  29. for (var _key in oldWx) {
  30. if (isWxKey(_key)) {
  31. // TODO wrapper function
  32. newWx[_key] = oldWx[_key];
  33. }
  34. }
  35. return newWx;
  36. }
  37. target[key] = initWx();
  38. var _default = target[key];
  39. exports.default = _default;
  40. /***/ }),
  41. /***/ 10:
  42. /*!****************************************************************!*\
  43. !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
  44. \****************************************************************/
  45. /*! no static exports found */
  46. /***/ (function(module, exports) {
  47. function _nonIterableRest() {
  48. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  49. }
  50. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  51. /***/ }),
  52. /***/ 11:
  53. /*!***************************************************************!*\
  54. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  55. \***************************************************************/
  56. /*! no static exports found */
  57. /***/ (function(module, exports, __webpack_require__) {
  58. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  59. function _defineProperty(obj, key, value) {
  60. key = toPropertyKey(key);
  61. if (key in obj) {
  62. Object.defineProperty(obj, key, {
  63. value: value,
  64. enumerable: true,
  65. configurable: true,
  66. writable: true
  67. });
  68. } else {
  69. obj[key] = value;
  70. }
  71. return obj;
  72. }
  73. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  74. /***/ }),
  75. /***/ 12:
  76. /*!**************************************************************!*\
  77. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  78. \**************************************************************/
  79. /*! no static exports found */
  80. /***/ (function(module, exports, __webpack_require__) {
  81. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  82. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  83. function _toPropertyKey(arg) {
  84. var key = toPrimitive(arg, "string");
  85. return _typeof(key) === "symbol" ? key : String(key);
  86. }
  87. module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  88. /***/ }),
  89. /***/ 124:
  90. /*!************************************************!*\
  91. !*** E:/work/mdapp/js_sdk/xb-copy/uni-copy.js ***!
  92. \************************************************/
  93. /*! no static exports found */
  94. /***/ (function(module, exports, __webpack_require__) {
  95. "use strict";
  96. /* WEBPACK VAR INJECTION */(function(uni) {
  97. Object.defineProperty(exports, "__esModule", {
  98. value: true
  99. });
  100. exports.default = uniCopy;
  101. function uniCopy(_ref) {
  102. var content = _ref.content,
  103. _success = _ref.success,
  104. error = _ref.error;
  105. if (!content) return error('复制的内容不能为空 !');
  106. content = typeof content === 'string' ? content : content.toString(); // 复制内容,必须字符串,数字需要转换为字符串
  107. /**
  108. * 小程序端 和 app端的复制逻辑
  109. */
  110. uni.setClipboardData({
  111. data: content,
  112. success: function success() {
  113. _success("复制成功~");
  114. console.log('success');
  115. },
  116. fail: function fail() {
  117. _success("复制失败~");
  118. }
  119. });
  120. /**
  121. * H5端的复制逻辑
  122. */
  123. }
  124. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  125. /***/ }),
  126. /***/ 13:
  127. /*!*******************************************************!*\
  128. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  129. \*******************************************************/
  130. /*! no static exports found */
  131. /***/ (function(module, exports) {
  132. function _typeof(obj) {
  133. "@babel/helpers - typeof";
  134. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  135. return typeof obj;
  136. } : function (obj) {
  137. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  138. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
  139. }
  140. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  141. /***/ }),
  142. /***/ 14:
  143. /*!************************************************************!*\
  144. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  145. \************************************************************/
  146. /*! no static exports found */
  147. /***/ (function(module, exports, __webpack_require__) {
  148. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  149. function _toPrimitive(input, hint) {
  150. if (_typeof(input) !== "object" || input === null) return input;
  151. var prim = input[Symbol.toPrimitive];
  152. if (prim !== undefined) {
  153. var res = prim.call(input, hint || "default");
  154. if (_typeof(res) !== "object") return res;
  155. throw new TypeError("@@toPrimitive must return a primitive value.");
  156. }
  157. return (hint === "string" ? String : Number)(input);
  158. }
  159. module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  160. /***/ }),
  161. /***/ 149:
  162. /*!*************************************!*\
  163. !*** E:/work/mdapp/utils/qrcode.js ***!
  164. \*************************************/
  165. /*! no static exports found */
  166. /***/ (function(module, exports, __webpack_require__) {
  167. "use strict";
  168. /* WEBPACK VAR INJECTION */(function(uni) {
  169. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  170. Object.defineProperty(exports, "__esModule", {
  171. value: true
  172. });
  173. exports.default = void 0;
  174. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  175. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  176. /**
  177. * qrcode-wx-miniprogram
  178. */
  179. var QRMode = {
  180. MODE_NUMBER: 1 << 0,
  181. MODE_ALPHA_NUM: 1 << 1,
  182. MODE_8BIT_BYTE: 1 << 2,
  183. MODE_KANJI: 1 << 3
  184. },
  185. QRErrorCorrectLevel = {
  186. L: 1,
  187. M: 0,
  188. Q: 3,
  189. H: 2
  190. },
  191. QRMaskPattern = {
  192. PATTERN000: 0,
  193. PATTERN001: 1,
  194. PATTERN010: 2,
  195. PATTERN011: 3,
  196. PATTERN100: 4,
  197. PATTERN101: 5,
  198. PATTERN110: 6,
  199. PATTERN111: 7
  200. },
  201. QRUtil = {
  202. PATTERN_POSITION_TABLE: [[], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50], [6, 30, 54], [6, 32, 58], [6, 34, 62], [6, 26, 46, 66], [6, 26, 48, 70], [6, 26, 50, 74], [6, 30, 54, 78], [6, 30, 56, 82], [6, 30, 58, 86], [6, 34, 62, 90], [6, 28, 50, 72, 94], [6, 26, 50, 74, 98], [6, 30, 54, 78, 102], [6, 28, 54, 80, 106], [6, 32, 58, 84, 110], [6, 30, 58, 86, 114], [6, 34, 62, 90, 118], [6, 26, 50, 74, 98, 122], [6, 30, 54, 78, 102, 126], [6, 26, 52, 78, 104, 130], [6, 30, 56, 82, 108, 134], [6, 34, 60, 86, 112, 138], [6, 30, 58, 86, 114, 142], [6, 34, 62, 90, 118, 146], [6, 30, 54, 78, 102, 126, 150], [6, 24, 50, 76, 102, 128, 154], [6, 28, 54, 80, 106, 132, 158], [6, 32, 58, 84, 110, 136, 162], [6, 26, 54, 82, 110, 138, 166], [6, 30, 58, 86, 114, 142, 170]],
  203. G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,
  204. G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,
  205. G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,
  206. getBCHTypeInfo: function getBCHTypeInfo(data) {
  207. var d = data << 10;
  208. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
  209. d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15);
  210. }
  211. return (data << 10 | d) ^ QRUtil.G15_MASK;
  212. },
  213. getBCHTypeNumber: function getBCHTypeNumber(data) {
  214. var d = data << 12;
  215. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
  216. d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18);
  217. }
  218. return data << 12 | d;
  219. },
  220. getBCHDigit: function getBCHDigit(data) {
  221. var digit = 0;
  222. while (data != 0) {
  223. digit++;
  224. data >>>= 1;
  225. }
  226. return digit;
  227. },
  228. getPatternPosition: function getPatternPosition(typeNumber) {
  229. return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
  230. },
  231. getMask: function getMask(maskPattern, i, j) {
  232. switch (maskPattern) {
  233. case QRMaskPattern.PATTERN000:
  234. return (i + j) % 2 == 0;
  235. case QRMaskPattern.PATTERN001:
  236. return i % 2 == 0;
  237. case QRMaskPattern.PATTERN010:
  238. return j % 3 == 0;
  239. case QRMaskPattern.PATTERN011:
  240. return (i + j) % 3 == 0;
  241. case QRMaskPattern.PATTERN100:
  242. return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
  243. case QRMaskPattern.PATTERN101:
  244. return i * j % 2 + i * j % 3 == 0;
  245. case QRMaskPattern.PATTERN110:
  246. return (i * j % 2 + i * j % 3) % 2 == 0;
  247. case QRMaskPattern.PATTERN111:
  248. return (i * j % 3 + (i + j) % 2) % 2 == 0;
  249. default:
  250. //throw new Error("bad maskPattern:" + maskPattern);
  251. throwError("bad maskPattern:" + maskPattern);
  252. }
  253. },
  254. getErrorCorrectPolynomial: function getErrorCorrectPolynomial(errorCorrectLength) {
  255. var a = new QRPolynomial([1], 0);
  256. for (var i = 0; i < errorCorrectLength; i++) {
  257. a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
  258. }
  259. return a;
  260. },
  261. getLengthInBits: function getLengthInBits(mode, type) {
  262. if (1 <= type && type < 10) {
  263. switch (mode) {
  264. case QRMode.MODE_NUMBER:
  265. return 10;
  266. case QRMode.MODE_ALPHA_NUM:
  267. return 9;
  268. case QRMode.MODE_8BIT_BYTE:
  269. return 8;
  270. case QRMode.MODE_KANJI:
  271. return 8;
  272. default:
  273. //throw new Error("mode:" + mode);
  274. throwError("mode:" + mode);
  275. }
  276. } else if (type < 27) {
  277. switch (mode) {
  278. case QRMode.MODE_NUMBER:
  279. return 12;
  280. case QRMode.MODE_ALPHA_NUM:
  281. return 11;
  282. case QRMode.MODE_8BIT_BYTE:
  283. return 16;
  284. case QRMode.MODE_KANJI:
  285. return 10;
  286. default:
  287. //throw new Error("mode:" + mode);
  288. throwError("mode:" + mode);
  289. }
  290. } else if (type < 41) {
  291. switch (mode) {
  292. case QRMode.MODE_NUMBER:
  293. return 14;
  294. case QRMode.MODE_ALPHA_NUM:
  295. return 13;
  296. case QRMode.MODE_8BIT_BYTE:
  297. return 16;
  298. case QRMode.MODE_KANJI:
  299. return 12;
  300. default:
  301. //throw new Error("mode:" + mode);
  302. throwError("mode:" + mode);
  303. }
  304. } else {
  305. //throw new Error("type:" + type);
  306. throwError("type:" + type);
  307. }
  308. },
  309. getLostPoint: function getLostPoint(qrCode) {
  310. var moduleCount = qrCode.getModuleCount();
  311. var lostPoint = 0;
  312. for (var row = 0; row < moduleCount; row++) {
  313. for (var col = 0; col < moduleCount; col++) {
  314. var sameCount = 0;
  315. var dark = qrCode.isDark(row, col);
  316. for (var r = -1; r <= 1; r++) {
  317. if (row + r < 0 || moduleCount <= row + r) {
  318. continue;
  319. }
  320. for (var c = -1; c <= 1; c++) {
  321. if (col + c < 0 || moduleCount <= col + c) {
  322. continue;
  323. }
  324. if (r == 0 && c == 0) {
  325. continue;
  326. }
  327. if (dark == qrCode.isDark(row + r, col + c)) {
  328. sameCount++;
  329. }
  330. }
  331. }
  332. if (sameCount > 5) {
  333. lostPoint += 3 + sameCount - 5;
  334. }
  335. }
  336. }
  337. for (var row = 0; row < moduleCount - 1; row++) {
  338. for (var col = 0; col < moduleCount - 1; col++) {
  339. var count = 0;
  340. if (qrCode.isDark(row, col)) count++;
  341. if (qrCode.isDark(row + 1, col)) count++;
  342. if (qrCode.isDark(row, col + 1)) count++;
  343. if (qrCode.isDark(row + 1, col + 1)) count++;
  344. if (count == 0 || count == 4) {
  345. lostPoint += 3;
  346. }
  347. }
  348. }
  349. for (var row = 0; row < moduleCount; row++) {
  350. for (var col = 0; col < moduleCount - 6; col++) {
  351. if (qrCode.isDark(row, col) && !qrCode.isDark(row, col + 1) && qrCode.isDark(row, col + 2) && qrCode.isDark(row, col + 3) && qrCode.isDark(row, col + 4) && !qrCode.isDark(row, col + 5) && qrCode.isDark(row, col + 6)) {
  352. lostPoint += 40;
  353. }
  354. }
  355. }
  356. for (var col = 0; col < moduleCount; col++) {
  357. for (var row = 0; row < moduleCount - 6; row++) {
  358. if (qrCode.isDark(row, col) && !qrCode.isDark(row + 1, col) && qrCode.isDark(row + 2, col) && qrCode.isDark(row + 3, col) && qrCode.isDark(row + 4, col) && !qrCode.isDark(row + 5, col) && qrCode.isDark(row + 6, col)) {
  359. lostPoint += 40;
  360. }
  361. }
  362. }
  363. var darkCount = 0;
  364. for (var col = 0; col < moduleCount; col++) {
  365. for (var row = 0; row < moduleCount; row++) {
  366. if (qrCode.isDark(row, col)) {
  367. darkCount++;
  368. }
  369. }
  370. }
  371. var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
  372. lostPoint += ratio * 10;
  373. return lostPoint;
  374. }
  375. },
  376. QRMath = {
  377. glog: function glog(n) {
  378. if (n < 1) {
  379. //throw new Error("glog(" + n + ")");
  380. throwError("glog(" + n + ")");
  381. }
  382. return QRMath.LOG_TABLE[n];
  383. },
  384. gexp: function gexp(n) {
  385. while (n < 0) {
  386. n += 255;
  387. }
  388. while (n >= 256) {
  389. n -= 255;
  390. }
  391. return QRMath.EXP_TABLE[n];
  392. },
  393. EXP_TABLE: new Array(256),
  394. LOG_TABLE: new Array(256)
  395. };
  396. for (var i = 0; i < 8; i++) {
  397. QRMath.EXP_TABLE[i] = 1 << i;
  398. }
  399. for (var _i = 8; _i < 256; _i++) {
  400. QRMath.EXP_TABLE[_i] = QRMath.EXP_TABLE[_i - 4] ^ QRMath.EXP_TABLE[_i - 5] ^ QRMath.EXP_TABLE[_i - 6] ^ QRMath.EXP_TABLE[_i - 8];
  401. }
  402. for (var _i2 = 0; _i2 < 255; _i2++) {
  403. QRMath.LOG_TABLE[QRMath.EXP_TABLE[_i2]] = _i2;
  404. }
  405. /*
  406. * class QR8bitByte
  407. * */
  408. var QR8bitByte = /*#__PURE__*/function () {
  409. function QR8bitByte(data) {
  410. (0, _classCallCheck2.default)(this, QR8bitByte);
  411. this.mode = QRMode.MODE_8BIT_BYTE;
  412. this.data = data;
  413. this.parsedData = [];
  414. // Added to support UTF-8 Characters
  415. for (var _i3 = 0, l = this.data.length; _i3 < l; _i3++) {
  416. var byteArray = [],
  417. code = this.data.charCodeAt(_i3);
  418. if (code > 0x10000) {
  419. byteArray[0] = 0xF0 | (code & 0x1C0000) >>> 18;
  420. byteArray[1] = 0x80 | (code & 0x3F000) >>> 12;
  421. byteArray[2] = 0x80 | (code & 0xFC0) >>> 6;
  422. byteArray[3] = 0x80 | code & 0x3F;
  423. } else if (code > 0x800) {
  424. byteArray[0] = 0xE0 | (code & 0xF000) >>> 12;
  425. byteArray[1] = 0x80 | (code & 0xFC0) >>> 6;
  426. byteArray[2] = 0x80 | code & 0x3F;
  427. } else if (code > 0x80) {
  428. byteArray[0] = 0xC0 | (code & 0x7C0) >>> 6;
  429. byteArray[1] = 0x80 | code & 0x3F;
  430. } else {
  431. byteArray[0] = code;
  432. }
  433. this.parsedData.push(byteArray);
  434. }
  435. this.parsedData = Array.prototype.concat.apply([], this.parsedData);
  436. if (this.parsedData.length !== this.data.length) {
  437. this.parsedData.unshift(191);
  438. this.parsedData.unshift(187);
  439. this.parsedData.unshift(239);
  440. }
  441. }
  442. (0, _createClass2.default)(QR8bitByte, [{
  443. key: "getLength",
  444. value: function getLength(buffer) {
  445. return this.parsedData.length;
  446. }
  447. }, {
  448. key: "write",
  449. value: function write(buffer) {
  450. for (var _i4 = 0, l = this.parsedData.length; _i4 < l; _i4++) {
  451. buffer.put(this.parsedData[_i4], 8);
  452. }
  453. }
  454. }]);
  455. return QR8bitByte;
  456. }();
  457. /*
  458. * class QRCodeModel
  459. * */
  460. var QRCodeModel = /*#__PURE__*/function () {
  461. function QRCodeModel(typeNumber, errorCorrectLevel) {
  462. (0, _classCallCheck2.default)(this, QRCodeModel);
  463. this.typeNumber = typeNumber;
  464. this.errorCorrectLevel = errorCorrectLevel;
  465. this.modules = null;
  466. this.moduleCount = 0;
  467. this.dataCache = null;
  468. this.dataList = [];
  469. }
  470. (0, _createClass2.default)(QRCodeModel, [{
  471. key: "addData",
  472. value: function addData(data) {
  473. var newData = new QR8bitByte(data);
  474. this.dataList.push(newData);
  475. this.dataCache = null;
  476. }
  477. }, {
  478. key: "isDark",
  479. value: function isDark(row, col) {
  480. if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {
  481. //throw new Error(row + ',' + col);
  482. throwError(row + ',' + col);
  483. }
  484. return this.modules[row][col];
  485. }
  486. }, {
  487. key: "getModuleCount",
  488. value: function getModuleCount() {
  489. return this.moduleCount;
  490. }
  491. }, {
  492. key: "make",
  493. value: function make() {
  494. this.makeImpl(false, this.getBestMaskPattern());
  495. }
  496. }, {
  497. key: "makeImpl",
  498. value: function makeImpl(test, maskPattern) {
  499. this.moduleCount = this.typeNumber * 4 + 17;
  500. this.modules = new Array(this.moduleCount);
  501. for (var row = 0; row < this.moduleCount; row++) {
  502. this.modules[row] = new Array(this.moduleCount);
  503. for (var col = 0; col < this.moduleCount; col++) {
  504. this.modules[row][col] = null;
  505. }
  506. }
  507. this.setupPositionProbePattern(0, 0);
  508. this.setupPositionProbePattern(this.moduleCount - 7, 0);
  509. this.setupPositionProbePattern(0, this.moduleCount - 7);
  510. this.setupPositionAdjustPattern();
  511. this.setupTimingPattern();
  512. this.setupTypeInfo(test, maskPattern);
  513. if (this.typeNumber >= 7) {
  514. this.setupTypeNumber(test);
  515. }
  516. if (this.dataCache == null) {
  517. this.dataCache = QRCodeModel.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);
  518. }
  519. this.mapData(this.dataCache, maskPattern);
  520. }
  521. }, {
  522. key: "setupPositionProbePattern",
  523. value: function setupPositionProbePattern(row, col) {
  524. for (var r = -1; r <= 7; r++) {
  525. if (row + r <= -1 || this.moduleCount <= row + r) {
  526. continue;
  527. }
  528. for (var c = -1; c <= 7; c++) {
  529. if (col + c <= -1 || this.moduleCount <= col + c) {
  530. continue;
  531. }
  532. this.modules[row + r][col + c] = 0 <= r && r <= 6 && (c == 0 || c == 6) || 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4;
  533. }
  534. }
  535. }
  536. }, {
  537. key: "getBestMaskPattern",
  538. value: function getBestMaskPattern() {
  539. var minLostPoint = 0,
  540. pattern = 0;
  541. for (var _i5 = 0; _i5 < 8; _i5++) {
  542. this.makeImpl(true, _i5);
  543. var lostPoint = QRUtil.getLostPoint(this);
  544. if (_i5 == 0 || minLostPoint > lostPoint) {
  545. minLostPoint = lostPoint;
  546. pattern = _i5;
  547. }
  548. }
  549. return pattern;
  550. }
  551. }, {
  552. key: "setupTimingPattern",
  553. value: function setupTimingPattern() {
  554. for (var r = 8; r < this.moduleCount - 8; r++) {
  555. if (this.modules[r][6] != null) {
  556. continue;
  557. }
  558. this.modules[r][6] = r % 2 == 0;
  559. }
  560. for (var c = 8; c < this.moduleCount - 8; c++) {
  561. if (this.modules[6][c] != null) {
  562. continue;
  563. }
  564. this.modules[6][c] = c % 2 == 0;
  565. }
  566. }
  567. }, {
  568. key: "setupPositionAdjustPattern",
  569. value: function setupPositionAdjustPattern() {
  570. var pos = QRUtil.getPatternPosition(this.typeNumber);
  571. for (var _i6 = 0; _i6 < pos.length; _i6++) {
  572. for (var j = 0; j < pos.length; j++) {
  573. var row = pos[_i6],
  574. col = pos[j];
  575. if (this.modules[row][col] != null) {
  576. continue;
  577. }
  578. for (var r = -2; r <= 2; r++) {
  579. for (var c = -2; c <= 2; c++) {
  580. this.modules[row + r][col + c] = r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c == 0;
  581. }
  582. }
  583. }
  584. }
  585. }
  586. }, {
  587. key: "setupTypeNumber",
  588. value: function setupTypeNumber(test) {
  589. var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
  590. for (var _i7 = 0; _i7 < 18; _i7++) {
  591. this.modules[Math.floor(_i7 / 3)][_i7 % 3 + this.moduleCount - 8 - 3] = !test && (bits >> _i7 & 1) == 1;
  592. }
  593. for (var _i8 = 0; _i8 < 18; _i8++) {
  594. this.modules[_i8 % 3 + this.moduleCount - 8 - 3][Math.floor(_i8 / 3)] = !test && (bits >> _i8 & 1) == 1;
  595. }
  596. }
  597. }, {
  598. key: "setupTypeInfo",
  599. value: function setupTypeInfo(test, maskPattern) {
  600. var data = this.errorCorrectLevel << 3 | maskPattern,
  601. bits = QRUtil.getBCHTypeInfo(data);
  602. for (var _i9 = 0; _i9 < 15; _i9++) {
  603. var mod = !test && (bits >> _i9 & 1) == 1;
  604. if (_i9 < 6) {
  605. this.modules[_i9][8] = mod;
  606. } else if (_i9 < 8) {
  607. this.modules[_i9 + 1][8] = mod;
  608. } else {
  609. this.modules[this.moduleCount - 15 + _i9][8] = mod;
  610. }
  611. }
  612. for (var _i10 = 0; _i10 < 15; _i10++) {
  613. var _mod = !test && (bits >> _i10 & 1) == 1;
  614. if (_i10 < 8) {
  615. this.modules[8][this.moduleCount - _i10 - 1] = _mod;
  616. } else if (_i10 < 9) {
  617. this.modules[8][15 - _i10 - 1 + 1] = _mod;
  618. } else {
  619. this.modules[8][15 - _i10 - 1] = _mod;
  620. }
  621. }
  622. this.modules[this.moduleCount - 8][8] = !test;
  623. }
  624. }, {
  625. key: "mapData",
  626. value: function mapData(data, maskPattern) {
  627. var inc = -1,
  628. row = this.moduleCount - 1,
  629. bitIndex = 7,
  630. byteIndex = 0;
  631. for (var col = this.moduleCount - 1; col > 0; col -= 2) {
  632. if (col == 6) col--;
  633. while (true) {
  634. for (var c = 0; c < 2; c++) {
  635. if (this.modules[row][col - c] == null) {
  636. var dark = false;
  637. if (byteIndex < data.length) {
  638. dark = (data[byteIndex] >>> bitIndex & 1) == 1;
  639. }
  640. var mask = QRUtil.getMask(maskPattern, row, col - c);
  641. if (mask) {
  642. dark = !dark;
  643. }
  644. this.modules[row][col - c] = dark;
  645. bitIndex--;
  646. if (bitIndex == -1) {
  647. byteIndex++;
  648. bitIndex = 7;
  649. }
  650. }
  651. }
  652. row += inc;
  653. if (row < 0 || this.moduleCount <= row) {
  654. row -= inc;
  655. inc = -inc;
  656. break;
  657. }
  658. }
  659. }
  660. }
  661. }]);
  662. return QRCodeModel;
  663. }();
  664. QRCodeModel.PAD0 = 0xEC;
  665. QRCodeModel.PAD1 = 0x11;
  666. QRCodeModel.createData = function (typeNumber, errorCorrectLevel, dataList) {
  667. var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel),
  668. buffer = new QRBitBuffer();
  669. for (var _i11 = 0; _i11 < dataList.length; _i11++) {
  670. var data = dataList[_i11];
  671. buffer.put(data.mode, 4);
  672. buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber));
  673. data.write(buffer);
  674. }
  675. var totalDataCount = 0;
  676. for (var _i12 = 0; _i12 < rsBlocks.length; _i12++) {
  677. totalDataCount += rsBlocks[_i12].dataCount;
  678. }
  679. if (buffer.getLengthInBits() > totalDataCount * 8) {
  680. /*
  681. throw new Error("code length overflow. (" +
  682. buffer.getLengthInBits() +
  683. ">" +
  684. totalDataCount * 8 +
  685. ")");
  686. */
  687. throwError("code length overflow. (" + buffer.getLengthInBits() + ">" + totalDataCount * 8 + ")");
  688. }
  689. if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
  690. buffer.put(0, 4);
  691. }
  692. while (buffer.getLengthInBits() % 8 != 0) {
  693. buffer.putBit(false);
  694. }
  695. while (true) {
  696. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  697. break;
  698. }
  699. buffer.put(QRCodeModel.PAD0, 8);
  700. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  701. break;
  702. }
  703. buffer.put(QRCodeModel.PAD1, 8);
  704. }
  705. return QRCodeModel.createBytes(buffer, rsBlocks);
  706. };
  707. QRCodeModel.createBytes = function (buffer, rsBlocks) {
  708. var offset = 0,
  709. maxDcCount = 0,
  710. maxEcCount = 0,
  711. dcData = new Array(rsBlocks.length),
  712. ecData = new Array(rsBlocks.length);
  713. for (var r = 0; r < rsBlocks.length; r++) {
  714. var dcCount = rsBlocks[r].dataCount,
  715. ecCount = rsBlocks[r].totalCount - dcCount;
  716. maxDcCount = Math.max(maxDcCount, dcCount);
  717. maxEcCount = Math.max(maxEcCount, ecCount);
  718. dcData[r] = new Array(dcCount);
  719. for (var _i13 = 0; _i13 < dcData[r].length; _i13++) {
  720. dcData[r][_i13] = 0xff & buffer.buffer[_i13 + offset];
  721. }
  722. offset += dcCount;
  723. var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount),
  724. rawPoly = new QRPolynomial(dcData[r], rsPoly.getLength() - 1),
  725. modPoly = rawPoly.mod(rsPoly);
  726. ecData[r] = new Array(rsPoly.getLength() - 1);
  727. for (var _i14 = 0; _i14 < ecData[r].length; _i14++) {
  728. var modIndex = _i14 + modPoly.getLength() - ecData[r].length;
  729. ecData[r][_i14] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
  730. }
  731. }
  732. var totalCodeCount = 0;
  733. for (var _i15 = 0; _i15 < rsBlocks.length; _i15++) {
  734. totalCodeCount += rsBlocks[_i15].totalCount;
  735. }
  736. var data = new Array(totalCodeCount),
  737. index = 0;
  738. for (var _i16 = 0; _i16 < maxDcCount; _i16++) {
  739. for (var _r = 0; _r < rsBlocks.length; _r++) {
  740. if (_i16 < dcData[_r].length) {
  741. data[index++] = dcData[_r][_i16];
  742. }
  743. }
  744. }
  745. for (var _i17 = 0; _i17 < maxEcCount; _i17++) {
  746. for (var _r2 = 0; _r2 < rsBlocks.length; _r2++) {
  747. if (_i17 < ecData[_r2].length) {
  748. data[index++] = ecData[_r2][_i17];
  749. }
  750. }
  751. }
  752. return data;
  753. };
  754. /*
  755. * class QRPolynomial
  756. * */
  757. var QRPolynomial = /*#__PURE__*/function () {
  758. function QRPolynomial(num, shift) {
  759. (0, _classCallCheck2.default)(this, QRPolynomial);
  760. if (num.length == undefined) {
  761. //throw new Error(num.length + '/' + shift);
  762. throwError(num.length + '/' + shift);
  763. }
  764. var offset = 0;
  765. while (offset < num.length && num[offset] == 0) {
  766. offset++;
  767. }
  768. this.num = new Array(num.length - offset + shift);
  769. for (var _i18 = 0; _i18 < num.length - offset; _i18++) {
  770. this.num[_i18] = num[_i18 + offset];
  771. }
  772. }
  773. (0, _createClass2.default)(QRPolynomial, [{
  774. key: "get",
  775. value: function get(index) {
  776. return this.num[index];
  777. }
  778. }, {
  779. key: "getLength",
  780. value: function getLength() {
  781. return this.num.length;
  782. }
  783. }, {
  784. key: "multiply",
  785. value: function multiply(e) {
  786. var num = new Array(this.getLength() + e.getLength() - 1);
  787. for (var _i19 = 0; _i19 < this.getLength(); _i19++) {
  788. for (var j = 0; j < e.getLength(); j++) {
  789. num[_i19 + j] ^= QRMath.gexp(QRMath.glog(this.get(_i19)) + QRMath.glog(e.get(j)));
  790. }
  791. }
  792. return new QRPolynomial(num, 0);
  793. }
  794. }, {
  795. key: "mod",
  796. value: function mod(e) {
  797. if (this.getLength() - e.getLength() < 0) {
  798. return this;
  799. }
  800. var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0)),
  801. num = new Array(this.getLength());
  802. for (var _i20 = 0; _i20 < this.getLength(); _i20++) {
  803. num[_i20] = this.get(_i20);
  804. }
  805. for (var _i21 = 0; _i21 < e.getLength(); _i21++) {
  806. num[_i21] ^= QRMath.gexp(QRMath.glog(e.get(_i21)) + ratio);
  807. }
  808. return new QRPolynomial(num, 0).mod(e);
  809. }
  810. }]);
  811. return QRPolynomial;
  812. }();
  813. /*
  814. * class QRRSBlock
  815. * */
  816. var QRRSBlock = /*#__PURE__*/(0, _createClass2.default)(function QRRSBlock(totalCount, dataCount) {
  817. (0, _classCallCheck2.default)(this, QRRSBlock);
  818. this.totalCount = totalCount;
  819. this.dataCount = dataCount;
  820. });
  821. QRRSBlock.RS_BLOCK_TABLE = [[1, 26, 19], [1, 26, 16], [1, 26, 13], [1, 26, 9], [1, 44, 34], [1, 44, 28], [1, 44, 22], [1, 44, 16], [1, 70, 55], [1, 70, 44], [2, 35, 17], [2, 35, 13], [1, 100, 80], [2, 50, 32], [2, 50, 24], [4, 25, 9], [1, 134, 108], [2, 67, 43], [2, 33, 15, 2, 34, 16], [2, 33, 11, 2, 34, 12], [2, 86, 68], [4, 43, 27], [4, 43, 19], [4, 43, 15], [2, 98, 78], [4, 49, 31], [2, 32, 14, 4, 33, 15], [4, 39, 13, 1, 40, 14], [2, 121, 97], [2, 60, 38, 2, 61, 39], [4, 40, 18, 2, 41, 19], [4, 40, 14, 2, 41, 15], [2, 146, 116], [3, 58, 36, 2, 59, 37], [4, 36, 16, 4, 37, 17], [4, 36, 12, 4, 37, 13], [2, 86, 68, 2, 87, 69], [4, 69, 43, 1, 70, 44], [6, 43, 19, 2, 44, 20], [6, 43, 15, 2, 44, 16], [4, 101, 81], [1, 80, 50, 4, 81, 51], [4, 50, 22, 4, 51, 23], [3, 36, 12, 8, 37, 13], [2, 116, 92, 2, 117, 93], [6, 58, 36, 2, 59, 37], [4, 46, 20, 6, 47, 21], [7, 42, 14, 4, 43, 15], [4, 133, 107], [8, 59, 37, 1, 60, 38], [8, 44, 20, 4, 45, 21], [12, 33, 11, 4, 34, 12], [3, 145, 115, 1, 146, 116], [4, 64, 40, 5, 65, 41], [11, 36, 16, 5, 37, 17], [11, 36, 12, 5, 37, 13], [5, 109, 87, 1, 110, 88], [5, 65, 41, 5, 66, 42], [5, 54, 24, 7, 55, 25], [11, 36, 12], [5, 122, 98, 1, 123, 99], [7, 73, 45, 3, 74, 46], [15, 43, 19, 2, 44, 20], [3, 45, 15, 13, 46, 16], [1, 135, 107, 5, 136, 108], [10, 74, 46, 1, 75, 47], [1, 50, 22, 15, 51, 23], [2, 42, 14, 17, 43, 15], [5, 150, 120, 1, 151, 121], [9, 69, 43, 4, 70, 44], [17, 50, 22, 1, 51, 23], [2, 42, 14, 19, 43, 15], [3, 141, 113, 4, 142, 114], [3, 70, 44, 11, 71, 45], [17, 47, 21, 4, 48, 22], [9, 39, 13, 16, 40, 14], [3, 135, 107, 5, 136, 108], [3, 67, 41, 13, 68, 42], [15, 54, 24, 5, 55, 25], [15, 43, 15, 10, 44, 16], [4, 144, 116, 4, 145, 117], [17, 68, 42], [17, 50, 22, 6, 51, 23], [19, 46, 16, 6, 47, 17], [2, 139, 111, 7, 140, 112], [17, 74, 46], [7, 54, 24, 16, 55, 25], [34, 37, 13], [4, 151, 121, 5, 152, 122], [4, 75, 47, 14, 76, 48], [11, 54, 24, 14, 55, 25], [16, 45, 15, 14, 46, 16], [6, 147, 117, 4, 148, 118], [6, 73, 45, 14, 74, 46], [11, 54, 24, 16, 55, 25], [30, 46, 16, 2, 47, 17], [8, 132, 106, 4, 133, 107], [8, 75, 47, 13, 76, 48], [7, 54, 24, 22, 55, 25], [22, 45, 15, 13, 46, 16], [10, 142, 114, 2, 143, 115], [19, 74, 46, 4, 75, 47], [28, 50, 22, 6, 51, 23], [33, 46, 16, 4, 47, 17], [8, 152, 122, 4, 153, 123], [22, 73, 45, 3, 74, 46], [8, 53, 23, 26, 54, 24], [12, 45, 15, 28, 46, 16], [3, 147, 117, 10, 148, 118], [3, 73, 45, 23, 74, 46], [4, 54, 24, 31, 55, 25], [11, 45, 15, 31, 46, 16], [7, 146, 116, 7, 147, 117], [21, 73, 45, 7, 74, 46], [1, 53, 23, 37, 54, 24], [19, 45, 15, 26, 46, 16], [5, 145, 115, 10, 146, 116], [19, 75, 47, 10, 76, 48], [15, 54, 24, 25, 55, 25], [23, 45, 15, 25, 46, 16], [13, 145, 115, 3, 146, 116], [2, 74, 46, 29, 75, 47], [42, 54, 24, 1, 55, 25], [23, 45, 15, 28, 46, 16], [17, 145, 115], [10, 74, 46, 23, 75, 47], [10, 54, 24, 35, 55, 25], [19, 45, 15, 35, 46, 16], [17, 145, 115, 1, 146, 116], [14, 74, 46, 21, 75, 47], [29, 54, 24, 19, 55, 25], [11, 45, 15, 46, 46, 16], [13, 145, 115, 6, 146, 116], [14, 74, 46, 23, 75, 47], [44, 54, 24, 7, 55, 25], [59, 46, 16, 1, 47, 17], [12, 151, 121, 7, 152, 122], [12, 75, 47, 26, 76, 48], [39, 54, 24, 14, 55, 25], [22, 45, 15, 41, 46, 16], [6, 151, 121, 14, 152, 122], [6, 75, 47, 34, 76, 48], [46, 54, 24, 10, 55, 25], [2, 45, 15, 64, 46, 16], [17, 152, 122, 4, 153, 123], [29, 74, 46, 14, 75, 47], [49, 54, 24, 10, 55, 25], [24, 45, 15, 46, 46, 16], [4, 152, 122, 18, 153, 123], [13, 74, 46, 32, 75, 47], [48, 54, 24, 14, 55, 25], [42, 45, 15, 32, 46, 16], [20, 147, 117, 4, 148, 118], [40, 75, 47, 7, 76, 48], [43, 54, 24, 22, 55, 25], [10, 45, 15, 67, 46, 16], [19, 148, 118, 6, 149, 119], [18, 75, 47, 31, 76, 48], [34, 54, 24, 34, 55, 25], [20, 45, 15, 61, 46, 16]];
  822. QRRSBlock.getRSBlocks = function (typeNumber, errorCorrectLevel) {
  823. var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel);
  824. if (!rsBlock) {
  825. //throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
  826. throwError("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
  827. }
  828. var length = rsBlock.length / 3,
  829. list = [];
  830. for (var _i22 = 0; _i22 < length; _i22++) {
  831. var count = rsBlock[_i22 * 3],
  832. totalCount = rsBlock[_i22 * 3 + 1],
  833. dataCount = rsBlock[_i22 * 3 + 2];
  834. for (var j = 0; j < count; j++) {
  835. list.push(new QRRSBlock(totalCount, dataCount));
  836. }
  837. }
  838. return list;
  839. };
  840. QRRSBlock.getRsBlockTable = function (typeNumber, errorCorrectLevel) {
  841. switch (errorCorrectLevel) {
  842. case QRErrorCorrectLevel.L:
  843. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4];
  844. case QRErrorCorrectLevel.M:
  845. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
  846. case QRErrorCorrectLevel.Q:
  847. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
  848. case QRErrorCorrectLevel.H:
  849. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
  850. default:
  851. return undefined;
  852. }
  853. };
  854. /*
  855. * class QRBitBuffer
  856. * */
  857. var QRBitBuffer = /*#__PURE__*/function () {
  858. function QRBitBuffer() {
  859. (0, _classCallCheck2.default)(this, QRBitBuffer);
  860. this.buffer = [];
  861. this.length = 0;
  862. }
  863. (0, _createClass2.default)(QRBitBuffer, [{
  864. key: "get",
  865. value: function get(index) {
  866. var bufIndex = Math.floor(index / 8);
  867. return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) == 1;
  868. }
  869. }, {
  870. key: "put",
  871. value: function put(num, length) {
  872. for (var _i23 = 0; _i23 < length; _i23++) {
  873. this.putBit((num >>> length - _i23 - 1 & 1) == 1);
  874. }
  875. }
  876. }, {
  877. key: "getLengthInBits",
  878. value: function getLengthInBits() {
  879. return this.length;
  880. }
  881. }, {
  882. key: "putBit",
  883. value: function putBit(bit) {
  884. var bufIndex = Math.floor(this.length / 8);
  885. if (this.buffer.length <= bufIndex) {
  886. this.buffer.push(0);
  887. }
  888. if (bit) {
  889. this.buffer[bufIndex] |= 0x80 >>> this.length % 8;
  890. }
  891. this.length++;
  892. }
  893. }]);
  894. return QRBitBuffer;
  895. }();
  896. /*
  897. * Class Drawing
  898. * */
  899. var Drawing = /*#__PURE__*/function () {
  900. function Drawing(el, opts) {
  901. (0, _classCallCheck2.default)(this, Drawing);
  902. this._opts = opts;
  903. this._el = el;
  904. this._ctx = uni.createCanvasContext(el);
  905. }
  906. (0, _createClass2.default)(Drawing, [{
  907. key: "draw",
  908. value: function draw(QRCode) {
  909. var ctx = this._ctx,
  910. opts = this._opts;
  911. var ctxPosFix = opts.width / 20;
  912. //console.log(opts.width)
  913. var count = QRCode.getModuleCount(),
  914. width = (opts.width - 2 * ctxPosFix) / count,
  915. height = (opts.height - 2 * ctxPosFix) / count,
  916. roundedWidth = Math.round(width),
  917. roundedHeight = Math.round(height);
  918. this.clear();
  919. ctx.setFillStyle('#fff');
  920. ctx.fillRect(0, 0, this._opts.width + 4 * ctxPosFix, this._opts.width + 4 * ctxPosFix);
  921. for (var row = 0; row < count; row++) {
  922. for (var col = 0; col < count; col++) {
  923. var isDark = QRCode.isDark(row, col),
  924. left = col * width + ctxPosFix,
  925. top = row * height + ctxPosFix;
  926. ctx.setStrokeStyle(isDark ? opts.colorDark : opts.colorLight);
  927. ctx.setLineWidth(1);
  928. ctx.setFillStyle(isDark ? opts.colorDark : opts.colorLight);
  929. ctx.fillRect(left, top, width, height);
  930. ctx.strokeRect(Math.floor(left) + 0.5, Math.floor(top) + 0.5, roundedWidth, roundedHeight);
  931. ctx.strokeRect(Math.ceil(left) - 0.5, Math.ceil(top) - 0.5, roundedWidth, roundedHeight);
  932. }
  933. }
  934. this._opts.logo && this.drawImg(this._opts.logo, this._opts.width, ctx);
  935. ctx.draw();
  936. this._bIsPainted = true;
  937. if (this._opts.successTips && drawingOptsSuccessTips) {
  938. uni.hideLoading();
  939. uni.showToast({
  940. title: '生成成功',
  941. icon: 'success',
  942. duration: 1000
  943. });
  944. }
  945. drawingOptsSuccessTips = true;
  946. }
  947. }, {
  948. key: "clear",
  949. value: function clear() {
  950. this._ctx.clearRect(0, 0, this._opts.width, this._opts.height);
  951. }
  952. /** anlib **/
  953. /**
  954. * 二维码上添加图片
  955. */
  956. }, {
  957. key: "drawImg",
  958. value: function drawImg(src, width, ctx) {
  959. // logo相对二维码的比例
  960. var scale = 5;
  961. // logo相对二维码的大小
  962. var imgSize = width / scale;
  963. // 偏移位置起始点
  964. var imgPos = width / scale * 2;
  965. // 二维码边框尺寸,这里设置为原宽度的80分之一
  966. var imgPosFix = width / 80;
  967. //console.log('width', width);
  968. //console.log('imgSize', imgSize);
  969. //console.log('imgPos', imgPos);
  970. //console.log('imgPosFix', imgPosFix);
  971. //console.log('src', src);
  972. ctx.setFillStyle('#fff');
  973. ctx.fillRect(imgPos - imgPosFix, imgPos - imgPosFix, imgSize + imgPosFix * 2, imgSize + imgPosFix * 2);
  974. ctx.beginPath();
  975. ctx.moveTo(imgPos - imgPosFix, imgPos - imgPosFix);
  976. ctx.stroke();
  977. ctx.closePath();
  978. ctx.drawImage(src, imgPos, imgPos, imgSize, imgSize);
  979. ctx.beginPath();
  980. }
  981. }]);
  982. return Drawing;
  983. }();
  984. /*
  985. * Class QRCode
  986. * */
  987. var QRCode = function () {
  988. /**
  989. * Get the type by string length
  990. * @author anlib
  991. * @private
  992. * @param {String} text
  993. * @param {Number} correctLevel
  994. * @return {Number} type
  995. */
  996. function getTypeNumber(text, correctLevel) {
  997. var type = 1,
  998. length = getUTF8Length(text),
  999. QRCodeLimitLength = [[17, 14, 11, 7], [32, 26, 20, 14], [53, 42, 32, 24], [78, 62, 46, 34], [106, 84, 60, 44], [134, 106, 74, 58], [154, 122, 86, 64], [192, 152, 108, 84], [230, 180, 130, 98], [271, 213, 151, 119], [321, 251, 177, 137], [367, 287, 203, 155], [425, 331, 241, 177], [458, 362, 258, 194], [520, 412, 292, 220], [586, 450, 322, 250], [644, 504, 364, 280], [718, 560, 394, 310], [792, 624, 442, 338], [858, 666, 482, 382], [929, 711, 509, 403], [1003, 779, 565, 439], [1091, 857, 611, 461], [1171, 911, 661, 511], [1273, 997, 715, 535], [1367, 1059, 751, 593], [1465, 1125, 805, 625], [1528, 1190, 868, 658], [1628, 1264, 908, 698], [1732, 1370, 982, 742], [1840, 1452, 1030, 790], [1952, 1538, 1112, 842], [2068, 1628, 1168, 898], [2188, 1722, 1228, 958], [2303, 1809, 1283, 983], [2431, 1911, 1351, 1051], [2563, 1989, 1423, 1093], [2699, 2099, 1499, 1139], [2809, 2213, 1579, 1219], [2953, 2331, 1663, 1273]];
  1000. for (var _i24 = 0, len = QRCodeLimitLength.length; _i24 <= len; _i24++) {
  1001. var limit = 0;
  1002. switch (correctLevel) {
  1003. case QRErrorCorrectLevel.L:
  1004. limit = QRCodeLimitLength[_i24][0];
  1005. break;
  1006. case QRErrorCorrectLevel.M:
  1007. limit = QRCodeLimitLength[_i24][1];
  1008. break;
  1009. case QRErrorCorrectLevel.Q:
  1010. limit = QRCodeLimitLength[_i24][2];
  1011. break;
  1012. case QRErrorCorrectLevel.H:
  1013. limit = QRCodeLimitLength[_i24][3];
  1014. break;
  1015. }
  1016. if (length <= limit) {
  1017. break;
  1018. } else {
  1019. type++;
  1020. }
  1021. }
  1022. if (type > QRCodeLimitLength.length) {
  1023. // throw new Error('Too long data'); //supfire
  1024. throwError('Too long data');
  1025. }
  1026. return type;
  1027. }
  1028. function getUTF8Length(text) {
  1029. var replacedText = encodeURI(text).toString().replace(/\%[0-9a-fA-F]{2}/g, 'a');
  1030. return replacedText.length + (replacedText.length != text ? 3 : 0);
  1031. }
  1032. var Fn = /*#__PURE__*/function () {
  1033. function Fn(el, opts) {
  1034. (0, _classCallCheck2.default)(this, Fn);
  1035. this._opts = {
  1036. width: 300,
  1037. height: 300,
  1038. typeNumber: 4,
  1039. colorDark: '#000000',
  1040. colorLight: '#ffffff',
  1041. correctLevel: Fn.correctLevel.H,
  1042. logo: false,
  1043. successTips: false
  1044. };
  1045. if (typeof opts === 'string') {
  1046. opts = {
  1047. text: opts
  1048. };
  1049. }
  1050. // Overwrites options 简单拷贝
  1051. if (opts) {
  1052. for (var _i25 in opts) {
  1053. if (opts.hasOwnProperty(_i25)) {
  1054. this._opts[_i25] = opts[_i25];
  1055. }
  1056. }
  1057. }
  1058. this._el = el;
  1059. this._QRCode = null;
  1060. this._drawing = new Drawing(this._el, this._opts);
  1061. if (this._opts.text) {
  1062. this.makeCode(this._opts.text);
  1063. }
  1064. }
  1065. (0, _createClass2.default)(Fn, [{
  1066. key: "makeCode",
  1067. value: function makeCode(text) {
  1068. this._QRCode = new QRCodeModel(getTypeNumber(text, this._opts.correctLevel), this._opts.correctLevel);
  1069. this._QRCode.addData(text);
  1070. this._QRCode.make();
  1071. this._drawing.draw(this._QRCode);
  1072. }
  1073. }, {
  1074. key: "clear",
  1075. value: function clear() {
  1076. this._drawing.clear();
  1077. }
  1078. }]);
  1079. return Fn;
  1080. }();
  1081. Fn.correctLevel = QRErrorCorrectLevel;
  1082. return Fn;
  1083. }();
  1084. /** anlib **/
  1085. var drawingOptsSuccessTips = true;
  1086. /**
  1087. * 抛出错误
  1088. */
  1089. function throwError(str) {
  1090. uni.hideLoading();
  1091. uni.showToast({
  1092. title: '有字符暂不支持',
  1093. icon: 'none',
  1094. duration: 2000
  1095. });
  1096. drawingOptsSuccessTips = false;
  1097. //throw new Error(str);
  1098. }
  1099. var _default = QRCode;
  1100. exports.default = _default;
  1101. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  1102. /***/ }),
  1103. /***/ 15:
  1104. /*!**********************************************************!*\
  1105. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  1106. \**********************************************************/
  1107. /*! no static exports found */
  1108. /***/ (function(module, exports, __webpack_require__) {
  1109. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  1110. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  1111. function _construct(Parent, args, Class) {
  1112. if (isNativeReflectConstruct()) {
  1113. module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
  1114. } else {
  1115. module.exports = _construct = function _construct(Parent, args, Class) {
  1116. var a = [null];
  1117. a.push.apply(a, args);
  1118. var Constructor = Function.bind.apply(Parent, a);
  1119. var instance = new Constructor();
  1120. if (Class) setPrototypeOf(instance, Class.prototype);
  1121. return instance;
  1122. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1123. }
  1124. return _construct.apply(null, arguments);
  1125. }
  1126. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1127. /***/ }),
  1128. /***/ 16:
  1129. /*!***************************************************************!*\
  1130. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  1131. \***************************************************************/
  1132. /*! no static exports found */
  1133. /***/ (function(module, exports) {
  1134. function _setPrototypeOf(o, p) {
  1135. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  1136. o.__proto__ = p;
  1137. return o;
  1138. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1139. return _setPrototypeOf(o, p);
  1140. }
  1141. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1142. /***/ }),
  1143. /***/ 17:
  1144. /*!*************************************************************************!*\
  1145. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  1146. \*************************************************************************/
  1147. /*! no static exports found */
  1148. /***/ (function(module, exports) {
  1149. function _isNativeReflectConstruct() {
  1150. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  1151. if (Reflect.construct.sham) return false;
  1152. if (typeof Proxy === "function") return true;
  1153. try {
  1154. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  1155. return true;
  1156. } catch (e) {
  1157. return false;
  1158. }
  1159. }
  1160. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1161. /***/ }),
  1162. /***/ 18:
  1163. /*!******************************************************************!*\
  1164. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  1165. \******************************************************************/
  1166. /*! no static exports found */
  1167. /***/ (function(module, exports, __webpack_require__) {
  1168. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  1169. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  1170. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  1171. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  1172. function _toConsumableArray(arr) {
  1173. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  1174. }
  1175. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1176. /***/ }),
  1177. /***/ 19:
  1178. /*!******************************************************************!*\
  1179. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  1180. \******************************************************************/
  1181. /*! no static exports found */
  1182. /***/ (function(module, exports, __webpack_require__) {
  1183. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  1184. function _arrayWithoutHoles(arr) {
  1185. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  1186. }
  1187. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1188. /***/ }),
  1189. /***/ 2:
  1190. /*!************************************************************!*\
  1191. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  1192. \************************************************************/
  1193. /*! no static exports found */
  1194. /***/ (function(module, exports, __webpack_require__) {
  1195. "use strict";
  1196. /* WEBPACK VAR INJECTION */(function(wx, global) {
  1197. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  1198. Object.defineProperty(exports, "__esModule", {
  1199. value: true
  1200. });
  1201. exports.createApp = createApp;
  1202. exports.createComponent = createComponent;
  1203. exports.createPage = createPage;
  1204. exports.createPlugin = createPlugin;
  1205. exports.createSubpackageApp = createSubpackageApp;
  1206. exports.default = void 0;
  1207. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  1208. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  1209. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  1210. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  1211. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  1212. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  1213. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  1214. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  1215. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  1216. var realAtob;
  1217. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  1218. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  1219. if (typeof atob !== 'function') {
  1220. realAtob = function realAtob(str) {
  1221. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  1222. if (!b64re.test(str)) {
  1223. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  1224. }
  1225. // Adding the padding if missing, for semplicity
  1226. str += '=='.slice(2 - (str.length & 3));
  1227. var bitmap;
  1228. var result = '';
  1229. var r1;
  1230. var r2;
  1231. var i = 0;
  1232. for (; i < str.length;) {
  1233. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 | (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  1234. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  1235. }
  1236. return result;
  1237. };
  1238. } else {
  1239. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  1240. realAtob = atob;
  1241. }
  1242. function b64DecodeUnicode(str) {
  1243. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  1244. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  1245. }).join(''));
  1246. }
  1247. function getCurrentUserInfo() {
  1248. var token = wx.getStorageSync('uni_id_token') || '';
  1249. var tokenArr = token.split('.');
  1250. if (!token || tokenArr.length !== 3) {
  1251. return {
  1252. uid: null,
  1253. role: [],
  1254. permission: [],
  1255. tokenExpired: 0
  1256. };
  1257. }
  1258. var userInfo;
  1259. try {
  1260. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  1261. } catch (error) {
  1262. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  1263. }
  1264. userInfo.tokenExpired = userInfo.exp * 1000;
  1265. delete userInfo.exp;
  1266. delete userInfo.iat;
  1267. return userInfo;
  1268. }
  1269. function uniIdMixin(Vue) {
  1270. Vue.prototype.uniIDHasRole = function (roleId) {
  1271. var _getCurrentUserInfo = getCurrentUserInfo(),
  1272. role = _getCurrentUserInfo.role;
  1273. return role.indexOf(roleId) > -1;
  1274. };
  1275. Vue.prototype.uniIDHasPermission = function (permissionId) {
  1276. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  1277. permission = _getCurrentUserInfo2.permission;
  1278. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  1279. };
  1280. Vue.prototype.uniIDTokenValid = function () {
  1281. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  1282. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  1283. return tokenExpired > Date.now();
  1284. };
  1285. }
  1286. var _toString = Object.prototype.toString;
  1287. var hasOwnProperty = Object.prototype.hasOwnProperty;
  1288. function isFn(fn) {
  1289. return typeof fn === 'function';
  1290. }
  1291. function isStr(str) {
  1292. return typeof str === 'string';
  1293. }
  1294. function isObject(obj) {
  1295. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  1296. }
  1297. function isPlainObject(obj) {
  1298. return _toString.call(obj) === '[object Object]';
  1299. }
  1300. function hasOwn(obj, key) {
  1301. return hasOwnProperty.call(obj, key);
  1302. }
  1303. function noop() {}
  1304. /**
  1305. * Create a cached version of a pure function.
  1306. */
  1307. function cached(fn) {
  1308. var cache = Object.create(null);
  1309. return function cachedFn(str) {
  1310. var hit = cache[str];
  1311. return hit || (cache[str] = fn(str));
  1312. };
  1313. }
  1314. /**
  1315. * Camelize a hyphen-delimited string.
  1316. */
  1317. var camelizeRE = /-(\w)/g;
  1318. var camelize = cached(function (str) {
  1319. return str.replace(camelizeRE, function (_, c) {
  1320. return c ? c.toUpperCase() : '';
  1321. });
  1322. });
  1323. function sortObject(obj) {
  1324. var sortObj = {};
  1325. if (isPlainObject(obj)) {
  1326. Object.keys(obj).sort().forEach(function (key) {
  1327. sortObj[key] = obj[key];
  1328. });
  1329. }
  1330. return !Object.keys(sortObj) ? obj : sortObj;
  1331. }
  1332. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  1333. var globalInterceptors = {};
  1334. var scopedInterceptors = {};
  1335. function mergeHook(parentVal, childVal) {
  1336. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  1337. return res ? dedupeHooks(res) : res;
  1338. }
  1339. function dedupeHooks(hooks) {
  1340. var res = [];
  1341. for (var i = 0; i < hooks.length; i++) {
  1342. if (res.indexOf(hooks[i]) === -1) {
  1343. res.push(hooks[i]);
  1344. }
  1345. }
  1346. return res;
  1347. }
  1348. function removeHook(hooks, hook) {
  1349. var index = hooks.indexOf(hook);
  1350. if (index !== -1) {
  1351. hooks.splice(index, 1);
  1352. }
  1353. }
  1354. function mergeInterceptorHook(interceptor, option) {
  1355. Object.keys(option).forEach(function (hook) {
  1356. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  1357. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  1358. }
  1359. });
  1360. }
  1361. function removeInterceptorHook(interceptor, option) {
  1362. if (!interceptor || !option) {
  1363. return;
  1364. }
  1365. Object.keys(option).forEach(function (hook) {
  1366. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  1367. removeHook(interceptor[hook], option[hook]);
  1368. }
  1369. });
  1370. }
  1371. function addInterceptor(method, option) {
  1372. if (typeof method === 'string' && isPlainObject(option)) {
  1373. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  1374. } else if (isPlainObject(method)) {
  1375. mergeInterceptorHook(globalInterceptors, method);
  1376. }
  1377. }
  1378. function removeInterceptor(method, option) {
  1379. if (typeof method === 'string') {
  1380. if (isPlainObject(option)) {
  1381. removeInterceptorHook(scopedInterceptors[method], option);
  1382. } else {
  1383. delete scopedInterceptors[method];
  1384. }
  1385. } else if (isPlainObject(method)) {
  1386. removeInterceptorHook(globalInterceptors, method);
  1387. }
  1388. }
  1389. function wrapperHook(hook) {
  1390. return function (data) {
  1391. return hook(data) || data;
  1392. };
  1393. }
  1394. function isPromise(obj) {
  1395. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  1396. }
  1397. function queue(hooks, data) {
  1398. var promise = false;
  1399. for (var i = 0; i < hooks.length; i++) {
  1400. var hook = hooks[i];
  1401. if (promise) {
  1402. promise = Promise.resolve(wrapperHook(hook));
  1403. } else {
  1404. var res = hook(data);
  1405. if (isPromise(res)) {
  1406. promise = Promise.resolve(res);
  1407. }
  1408. if (res === false) {
  1409. return {
  1410. then: function then() {}
  1411. };
  1412. }
  1413. }
  1414. }
  1415. return promise || {
  1416. then: function then(callback) {
  1417. return callback(data);
  1418. }
  1419. };
  1420. }
  1421. function wrapperOptions(interceptor) {
  1422. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1423. ['success', 'fail', 'complete'].forEach(function (name) {
  1424. if (Array.isArray(interceptor[name])) {
  1425. var oldCallback = options[name];
  1426. options[name] = function callbackInterceptor(res) {
  1427. queue(interceptor[name], res).then(function (res) {
  1428. /* eslint-disable no-mixed-operators */
  1429. return isFn(oldCallback) && oldCallback(res) || res;
  1430. });
  1431. };
  1432. }
  1433. });
  1434. return options;
  1435. }
  1436. function wrapperReturnValue(method, returnValue) {
  1437. var returnValueHooks = [];
  1438. if (Array.isArray(globalInterceptors.returnValue)) {
  1439. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  1440. }
  1441. var interceptor = scopedInterceptors[method];
  1442. if (interceptor && Array.isArray(interceptor.returnValue)) {
  1443. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  1444. }
  1445. returnValueHooks.forEach(function (hook) {
  1446. returnValue = hook(returnValue) || returnValue;
  1447. });
  1448. return returnValue;
  1449. }
  1450. function getApiInterceptorHooks(method) {
  1451. var interceptor = Object.create(null);
  1452. Object.keys(globalInterceptors).forEach(function (hook) {
  1453. if (hook !== 'returnValue') {
  1454. interceptor[hook] = globalInterceptors[hook].slice();
  1455. }
  1456. });
  1457. var scopedInterceptor = scopedInterceptors[method];
  1458. if (scopedInterceptor) {
  1459. Object.keys(scopedInterceptor).forEach(function (hook) {
  1460. if (hook !== 'returnValue') {
  1461. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  1462. }
  1463. });
  1464. }
  1465. return interceptor;
  1466. }
  1467. function invokeApi(method, api, options) {
  1468. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  1469. params[_key - 3] = arguments[_key];
  1470. }
  1471. var interceptor = getApiInterceptorHooks(method);
  1472. if (interceptor && Object.keys(interceptor).length) {
  1473. if (Array.isArray(interceptor.invoke)) {
  1474. var res = queue(interceptor.invoke, options);
  1475. return res.then(function (options) {
  1476. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  1477. });
  1478. } else {
  1479. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  1480. }
  1481. }
  1482. return api.apply(void 0, [options].concat(params));
  1483. }
  1484. var promiseInterceptor = {
  1485. returnValue: function returnValue(res) {
  1486. if (!isPromise(res)) {
  1487. return res;
  1488. }
  1489. return new Promise(function (resolve, reject) {
  1490. res.then(function (res) {
  1491. if (res[0]) {
  1492. reject(res[0]);
  1493. } else {
  1494. resolve(res[1]);
  1495. }
  1496. });
  1497. });
  1498. }
  1499. };
  1500. var SYNC_API_RE = /^\$|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|getSystemSetting|getAppAuthorizeSetting|initUTS|requireUTS|registerUTS/;
  1501. var CONTEXT_API_RE = /^create|Manager$/;
  1502. // Context例外情况
  1503. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  1504. // 同步例外情况
  1505. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  1506. var CALLBACK_API_RE = /^on|^off/;
  1507. function isContextApi(name) {
  1508. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  1509. }
  1510. function isSyncApi(name) {
  1511. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  1512. }
  1513. function isCallbackApi(name) {
  1514. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  1515. }
  1516. function handlePromise(promise) {
  1517. return promise.then(function (data) {
  1518. return [null, data];
  1519. }).catch(function (err) {
  1520. return [err];
  1521. });
  1522. }
  1523. function shouldPromise(name) {
  1524. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  1525. return false;
  1526. }
  1527. return true;
  1528. }
  1529. /* eslint-disable no-extend-native */
  1530. if (!Promise.prototype.finally) {
  1531. Promise.prototype.finally = function (callback) {
  1532. var promise = this.constructor;
  1533. return this.then(function (value) {
  1534. return promise.resolve(callback()).then(function () {
  1535. return value;
  1536. });
  1537. }, function (reason) {
  1538. return promise.resolve(callback()).then(function () {
  1539. throw reason;
  1540. });
  1541. });
  1542. };
  1543. }
  1544. function promisify(name, api) {
  1545. if (!shouldPromise(name) || !isFn(api)) {
  1546. return api;
  1547. }
  1548. return function promiseApi() {
  1549. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1550. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  1551. params[_key2 - 1] = arguments[_key2];
  1552. }
  1553. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  1554. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  1555. }
  1556. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  1557. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  1558. success: resolve,
  1559. fail: reject
  1560. })].concat(params));
  1561. })));
  1562. };
  1563. }
  1564. var EPS = 1e-4;
  1565. var BASE_DEVICE_WIDTH = 750;
  1566. var isIOS = false;
  1567. var deviceWidth = 0;
  1568. var deviceDPR = 0;
  1569. function checkDeviceWidth() {
  1570. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  1571. platform = _wx$getSystemInfoSync.platform,
  1572. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  1573. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  1574. deviceWidth = windowWidth;
  1575. deviceDPR = pixelRatio;
  1576. isIOS = platform === 'ios';
  1577. }
  1578. function upx2px(number, newDeviceWidth) {
  1579. if (deviceWidth === 0) {
  1580. checkDeviceWidth();
  1581. }
  1582. number = Number(number);
  1583. if (number === 0) {
  1584. return 0;
  1585. }
  1586. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  1587. if (result < 0) {
  1588. result = -result;
  1589. }
  1590. result = Math.floor(result + EPS);
  1591. if (result === 0) {
  1592. if (deviceDPR === 1 || !isIOS) {
  1593. result = 1;
  1594. } else {
  1595. result = 0.5;
  1596. }
  1597. }
  1598. return number < 0 ? -result : result;
  1599. }
  1600. var LOCALE_ZH_HANS = 'zh-Hans';
  1601. var LOCALE_ZH_HANT = 'zh-Hant';
  1602. var LOCALE_EN = 'en';
  1603. var LOCALE_FR = 'fr';
  1604. var LOCALE_ES = 'es';
  1605. var messages = {};
  1606. var locale;
  1607. {
  1608. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1609. }
  1610. function initI18nMessages() {
  1611. if (!isEnableLocale()) {
  1612. return;
  1613. }
  1614. var localeKeys = Object.keys(__uniConfig.locales);
  1615. if (localeKeys.length) {
  1616. localeKeys.forEach(function (locale) {
  1617. var curMessages = messages[locale];
  1618. var userMessages = __uniConfig.locales[locale];
  1619. if (curMessages) {
  1620. Object.assign(curMessages, userMessages);
  1621. } else {
  1622. messages[locale] = userMessages;
  1623. }
  1624. });
  1625. }
  1626. }
  1627. initI18nMessages();
  1628. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  1629. var t = i18n.t;
  1630. var i18nMixin = i18n.mixin = {
  1631. beforeCreate: function beforeCreate() {
  1632. var _this = this;
  1633. var unwatch = i18n.i18n.watchLocale(function () {
  1634. _this.$forceUpdate();
  1635. });
  1636. this.$once('hook:beforeDestroy', function () {
  1637. unwatch();
  1638. });
  1639. },
  1640. methods: {
  1641. $$t: function $$t(key, values) {
  1642. return t(key, values);
  1643. }
  1644. }
  1645. };
  1646. var setLocale = i18n.setLocale;
  1647. var getLocale = i18n.getLocale;
  1648. function initAppLocale(Vue, appVm, locale) {
  1649. var state = Vue.observable({
  1650. locale: locale || i18n.getLocale()
  1651. });
  1652. var localeWatchers = [];
  1653. appVm.$watchLocale = function (fn) {
  1654. localeWatchers.push(fn);
  1655. };
  1656. Object.defineProperty(appVm, '$locale', {
  1657. get: function get() {
  1658. return state.locale;
  1659. },
  1660. set: function set(v) {
  1661. state.locale = v;
  1662. localeWatchers.forEach(function (watch) {
  1663. return watch(v);
  1664. });
  1665. }
  1666. });
  1667. }
  1668. function isEnableLocale() {
  1669. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  1670. }
  1671. function include(str, parts) {
  1672. return !!parts.find(function (part) {
  1673. return str.indexOf(part) !== -1;
  1674. });
  1675. }
  1676. function startsWith(str, parts) {
  1677. return parts.find(function (part) {
  1678. return str.indexOf(part) === 0;
  1679. });
  1680. }
  1681. function normalizeLocale(locale, messages) {
  1682. if (!locale) {
  1683. return;
  1684. }
  1685. locale = locale.trim().replace(/_/g, '-');
  1686. if (messages && messages[locale]) {
  1687. return locale;
  1688. }
  1689. locale = locale.toLowerCase();
  1690. if (locale === 'chinese') {
  1691. // 支付宝
  1692. return LOCALE_ZH_HANS;
  1693. }
  1694. if (locale.indexOf('zh') === 0) {
  1695. if (locale.indexOf('-hans') > -1) {
  1696. return LOCALE_ZH_HANS;
  1697. }
  1698. if (locale.indexOf('-hant') > -1) {
  1699. return LOCALE_ZH_HANT;
  1700. }
  1701. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  1702. return LOCALE_ZH_HANT;
  1703. }
  1704. return LOCALE_ZH_HANS;
  1705. }
  1706. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  1707. if (lang) {
  1708. return lang;
  1709. }
  1710. }
  1711. // export function initI18n() {
  1712. // const localeKeys = Object.keys(__uniConfig.locales || {})
  1713. // if (localeKeys.length) {
  1714. // localeKeys.forEach((locale) =>
  1715. // i18n.add(locale, __uniConfig.locales[locale])
  1716. // )
  1717. // }
  1718. // }
  1719. function getLocale$1() {
  1720. // 优先使用 $locale
  1721. if (isFn(getApp)) {
  1722. var app = getApp({
  1723. allowDefault: true
  1724. });
  1725. if (app && app.$vm) {
  1726. return app.$vm.$locale;
  1727. }
  1728. }
  1729. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1730. }
  1731. function setLocale$1(locale) {
  1732. var app = isFn(getApp) ? getApp() : false;
  1733. if (!app) {
  1734. return false;
  1735. }
  1736. var oldLocale = app.$vm.$locale;
  1737. if (oldLocale !== locale) {
  1738. app.$vm.$locale = locale;
  1739. onLocaleChangeCallbacks.forEach(function (fn) {
  1740. return fn({
  1741. locale: locale
  1742. });
  1743. });
  1744. return true;
  1745. }
  1746. return false;
  1747. }
  1748. var onLocaleChangeCallbacks = [];
  1749. function onLocaleChange(fn) {
  1750. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  1751. onLocaleChangeCallbacks.push(fn);
  1752. }
  1753. }
  1754. if (typeof global !== 'undefined') {
  1755. global.getLocale = getLocale$1;
  1756. }
  1757. var interceptors = {
  1758. promiseInterceptor: promiseInterceptor
  1759. };
  1760. var baseApi = /*#__PURE__*/Object.freeze({
  1761. __proto__: null,
  1762. upx2px: upx2px,
  1763. getLocale: getLocale$1,
  1764. setLocale: setLocale$1,
  1765. onLocaleChange: onLocaleChange,
  1766. addInterceptor: addInterceptor,
  1767. removeInterceptor: removeInterceptor,
  1768. interceptors: interceptors
  1769. });
  1770. function findExistsPageIndex(url) {
  1771. var pages = getCurrentPages();
  1772. var len = pages.length;
  1773. while (len--) {
  1774. var page = pages[len];
  1775. if (page.$page && page.$page.fullPath === url) {
  1776. return len;
  1777. }
  1778. }
  1779. return -1;
  1780. }
  1781. var redirectTo = {
  1782. name: function name(fromArgs) {
  1783. if (fromArgs.exists === 'back' && fromArgs.delta) {
  1784. return 'navigateBack';
  1785. }
  1786. return 'redirectTo';
  1787. },
  1788. args: function args(fromArgs) {
  1789. if (fromArgs.exists === 'back' && fromArgs.url) {
  1790. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  1791. if (existsPageIndex !== -1) {
  1792. var delta = getCurrentPages().length - 1 - existsPageIndex;
  1793. if (delta > 0) {
  1794. fromArgs.delta = delta;
  1795. }
  1796. }
  1797. }
  1798. }
  1799. };
  1800. var previewImage = {
  1801. args: function args(fromArgs) {
  1802. var currentIndex = parseInt(fromArgs.current);
  1803. if (isNaN(currentIndex)) {
  1804. return;
  1805. }
  1806. var urls = fromArgs.urls;
  1807. if (!Array.isArray(urls)) {
  1808. return;
  1809. }
  1810. var len = urls.length;
  1811. if (!len) {
  1812. return;
  1813. }
  1814. if (currentIndex < 0) {
  1815. currentIndex = 0;
  1816. } else if (currentIndex >= len) {
  1817. currentIndex = len - 1;
  1818. }
  1819. if (currentIndex > 0) {
  1820. fromArgs.current = urls[currentIndex];
  1821. fromArgs.urls = urls.filter(function (item, index) {
  1822. return index < currentIndex ? item !== urls[currentIndex] : true;
  1823. });
  1824. } else {
  1825. fromArgs.current = urls[0];
  1826. }
  1827. return {
  1828. indicator: false,
  1829. loop: false
  1830. };
  1831. }
  1832. };
  1833. var UUID_KEY = '__DC_STAT_UUID';
  1834. var deviceId;
  1835. function useDeviceId(result) {
  1836. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  1837. if (!deviceId) {
  1838. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  1839. wx.setStorage({
  1840. key: UUID_KEY,
  1841. data: deviceId
  1842. });
  1843. }
  1844. result.deviceId = deviceId;
  1845. }
  1846. function addSafeAreaInsets(result) {
  1847. if (result.safeArea) {
  1848. var safeArea = result.safeArea;
  1849. result.safeAreaInsets = {
  1850. top: safeArea.top,
  1851. left: safeArea.left,
  1852. right: result.windowWidth - safeArea.right,
  1853. bottom: result.screenHeight - safeArea.bottom
  1854. };
  1855. }
  1856. }
  1857. function populateParameters(result) {
  1858. var _result$brand = result.brand,
  1859. brand = _result$brand === void 0 ? '' : _result$brand,
  1860. _result$model = result.model,
  1861. model = _result$model === void 0 ? '' : _result$model,
  1862. _result$system = result.system,
  1863. system = _result$system === void 0 ? '' : _result$system,
  1864. _result$language = result.language,
  1865. language = _result$language === void 0 ? '' : _result$language,
  1866. theme = result.theme,
  1867. version = result.version,
  1868. platform = result.platform,
  1869. fontSizeSetting = result.fontSizeSetting,
  1870. SDKVersion = result.SDKVersion,
  1871. pixelRatio = result.pixelRatio,
  1872. deviceOrientation = result.deviceOrientation;
  1873. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  1874. var extraParam = {};
  1875. // osName osVersion
  1876. var osName = '';
  1877. var osVersion = '';
  1878. {
  1879. osName = system.split(' ')[0] || '';
  1880. osVersion = system.split(' ')[1] || '';
  1881. }
  1882. var hostVersion = version;
  1883. // deviceType
  1884. var deviceType = getGetDeviceType(result, model);
  1885. // deviceModel
  1886. var deviceBrand = getDeviceBrand(brand);
  1887. // hostName
  1888. var _hostName = getHostName(result);
  1889. // deviceOrientation
  1890. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  1891. // devicePixelRatio
  1892. var _devicePixelRatio = pixelRatio;
  1893. // SDKVersion
  1894. var _SDKVersion = SDKVersion;
  1895. // hostLanguage
  1896. var hostLanguage = language.replace(/_/g, '-');
  1897. // wx.getAccountInfoSync
  1898. var parameters = {
  1899. appId: "__UNI__1C40FB4",
  1900. appName: "房票科技",
  1901. appVersion: "1.0.0",
  1902. appVersionCode: "100",
  1903. appLanguage: getAppLanguage(hostLanguage),
  1904. uniCompileVersion: "3.7.3",
  1905. uniRuntimeVersion: "3.7.3",
  1906. uniPlatform: undefined || "mp-weixin",
  1907. deviceBrand: deviceBrand,
  1908. deviceModel: model,
  1909. deviceType: deviceType,
  1910. devicePixelRatio: _devicePixelRatio,
  1911. deviceOrientation: _deviceOrientation,
  1912. osName: osName.toLocaleLowerCase(),
  1913. osVersion: osVersion,
  1914. hostTheme: theme,
  1915. hostVersion: hostVersion,
  1916. hostLanguage: hostLanguage,
  1917. hostName: _hostName,
  1918. hostSDKVersion: _SDKVersion,
  1919. hostFontSizeSetting: fontSizeSetting,
  1920. windowTop: 0,
  1921. windowBottom: 0,
  1922. // TODO
  1923. osLanguage: undefined,
  1924. osTheme: undefined,
  1925. ua: undefined,
  1926. hostPackageName: undefined,
  1927. browserName: undefined,
  1928. browserVersion: undefined
  1929. };
  1930. Object.assign(result, parameters, extraParam);
  1931. }
  1932. function getGetDeviceType(result, model) {
  1933. var deviceType = result.deviceType || 'phone';
  1934. {
  1935. var deviceTypeMaps = {
  1936. ipad: 'pad',
  1937. windows: 'pc',
  1938. mac: 'pc'
  1939. };
  1940. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  1941. var _model = model.toLocaleLowerCase();
  1942. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  1943. var _m = deviceTypeMapsKeys[index];
  1944. if (_model.indexOf(_m) !== -1) {
  1945. deviceType = deviceTypeMaps[_m];
  1946. break;
  1947. }
  1948. }
  1949. }
  1950. return deviceType;
  1951. }
  1952. function getDeviceBrand(brand) {
  1953. var deviceBrand = brand;
  1954. if (deviceBrand) {
  1955. deviceBrand = brand.toLocaleLowerCase();
  1956. }
  1957. return deviceBrand;
  1958. }
  1959. function getAppLanguage(defaultLanguage) {
  1960. return getLocale$1 ? getLocale$1() : defaultLanguage;
  1961. }
  1962. function getHostName(result) {
  1963. var _platform = 'WeChat';
  1964. var _hostName = result.hostName || _platform; // mp-jd
  1965. {
  1966. if (result.environment) {
  1967. _hostName = result.environment;
  1968. } else if (result.host && result.host.env) {
  1969. _hostName = result.host.env;
  1970. }
  1971. }
  1972. return _hostName;
  1973. }
  1974. var getSystemInfo = {
  1975. returnValue: function returnValue(result) {
  1976. useDeviceId(result);
  1977. addSafeAreaInsets(result);
  1978. populateParameters(result);
  1979. }
  1980. };
  1981. var showActionSheet = {
  1982. args: function args(fromArgs) {
  1983. if ((0, _typeof2.default)(fromArgs) === 'object') {
  1984. fromArgs.alertText = fromArgs.title;
  1985. }
  1986. }
  1987. };
  1988. var getAppBaseInfo = {
  1989. returnValue: function returnValue(result) {
  1990. var _result = result,
  1991. version = _result.version,
  1992. language = _result.language,
  1993. SDKVersion = _result.SDKVersion,
  1994. theme = _result.theme;
  1995. var _hostName = getHostName(result);
  1996. var hostLanguage = language.replace('_', '-');
  1997. result = sortObject(Object.assign(result, {
  1998. appId: "__UNI__1C40FB4",
  1999. appName: "房票科技",
  2000. appVersion: "1.0.0",
  2001. appVersionCode: "100",
  2002. appLanguage: getAppLanguage(hostLanguage),
  2003. hostVersion: version,
  2004. hostLanguage: hostLanguage,
  2005. hostName: _hostName,
  2006. hostSDKVersion: SDKVersion,
  2007. hostTheme: theme
  2008. }));
  2009. }
  2010. };
  2011. var getDeviceInfo = {
  2012. returnValue: function returnValue(result) {
  2013. var _result2 = result,
  2014. brand = _result2.brand,
  2015. model = _result2.model;
  2016. var deviceType = getGetDeviceType(result, model);
  2017. var deviceBrand = getDeviceBrand(brand);
  2018. useDeviceId(result);
  2019. result = sortObject(Object.assign(result, {
  2020. deviceType: deviceType,
  2021. deviceBrand: deviceBrand,
  2022. deviceModel: model
  2023. }));
  2024. }
  2025. };
  2026. var getWindowInfo = {
  2027. returnValue: function returnValue(result) {
  2028. addSafeAreaInsets(result);
  2029. result = sortObject(Object.assign(result, {
  2030. windowTop: 0,
  2031. windowBottom: 0
  2032. }));
  2033. }
  2034. };
  2035. var getAppAuthorizeSetting = {
  2036. returnValue: function returnValue(result) {
  2037. var locationReducedAccuracy = result.locationReducedAccuracy;
  2038. result.locationAccuracy = 'unsupported';
  2039. if (locationReducedAccuracy === true) {
  2040. result.locationAccuracy = 'reduced';
  2041. } else if (locationReducedAccuracy === false) {
  2042. result.locationAccuracy = 'full';
  2043. }
  2044. }
  2045. };
  2046. // import navigateTo from 'uni-helpers/navigate-to'
  2047. var compressImage = {
  2048. args: function args(fromArgs) {
  2049. // https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
  2050. if (fromArgs.compressedHeight && !fromArgs.compressHeight) {
  2051. fromArgs.compressHeight = fromArgs.compressedHeight;
  2052. }
  2053. if (fromArgs.compressedWidth && !fromArgs.compressWidth) {
  2054. fromArgs.compressWidth = fromArgs.compressedWidth;
  2055. }
  2056. }
  2057. };
  2058. var protocols = {
  2059. redirectTo: redirectTo,
  2060. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  2061. previewImage: previewImage,
  2062. getSystemInfo: getSystemInfo,
  2063. getSystemInfoSync: getSystemInfo,
  2064. showActionSheet: showActionSheet,
  2065. getAppBaseInfo: getAppBaseInfo,
  2066. getDeviceInfo: getDeviceInfo,
  2067. getWindowInfo: getWindowInfo,
  2068. getAppAuthorizeSetting: getAppAuthorizeSetting,
  2069. compressImage: compressImage
  2070. };
  2071. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  2072. var canIUses = [];
  2073. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  2074. function processCallback(methodName, method, returnValue) {
  2075. return function (res) {
  2076. return method(processReturnValue(methodName, res, returnValue));
  2077. };
  2078. }
  2079. function processArgs(methodName, fromArgs) {
  2080. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2081. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  2082. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  2083. if (isPlainObject(fromArgs)) {
  2084. // 一般 api 的参数解析
  2085. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  2086. if (isFn(argsOption)) {
  2087. argsOption = argsOption(fromArgs, toArgs) || {};
  2088. }
  2089. for (var key in fromArgs) {
  2090. if (hasOwn(argsOption, key)) {
  2091. var keyOption = argsOption[key];
  2092. if (isFn(keyOption)) {
  2093. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  2094. }
  2095. if (!keyOption) {
  2096. // 不支持的参数
  2097. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  2098. } else if (isStr(keyOption)) {
  2099. // 重写参数 key
  2100. toArgs[keyOption] = fromArgs[key];
  2101. } else if (isPlainObject(keyOption)) {
  2102. // {name:newName,value:value}可重新指定参数 key:value
  2103. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  2104. }
  2105. } else if (CALLBACKS.indexOf(key) !== -1) {
  2106. if (isFn(fromArgs[key])) {
  2107. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  2108. }
  2109. } else {
  2110. if (!keepFromArgs) {
  2111. toArgs[key] = fromArgs[key];
  2112. }
  2113. }
  2114. }
  2115. return toArgs;
  2116. } else if (isFn(fromArgs)) {
  2117. fromArgs = processCallback(methodName, fromArgs, returnValue);
  2118. }
  2119. return fromArgs;
  2120. }
  2121. function processReturnValue(methodName, res, returnValue) {
  2122. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  2123. if (isFn(protocols.returnValue)) {
  2124. // 处理通用 returnValue
  2125. res = protocols.returnValue(methodName, res);
  2126. }
  2127. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  2128. }
  2129. function wrapper(methodName, method) {
  2130. if (hasOwn(protocols, methodName)) {
  2131. var protocol = protocols[methodName];
  2132. if (!protocol) {
  2133. // 暂不支持的 api
  2134. return function () {
  2135. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  2136. };
  2137. }
  2138. return function (arg1, arg2) {
  2139. // 目前 api 最多两个参数
  2140. var options = protocol;
  2141. if (isFn(protocol)) {
  2142. options = protocol(arg1);
  2143. }
  2144. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  2145. var args = [arg1];
  2146. if (typeof arg2 !== 'undefined') {
  2147. args.push(arg2);
  2148. }
  2149. if (isFn(options.name)) {
  2150. methodName = options.name(arg1);
  2151. } else if (isStr(options.name)) {
  2152. methodName = options.name;
  2153. }
  2154. var returnValue = wx[methodName].apply(wx, args);
  2155. if (isSyncApi(methodName)) {
  2156. // 同步 api
  2157. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  2158. }
  2159. return returnValue;
  2160. };
  2161. }
  2162. return method;
  2163. }
  2164. var todoApis = Object.create(null);
  2165. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  2166. function createTodoApi(name) {
  2167. return function todoApi(_ref) {
  2168. var fail = _ref.fail,
  2169. complete = _ref.complete;
  2170. var res = {
  2171. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  2172. };
  2173. isFn(fail) && fail(res);
  2174. isFn(complete) && complete(res);
  2175. };
  2176. }
  2177. TODOS.forEach(function (name) {
  2178. todoApis[name] = createTodoApi(name);
  2179. });
  2180. var providers = {
  2181. oauth: ['weixin'],
  2182. share: ['weixin'],
  2183. payment: ['wxpay'],
  2184. push: ['weixin']
  2185. };
  2186. function getProvider(_ref2) {
  2187. var service = _ref2.service,
  2188. success = _ref2.success,
  2189. fail = _ref2.fail,
  2190. complete = _ref2.complete;
  2191. var res = false;
  2192. if (providers[service]) {
  2193. res = {
  2194. errMsg: 'getProvider:ok',
  2195. service: service,
  2196. provider: providers[service]
  2197. };
  2198. isFn(success) && success(res);
  2199. } else {
  2200. res = {
  2201. errMsg: 'getProvider:fail service not found'
  2202. };
  2203. isFn(fail) && fail(res);
  2204. }
  2205. isFn(complete) && complete(res);
  2206. }
  2207. var extraApi = /*#__PURE__*/Object.freeze({
  2208. __proto__: null,
  2209. getProvider: getProvider
  2210. });
  2211. var getEmitter = function () {
  2212. var Emitter;
  2213. return function getUniEmitter() {
  2214. if (!Emitter) {
  2215. Emitter = new _vue.default();
  2216. }
  2217. return Emitter;
  2218. };
  2219. }();
  2220. function apply(ctx, method, args) {
  2221. return ctx[method].apply(ctx, args);
  2222. }
  2223. function $on() {
  2224. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  2225. }
  2226. function $off() {
  2227. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  2228. }
  2229. function $once() {
  2230. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  2231. }
  2232. function $emit() {
  2233. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  2234. }
  2235. var eventApi = /*#__PURE__*/Object.freeze({
  2236. __proto__: null,
  2237. $on: $on,
  2238. $off: $off,
  2239. $once: $once,
  2240. $emit: $emit
  2241. });
  2242. /**
  2243. * 框架内 try-catch
  2244. */
  2245. /**
  2246. * 开发者 try-catch
  2247. */
  2248. function tryCatch(fn) {
  2249. return function () {
  2250. try {
  2251. return fn.apply(fn, arguments);
  2252. } catch (e) {
  2253. // TODO
  2254. console.error(e);
  2255. }
  2256. };
  2257. }
  2258. function getApiCallbacks(params) {
  2259. var apiCallbacks = {};
  2260. for (var name in params) {
  2261. var param = params[name];
  2262. if (isFn(param)) {
  2263. apiCallbacks[name] = tryCatch(param);
  2264. delete params[name];
  2265. }
  2266. }
  2267. return apiCallbacks;
  2268. }
  2269. var cid;
  2270. var cidErrMsg;
  2271. var enabled;
  2272. function normalizePushMessage(message) {
  2273. try {
  2274. return JSON.parse(message);
  2275. } catch (e) {}
  2276. return message;
  2277. }
  2278. function invokePushCallback(args) {
  2279. if (args.type === 'enabled') {
  2280. enabled = true;
  2281. } else if (args.type === 'clientId') {
  2282. cid = args.cid;
  2283. cidErrMsg = args.errMsg;
  2284. invokeGetPushCidCallbacks(cid, args.errMsg);
  2285. } else if (args.type === 'pushMsg') {
  2286. var message = {
  2287. type: 'receive',
  2288. data: normalizePushMessage(args.message)
  2289. };
  2290. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  2291. var callback = onPushMessageCallbacks[i];
  2292. callback(message);
  2293. // 该消息已被阻止
  2294. if (message.stopped) {
  2295. break;
  2296. }
  2297. }
  2298. } else if (args.type === 'click') {
  2299. onPushMessageCallbacks.forEach(function (callback) {
  2300. callback({
  2301. type: 'click',
  2302. data: normalizePushMessage(args.message)
  2303. });
  2304. });
  2305. }
  2306. }
  2307. var getPushCidCallbacks = [];
  2308. function invokeGetPushCidCallbacks(cid, errMsg) {
  2309. getPushCidCallbacks.forEach(function (callback) {
  2310. callback(cid, errMsg);
  2311. });
  2312. getPushCidCallbacks.length = 0;
  2313. }
  2314. function getPushClientId(args) {
  2315. if (!isPlainObject(args)) {
  2316. args = {};
  2317. }
  2318. var _getApiCallbacks = getApiCallbacks(args),
  2319. success = _getApiCallbacks.success,
  2320. fail = _getApiCallbacks.fail,
  2321. complete = _getApiCallbacks.complete;
  2322. var hasSuccess = isFn(success);
  2323. var hasFail = isFn(fail);
  2324. var hasComplete = isFn(complete);
  2325. Promise.resolve().then(function () {
  2326. if (typeof enabled === 'undefined') {
  2327. enabled = false;
  2328. cid = '';
  2329. cidErrMsg = 'uniPush is not enabled';
  2330. }
  2331. getPushCidCallbacks.push(function (cid, errMsg) {
  2332. var res;
  2333. if (cid) {
  2334. res = {
  2335. errMsg: 'getPushClientId:ok',
  2336. cid: cid
  2337. };
  2338. hasSuccess && success(res);
  2339. } else {
  2340. res = {
  2341. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  2342. };
  2343. hasFail && fail(res);
  2344. }
  2345. hasComplete && complete(res);
  2346. });
  2347. if (typeof cid !== 'undefined') {
  2348. invokeGetPushCidCallbacks(cid, cidErrMsg);
  2349. }
  2350. });
  2351. }
  2352. var onPushMessageCallbacks = [];
  2353. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  2354. var onPushMessage = function onPushMessage(fn) {
  2355. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  2356. onPushMessageCallbacks.push(fn);
  2357. }
  2358. };
  2359. var offPushMessage = function offPushMessage(fn) {
  2360. if (!fn) {
  2361. onPushMessageCallbacks.length = 0;
  2362. } else {
  2363. var index = onPushMessageCallbacks.indexOf(fn);
  2364. if (index > -1) {
  2365. onPushMessageCallbacks.splice(index, 1);
  2366. }
  2367. }
  2368. };
  2369. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  2370. if (!baseInfo) {
  2371. baseInfo = wx.getSystemInfoSync();
  2372. }
  2373. var host = baseInfo ? baseInfo.host : null;
  2374. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  2375. var api = /*#__PURE__*/Object.freeze({
  2376. __proto__: null,
  2377. shareVideoMessage: shareVideoMessage,
  2378. getPushClientId: getPushClientId,
  2379. onPushMessage: onPushMessage,
  2380. offPushMessage: offPushMessage,
  2381. invokePushCallback: invokePushCallback
  2382. });
  2383. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  2384. function findVmByVueId(vm, vuePid) {
  2385. var $children = vm.$children;
  2386. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  2387. for (var i = $children.length - 1; i >= 0; i--) {
  2388. var childVm = $children[i];
  2389. if (childVm.$scope._$vueId === vuePid) {
  2390. return childVm;
  2391. }
  2392. }
  2393. // 反向递归查找
  2394. var parentVm;
  2395. for (var _i = $children.length - 1; _i >= 0; _i--) {
  2396. parentVm = findVmByVueId($children[_i], vuePid);
  2397. if (parentVm) {
  2398. return parentVm;
  2399. }
  2400. }
  2401. }
  2402. function initBehavior(options) {
  2403. return Behavior(options);
  2404. }
  2405. function isPage() {
  2406. return !!this.route;
  2407. }
  2408. function initRelation(detail) {
  2409. this.triggerEvent('__l', detail);
  2410. }
  2411. function selectAllComponents(mpInstance, selector, $refs) {
  2412. var components = mpInstance.selectAllComponents(selector) || [];
  2413. components.forEach(function (component) {
  2414. var ref = component.dataset.ref;
  2415. $refs[ref] = component.$vm || toSkip(component);
  2416. {
  2417. if (component.dataset.vueGeneric === 'scoped') {
  2418. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  2419. selectAllComponents(scopedComponent, selector, $refs);
  2420. });
  2421. }
  2422. }
  2423. });
  2424. }
  2425. function syncRefs(refs, newRefs) {
  2426. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  2427. var newKeys = Object.keys(newRefs);
  2428. newKeys.forEach(function (key) {
  2429. var oldValue = refs[key];
  2430. var newValue = newRefs[key];
  2431. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  2432. return oldValue.includes(value);
  2433. })) {
  2434. return;
  2435. }
  2436. refs[key] = newValue;
  2437. oldKeys.delete(key);
  2438. });
  2439. oldKeys.forEach(function (key) {
  2440. delete refs[key];
  2441. });
  2442. return refs;
  2443. }
  2444. function initRefs(vm) {
  2445. var mpInstance = vm.$scope;
  2446. var refs = {};
  2447. Object.defineProperty(vm, '$refs', {
  2448. get: function get() {
  2449. var $refs = {};
  2450. selectAllComponents(mpInstance, '.vue-ref', $refs);
  2451. // TODO 暂不考虑 for 中的 scoped
  2452. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  2453. forComponents.forEach(function (component) {
  2454. var ref = component.dataset.ref;
  2455. if (!$refs[ref]) {
  2456. $refs[ref] = [];
  2457. }
  2458. $refs[ref].push(component.$vm || toSkip(component));
  2459. });
  2460. return syncRefs(refs, $refs);
  2461. }
  2462. });
  2463. }
  2464. function handleLink(event) {
  2465. var _ref3 = event.detail || event.value,
  2466. vuePid = _ref3.vuePid,
  2467. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  2468. var parentVm;
  2469. if (vuePid) {
  2470. parentVm = findVmByVueId(this.$vm, vuePid);
  2471. }
  2472. if (!parentVm) {
  2473. parentVm = this.$vm;
  2474. }
  2475. vueOptions.parent = parentVm;
  2476. }
  2477. function markMPComponent(component) {
  2478. // 在 Vue 中标记为小程序组件
  2479. var IS_MP = '__v_isMPComponent';
  2480. Object.defineProperty(component, IS_MP, {
  2481. configurable: true,
  2482. enumerable: false,
  2483. value: true
  2484. });
  2485. return component;
  2486. }
  2487. function toSkip(obj) {
  2488. var OB = '__ob__';
  2489. var SKIP = '__v_skip';
  2490. if (isObject(obj) && Object.isExtensible(obj)) {
  2491. // 避免被 @vue/composition-api 观测
  2492. Object.defineProperty(obj, OB, {
  2493. configurable: true,
  2494. enumerable: false,
  2495. value: (0, _defineProperty2.default)({}, SKIP, true)
  2496. });
  2497. }
  2498. return obj;
  2499. }
  2500. var MPPage = Page;
  2501. var MPComponent = Component;
  2502. var customizeRE = /:/g;
  2503. var customize = cached(function (str) {
  2504. return camelize(str.replace(customizeRE, '-'));
  2505. });
  2506. function initTriggerEvent(mpInstance) {
  2507. var oldTriggerEvent = mpInstance.triggerEvent;
  2508. var newTriggerEvent = function newTriggerEvent(event) {
  2509. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  2510. args[_key3 - 1] = arguments[_key3];
  2511. }
  2512. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  2513. if (this.$vm || this.dataset && this.dataset.comType) {
  2514. event = customize(event);
  2515. } else {
  2516. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  2517. var newEvent = customize(event);
  2518. if (newEvent !== event) {
  2519. oldTriggerEvent.apply(this, [newEvent].concat(args));
  2520. }
  2521. }
  2522. return oldTriggerEvent.apply(this, [event].concat(args));
  2523. };
  2524. try {
  2525. // 京东小程序 triggerEvent 为只读
  2526. mpInstance.triggerEvent = newTriggerEvent;
  2527. } catch (error) {
  2528. mpInstance._triggerEvent = newTriggerEvent;
  2529. }
  2530. }
  2531. function initHook(name, options, isComponent) {
  2532. var oldHook = options[name];
  2533. options[name] = function () {
  2534. markMPComponent(this);
  2535. initTriggerEvent(this);
  2536. if (oldHook) {
  2537. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  2538. args[_key4] = arguments[_key4];
  2539. }
  2540. return oldHook.apply(this, args);
  2541. }
  2542. };
  2543. }
  2544. if (!MPPage.__$wrappered) {
  2545. MPPage.__$wrappered = true;
  2546. Page = function Page() {
  2547. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2548. initHook('onLoad', options);
  2549. return MPPage(options);
  2550. };
  2551. Page.after = MPPage.after;
  2552. Component = function Component() {
  2553. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2554. initHook('created', options);
  2555. return MPComponent(options);
  2556. };
  2557. }
  2558. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  2559. function initMocks(vm, mocks) {
  2560. var mpInstance = vm.$mp[vm.mpType];
  2561. mocks.forEach(function (mock) {
  2562. if (hasOwn(mpInstance, mock)) {
  2563. vm[mock] = mpInstance[mock];
  2564. }
  2565. });
  2566. }
  2567. function hasHook(hook, vueOptions) {
  2568. if (!vueOptions) {
  2569. return true;
  2570. }
  2571. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  2572. return true;
  2573. }
  2574. vueOptions = vueOptions.default || vueOptions;
  2575. if (isFn(vueOptions)) {
  2576. if (isFn(vueOptions.extendOptions[hook])) {
  2577. return true;
  2578. }
  2579. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  2580. return true;
  2581. }
  2582. return false;
  2583. }
  2584. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  2585. return true;
  2586. }
  2587. var mixins = vueOptions.mixins;
  2588. if (Array.isArray(mixins)) {
  2589. return !!mixins.find(function (mixin) {
  2590. return hasHook(hook, mixin);
  2591. });
  2592. }
  2593. }
  2594. function initHooks(mpOptions, hooks, vueOptions) {
  2595. hooks.forEach(function (hook) {
  2596. if (hasHook(hook, vueOptions)) {
  2597. mpOptions[hook] = function (args) {
  2598. return this.$vm && this.$vm.__call_hook(hook, args);
  2599. };
  2600. }
  2601. });
  2602. }
  2603. function initUnknownHooks(mpOptions, vueOptions) {
  2604. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2605. findHooks(vueOptions).forEach(function (hook) {
  2606. return initHook$1(mpOptions, hook, excludes);
  2607. });
  2608. }
  2609. function findHooks(vueOptions) {
  2610. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  2611. if (vueOptions) {
  2612. Object.keys(vueOptions).forEach(function (name) {
  2613. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  2614. hooks.push(name);
  2615. }
  2616. });
  2617. }
  2618. return hooks;
  2619. }
  2620. function initHook$1(mpOptions, hook, excludes) {
  2621. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  2622. mpOptions[hook] = function (args) {
  2623. return this.$vm && this.$vm.__call_hook(hook, args);
  2624. };
  2625. }
  2626. }
  2627. function initVueComponent(Vue, vueOptions) {
  2628. vueOptions = vueOptions.default || vueOptions;
  2629. var VueComponent;
  2630. if (isFn(vueOptions)) {
  2631. VueComponent = vueOptions;
  2632. } else {
  2633. VueComponent = Vue.extend(vueOptions);
  2634. }
  2635. vueOptions = VueComponent.options;
  2636. return [VueComponent, vueOptions];
  2637. }
  2638. function initSlots(vm, vueSlots) {
  2639. if (Array.isArray(vueSlots) && vueSlots.length) {
  2640. var $slots = Object.create(null);
  2641. vueSlots.forEach(function (slotName) {
  2642. $slots[slotName] = true;
  2643. });
  2644. vm.$scopedSlots = vm.$slots = $slots;
  2645. }
  2646. }
  2647. function initVueIds(vueIds, mpInstance) {
  2648. vueIds = (vueIds || '').split(',');
  2649. var len = vueIds.length;
  2650. if (len === 1) {
  2651. mpInstance._$vueId = vueIds[0];
  2652. } else if (len === 2) {
  2653. mpInstance._$vueId = vueIds[0];
  2654. mpInstance._$vuePid = vueIds[1];
  2655. }
  2656. }
  2657. function initData(vueOptions, context) {
  2658. var data = vueOptions.data || {};
  2659. var methods = vueOptions.methods || {};
  2660. if (typeof data === 'function') {
  2661. try {
  2662. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  2663. } catch (e) {
  2664. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  2665. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  2666. }
  2667. }
  2668. } else {
  2669. try {
  2670. // 对 data 格式化
  2671. data = JSON.parse(JSON.stringify(data));
  2672. } catch (e) {}
  2673. }
  2674. if (!isPlainObject(data)) {
  2675. data = {};
  2676. }
  2677. Object.keys(methods).forEach(function (methodName) {
  2678. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  2679. data[methodName] = methods[methodName];
  2680. }
  2681. });
  2682. return data;
  2683. }
  2684. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  2685. function createObserver(name) {
  2686. return function observer(newVal, oldVal) {
  2687. if (this.$vm) {
  2688. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  2689. }
  2690. };
  2691. }
  2692. function initBehaviors(vueOptions, initBehavior) {
  2693. var vueBehaviors = vueOptions.behaviors;
  2694. var vueExtends = vueOptions.extends;
  2695. var vueMixins = vueOptions.mixins;
  2696. var vueProps = vueOptions.props;
  2697. if (!vueProps) {
  2698. vueOptions.props = vueProps = [];
  2699. }
  2700. var behaviors = [];
  2701. if (Array.isArray(vueBehaviors)) {
  2702. vueBehaviors.forEach(function (behavior) {
  2703. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  2704. if (behavior === 'uni://form-field') {
  2705. if (Array.isArray(vueProps)) {
  2706. vueProps.push('name');
  2707. vueProps.push('value');
  2708. } else {
  2709. vueProps.name = {
  2710. type: String,
  2711. default: ''
  2712. };
  2713. vueProps.value = {
  2714. type: [String, Number, Boolean, Array, Object, Date],
  2715. default: ''
  2716. };
  2717. }
  2718. }
  2719. });
  2720. }
  2721. if (isPlainObject(vueExtends) && vueExtends.props) {
  2722. behaviors.push(initBehavior({
  2723. properties: initProperties(vueExtends.props, true)
  2724. }));
  2725. }
  2726. if (Array.isArray(vueMixins)) {
  2727. vueMixins.forEach(function (vueMixin) {
  2728. if (isPlainObject(vueMixin) && vueMixin.props) {
  2729. behaviors.push(initBehavior({
  2730. properties: initProperties(vueMixin.props, true)
  2731. }));
  2732. }
  2733. });
  2734. }
  2735. return behaviors;
  2736. }
  2737. function parsePropType(key, type, defaultValue, file) {
  2738. // [String]=>String
  2739. if (Array.isArray(type) && type.length === 1) {
  2740. return type[0];
  2741. }
  2742. return type;
  2743. }
  2744. function initProperties(props) {
  2745. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  2746. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  2747. var options = arguments.length > 3 ? arguments[3] : undefined;
  2748. var properties = {};
  2749. if (!isBehavior) {
  2750. properties.vueId = {
  2751. type: String,
  2752. value: ''
  2753. };
  2754. {
  2755. if (options.virtualHost) {
  2756. properties.virtualHostStyle = {
  2757. type: null,
  2758. value: ''
  2759. };
  2760. properties.virtualHostClass = {
  2761. type: null,
  2762. value: ''
  2763. };
  2764. }
  2765. }
  2766. // scopedSlotsCompiler auto
  2767. properties.scopedSlotsCompiler = {
  2768. type: String,
  2769. value: ''
  2770. };
  2771. properties.vueSlots = {
  2772. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  2773. type: null,
  2774. value: [],
  2775. observer: function observer(newVal, oldVal) {
  2776. var $slots = Object.create(null);
  2777. newVal.forEach(function (slotName) {
  2778. $slots[slotName] = true;
  2779. });
  2780. this.setData({
  2781. $slots: $slots
  2782. });
  2783. }
  2784. };
  2785. }
  2786. if (Array.isArray(props)) {
  2787. // ['title']
  2788. props.forEach(function (key) {
  2789. properties[key] = {
  2790. type: null,
  2791. observer: createObserver(key)
  2792. };
  2793. });
  2794. } else if (isPlainObject(props)) {
  2795. // {title:{type:String,default:''},content:String}
  2796. Object.keys(props).forEach(function (key) {
  2797. var opts = props[key];
  2798. if (isPlainObject(opts)) {
  2799. // title:{type:String,default:''}
  2800. var value = opts.default;
  2801. if (isFn(value)) {
  2802. value = value();
  2803. }
  2804. opts.type = parsePropType(key, opts.type);
  2805. properties[key] = {
  2806. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  2807. value: value,
  2808. observer: createObserver(key)
  2809. };
  2810. } else {
  2811. // content:String
  2812. var type = parsePropType(key, opts);
  2813. properties[key] = {
  2814. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  2815. observer: createObserver(key)
  2816. };
  2817. }
  2818. });
  2819. }
  2820. return properties;
  2821. }
  2822. function wrapper$1(event) {
  2823. // TODO 又得兼容 mpvue 的 mp 对象
  2824. try {
  2825. event.mp = JSON.parse(JSON.stringify(event));
  2826. } catch (e) {}
  2827. event.stopPropagation = noop;
  2828. event.preventDefault = noop;
  2829. event.target = event.target || {};
  2830. if (!hasOwn(event, 'detail')) {
  2831. event.detail = {};
  2832. }
  2833. if (hasOwn(event, 'markerId')) {
  2834. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  2835. event.detail.markerId = event.markerId;
  2836. }
  2837. if (isPlainObject(event.detail)) {
  2838. event.target = Object.assign({}, event.target, event.detail);
  2839. }
  2840. return event;
  2841. }
  2842. function getExtraValue(vm, dataPathsArray) {
  2843. var context = vm;
  2844. dataPathsArray.forEach(function (dataPathArray) {
  2845. var dataPath = dataPathArray[0];
  2846. var value = dataPathArray[2];
  2847. if (dataPath || typeof value !== 'undefined') {
  2848. // ['','',index,'disable']
  2849. var propPath = dataPathArray[1];
  2850. var valuePath = dataPathArray[3];
  2851. var vFor;
  2852. if (Number.isInteger(dataPath)) {
  2853. vFor = dataPath;
  2854. } else if (!dataPath) {
  2855. vFor = context;
  2856. } else if (typeof dataPath === 'string' && dataPath) {
  2857. if (dataPath.indexOf('#s#') === 0) {
  2858. vFor = dataPath.substr(3);
  2859. } else {
  2860. vFor = vm.__get_value(dataPath, context);
  2861. }
  2862. }
  2863. if (Number.isInteger(vFor)) {
  2864. context = value;
  2865. } else if (!propPath) {
  2866. context = vFor[value];
  2867. } else {
  2868. if (Array.isArray(vFor)) {
  2869. context = vFor.find(function (vForItem) {
  2870. return vm.__get_value(propPath, vForItem) === value;
  2871. });
  2872. } else if (isPlainObject(vFor)) {
  2873. context = Object.keys(vFor).find(function (vForKey) {
  2874. return vm.__get_value(propPath, vFor[vForKey]) === value;
  2875. });
  2876. } else {
  2877. console.error('v-for 暂不支持循环数据:', vFor);
  2878. }
  2879. }
  2880. if (valuePath) {
  2881. context = vm.__get_value(valuePath, context);
  2882. }
  2883. }
  2884. });
  2885. return context;
  2886. }
  2887. function processEventExtra(vm, extra, event, __args__) {
  2888. var extraObj = {};
  2889. if (Array.isArray(extra) && extra.length) {
  2890. /**
  2891. *[
  2892. * ['data.items', 'data.id', item.data.id],
  2893. * ['metas', 'id', meta.id]
  2894. *],
  2895. *[
  2896. * ['data.items', 'data.id', item.data.id],
  2897. * ['metas', 'id', meta.id]
  2898. *],
  2899. *'test'
  2900. */
  2901. extra.forEach(function (dataPath, index) {
  2902. if (typeof dataPath === 'string') {
  2903. if (!dataPath) {
  2904. // model,prop.sync
  2905. extraObj['$' + index] = vm;
  2906. } else {
  2907. if (dataPath === '$event') {
  2908. // $event
  2909. extraObj['$' + index] = event;
  2910. } else if (dataPath === 'arguments') {
  2911. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  2912. } else if (dataPath.indexOf('$event.') === 0) {
  2913. // $event.target.value
  2914. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  2915. } else {
  2916. extraObj['$' + index] = vm.__get_value(dataPath);
  2917. }
  2918. }
  2919. } else {
  2920. extraObj['$' + index] = getExtraValue(vm, dataPath);
  2921. }
  2922. });
  2923. }
  2924. return extraObj;
  2925. }
  2926. function getObjByArray(arr) {
  2927. var obj = {};
  2928. for (var i = 1; i < arr.length; i++) {
  2929. var element = arr[i];
  2930. obj[element[0]] = element[1];
  2931. }
  2932. return obj;
  2933. }
  2934. function processEventArgs(vm, event) {
  2935. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2936. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  2937. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  2938. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  2939. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  2940. // fixed 用户直接触发 mpInstance.triggerEvent
  2941. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  2942. if (isCustom) {
  2943. // 自定义事件
  2944. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  2945. if (!args.length) {
  2946. // 无参数,直接传入 event 或 detail 数组
  2947. if (isCustomMPEvent) {
  2948. return [event];
  2949. }
  2950. return __args__;
  2951. }
  2952. }
  2953. var extraObj = processEventExtra(vm, extra, event, __args__);
  2954. var ret = [];
  2955. args.forEach(function (arg) {
  2956. if (arg === '$event') {
  2957. if (methodName === '__set_model' && !isCustom) {
  2958. // input v-model value
  2959. ret.push(event.target.value);
  2960. } else {
  2961. if (isCustom && !isCustomMPEvent) {
  2962. ret.push(__args__[0]);
  2963. } else {
  2964. // wxcomponent 组件或内置组件
  2965. ret.push(event);
  2966. }
  2967. }
  2968. } else {
  2969. if (Array.isArray(arg) && arg[0] === 'o') {
  2970. ret.push(getObjByArray(arg));
  2971. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  2972. ret.push(extraObj[arg]);
  2973. } else {
  2974. ret.push(arg);
  2975. }
  2976. }
  2977. });
  2978. return ret;
  2979. }
  2980. var ONCE = '~';
  2981. var CUSTOM = '^';
  2982. function isMatchEventType(eventType, optType) {
  2983. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  2984. }
  2985. function getContextVm(vm) {
  2986. var $parent = vm.$parent;
  2987. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  2988. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  2989. $parent = $parent.$parent;
  2990. }
  2991. return $parent && $parent.$parent;
  2992. }
  2993. function handleEvent(event) {
  2994. var _this2 = this;
  2995. event = wrapper$1(event);
  2996. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  2997. var dataset = (event.currentTarget || event.target).dataset;
  2998. if (!dataset) {
  2999. return console.warn('事件信息不存在');
  3000. }
  3001. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  3002. if (!eventOpts) {
  3003. return console.warn('事件信息不存在');
  3004. }
  3005. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  3006. var eventType = event.type;
  3007. var ret = [];
  3008. eventOpts.forEach(function (eventOpt) {
  3009. var type = eventOpt[0];
  3010. var eventsArray = eventOpt[1];
  3011. var isCustom = type.charAt(0) === CUSTOM;
  3012. type = isCustom ? type.slice(1) : type;
  3013. var isOnce = type.charAt(0) === ONCE;
  3014. type = isOnce ? type.slice(1) : type;
  3015. if (eventsArray && isMatchEventType(eventType, type)) {
  3016. eventsArray.forEach(function (eventArray) {
  3017. var methodName = eventArray[0];
  3018. if (methodName) {
  3019. var handlerCtx = _this2.$vm;
  3020. if (handlerCtx.$options.generic) {
  3021. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  3022. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  3023. }
  3024. if (methodName === '$emit') {
  3025. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  3026. return;
  3027. }
  3028. var handler = handlerCtx[methodName];
  3029. if (!isFn(handler)) {
  3030. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  3031. var path = _this2.route || _this2.is;
  3032. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  3033. }
  3034. if (isOnce) {
  3035. if (handler.once) {
  3036. return;
  3037. }
  3038. handler.once = true;
  3039. }
  3040. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  3041. params = Array.isArray(params) ? params : [];
  3042. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  3043. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  3044. // eslint-disable-next-line no-sparse-arrays
  3045. params = params.concat([,,,,,,,,,, event]);
  3046. }
  3047. ret.push(handler.apply(handlerCtx, params));
  3048. }
  3049. });
  3050. }
  3051. });
  3052. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  3053. return ret[0];
  3054. }
  3055. }
  3056. var eventChannels = {};
  3057. var eventChannelStack = [];
  3058. function getEventChannel(id) {
  3059. if (id) {
  3060. var eventChannel = eventChannels[id];
  3061. delete eventChannels[id];
  3062. return eventChannel;
  3063. }
  3064. return eventChannelStack.shift();
  3065. }
  3066. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  3067. function initEventChannel() {
  3068. _vue.default.prototype.getOpenerEventChannel = function () {
  3069. // 微信小程序使用自身getOpenerEventChannel
  3070. {
  3071. return this.$scope.getOpenerEventChannel();
  3072. }
  3073. };
  3074. var callHook = _vue.default.prototype.__call_hook;
  3075. _vue.default.prototype.__call_hook = function (hook, args) {
  3076. if (hook === 'onLoad' && args && args.__id__) {
  3077. this.__eventChannel__ = getEventChannel(args.__id__);
  3078. delete args.__id__;
  3079. }
  3080. return callHook.call(this, hook, args);
  3081. };
  3082. }
  3083. function initScopedSlotsParams() {
  3084. var center = {};
  3085. var parents = {};
  3086. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  3087. var has = center[vueId];
  3088. if (!has) {
  3089. parents[vueId] = this;
  3090. this.$on('hook:destroyed', function () {
  3091. delete parents[vueId];
  3092. });
  3093. }
  3094. return has;
  3095. };
  3096. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  3097. var data = center[vueId];
  3098. if (data) {
  3099. var object = data[name] || {};
  3100. return key ? object[key] : object;
  3101. } else {
  3102. parents[vueId] = this;
  3103. this.$on('hook:destroyed', function () {
  3104. delete parents[vueId];
  3105. });
  3106. }
  3107. };
  3108. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  3109. var vueIds = this.$options.propsData.vueId;
  3110. if (vueIds) {
  3111. var vueId = vueIds.split(',')[0];
  3112. var object = center[vueId] = center[vueId] || {};
  3113. object[name] = value;
  3114. if (parents[vueId]) {
  3115. parents[vueId].$forceUpdate();
  3116. }
  3117. }
  3118. };
  3119. _vue.default.mixin({
  3120. destroyed: function destroyed() {
  3121. var propsData = this.$options.propsData;
  3122. var vueId = propsData && propsData.vueId;
  3123. if (vueId) {
  3124. delete center[vueId];
  3125. delete parents[vueId];
  3126. }
  3127. }
  3128. });
  3129. }
  3130. function parseBaseApp(vm, _ref4) {
  3131. var mocks = _ref4.mocks,
  3132. initRefs = _ref4.initRefs;
  3133. initEventChannel();
  3134. {
  3135. initScopedSlotsParams();
  3136. }
  3137. if (vm.$options.store) {
  3138. _vue.default.prototype.$store = vm.$options.store;
  3139. }
  3140. uniIdMixin(_vue.default);
  3141. _vue.default.prototype.mpHost = "mp-weixin";
  3142. _vue.default.mixin({
  3143. beforeCreate: function beforeCreate() {
  3144. if (!this.$options.mpType) {
  3145. return;
  3146. }
  3147. this.mpType = this.$options.mpType;
  3148. this.$mp = (0, _defineProperty2.default)({
  3149. data: {}
  3150. }, this.mpType, this.$options.mpInstance);
  3151. this.$scope = this.$options.mpInstance;
  3152. delete this.$options.mpType;
  3153. delete this.$options.mpInstance;
  3154. if (this.mpType === 'page' && typeof getApp === 'function') {
  3155. // hack vue-i18n
  3156. var app = getApp();
  3157. if (app.$vm && app.$vm.$i18n) {
  3158. this._i18n = app.$vm.$i18n;
  3159. }
  3160. }
  3161. if (this.mpType !== 'app') {
  3162. initRefs(this);
  3163. initMocks(this, mocks);
  3164. }
  3165. }
  3166. });
  3167. var appOptions = {
  3168. onLaunch: function onLaunch(args) {
  3169. if (this.$vm) {
  3170. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  3171. return;
  3172. }
  3173. {
  3174. if (wx.canIUse && !wx.canIUse('nextTick')) {
  3175. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  3176. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  3177. }
  3178. }
  3179. this.$vm = vm;
  3180. this.$vm.$mp = {
  3181. app: this
  3182. };
  3183. this.$vm.$scope = this;
  3184. // vm 上也挂载 globalData
  3185. this.$vm.globalData = this.globalData;
  3186. this.$vm._isMounted = true;
  3187. this.$vm.__call_hook('mounted', args);
  3188. this.$vm.__call_hook('onLaunch', args);
  3189. }
  3190. };
  3191. // 兼容旧版本 globalData
  3192. appOptions.globalData = vm.$options.globalData || {};
  3193. // 将 methods 中的方法挂在 getApp() 中
  3194. var methods = vm.$options.methods;
  3195. if (methods) {
  3196. Object.keys(methods).forEach(function (name) {
  3197. appOptions[name] = methods[name];
  3198. });
  3199. }
  3200. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  3201. initHooks(appOptions, hooks);
  3202. initUnknownHooks(appOptions, vm.$options);
  3203. return appOptions;
  3204. }
  3205. function parseApp(vm) {
  3206. return parseBaseApp(vm, {
  3207. mocks: mocks,
  3208. initRefs: initRefs
  3209. });
  3210. }
  3211. function createApp(vm) {
  3212. App(parseApp(vm));
  3213. return vm;
  3214. }
  3215. var encodeReserveRE = /[!'()*]/g;
  3216. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  3217. return '%' + c.charCodeAt(0).toString(16);
  3218. };
  3219. var commaRE = /%2C/g;
  3220. // fixed encodeURIComponent which is more conformant to RFC3986:
  3221. // - escapes [!'()*]
  3222. // - preserve commas
  3223. var encode = function encode(str) {
  3224. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  3225. };
  3226. function stringifyQuery(obj) {
  3227. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  3228. var res = obj ? Object.keys(obj).map(function (key) {
  3229. var val = obj[key];
  3230. if (val === undefined) {
  3231. return '';
  3232. }
  3233. if (val === null) {
  3234. return encodeStr(key);
  3235. }
  3236. if (Array.isArray(val)) {
  3237. var result = [];
  3238. val.forEach(function (val2) {
  3239. if (val2 === undefined) {
  3240. return;
  3241. }
  3242. if (val2 === null) {
  3243. result.push(encodeStr(key));
  3244. } else {
  3245. result.push(encodeStr(key) + '=' + encodeStr(val2));
  3246. }
  3247. });
  3248. return result.join('&');
  3249. }
  3250. return encodeStr(key) + '=' + encodeStr(val);
  3251. }).filter(function (x) {
  3252. return x.length > 0;
  3253. }).join('&') : null;
  3254. return res ? "?".concat(res) : '';
  3255. }
  3256. function parseBaseComponent(vueComponentOptions) {
  3257. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  3258. isPage = _ref5.isPage,
  3259. initRelation = _ref5.initRelation;
  3260. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  3261. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  3262. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  3263. VueComponent = _initVueComponent2[0],
  3264. vueOptions = _initVueComponent2[1];
  3265. var options = _objectSpread({
  3266. multipleSlots: true,
  3267. addGlobalClass: true
  3268. }, vueOptions.options || {});
  3269. {
  3270. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  3271. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  3272. Object.assign(options, vueOptions['mp-weixin'].options);
  3273. }
  3274. }
  3275. var componentOptions = {
  3276. options: options,
  3277. data: initData(vueOptions, _vue.default.prototype),
  3278. behaviors: initBehaviors(vueOptions, initBehavior),
  3279. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  3280. lifetimes: {
  3281. attached: function attached() {
  3282. var properties = this.properties;
  3283. var options = {
  3284. mpType: isPage.call(this) ? 'page' : 'component',
  3285. mpInstance: this,
  3286. propsData: properties
  3287. };
  3288. initVueIds(properties.vueId, this);
  3289. // 处理父子关系
  3290. initRelation.call(this, {
  3291. vuePid: this._$vuePid,
  3292. vueOptions: options
  3293. });
  3294. // 初始化 vue 实例
  3295. this.$vm = new VueComponent(options);
  3296. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  3297. initSlots(this.$vm, properties.vueSlots);
  3298. // 触发首次 setData
  3299. this.$vm.$mount();
  3300. },
  3301. ready: function ready() {
  3302. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  3303. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  3304. if (this.$vm) {
  3305. this.$vm._isMounted = true;
  3306. this.$vm.__call_hook('mounted');
  3307. this.$vm.__call_hook('onReady');
  3308. }
  3309. },
  3310. detached: function detached() {
  3311. this.$vm && this.$vm.$destroy();
  3312. }
  3313. },
  3314. pageLifetimes: {
  3315. show: function show(args) {
  3316. this.$vm && this.$vm.__call_hook('onPageShow', args);
  3317. },
  3318. hide: function hide() {
  3319. this.$vm && this.$vm.__call_hook('onPageHide');
  3320. },
  3321. resize: function resize(size) {
  3322. this.$vm && this.$vm.__call_hook('onPageResize', size);
  3323. }
  3324. },
  3325. methods: {
  3326. __l: handleLink,
  3327. __e: handleEvent
  3328. }
  3329. };
  3330. // externalClasses
  3331. if (vueOptions.externalClasses) {
  3332. componentOptions.externalClasses = vueOptions.externalClasses;
  3333. }
  3334. if (Array.isArray(vueOptions.wxsCallMethods)) {
  3335. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  3336. componentOptions.methods[callMethod] = function (args) {
  3337. return this.$vm[callMethod](args);
  3338. };
  3339. });
  3340. }
  3341. if (needVueOptions) {
  3342. return [componentOptions, vueOptions, VueComponent];
  3343. }
  3344. if (isPage) {
  3345. return componentOptions;
  3346. }
  3347. return [componentOptions, VueComponent];
  3348. }
  3349. function parseComponent(vueComponentOptions, needVueOptions) {
  3350. return parseBaseComponent(vueComponentOptions, {
  3351. isPage: isPage,
  3352. initRelation: initRelation
  3353. }, needVueOptions);
  3354. }
  3355. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  3356. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  3357. function parseBasePage(vuePageOptions) {
  3358. var _parseComponent = parseComponent(vuePageOptions, true),
  3359. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  3360. pageOptions = _parseComponent2[0],
  3361. vueOptions = _parseComponent2[1];
  3362. initHooks(pageOptions.methods, hooks$1, vueOptions);
  3363. pageOptions.methods.onLoad = function (query) {
  3364. this.options = query;
  3365. var copyQuery = Object.assign({}, query);
  3366. delete copyQuery.__id__;
  3367. this.$page = {
  3368. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  3369. };
  3370. this.$vm.$mp.query = query; // 兼容 mpvue
  3371. this.$vm.__call_hook('onLoad', query);
  3372. };
  3373. {
  3374. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  3375. }
  3376. return pageOptions;
  3377. }
  3378. function parsePage(vuePageOptions) {
  3379. return parseBasePage(vuePageOptions);
  3380. }
  3381. function createPage(vuePageOptions) {
  3382. {
  3383. return Component(parsePage(vuePageOptions));
  3384. }
  3385. }
  3386. function createComponent(vueOptions) {
  3387. {
  3388. return Component(parseComponent(vueOptions));
  3389. }
  3390. }
  3391. function createSubpackageApp(vm) {
  3392. var appOptions = parseApp(vm);
  3393. var app = getApp({
  3394. allowDefault: true
  3395. });
  3396. vm.$scope = app;
  3397. var globalData = app.globalData;
  3398. if (globalData) {
  3399. Object.keys(appOptions.globalData).forEach(function (name) {
  3400. if (!hasOwn(globalData, name)) {
  3401. globalData[name] = appOptions.globalData[name];
  3402. }
  3403. });
  3404. }
  3405. Object.keys(appOptions).forEach(function (name) {
  3406. if (!hasOwn(app, name)) {
  3407. app[name] = appOptions[name];
  3408. }
  3409. });
  3410. if (isFn(appOptions.onShow) && wx.onAppShow) {
  3411. wx.onAppShow(function () {
  3412. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  3413. args[_key5] = arguments[_key5];
  3414. }
  3415. vm.__call_hook('onShow', args);
  3416. });
  3417. }
  3418. if (isFn(appOptions.onHide) && wx.onAppHide) {
  3419. wx.onAppHide(function () {
  3420. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  3421. args[_key6] = arguments[_key6];
  3422. }
  3423. vm.__call_hook('onHide', args);
  3424. });
  3425. }
  3426. if (isFn(appOptions.onLaunch)) {
  3427. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  3428. vm.__call_hook('onLaunch', args);
  3429. }
  3430. return vm;
  3431. }
  3432. function createPlugin(vm) {
  3433. var appOptions = parseApp(vm);
  3434. if (isFn(appOptions.onShow) && wx.onAppShow) {
  3435. wx.onAppShow(function () {
  3436. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  3437. args[_key7] = arguments[_key7];
  3438. }
  3439. vm.__call_hook('onShow', args);
  3440. });
  3441. }
  3442. if (isFn(appOptions.onHide) && wx.onAppHide) {
  3443. wx.onAppHide(function () {
  3444. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  3445. args[_key8] = arguments[_key8];
  3446. }
  3447. vm.__call_hook('onHide', args);
  3448. });
  3449. }
  3450. if (isFn(appOptions.onLaunch)) {
  3451. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  3452. vm.__call_hook('onLaunch', args);
  3453. }
  3454. return vm;
  3455. }
  3456. todos.forEach(function (todoApi) {
  3457. protocols[todoApi] = false;
  3458. });
  3459. canIUses.forEach(function (canIUseApi) {
  3460. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  3461. if (!wx.canIUse(apiName)) {
  3462. protocols[canIUseApi] = false;
  3463. }
  3464. });
  3465. var uni = {};
  3466. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  3467. uni = new Proxy({}, {
  3468. get: function get(target, name) {
  3469. if (hasOwn(target, name)) {
  3470. return target[name];
  3471. }
  3472. if (baseApi[name]) {
  3473. return baseApi[name];
  3474. }
  3475. if (api[name]) {
  3476. return promisify(name, api[name]);
  3477. }
  3478. {
  3479. if (extraApi[name]) {
  3480. return promisify(name, extraApi[name]);
  3481. }
  3482. if (todoApis[name]) {
  3483. return promisify(name, todoApis[name]);
  3484. }
  3485. }
  3486. if (eventApi[name]) {
  3487. return eventApi[name];
  3488. }
  3489. return promisify(name, wrapper(name, wx[name]));
  3490. },
  3491. set: function set(target, name, value) {
  3492. target[name] = value;
  3493. return true;
  3494. }
  3495. });
  3496. } else {
  3497. Object.keys(baseApi).forEach(function (name) {
  3498. uni[name] = baseApi[name];
  3499. });
  3500. {
  3501. Object.keys(todoApis).forEach(function (name) {
  3502. uni[name] = promisify(name, todoApis[name]);
  3503. });
  3504. Object.keys(extraApi).forEach(function (name) {
  3505. uni[name] = promisify(name, todoApis[name]);
  3506. });
  3507. }
  3508. Object.keys(eventApi).forEach(function (name) {
  3509. uni[name] = eventApi[name];
  3510. });
  3511. Object.keys(api).forEach(function (name) {
  3512. uni[name] = promisify(name, api[name]);
  3513. });
  3514. Object.keys(wx).forEach(function (name) {
  3515. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  3516. uni[name] = promisify(name, wrapper(name, wx[name]));
  3517. }
  3518. });
  3519. }
  3520. wx.createApp = createApp;
  3521. wx.createPage = createPage;
  3522. wx.createComponent = createComponent;
  3523. wx.createSubpackageApp = createSubpackageApp;
  3524. wx.createPlugin = createPlugin;
  3525. var uni$1 = uni;
  3526. var _default = uni$1;
  3527. exports.default = _default;
  3528. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 3)))
  3529. /***/ }),
  3530. /***/ 20:
  3531. /*!****************************************************************!*\
  3532. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  3533. \****************************************************************/
  3534. /*! no static exports found */
  3535. /***/ (function(module, exports) {
  3536. function _iterableToArray(iter) {
  3537. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  3538. }
  3539. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3540. /***/ }),
  3541. /***/ 21:
  3542. /*!******************************************************************!*\
  3543. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  3544. \******************************************************************/
  3545. /*! no static exports found */
  3546. /***/ (function(module, exports) {
  3547. function _nonIterableSpread() {
  3548. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  3549. }
  3550. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3551. /***/ }),
  3552. /***/ 22:
  3553. /*!*************************************************************!*\
  3554. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  3555. \*************************************************************/
  3556. /*! no static exports found */
  3557. /***/ (function(module, exports, __webpack_require__) {
  3558. "use strict";
  3559. /* WEBPACK VAR INJECTION */(function(uni, global) {
  3560. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  3561. Object.defineProperty(exports, "__esModule", {
  3562. value: true
  3563. });
  3564. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  3565. exports.compileI18nJsonStr = compileI18nJsonStr;
  3566. exports.hasI18nJson = hasI18nJson;
  3567. exports.initVueI18n = initVueI18n;
  3568. exports.isI18nStr = isI18nStr;
  3569. exports.isString = void 0;
  3570. exports.normalizeLocale = normalizeLocale;
  3571. exports.parseI18nJson = parseI18nJson;
  3572. exports.resolveLocale = resolveLocale;
  3573. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  3574. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  3575. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  3576. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  3577. var isArray = Array.isArray;
  3578. var isObject = function isObject(val) {
  3579. return val !== null && (0, _typeof2.default)(val) === 'object';
  3580. };
  3581. var defaultDelimiters = ['{', '}'];
  3582. var BaseFormatter = /*#__PURE__*/function () {
  3583. function BaseFormatter() {
  3584. (0, _classCallCheck2.default)(this, BaseFormatter);
  3585. this._caches = Object.create(null);
  3586. }
  3587. (0, _createClass2.default)(BaseFormatter, [{
  3588. key: "interpolate",
  3589. value: function interpolate(message, values) {
  3590. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  3591. if (!values) {
  3592. return [message];
  3593. }
  3594. var tokens = this._caches[message];
  3595. if (!tokens) {
  3596. tokens = parse(message, delimiters);
  3597. this._caches[message] = tokens;
  3598. }
  3599. return compile(tokens, values);
  3600. }
  3601. }]);
  3602. return BaseFormatter;
  3603. }();
  3604. exports.Formatter = BaseFormatter;
  3605. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  3606. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  3607. function parse(format, _ref) {
  3608. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  3609. startDelimiter = _ref2[0],
  3610. endDelimiter = _ref2[1];
  3611. var tokens = [];
  3612. var position = 0;
  3613. var text = '';
  3614. while (position < format.length) {
  3615. var char = format[position++];
  3616. if (char === startDelimiter) {
  3617. if (text) {
  3618. tokens.push({
  3619. type: 'text',
  3620. value: text
  3621. });
  3622. }
  3623. text = '';
  3624. var sub = '';
  3625. char = format[position++];
  3626. while (char !== undefined && char !== endDelimiter) {
  3627. sub += char;
  3628. char = format[position++];
  3629. }
  3630. var isClosed = char === endDelimiter;
  3631. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  3632. tokens.push({
  3633. value: sub,
  3634. type: type
  3635. });
  3636. }
  3637. // else if (char === '%') {
  3638. // // when found rails i18n syntax, skip text capture
  3639. // if (format[position] !== '{') {
  3640. // text += char
  3641. // }
  3642. // }
  3643. else {
  3644. text += char;
  3645. }
  3646. }
  3647. text && tokens.push({
  3648. type: 'text',
  3649. value: text
  3650. });
  3651. return tokens;
  3652. }
  3653. function compile(tokens, values) {
  3654. var compiled = [];
  3655. var index = 0;
  3656. var mode = isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  3657. if (mode === 'unknown') {
  3658. return compiled;
  3659. }
  3660. while (index < tokens.length) {
  3661. var token = tokens[index];
  3662. switch (token.type) {
  3663. case 'text':
  3664. compiled.push(token.value);
  3665. break;
  3666. case 'list':
  3667. compiled.push(values[parseInt(token.value, 10)]);
  3668. break;
  3669. case 'named':
  3670. if (mode === 'named') {
  3671. compiled.push(values[token.value]);
  3672. } else {
  3673. if (true) {
  3674. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  3675. }
  3676. }
  3677. break;
  3678. case 'unknown':
  3679. if (true) {
  3680. console.warn("Detect 'unknown' type of token!");
  3681. }
  3682. break;
  3683. }
  3684. index++;
  3685. }
  3686. return compiled;
  3687. }
  3688. var LOCALE_ZH_HANS = 'zh-Hans';
  3689. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  3690. var LOCALE_ZH_HANT = 'zh-Hant';
  3691. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  3692. var LOCALE_EN = 'en';
  3693. exports.LOCALE_EN = LOCALE_EN;
  3694. var LOCALE_FR = 'fr';
  3695. exports.LOCALE_FR = LOCALE_FR;
  3696. var LOCALE_ES = 'es';
  3697. exports.LOCALE_ES = LOCALE_ES;
  3698. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3699. var hasOwn = function hasOwn(val, key) {
  3700. return hasOwnProperty.call(val, key);
  3701. };
  3702. var defaultFormatter = new BaseFormatter();
  3703. function include(str, parts) {
  3704. return !!parts.find(function (part) {
  3705. return str.indexOf(part) !== -1;
  3706. });
  3707. }
  3708. function startsWith(str, parts) {
  3709. return parts.find(function (part) {
  3710. return str.indexOf(part) === 0;
  3711. });
  3712. }
  3713. function normalizeLocale(locale, messages) {
  3714. if (!locale) {
  3715. return;
  3716. }
  3717. locale = locale.trim().replace(/_/g, '-');
  3718. if (messages && messages[locale]) {
  3719. return locale;
  3720. }
  3721. locale = locale.toLowerCase();
  3722. if (locale.indexOf('zh') === 0) {
  3723. if (locale.indexOf('-hans') > -1) {
  3724. return LOCALE_ZH_HANS;
  3725. }
  3726. if (locale.indexOf('-hant') > -1) {
  3727. return LOCALE_ZH_HANT;
  3728. }
  3729. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  3730. return LOCALE_ZH_HANT;
  3731. }
  3732. return LOCALE_ZH_HANS;
  3733. }
  3734. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  3735. if (lang) {
  3736. return lang;
  3737. }
  3738. }
  3739. var I18n = /*#__PURE__*/function () {
  3740. function I18n(_ref3) {
  3741. var locale = _ref3.locale,
  3742. fallbackLocale = _ref3.fallbackLocale,
  3743. messages = _ref3.messages,
  3744. watcher = _ref3.watcher,
  3745. formater = _ref3.formater;
  3746. (0, _classCallCheck2.default)(this, I18n);
  3747. this.locale = LOCALE_EN;
  3748. this.fallbackLocale = LOCALE_EN;
  3749. this.message = {};
  3750. this.messages = {};
  3751. this.watchers = [];
  3752. if (fallbackLocale) {
  3753. this.fallbackLocale = fallbackLocale;
  3754. }
  3755. this.formater = formater || defaultFormatter;
  3756. this.messages = messages || {};
  3757. this.setLocale(locale || LOCALE_EN);
  3758. if (watcher) {
  3759. this.watchLocale(watcher);
  3760. }
  3761. }
  3762. (0, _createClass2.default)(I18n, [{
  3763. key: "setLocale",
  3764. value: function setLocale(locale) {
  3765. var _this = this;
  3766. var oldLocale = this.locale;
  3767. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  3768. if (!this.messages[this.locale]) {
  3769. // 可能初始化时不存在
  3770. this.messages[this.locale] = {};
  3771. }
  3772. this.message = this.messages[this.locale];
  3773. // 仅发生变化时,通知
  3774. if (oldLocale !== this.locale) {
  3775. this.watchers.forEach(function (watcher) {
  3776. watcher(_this.locale, oldLocale);
  3777. });
  3778. }
  3779. }
  3780. }, {
  3781. key: "getLocale",
  3782. value: function getLocale() {
  3783. return this.locale;
  3784. }
  3785. }, {
  3786. key: "watchLocale",
  3787. value: function watchLocale(fn) {
  3788. var _this2 = this;
  3789. var index = this.watchers.push(fn) - 1;
  3790. return function () {
  3791. _this2.watchers.splice(index, 1);
  3792. };
  3793. }
  3794. }, {
  3795. key: "add",
  3796. value: function add(locale, message) {
  3797. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3798. var curMessages = this.messages[locale];
  3799. if (curMessages) {
  3800. if (override) {
  3801. Object.assign(curMessages, message);
  3802. } else {
  3803. Object.keys(message).forEach(function (key) {
  3804. if (!hasOwn(curMessages, key)) {
  3805. curMessages[key] = message[key];
  3806. }
  3807. });
  3808. }
  3809. } else {
  3810. this.messages[locale] = message;
  3811. }
  3812. }
  3813. }, {
  3814. key: "f",
  3815. value: function f(message, values, delimiters) {
  3816. return this.formater.interpolate(message, values, delimiters).join('');
  3817. }
  3818. }, {
  3819. key: "t",
  3820. value: function t(key, locale, values) {
  3821. var message = this.message;
  3822. if (typeof locale === 'string') {
  3823. locale = normalizeLocale(locale, this.messages);
  3824. locale && (message = this.messages[locale]);
  3825. } else {
  3826. values = locale;
  3827. }
  3828. if (!hasOwn(message, key)) {
  3829. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  3830. return key;
  3831. }
  3832. return this.formater.interpolate(message[key], values).join('');
  3833. }
  3834. }]);
  3835. return I18n;
  3836. }();
  3837. exports.I18n = I18n;
  3838. function watchAppLocale(appVm, i18n) {
  3839. // 需要保证 watch 的触发在组件渲染之前
  3840. if (appVm.$watchLocale) {
  3841. // vue2
  3842. appVm.$watchLocale(function (newLocale) {
  3843. i18n.setLocale(newLocale);
  3844. });
  3845. } else {
  3846. appVm.$watch(function () {
  3847. return appVm.$locale;
  3848. }, function (newLocale) {
  3849. i18n.setLocale(newLocale);
  3850. });
  3851. }
  3852. }
  3853. function getDefaultLocale() {
  3854. if (typeof uni !== 'undefined' && uni.getLocale) {
  3855. return uni.getLocale();
  3856. }
  3857. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  3858. if (typeof global !== 'undefined' && global.getLocale) {
  3859. return global.getLocale();
  3860. }
  3861. return LOCALE_EN;
  3862. }
  3863. function initVueI18n(locale) {
  3864. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3865. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  3866. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  3867. // 兼容旧版本入参
  3868. if (typeof locale !== 'string') {
  3869. var _ref4 = [messages, locale];
  3870. locale = _ref4[0];
  3871. messages = _ref4[1];
  3872. }
  3873. if (typeof locale !== 'string') {
  3874. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  3875. locale = getDefaultLocale();
  3876. }
  3877. if (typeof fallbackLocale !== 'string') {
  3878. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  3879. }
  3880. var i18n = new I18n({
  3881. locale: locale,
  3882. fallbackLocale: fallbackLocale,
  3883. messages: messages,
  3884. watcher: watcher
  3885. });
  3886. var _t = function t(key, values) {
  3887. if (typeof getApp !== 'function') {
  3888. // app view
  3889. /* eslint-disable no-func-assign */
  3890. _t = function t(key, values) {
  3891. return i18n.t(key, values);
  3892. };
  3893. } else {
  3894. var isWatchedAppLocale = false;
  3895. _t = function t(key, values) {
  3896. var appVm = getApp().$vm;
  3897. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  3898. // options: {
  3899. // type: Array,
  3900. // default () {
  3901. // return [{
  3902. // icon: 'shop',
  3903. // text: t("uni-goods-nav.options.shop"),
  3904. // }, {
  3905. // icon: 'cart',
  3906. // text: t("uni-goods-nav.options.cart")
  3907. // }]
  3908. // }
  3909. // },
  3910. if (appVm) {
  3911. // 触发响应式
  3912. appVm.$locale;
  3913. if (!isWatchedAppLocale) {
  3914. isWatchedAppLocale = true;
  3915. watchAppLocale(appVm, i18n);
  3916. }
  3917. }
  3918. return i18n.t(key, values);
  3919. };
  3920. }
  3921. return _t(key, values);
  3922. };
  3923. return {
  3924. i18n: i18n,
  3925. f: function f(message, values, delimiters) {
  3926. return i18n.f(message, values, delimiters);
  3927. },
  3928. t: function t(key, values) {
  3929. return _t(key, values);
  3930. },
  3931. add: function add(locale, message) {
  3932. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3933. return i18n.add(locale, message, override);
  3934. },
  3935. watch: function watch(fn) {
  3936. return i18n.watchLocale(fn);
  3937. },
  3938. getLocale: function getLocale() {
  3939. return i18n.getLocale();
  3940. },
  3941. setLocale: function setLocale(newLocale) {
  3942. return i18n.setLocale(newLocale);
  3943. }
  3944. };
  3945. }
  3946. var isString = function isString(val) {
  3947. return typeof val === 'string';
  3948. };
  3949. exports.isString = isString;
  3950. var formater;
  3951. function hasI18nJson(jsonObj, delimiters) {
  3952. if (!formater) {
  3953. formater = new BaseFormatter();
  3954. }
  3955. return walkJsonObj(jsonObj, function (jsonObj, key) {
  3956. var value = jsonObj[key];
  3957. if (isString(value)) {
  3958. if (isI18nStr(value, delimiters)) {
  3959. return true;
  3960. }
  3961. } else {
  3962. return hasI18nJson(value, delimiters);
  3963. }
  3964. });
  3965. }
  3966. function parseI18nJson(jsonObj, values, delimiters) {
  3967. if (!formater) {
  3968. formater = new BaseFormatter();
  3969. }
  3970. walkJsonObj(jsonObj, function (jsonObj, key) {
  3971. var value = jsonObj[key];
  3972. if (isString(value)) {
  3973. if (isI18nStr(value, delimiters)) {
  3974. jsonObj[key] = compileStr(value, values, delimiters);
  3975. }
  3976. } else {
  3977. parseI18nJson(value, values, delimiters);
  3978. }
  3979. });
  3980. return jsonObj;
  3981. }
  3982. function compileI18nJsonStr(jsonStr, _ref5) {
  3983. var locale = _ref5.locale,
  3984. locales = _ref5.locales,
  3985. delimiters = _ref5.delimiters;
  3986. if (!isI18nStr(jsonStr, delimiters)) {
  3987. return jsonStr;
  3988. }
  3989. if (!formater) {
  3990. formater = new BaseFormatter();
  3991. }
  3992. var localeValues = [];
  3993. Object.keys(locales).forEach(function (name) {
  3994. if (name !== locale) {
  3995. localeValues.push({
  3996. locale: name,
  3997. values: locales[name]
  3998. });
  3999. }
  4000. });
  4001. localeValues.unshift({
  4002. locale: locale,
  4003. values: locales[locale]
  4004. });
  4005. try {
  4006. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  4007. } catch (e) {}
  4008. return jsonStr;
  4009. }
  4010. function isI18nStr(value, delimiters) {
  4011. return value.indexOf(delimiters[0]) > -1;
  4012. }
  4013. function compileStr(value, values, delimiters) {
  4014. return formater.interpolate(value, values, delimiters).join('');
  4015. }
  4016. function compileValue(jsonObj, key, localeValues, delimiters) {
  4017. var value = jsonObj[key];
  4018. if (isString(value)) {
  4019. // 存在国际化
  4020. if (isI18nStr(value, delimiters)) {
  4021. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  4022. if (localeValues.length > 1) {
  4023. // 格式化国际化语言
  4024. var valueLocales = jsonObj[key + 'Locales'] = {};
  4025. localeValues.forEach(function (localValue) {
  4026. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  4027. });
  4028. }
  4029. }
  4030. } else {
  4031. compileJsonObj(value, localeValues, delimiters);
  4032. }
  4033. }
  4034. function compileJsonObj(jsonObj, localeValues, delimiters) {
  4035. walkJsonObj(jsonObj, function (jsonObj, key) {
  4036. compileValue(jsonObj, key, localeValues, delimiters);
  4037. });
  4038. return jsonObj;
  4039. }
  4040. function walkJsonObj(jsonObj, walk) {
  4041. if (isArray(jsonObj)) {
  4042. for (var i = 0; i < jsonObj.length; i++) {
  4043. if (walk(jsonObj, i)) {
  4044. return true;
  4045. }
  4046. }
  4047. } else if (isObject(jsonObj)) {
  4048. for (var key in jsonObj) {
  4049. if (walk(jsonObj, key)) {
  4050. return true;
  4051. }
  4052. }
  4053. }
  4054. return false;
  4055. }
  4056. function resolveLocale(locales) {
  4057. return function (locale) {
  4058. if (!locale) {
  4059. return locale;
  4060. }
  4061. locale = normalizeLocale(locale) || locale;
  4062. return resolveLocaleChain(locale).find(function (locale) {
  4063. return locales.indexOf(locale) > -1;
  4064. });
  4065. };
  4066. }
  4067. function resolveLocaleChain(locale) {
  4068. var chain = [];
  4069. var tokens = locale.split('-');
  4070. while (tokens.length) {
  4071. chain.push(tokens.join('-'));
  4072. tokens.pop();
  4073. }
  4074. return chain;
  4075. }
  4076. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 3)))
  4077. /***/ }),
  4078. /***/ 23:
  4079. /*!***************************************************************!*\
  4080. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  4081. \***************************************************************/
  4082. /*! no static exports found */
  4083. /***/ (function(module, exports) {
  4084. function _classCallCheck(instance, Constructor) {
  4085. if (!(instance instanceof Constructor)) {
  4086. throw new TypeError("Cannot call a class as a function");
  4087. }
  4088. }
  4089. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4090. /***/ }),
  4091. /***/ 24:
  4092. /*!************************************************************!*\
  4093. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  4094. \************************************************************/
  4095. /*! no static exports found */
  4096. /***/ (function(module, exports, __webpack_require__) {
  4097. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  4098. function _defineProperties(target, props) {
  4099. for (var i = 0; i < props.length; i++) {
  4100. var descriptor = props[i];
  4101. descriptor.enumerable = descriptor.enumerable || false;
  4102. descriptor.configurable = true;
  4103. if ("value" in descriptor) descriptor.writable = true;
  4104. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  4105. }
  4106. }
  4107. function _createClass(Constructor, protoProps, staticProps) {
  4108. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  4109. if (staticProps) _defineProperties(Constructor, staticProps);
  4110. Object.defineProperty(Constructor, "prototype", {
  4111. writable: false
  4112. });
  4113. return Constructor;
  4114. }
  4115. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4116. /***/ }),
  4117. /***/ 25:
  4118. /*!******************************************************************************************!*\
  4119. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  4120. \******************************************************************************************/
  4121. /*! exports provided: default */
  4122. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4123. "use strict";
  4124. __webpack_require__.r(__webpack_exports__);
  4125. /* WEBPACK VAR INJECTION */(function(global) {/*!
  4126. * Vue.js v2.6.11
  4127. * (c) 2014-2022 Evan You
  4128. * Released under the MIT License.
  4129. */
  4130. /* */
  4131. var emptyObject = Object.freeze({});
  4132. // These helpers produce better VM code in JS engines due to their
  4133. // explicitness and function inlining.
  4134. function isUndef (v) {
  4135. return v === undefined || v === null
  4136. }
  4137. function isDef (v) {
  4138. return v !== undefined && v !== null
  4139. }
  4140. function isTrue (v) {
  4141. return v === true
  4142. }
  4143. function isFalse (v) {
  4144. return v === false
  4145. }
  4146. /**
  4147. * Check if value is primitive.
  4148. */
  4149. function isPrimitive (value) {
  4150. return (
  4151. typeof value === 'string' ||
  4152. typeof value === 'number' ||
  4153. // $flow-disable-line
  4154. typeof value === 'symbol' ||
  4155. typeof value === 'boolean'
  4156. )
  4157. }
  4158. /**
  4159. * Quick object check - this is primarily used to tell
  4160. * Objects from primitive values when we know the value
  4161. * is a JSON-compliant type.
  4162. */
  4163. function isObject (obj) {
  4164. return obj !== null && typeof obj === 'object'
  4165. }
  4166. /**
  4167. * Get the raw type string of a value, e.g., [object Object].
  4168. */
  4169. var _toString = Object.prototype.toString;
  4170. function toRawType (value) {
  4171. return _toString.call(value).slice(8, -1)
  4172. }
  4173. /**
  4174. * Strict object type check. Only returns true
  4175. * for plain JavaScript objects.
  4176. */
  4177. function isPlainObject (obj) {
  4178. return _toString.call(obj) === '[object Object]'
  4179. }
  4180. function isRegExp (v) {
  4181. return _toString.call(v) === '[object RegExp]'
  4182. }
  4183. /**
  4184. * Check if val is a valid array index.
  4185. */
  4186. function isValidArrayIndex (val) {
  4187. var n = parseFloat(String(val));
  4188. return n >= 0 && Math.floor(n) === n && isFinite(val)
  4189. }
  4190. function isPromise (val) {
  4191. return (
  4192. isDef(val) &&
  4193. typeof val.then === 'function' &&
  4194. typeof val.catch === 'function'
  4195. )
  4196. }
  4197. /**
  4198. * Convert a value to a string that is actually rendered.
  4199. */
  4200. function toString (val) {
  4201. return val == null
  4202. ? ''
  4203. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  4204. ? JSON.stringify(val, null, 2)
  4205. : String(val)
  4206. }
  4207. /**
  4208. * Convert an input value to a number for persistence.
  4209. * If the conversion fails, return original string.
  4210. */
  4211. function toNumber (val) {
  4212. var n = parseFloat(val);
  4213. return isNaN(n) ? val : n
  4214. }
  4215. /**
  4216. * Make a map and return a function for checking if a key
  4217. * is in that map.
  4218. */
  4219. function makeMap (
  4220. str,
  4221. expectsLowerCase
  4222. ) {
  4223. var map = Object.create(null);
  4224. var list = str.split(',');
  4225. for (var i = 0; i < list.length; i++) {
  4226. map[list[i]] = true;
  4227. }
  4228. return expectsLowerCase
  4229. ? function (val) { return map[val.toLowerCase()]; }
  4230. : function (val) { return map[val]; }
  4231. }
  4232. /**
  4233. * Check if a tag is a built-in tag.
  4234. */
  4235. var isBuiltInTag = makeMap('slot,component', true);
  4236. /**
  4237. * Check if an attribute is a reserved attribute.
  4238. */
  4239. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  4240. /**
  4241. * Remove an item from an array.
  4242. */
  4243. function remove (arr, item) {
  4244. if (arr.length) {
  4245. var index = arr.indexOf(item);
  4246. if (index > -1) {
  4247. return arr.splice(index, 1)
  4248. }
  4249. }
  4250. }
  4251. /**
  4252. * Check whether an object has the property.
  4253. */
  4254. var hasOwnProperty = Object.prototype.hasOwnProperty;
  4255. function hasOwn (obj, key) {
  4256. return hasOwnProperty.call(obj, key)
  4257. }
  4258. /**
  4259. * Create a cached version of a pure function.
  4260. */
  4261. function cached (fn) {
  4262. var cache = Object.create(null);
  4263. return (function cachedFn (str) {
  4264. var hit = cache[str];
  4265. return hit || (cache[str] = fn(str))
  4266. })
  4267. }
  4268. /**
  4269. * Camelize a hyphen-delimited string.
  4270. */
  4271. var camelizeRE = /-(\w)/g;
  4272. var camelize = cached(function (str) {
  4273. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  4274. });
  4275. /**
  4276. * Capitalize a string.
  4277. */
  4278. var capitalize = cached(function (str) {
  4279. return str.charAt(0).toUpperCase() + str.slice(1)
  4280. });
  4281. /**
  4282. * Hyphenate a camelCase string.
  4283. */
  4284. var hyphenateRE = /\B([A-Z])/g;
  4285. var hyphenate = cached(function (str) {
  4286. return str.replace(hyphenateRE, '-$1').toLowerCase()
  4287. });
  4288. /**
  4289. * Simple bind polyfill for environments that do not support it,
  4290. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  4291. * since native bind is now performant enough in most browsers.
  4292. * But removing it would mean breaking code that was able to run in
  4293. * PhantomJS 1.x, so this must be kept for backward compatibility.
  4294. */
  4295. /* istanbul ignore next */
  4296. function polyfillBind (fn, ctx) {
  4297. function boundFn (a) {
  4298. var l = arguments.length;
  4299. return l
  4300. ? l > 1
  4301. ? fn.apply(ctx, arguments)
  4302. : fn.call(ctx, a)
  4303. : fn.call(ctx)
  4304. }
  4305. boundFn._length = fn.length;
  4306. return boundFn
  4307. }
  4308. function nativeBind (fn, ctx) {
  4309. return fn.bind(ctx)
  4310. }
  4311. var bind = Function.prototype.bind
  4312. ? nativeBind
  4313. : polyfillBind;
  4314. /**
  4315. * Convert an Array-like object to a real Array.
  4316. */
  4317. function toArray (list, start) {
  4318. start = start || 0;
  4319. var i = list.length - start;
  4320. var ret = new Array(i);
  4321. while (i--) {
  4322. ret[i] = list[i + start];
  4323. }
  4324. return ret
  4325. }
  4326. /**
  4327. * Mix properties into target object.
  4328. */
  4329. function extend (to, _from) {
  4330. for (var key in _from) {
  4331. to[key] = _from[key];
  4332. }
  4333. return to
  4334. }
  4335. /**
  4336. * Merge an Array of Objects into a single Object.
  4337. */
  4338. function toObject (arr) {
  4339. var res = {};
  4340. for (var i = 0; i < arr.length; i++) {
  4341. if (arr[i]) {
  4342. extend(res, arr[i]);
  4343. }
  4344. }
  4345. return res
  4346. }
  4347. /* eslint-disable no-unused-vars */
  4348. /**
  4349. * Perform no operation.
  4350. * Stubbing args to make Flow happy without leaving useless transpiled code
  4351. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  4352. */
  4353. function noop (a, b, c) {}
  4354. /**
  4355. * Always return false.
  4356. */
  4357. var no = function (a, b, c) { return false; };
  4358. /* eslint-enable no-unused-vars */
  4359. /**
  4360. * Return the same value.
  4361. */
  4362. var identity = function (_) { return _; };
  4363. /**
  4364. * Check if two values are loosely equal - that is,
  4365. * if they are plain objects, do they have the same shape?
  4366. */
  4367. function looseEqual (a, b) {
  4368. if (a === b) { return true }
  4369. var isObjectA = isObject(a);
  4370. var isObjectB = isObject(b);
  4371. if (isObjectA && isObjectB) {
  4372. try {
  4373. var isArrayA = Array.isArray(a);
  4374. var isArrayB = Array.isArray(b);
  4375. if (isArrayA && isArrayB) {
  4376. return a.length === b.length && a.every(function (e, i) {
  4377. return looseEqual(e, b[i])
  4378. })
  4379. } else if (a instanceof Date && b instanceof Date) {
  4380. return a.getTime() === b.getTime()
  4381. } else if (!isArrayA && !isArrayB) {
  4382. var keysA = Object.keys(a);
  4383. var keysB = Object.keys(b);
  4384. return keysA.length === keysB.length && keysA.every(function (key) {
  4385. return looseEqual(a[key], b[key])
  4386. })
  4387. } else {
  4388. /* istanbul ignore next */
  4389. return false
  4390. }
  4391. } catch (e) {
  4392. /* istanbul ignore next */
  4393. return false
  4394. }
  4395. } else if (!isObjectA && !isObjectB) {
  4396. return String(a) === String(b)
  4397. } else {
  4398. return false
  4399. }
  4400. }
  4401. /**
  4402. * Return the first index at which a loosely equal value can be
  4403. * found in the array (if value is a plain object, the array must
  4404. * contain an object of the same shape), or -1 if it is not present.
  4405. */
  4406. function looseIndexOf (arr, val) {
  4407. for (var i = 0; i < arr.length; i++) {
  4408. if (looseEqual(arr[i], val)) { return i }
  4409. }
  4410. return -1
  4411. }
  4412. /**
  4413. * Ensure a function is called only once.
  4414. */
  4415. function once (fn) {
  4416. var called = false;
  4417. return function () {
  4418. if (!called) {
  4419. called = true;
  4420. fn.apply(this, arguments);
  4421. }
  4422. }
  4423. }
  4424. var ASSET_TYPES = [
  4425. 'component',
  4426. 'directive',
  4427. 'filter'
  4428. ];
  4429. var LIFECYCLE_HOOKS = [
  4430. 'beforeCreate',
  4431. 'created',
  4432. 'beforeMount',
  4433. 'mounted',
  4434. 'beforeUpdate',
  4435. 'updated',
  4436. 'beforeDestroy',
  4437. 'destroyed',
  4438. 'activated',
  4439. 'deactivated',
  4440. 'errorCaptured',
  4441. 'serverPrefetch'
  4442. ];
  4443. /* */
  4444. var config = ({
  4445. /**
  4446. * Option merge strategies (used in core/util/options)
  4447. */
  4448. // $flow-disable-line
  4449. optionMergeStrategies: Object.create(null),
  4450. /**
  4451. * Whether to suppress warnings.
  4452. */
  4453. silent: false,
  4454. /**
  4455. * Show production mode tip message on boot?
  4456. */
  4457. productionTip: "development" !== 'production',
  4458. /**
  4459. * Whether to enable devtools
  4460. */
  4461. devtools: "development" !== 'production',
  4462. /**
  4463. * Whether to record perf
  4464. */
  4465. performance: false,
  4466. /**
  4467. * Error handler for watcher errors
  4468. */
  4469. errorHandler: null,
  4470. /**
  4471. * Warn handler for watcher warns
  4472. */
  4473. warnHandler: null,
  4474. /**
  4475. * Ignore certain custom elements
  4476. */
  4477. ignoredElements: [],
  4478. /**
  4479. * Custom user key aliases for v-on
  4480. */
  4481. // $flow-disable-line
  4482. keyCodes: Object.create(null),
  4483. /**
  4484. * Check if a tag is reserved so that it cannot be registered as a
  4485. * component. This is platform-dependent and may be overwritten.
  4486. */
  4487. isReservedTag: no,
  4488. /**
  4489. * Check if an attribute is reserved so that it cannot be used as a component
  4490. * prop. This is platform-dependent and may be overwritten.
  4491. */
  4492. isReservedAttr: no,
  4493. /**
  4494. * Check if a tag is an unknown element.
  4495. * Platform-dependent.
  4496. */
  4497. isUnknownElement: no,
  4498. /**
  4499. * Get the namespace of an element
  4500. */
  4501. getTagNamespace: noop,
  4502. /**
  4503. * Parse the real tag name for the specific platform.
  4504. */
  4505. parsePlatformTagName: identity,
  4506. /**
  4507. * Check if an attribute must be bound using property, e.g. value
  4508. * Platform-dependent.
  4509. */
  4510. mustUseProp: no,
  4511. /**
  4512. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  4513. * This will significantly reduce performance if set to false.
  4514. */
  4515. async: true,
  4516. /**
  4517. * Exposed for legacy reasons
  4518. */
  4519. _lifecycleHooks: LIFECYCLE_HOOKS
  4520. });
  4521. /* */
  4522. /**
  4523. * unicode letters used for parsing html tags, component names and property paths.
  4524. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  4525. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  4526. */
  4527. 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/;
  4528. /**
  4529. * Check if a string starts with $ or _
  4530. */
  4531. function isReserved (str) {
  4532. var c = (str + '').charCodeAt(0);
  4533. return c === 0x24 || c === 0x5F
  4534. }
  4535. /**
  4536. * Define a property.
  4537. */
  4538. function def (obj, key, val, enumerable) {
  4539. Object.defineProperty(obj, key, {
  4540. value: val,
  4541. enumerable: !!enumerable,
  4542. writable: true,
  4543. configurable: true
  4544. });
  4545. }
  4546. /**
  4547. * Parse simple path.
  4548. */
  4549. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  4550. function parsePath (path) {
  4551. if (bailRE.test(path)) {
  4552. return
  4553. }
  4554. var segments = path.split('.');
  4555. return function (obj) {
  4556. for (var i = 0; i < segments.length; i++) {
  4557. if (!obj) { return }
  4558. obj = obj[segments[i]];
  4559. }
  4560. return obj
  4561. }
  4562. }
  4563. /* */
  4564. // can we use __proto__?
  4565. var hasProto = '__proto__' in {};
  4566. // Browser environment sniffing
  4567. var inBrowser = typeof window !== 'undefined';
  4568. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  4569. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  4570. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  4571. var isIE = UA && /msie|trident/.test(UA);
  4572. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  4573. var isEdge = UA && UA.indexOf('edge/') > 0;
  4574. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  4575. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  4576. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  4577. var isPhantomJS = UA && /phantomjs/.test(UA);
  4578. var isFF = UA && UA.match(/firefox\/(\d+)/);
  4579. // Firefox has a "watch" function on Object.prototype...
  4580. var nativeWatch = ({}).watch;
  4581. if (inBrowser) {
  4582. try {
  4583. var opts = {};
  4584. Object.defineProperty(opts, 'passive', ({
  4585. get: function get () {
  4586. }
  4587. })); // https://github.com/facebook/flow/issues/285
  4588. window.addEventListener('test-passive', null, opts);
  4589. } catch (e) {}
  4590. }
  4591. // this needs to be lazy-evaled because vue may be required before
  4592. // vue-server-renderer can set VUE_ENV
  4593. var _isServer;
  4594. var isServerRendering = function () {
  4595. if (_isServer === undefined) {
  4596. /* istanbul ignore if */
  4597. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  4598. // detect presence of vue-server-renderer and avoid
  4599. // Webpack shimming the process
  4600. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  4601. } else {
  4602. _isServer = false;
  4603. }
  4604. }
  4605. return _isServer
  4606. };
  4607. // detect devtools
  4608. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  4609. /* istanbul ignore next */
  4610. function isNative (Ctor) {
  4611. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  4612. }
  4613. var hasSymbol =
  4614. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  4615. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  4616. var _Set;
  4617. /* istanbul ignore if */ // $flow-disable-line
  4618. if (typeof Set !== 'undefined' && isNative(Set)) {
  4619. // use native Set when available.
  4620. _Set = Set;
  4621. } else {
  4622. // a non-standard Set polyfill that only works with primitive keys.
  4623. _Set = /*@__PURE__*/(function () {
  4624. function Set () {
  4625. this.set = Object.create(null);
  4626. }
  4627. Set.prototype.has = function has (key) {
  4628. return this.set[key] === true
  4629. };
  4630. Set.prototype.add = function add (key) {
  4631. this.set[key] = true;
  4632. };
  4633. Set.prototype.clear = function clear () {
  4634. this.set = Object.create(null);
  4635. };
  4636. return Set;
  4637. }());
  4638. }
  4639. /* */
  4640. var warn = noop;
  4641. var tip = noop;
  4642. var generateComponentTrace = (noop); // work around flow check
  4643. var formatComponentName = (noop);
  4644. if (true) {
  4645. var hasConsole = typeof console !== 'undefined';
  4646. var classifyRE = /(?:^|[-_])(\w)/g;
  4647. var classify = function (str) { return str
  4648. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  4649. .replace(/[-_]/g, ''); };
  4650. warn = function (msg, vm) {
  4651. var trace = vm ? generateComponentTrace(vm) : '';
  4652. if (config.warnHandler) {
  4653. config.warnHandler.call(null, msg, vm, trace);
  4654. } else if (hasConsole && (!config.silent)) {
  4655. console.error(("[Vue warn]: " + msg + trace));
  4656. }
  4657. };
  4658. tip = function (msg, vm) {
  4659. if (hasConsole && (!config.silent)) {
  4660. console.warn("[Vue tip]: " + msg + (
  4661. vm ? generateComponentTrace(vm) : ''
  4662. ));
  4663. }
  4664. };
  4665. formatComponentName = function (vm, includeFile) {
  4666. if (vm.$root === vm) {
  4667. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  4668. return ('') + vm.$options.__file
  4669. }
  4670. return '<Root>'
  4671. }
  4672. var options = typeof vm === 'function' && vm.cid != null
  4673. ? vm.options
  4674. : vm._isVue
  4675. ? vm.$options || vm.constructor.options
  4676. : vm;
  4677. var name = options.name || options._componentTag;
  4678. var file = options.__file;
  4679. if (!name && file) {
  4680. var match = file.match(/([^/\\]+)\.vue$/);
  4681. name = match && match[1];
  4682. }
  4683. return (
  4684. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  4685. (file && includeFile !== false ? (" at " + file) : '')
  4686. )
  4687. };
  4688. var repeat = function (str, n) {
  4689. var res = '';
  4690. while (n) {
  4691. if (n % 2 === 1) { res += str; }
  4692. if (n > 1) { str += str; }
  4693. n >>= 1;
  4694. }
  4695. return res
  4696. };
  4697. generateComponentTrace = function (vm) {
  4698. if (vm._isVue && vm.$parent) {
  4699. var tree = [];
  4700. var currentRecursiveSequence = 0;
  4701. while (vm && vm.$options.name !== 'PageBody') {
  4702. if (tree.length > 0) {
  4703. var last = tree[tree.length - 1];
  4704. if (last.constructor === vm.constructor) {
  4705. currentRecursiveSequence++;
  4706. vm = vm.$parent;
  4707. continue
  4708. } else if (currentRecursiveSequence > 0) {
  4709. tree[tree.length - 1] = [last, currentRecursiveSequence];
  4710. currentRecursiveSequence = 0;
  4711. }
  4712. }
  4713. !vm.$options.isReserved && tree.push(vm);
  4714. vm = vm.$parent;
  4715. }
  4716. return '\n\nfound in\n\n' + tree
  4717. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  4718. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  4719. : formatComponentName(vm))); })
  4720. .join('\n')
  4721. } else {
  4722. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  4723. }
  4724. };
  4725. }
  4726. /* */
  4727. var uid = 0;
  4728. /**
  4729. * A dep is an observable that can have multiple
  4730. * directives subscribing to it.
  4731. */
  4732. var Dep = function Dep () {
  4733. this.id = uid++;
  4734. this.subs = [];
  4735. };
  4736. Dep.prototype.addSub = function addSub (sub) {
  4737. this.subs.push(sub);
  4738. };
  4739. Dep.prototype.removeSub = function removeSub (sub) {
  4740. remove(this.subs, sub);
  4741. };
  4742. Dep.prototype.depend = function depend () {
  4743. if (Dep.SharedObject.target) {
  4744. Dep.SharedObject.target.addDep(this);
  4745. }
  4746. };
  4747. Dep.prototype.notify = function notify () {
  4748. // stabilize the subscriber list first
  4749. var subs = this.subs.slice();
  4750. if ( true && !config.async) {
  4751. // subs aren't sorted in scheduler if not running async
  4752. // we need to sort them now to make sure they fire in correct
  4753. // order
  4754. subs.sort(function (a, b) { return a.id - b.id; });
  4755. }
  4756. for (var i = 0, l = subs.length; i < l; i++) {
  4757. subs[i].update();
  4758. }
  4759. };
  4760. // The current target watcher being evaluated.
  4761. // This is globally unique because only one watcher
  4762. // can be evaluated at a time.
  4763. // fixed by xxxxxx (nvue shared vuex)
  4764. /* eslint-disable no-undef */
  4765. Dep.SharedObject = {};
  4766. Dep.SharedObject.target = null;
  4767. Dep.SharedObject.targetStack = [];
  4768. function pushTarget (target) {
  4769. Dep.SharedObject.targetStack.push(target);
  4770. Dep.SharedObject.target = target;
  4771. Dep.target = target;
  4772. }
  4773. function popTarget () {
  4774. Dep.SharedObject.targetStack.pop();
  4775. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  4776. Dep.target = Dep.SharedObject.target;
  4777. }
  4778. /* */
  4779. var VNode = function VNode (
  4780. tag,
  4781. data,
  4782. children,
  4783. text,
  4784. elm,
  4785. context,
  4786. componentOptions,
  4787. asyncFactory
  4788. ) {
  4789. this.tag = tag;
  4790. this.data = data;
  4791. this.children = children;
  4792. this.text = text;
  4793. this.elm = elm;
  4794. this.ns = undefined;
  4795. this.context = context;
  4796. this.fnContext = undefined;
  4797. this.fnOptions = undefined;
  4798. this.fnScopeId = undefined;
  4799. this.key = data && data.key;
  4800. this.componentOptions = componentOptions;
  4801. this.componentInstance = undefined;
  4802. this.parent = undefined;
  4803. this.raw = false;
  4804. this.isStatic = false;
  4805. this.isRootInsert = true;
  4806. this.isComment = false;
  4807. this.isCloned = false;
  4808. this.isOnce = false;
  4809. this.asyncFactory = asyncFactory;
  4810. this.asyncMeta = undefined;
  4811. this.isAsyncPlaceholder = false;
  4812. };
  4813. var prototypeAccessors = { child: { configurable: true } };
  4814. // DEPRECATED: alias for componentInstance for backwards compat.
  4815. /* istanbul ignore next */
  4816. prototypeAccessors.child.get = function () {
  4817. return this.componentInstance
  4818. };
  4819. Object.defineProperties( VNode.prototype, prototypeAccessors );
  4820. var createEmptyVNode = function (text) {
  4821. if ( text === void 0 ) text = '';
  4822. var node = new VNode();
  4823. node.text = text;
  4824. node.isComment = true;
  4825. return node
  4826. };
  4827. function createTextVNode (val) {
  4828. return new VNode(undefined, undefined, undefined, String(val))
  4829. }
  4830. // optimized shallow clone
  4831. // used for static nodes and slot nodes because they may be reused across
  4832. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4833. // on their elm reference.
  4834. function cloneVNode (vnode) {
  4835. var cloned = new VNode(
  4836. vnode.tag,
  4837. vnode.data,
  4838. // #7975
  4839. // clone children array to avoid mutating original in case of cloning
  4840. // a child.
  4841. vnode.children && vnode.children.slice(),
  4842. vnode.text,
  4843. vnode.elm,
  4844. vnode.context,
  4845. vnode.componentOptions,
  4846. vnode.asyncFactory
  4847. );
  4848. cloned.ns = vnode.ns;
  4849. cloned.isStatic = vnode.isStatic;
  4850. cloned.key = vnode.key;
  4851. cloned.isComment = vnode.isComment;
  4852. cloned.fnContext = vnode.fnContext;
  4853. cloned.fnOptions = vnode.fnOptions;
  4854. cloned.fnScopeId = vnode.fnScopeId;
  4855. cloned.asyncMeta = vnode.asyncMeta;
  4856. cloned.isCloned = true;
  4857. return cloned
  4858. }
  4859. /*
  4860. * not type checking this file because flow doesn't play well with
  4861. * dynamically accessing methods on Array prototype
  4862. */
  4863. var arrayProto = Array.prototype;
  4864. var arrayMethods = Object.create(arrayProto);
  4865. var methodsToPatch = [
  4866. 'push',
  4867. 'pop',
  4868. 'shift',
  4869. 'unshift',
  4870. 'splice',
  4871. 'sort',
  4872. 'reverse'
  4873. ];
  4874. /**
  4875. * Intercept mutating methods and emit events
  4876. */
  4877. methodsToPatch.forEach(function (method) {
  4878. // cache original method
  4879. var original = arrayProto[method];
  4880. def(arrayMethods, method, function mutator () {
  4881. var args = [], len = arguments.length;
  4882. while ( len-- ) args[ len ] = arguments[ len ];
  4883. var result = original.apply(this, args);
  4884. var ob = this.__ob__;
  4885. var inserted;
  4886. switch (method) {
  4887. case 'push':
  4888. case 'unshift':
  4889. inserted = args;
  4890. break
  4891. case 'splice':
  4892. inserted = args.slice(2);
  4893. break
  4894. }
  4895. if (inserted) { ob.observeArray(inserted); }
  4896. // notify change
  4897. ob.dep.notify();
  4898. return result
  4899. });
  4900. });
  4901. /* */
  4902. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4903. /**
  4904. * In some cases we may want to disable observation inside a component's
  4905. * update computation.
  4906. */
  4907. var shouldObserve = true;
  4908. function toggleObserving (value) {
  4909. shouldObserve = value;
  4910. }
  4911. /**
  4912. * Observer class that is attached to each observed
  4913. * object. Once attached, the observer converts the target
  4914. * object's property keys into getter/setters that
  4915. * collect dependencies and dispatch updates.
  4916. */
  4917. var Observer = function Observer (value) {
  4918. this.value = value;
  4919. this.dep = new Dep();
  4920. this.vmCount = 0;
  4921. def(value, '__ob__', this);
  4922. if (Array.isArray(value)) {
  4923. if (hasProto) {
  4924. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4925. if(value.push !== value.__proto__.push){
  4926. copyAugment(value, arrayMethods, arrayKeys);
  4927. } else {
  4928. protoAugment(value, arrayMethods);
  4929. }
  4930. }
  4931. } else {
  4932. copyAugment(value, arrayMethods, arrayKeys);
  4933. }
  4934. this.observeArray(value);
  4935. } else {
  4936. this.walk(value);
  4937. }
  4938. };
  4939. /**
  4940. * Walk through all properties and convert them into
  4941. * getter/setters. This method should only be called when
  4942. * value type is Object.
  4943. */
  4944. Observer.prototype.walk = function walk (obj) {
  4945. var keys = Object.keys(obj);
  4946. for (var i = 0; i < keys.length; i++) {
  4947. defineReactive$$1(obj, keys[i]);
  4948. }
  4949. };
  4950. /**
  4951. * Observe a list of Array items.
  4952. */
  4953. Observer.prototype.observeArray = function observeArray (items) {
  4954. for (var i = 0, l = items.length; i < l; i++) {
  4955. observe(items[i]);
  4956. }
  4957. };
  4958. // helpers
  4959. /**
  4960. * Augment a target Object or Array by intercepting
  4961. * the prototype chain using __proto__
  4962. */
  4963. function protoAugment (target, src) {
  4964. /* eslint-disable no-proto */
  4965. target.__proto__ = src;
  4966. /* eslint-enable no-proto */
  4967. }
  4968. /**
  4969. * Augment a target Object or Array by defining
  4970. * hidden properties.
  4971. */
  4972. /* istanbul ignore next */
  4973. function copyAugment (target, src, keys) {
  4974. for (var i = 0, l = keys.length; i < l; i++) {
  4975. var key = keys[i];
  4976. def(target, key, src[key]);
  4977. }
  4978. }
  4979. /**
  4980. * Attempt to create an observer instance for a value,
  4981. * returns the new observer if successfully observed,
  4982. * or the existing observer if the value already has one.
  4983. */
  4984. function observe (value, asRootData) {
  4985. if (!isObject(value) || value instanceof VNode) {
  4986. return
  4987. }
  4988. var ob;
  4989. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4990. ob = value.__ob__;
  4991. } else if (
  4992. shouldObserve &&
  4993. !isServerRendering() &&
  4994. (Array.isArray(value) || isPlainObject(value)) &&
  4995. Object.isExtensible(value) &&
  4996. !value._isVue &&
  4997. !value.__v_isMPComponent
  4998. ) {
  4999. ob = new Observer(value);
  5000. }
  5001. if (asRootData && ob) {
  5002. ob.vmCount++;
  5003. }
  5004. return ob
  5005. }
  5006. /**
  5007. * Define a reactive property on an Object.
  5008. */
  5009. function defineReactive$$1 (
  5010. obj,
  5011. key,
  5012. val,
  5013. customSetter,
  5014. shallow
  5015. ) {
  5016. var dep = new Dep();
  5017. var property = Object.getOwnPropertyDescriptor(obj, key);
  5018. if (property && property.configurable === false) {
  5019. return
  5020. }
  5021. // cater for pre-defined getter/setters
  5022. var getter = property && property.get;
  5023. var setter = property && property.set;
  5024. if ((!getter || setter) && arguments.length === 2) {
  5025. val = obj[key];
  5026. }
  5027. var childOb = !shallow && observe(val);
  5028. Object.defineProperty(obj, key, {
  5029. enumerable: true,
  5030. configurable: true,
  5031. get: function reactiveGetter () {
  5032. var value = getter ? getter.call(obj) : val;
  5033. if (Dep.SharedObject.target) { // fixed by xxxxxx
  5034. dep.depend();
  5035. if (childOb) {
  5036. childOb.dep.depend();
  5037. if (Array.isArray(value)) {
  5038. dependArray(value);
  5039. }
  5040. }
  5041. }
  5042. return value
  5043. },
  5044. set: function reactiveSetter (newVal) {
  5045. var value = getter ? getter.call(obj) : val;
  5046. /* eslint-disable no-self-compare */
  5047. if (newVal === value || (newVal !== newVal && value !== value)) {
  5048. return
  5049. }
  5050. /* eslint-enable no-self-compare */
  5051. if ( true && customSetter) {
  5052. customSetter();
  5053. }
  5054. // #7981: for accessor properties without setter
  5055. if (getter && !setter) { return }
  5056. if (setter) {
  5057. setter.call(obj, newVal);
  5058. } else {
  5059. val = newVal;
  5060. }
  5061. childOb = !shallow && observe(newVal);
  5062. dep.notify();
  5063. }
  5064. });
  5065. }
  5066. /**
  5067. * Set a property on an object. Adds the new property and
  5068. * triggers change notification if the property doesn't
  5069. * already exist.
  5070. */
  5071. function set (target, key, val) {
  5072. if ( true &&
  5073. (isUndef(target) || isPrimitive(target))
  5074. ) {
  5075. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  5076. }
  5077. if (Array.isArray(target) && isValidArrayIndex(key)) {
  5078. target.length = Math.max(target.length, key);
  5079. target.splice(key, 1, val);
  5080. return val
  5081. }
  5082. if (key in target && !(key in Object.prototype)) {
  5083. target[key] = val;
  5084. return val
  5085. }
  5086. var ob = (target).__ob__;
  5087. if (target._isVue || (ob && ob.vmCount)) {
  5088. true && warn(
  5089. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  5090. 'at runtime - declare it upfront in the data option.'
  5091. );
  5092. return val
  5093. }
  5094. if (!ob) {
  5095. target[key] = val;
  5096. return val
  5097. }
  5098. defineReactive$$1(ob.value, key, val);
  5099. ob.dep.notify();
  5100. return val
  5101. }
  5102. /**
  5103. * Delete a property and trigger change if necessary.
  5104. */
  5105. function del (target, key) {
  5106. if ( true &&
  5107. (isUndef(target) || isPrimitive(target))
  5108. ) {
  5109. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  5110. }
  5111. if (Array.isArray(target) && isValidArrayIndex(key)) {
  5112. target.splice(key, 1);
  5113. return
  5114. }
  5115. var ob = (target).__ob__;
  5116. if (target._isVue || (ob && ob.vmCount)) {
  5117. true && warn(
  5118. 'Avoid deleting properties on a Vue instance or its root $data ' +
  5119. '- just set it to null.'
  5120. );
  5121. return
  5122. }
  5123. if (!hasOwn(target, key)) {
  5124. return
  5125. }
  5126. delete target[key];
  5127. if (!ob) {
  5128. return
  5129. }
  5130. ob.dep.notify();
  5131. }
  5132. /**
  5133. * Collect dependencies on array elements when the array is touched, since
  5134. * we cannot intercept array element access like property getters.
  5135. */
  5136. function dependArray (value) {
  5137. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  5138. e = value[i];
  5139. e && e.__ob__ && e.__ob__.dep.depend();
  5140. if (Array.isArray(e)) {
  5141. dependArray(e);
  5142. }
  5143. }
  5144. }
  5145. /* */
  5146. /**
  5147. * Option overwriting strategies are functions that handle
  5148. * how to merge a parent option value and a child option
  5149. * value into the final value.
  5150. */
  5151. var strats = config.optionMergeStrategies;
  5152. /**
  5153. * Options with restrictions
  5154. */
  5155. if (true) {
  5156. strats.el = strats.propsData = function (parent, child, vm, key) {
  5157. if (!vm) {
  5158. warn(
  5159. "option \"" + key + "\" can only be used during instance " +
  5160. 'creation with the `new` keyword.'
  5161. );
  5162. }
  5163. return defaultStrat(parent, child)
  5164. };
  5165. }
  5166. /**
  5167. * Helper that recursively merges two data objects together.
  5168. */
  5169. function mergeData (to, from) {
  5170. if (!from) { return to }
  5171. var key, toVal, fromVal;
  5172. var keys = hasSymbol
  5173. ? Reflect.ownKeys(from)
  5174. : Object.keys(from);
  5175. for (var i = 0; i < keys.length; i++) {
  5176. key = keys[i];
  5177. // in case the object is already observed...
  5178. if (key === '__ob__') { continue }
  5179. toVal = to[key];
  5180. fromVal = from[key];
  5181. if (!hasOwn(to, key)) {
  5182. set(to, key, fromVal);
  5183. } else if (
  5184. toVal !== fromVal &&
  5185. isPlainObject(toVal) &&
  5186. isPlainObject(fromVal)
  5187. ) {
  5188. mergeData(toVal, fromVal);
  5189. }
  5190. }
  5191. return to
  5192. }
  5193. /**
  5194. * Data
  5195. */
  5196. function mergeDataOrFn (
  5197. parentVal,
  5198. childVal,
  5199. vm
  5200. ) {
  5201. if (!vm) {
  5202. // in a Vue.extend merge, both should be functions
  5203. if (!childVal) {
  5204. return parentVal
  5205. }
  5206. if (!parentVal) {
  5207. return childVal
  5208. }
  5209. // when parentVal & childVal are both present,
  5210. // we need to return a function that returns the
  5211. // merged result of both functions... no need to
  5212. // check if parentVal is a function here because
  5213. // it has to be a function to pass previous merges.
  5214. return function mergedDataFn () {
  5215. return mergeData(
  5216. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  5217. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  5218. )
  5219. }
  5220. } else {
  5221. return function mergedInstanceDataFn () {
  5222. // instance merge
  5223. var instanceData = typeof childVal === 'function'
  5224. ? childVal.call(vm, vm)
  5225. : childVal;
  5226. var defaultData = typeof parentVal === 'function'
  5227. ? parentVal.call(vm, vm)
  5228. : parentVal;
  5229. if (instanceData) {
  5230. return mergeData(instanceData, defaultData)
  5231. } else {
  5232. return defaultData
  5233. }
  5234. }
  5235. }
  5236. }
  5237. strats.data = function (
  5238. parentVal,
  5239. childVal,
  5240. vm
  5241. ) {
  5242. if (!vm) {
  5243. if (childVal && typeof childVal !== 'function') {
  5244. true && warn(
  5245. 'The "data" option should be a function ' +
  5246. 'that returns a per-instance value in component ' +
  5247. 'definitions.',
  5248. vm
  5249. );
  5250. return parentVal
  5251. }
  5252. return mergeDataOrFn(parentVal, childVal)
  5253. }
  5254. return mergeDataOrFn(parentVal, childVal, vm)
  5255. };
  5256. /**
  5257. * Hooks and props are merged as arrays.
  5258. */
  5259. function mergeHook (
  5260. parentVal,
  5261. childVal
  5262. ) {
  5263. var res = childVal
  5264. ? parentVal
  5265. ? parentVal.concat(childVal)
  5266. : Array.isArray(childVal)
  5267. ? childVal
  5268. : [childVal]
  5269. : parentVal;
  5270. return res
  5271. ? dedupeHooks(res)
  5272. : res
  5273. }
  5274. function dedupeHooks (hooks) {
  5275. var res = [];
  5276. for (var i = 0; i < hooks.length; i++) {
  5277. if (res.indexOf(hooks[i]) === -1) {
  5278. res.push(hooks[i]);
  5279. }
  5280. }
  5281. return res
  5282. }
  5283. LIFECYCLE_HOOKS.forEach(function (hook) {
  5284. strats[hook] = mergeHook;
  5285. });
  5286. /**
  5287. * Assets
  5288. *
  5289. * When a vm is present (instance creation), we need to do
  5290. * a three-way merge between constructor options, instance
  5291. * options and parent options.
  5292. */
  5293. function mergeAssets (
  5294. parentVal,
  5295. childVal,
  5296. vm,
  5297. key
  5298. ) {
  5299. var res = Object.create(parentVal || null);
  5300. if (childVal) {
  5301. true && assertObjectType(key, childVal, vm);
  5302. return extend(res, childVal)
  5303. } else {
  5304. return res
  5305. }
  5306. }
  5307. ASSET_TYPES.forEach(function (type) {
  5308. strats[type + 's'] = mergeAssets;
  5309. });
  5310. /**
  5311. * Watchers.
  5312. *
  5313. * Watchers hashes should not overwrite one
  5314. * another, so we merge them as arrays.
  5315. */
  5316. strats.watch = function (
  5317. parentVal,
  5318. childVal,
  5319. vm,
  5320. key
  5321. ) {
  5322. // work around Firefox's Object.prototype.watch...
  5323. if (parentVal === nativeWatch) { parentVal = undefined; }
  5324. if (childVal === nativeWatch) { childVal = undefined; }
  5325. /* istanbul ignore if */
  5326. if (!childVal) { return Object.create(parentVal || null) }
  5327. if (true) {
  5328. assertObjectType(key, childVal, vm);
  5329. }
  5330. if (!parentVal) { return childVal }
  5331. var ret = {};
  5332. extend(ret, parentVal);
  5333. for (var key$1 in childVal) {
  5334. var parent = ret[key$1];
  5335. var child = childVal[key$1];
  5336. if (parent && !Array.isArray(parent)) {
  5337. parent = [parent];
  5338. }
  5339. ret[key$1] = parent
  5340. ? parent.concat(child)
  5341. : Array.isArray(child) ? child : [child];
  5342. }
  5343. return ret
  5344. };
  5345. /**
  5346. * Other object hashes.
  5347. */
  5348. strats.props =
  5349. strats.methods =
  5350. strats.inject =
  5351. strats.computed = function (
  5352. parentVal,
  5353. childVal,
  5354. vm,
  5355. key
  5356. ) {
  5357. if (childVal && "development" !== 'production') {
  5358. assertObjectType(key, childVal, vm);
  5359. }
  5360. if (!parentVal) { return childVal }
  5361. var ret = Object.create(null);
  5362. extend(ret, parentVal);
  5363. if (childVal) { extend(ret, childVal); }
  5364. return ret
  5365. };
  5366. strats.provide = mergeDataOrFn;
  5367. /**
  5368. * Default strategy.
  5369. */
  5370. var defaultStrat = function (parentVal, childVal) {
  5371. return childVal === undefined
  5372. ? parentVal
  5373. : childVal
  5374. };
  5375. /**
  5376. * Validate component names
  5377. */
  5378. function checkComponents (options) {
  5379. for (var key in options.components) {
  5380. validateComponentName(key);
  5381. }
  5382. }
  5383. function validateComponentName (name) {
  5384. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  5385. warn(
  5386. 'Invalid component name: "' + name + '". Component names ' +
  5387. 'should conform to valid custom element name in html5 specification.'
  5388. );
  5389. }
  5390. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  5391. warn(
  5392. 'Do not use built-in or reserved HTML elements as component ' +
  5393. 'id: ' + name
  5394. );
  5395. }
  5396. }
  5397. /**
  5398. * Ensure all props option syntax are normalized into the
  5399. * Object-based format.
  5400. */
  5401. function normalizeProps (options, vm) {
  5402. var props = options.props;
  5403. if (!props) { return }
  5404. var res = {};
  5405. var i, val, name;
  5406. if (Array.isArray(props)) {
  5407. i = props.length;
  5408. while (i--) {
  5409. val = props[i];
  5410. if (typeof val === 'string') {
  5411. name = camelize(val);
  5412. res[name] = { type: null };
  5413. } else if (true) {
  5414. warn('props must be strings when using array syntax.');
  5415. }
  5416. }
  5417. } else if (isPlainObject(props)) {
  5418. for (var key in props) {
  5419. val = props[key];
  5420. name = camelize(key);
  5421. res[name] = isPlainObject(val)
  5422. ? val
  5423. : { type: val };
  5424. }
  5425. } else if (true) {
  5426. warn(
  5427. "Invalid value for option \"props\": expected an Array or an Object, " +
  5428. "but got " + (toRawType(props)) + ".",
  5429. vm
  5430. );
  5431. }
  5432. options.props = res;
  5433. }
  5434. /**
  5435. * Normalize all injections into Object-based format
  5436. */
  5437. function normalizeInject (options, vm) {
  5438. var inject = options.inject;
  5439. if (!inject) { return }
  5440. var normalized = options.inject = {};
  5441. if (Array.isArray(inject)) {
  5442. for (var i = 0; i < inject.length; i++) {
  5443. normalized[inject[i]] = { from: inject[i] };
  5444. }
  5445. } else if (isPlainObject(inject)) {
  5446. for (var key in inject) {
  5447. var val = inject[key];
  5448. normalized[key] = isPlainObject(val)
  5449. ? extend({ from: key }, val)
  5450. : { from: val };
  5451. }
  5452. } else if (true) {
  5453. warn(
  5454. "Invalid value for option \"inject\": expected an Array or an Object, " +
  5455. "but got " + (toRawType(inject)) + ".",
  5456. vm
  5457. );
  5458. }
  5459. }
  5460. /**
  5461. * Normalize raw function directives into object format.
  5462. */
  5463. function normalizeDirectives (options) {
  5464. var dirs = options.directives;
  5465. if (dirs) {
  5466. for (var key in dirs) {
  5467. var def$$1 = dirs[key];
  5468. if (typeof def$$1 === 'function') {
  5469. dirs[key] = { bind: def$$1, update: def$$1 };
  5470. }
  5471. }
  5472. }
  5473. }
  5474. function assertObjectType (name, value, vm) {
  5475. if (!isPlainObject(value)) {
  5476. warn(
  5477. "Invalid value for option \"" + name + "\": expected an Object, " +
  5478. "but got " + (toRawType(value)) + ".",
  5479. vm
  5480. );
  5481. }
  5482. }
  5483. /**
  5484. * Merge two option objects into a new one.
  5485. * Core utility used in both instantiation and inheritance.
  5486. */
  5487. function mergeOptions (
  5488. parent,
  5489. child,
  5490. vm
  5491. ) {
  5492. if (true) {
  5493. checkComponents(child);
  5494. }
  5495. if (typeof child === 'function') {
  5496. child = child.options;
  5497. }
  5498. normalizeProps(child, vm);
  5499. normalizeInject(child, vm);
  5500. normalizeDirectives(child);
  5501. // Apply extends and mixins on the child options,
  5502. // but only if it is a raw options object that isn't
  5503. // the result of another mergeOptions call.
  5504. // Only merged options has the _base property.
  5505. if (!child._base) {
  5506. if (child.extends) {
  5507. parent = mergeOptions(parent, child.extends, vm);
  5508. }
  5509. if (child.mixins) {
  5510. for (var i = 0, l = child.mixins.length; i < l; i++) {
  5511. parent = mergeOptions(parent, child.mixins[i], vm);
  5512. }
  5513. }
  5514. }
  5515. var options = {};
  5516. var key;
  5517. for (key in parent) {
  5518. mergeField(key);
  5519. }
  5520. for (key in child) {
  5521. if (!hasOwn(parent, key)) {
  5522. mergeField(key);
  5523. }
  5524. }
  5525. function mergeField (key) {
  5526. var strat = strats[key] || defaultStrat;
  5527. options[key] = strat(parent[key], child[key], vm, key);
  5528. }
  5529. return options
  5530. }
  5531. /**
  5532. * Resolve an asset.
  5533. * This function is used because child instances need access
  5534. * to assets defined in its ancestor chain.
  5535. */
  5536. function resolveAsset (
  5537. options,
  5538. type,
  5539. id,
  5540. warnMissing
  5541. ) {
  5542. /* istanbul ignore if */
  5543. if (typeof id !== 'string') {
  5544. return
  5545. }
  5546. var assets = options[type];
  5547. // check local registration variations first
  5548. if (hasOwn(assets, id)) { return assets[id] }
  5549. var camelizedId = camelize(id);
  5550. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  5551. var PascalCaseId = capitalize(camelizedId);
  5552. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  5553. // fallback to prototype chain
  5554. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  5555. if ( true && warnMissing && !res) {
  5556. warn(
  5557. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  5558. options
  5559. );
  5560. }
  5561. return res
  5562. }
  5563. /* */
  5564. function validateProp (
  5565. key,
  5566. propOptions,
  5567. propsData,
  5568. vm
  5569. ) {
  5570. var prop = propOptions[key];
  5571. var absent = !hasOwn(propsData, key);
  5572. var value = propsData[key];
  5573. // boolean casting
  5574. var booleanIndex = getTypeIndex(Boolean, prop.type);
  5575. if (booleanIndex > -1) {
  5576. if (absent && !hasOwn(prop, 'default')) {
  5577. value = false;
  5578. } else if (value === '' || value === hyphenate(key)) {
  5579. // only cast empty string / same name to boolean if
  5580. // boolean has higher priority
  5581. var stringIndex = getTypeIndex(String, prop.type);
  5582. if (stringIndex < 0 || booleanIndex < stringIndex) {
  5583. value = true;
  5584. }
  5585. }
  5586. }
  5587. // check default value
  5588. if (value === undefined) {
  5589. value = getPropDefaultValue(vm, prop, key);
  5590. // since the default value is a fresh copy,
  5591. // make sure to observe it.
  5592. var prevShouldObserve = shouldObserve;
  5593. toggleObserving(true);
  5594. observe(value);
  5595. toggleObserving(prevShouldObserve);
  5596. }
  5597. if (
  5598. true
  5599. ) {
  5600. assertProp(prop, key, value, vm, absent);
  5601. }
  5602. return value
  5603. }
  5604. /**
  5605. * Get the default value of a prop.
  5606. */
  5607. function getPropDefaultValue (vm, prop, key) {
  5608. // no default, return undefined
  5609. if (!hasOwn(prop, 'default')) {
  5610. return undefined
  5611. }
  5612. var def = prop.default;
  5613. // warn against non-factory defaults for Object & Array
  5614. if ( true && isObject(def)) {
  5615. warn(
  5616. 'Invalid default value for prop "' + key + '": ' +
  5617. 'Props with type Object/Array must use a factory function ' +
  5618. 'to return the default value.',
  5619. vm
  5620. );
  5621. }
  5622. // the raw prop value was also undefined from previous render,
  5623. // return previous default value to avoid unnecessary watcher trigger
  5624. if (vm && vm.$options.propsData &&
  5625. vm.$options.propsData[key] === undefined &&
  5626. vm._props[key] !== undefined
  5627. ) {
  5628. return vm._props[key]
  5629. }
  5630. // call factory function for non-Function types
  5631. // a value is Function if its prototype is function even across different execution context
  5632. return typeof def === 'function' && getType(prop.type) !== 'Function'
  5633. ? def.call(vm)
  5634. : def
  5635. }
  5636. /**
  5637. * Assert whether a prop is valid.
  5638. */
  5639. function assertProp (
  5640. prop,
  5641. name,
  5642. value,
  5643. vm,
  5644. absent
  5645. ) {
  5646. if (prop.required && absent) {
  5647. warn(
  5648. 'Missing required prop: "' + name + '"',
  5649. vm
  5650. );
  5651. return
  5652. }
  5653. if (value == null && !prop.required) {
  5654. return
  5655. }
  5656. var type = prop.type;
  5657. var valid = !type || type === true;
  5658. var expectedTypes = [];
  5659. if (type) {
  5660. if (!Array.isArray(type)) {
  5661. type = [type];
  5662. }
  5663. for (var i = 0; i < type.length && !valid; i++) {
  5664. var assertedType = assertType(value, type[i]);
  5665. expectedTypes.push(assertedType.expectedType || '');
  5666. valid = assertedType.valid;
  5667. }
  5668. }
  5669. if (!valid) {
  5670. warn(
  5671. getInvalidTypeMessage(name, value, expectedTypes),
  5672. vm
  5673. );
  5674. return
  5675. }
  5676. var validator = prop.validator;
  5677. if (validator) {
  5678. if (!validator(value)) {
  5679. warn(
  5680. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  5681. vm
  5682. );
  5683. }
  5684. }
  5685. }
  5686. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  5687. function assertType (value, type) {
  5688. var valid;
  5689. var expectedType = getType(type);
  5690. if (simpleCheckRE.test(expectedType)) {
  5691. var t = typeof value;
  5692. valid = t === expectedType.toLowerCase();
  5693. // for primitive wrapper objects
  5694. if (!valid && t === 'object') {
  5695. valid = value instanceof type;
  5696. }
  5697. } else if (expectedType === 'Object') {
  5698. valid = isPlainObject(value);
  5699. } else if (expectedType === 'Array') {
  5700. valid = Array.isArray(value);
  5701. } else {
  5702. valid = value instanceof type;
  5703. }
  5704. return {
  5705. valid: valid,
  5706. expectedType: expectedType
  5707. }
  5708. }
  5709. /**
  5710. * Use function string name to check built-in types,
  5711. * because a simple equality check will fail when running
  5712. * across different vms / iframes.
  5713. */
  5714. function getType (fn) {
  5715. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  5716. return match ? match[1] : ''
  5717. }
  5718. function isSameType (a, b) {
  5719. return getType(a) === getType(b)
  5720. }
  5721. function getTypeIndex (type, expectedTypes) {
  5722. if (!Array.isArray(expectedTypes)) {
  5723. return isSameType(expectedTypes, type) ? 0 : -1
  5724. }
  5725. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  5726. if (isSameType(expectedTypes[i], type)) {
  5727. return i
  5728. }
  5729. }
  5730. return -1
  5731. }
  5732. function getInvalidTypeMessage (name, value, expectedTypes) {
  5733. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  5734. " Expected " + (expectedTypes.map(capitalize).join(', '));
  5735. var expectedType = expectedTypes[0];
  5736. var receivedType = toRawType(value);
  5737. var expectedValue = styleValue(value, expectedType);
  5738. var receivedValue = styleValue(value, receivedType);
  5739. // check if we need to specify expected value
  5740. if (expectedTypes.length === 1 &&
  5741. isExplicable(expectedType) &&
  5742. !isBoolean(expectedType, receivedType)) {
  5743. message += " with value " + expectedValue;
  5744. }
  5745. message += ", got " + receivedType + " ";
  5746. // check if we need to specify received value
  5747. if (isExplicable(receivedType)) {
  5748. message += "with value " + receivedValue + ".";
  5749. }
  5750. return message
  5751. }
  5752. function styleValue (value, type) {
  5753. if (type === 'String') {
  5754. return ("\"" + value + "\"")
  5755. } else if (type === 'Number') {
  5756. return ("" + (Number(value)))
  5757. } else {
  5758. return ("" + value)
  5759. }
  5760. }
  5761. function isExplicable (value) {
  5762. var explicitTypes = ['string', 'number', 'boolean'];
  5763. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  5764. }
  5765. function isBoolean () {
  5766. var args = [], len = arguments.length;
  5767. while ( len-- ) args[ len ] = arguments[ len ];
  5768. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  5769. }
  5770. /* */
  5771. function handleError (err, vm, info) {
  5772. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  5773. // See: https://github.com/vuejs/vuex/issues/1505
  5774. pushTarget();
  5775. try {
  5776. if (vm) {
  5777. var cur = vm;
  5778. while ((cur = cur.$parent)) {
  5779. var hooks = cur.$options.errorCaptured;
  5780. if (hooks) {
  5781. for (var i = 0; i < hooks.length; i++) {
  5782. try {
  5783. var capture = hooks[i].call(cur, err, vm, info) === false;
  5784. if (capture) { return }
  5785. } catch (e) {
  5786. globalHandleError(e, cur, 'errorCaptured hook');
  5787. }
  5788. }
  5789. }
  5790. }
  5791. }
  5792. globalHandleError(err, vm, info);
  5793. } finally {
  5794. popTarget();
  5795. }
  5796. }
  5797. function invokeWithErrorHandling (
  5798. handler,
  5799. context,
  5800. args,
  5801. vm,
  5802. info
  5803. ) {
  5804. var res;
  5805. try {
  5806. res = args ? handler.apply(context, args) : handler.call(context);
  5807. if (res && !res._isVue && isPromise(res) && !res._handled) {
  5808. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  5809. // issue #9511
  5810. // avoid catch triggering multiple times when nested calls
  5811. res._handled = true;
  5812. }
  5813. } catch (e) {
  5814. handleError(e, vm, info);
  5815. }
  5816. return res
  5817. }
  5818. function globalHandleError (err, vm, info) {
  5819. if (config.errorHandler) {
  5820. try {
  5821. return config.errorHandler.call(null, err, vm, info)
  5822. } catch (e) {
  5823. // if the user intentionally throws the original error in the handler,
  5824. // do not log it twice
  5825. if (e !== err) {
  5826. logError(e, null, 'config.errorHandler');
  5827. }
  5828. }
  5829. }
  5830. logError(err, vm, info);
  5831. }
  5832. function logError (err, vm, info) {
  5833. if (true) {
  5834. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5835. }
  5836. /* istanbul ignore else */
  5837. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5838. console.error(err);
  5839. } else {
  5840. throw err
  5841. }
  5842. }
  5843. /* */
  5844. var callbacks = [];
  5845. var pending = false;
  5846. function flushCallbacks () {
  5847. pending = false;
  5848. var copies = callbacks.slice(0);
  5849. callbacks.length = 0;
  5850. for (var i = 0; i < copies.length; i++) {
  5851. copies[i]();
  5852. }
  5853. }
  5854. // Here we have async deferring wrappers using microtasks.
  5855. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5856. // However, it has subtle problems when state is changed right before repaint
  5857. // (e.g. #6813, out-in transitions).
  5858. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5859. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5860. // So we now use microtasks everywhere, again.
  5861. // A major drawback of this tradeoff is that there are some scenarios
  5862. // where microtasks have too high a priority and fire in between supposedly
  5863. // sequential events (e.g. #4521, #6690, which have workarounds)
  5864. // or even between bubbling of the same event (#6566).
  5865. var timerFunc;
  5866. // The nextTick behavior leverages the microtask queue, which can be accessed
  5867. // via either native Promise.then or MutationObserver.
  5868. // MutationObserver has wider support, however it is seriously bugged in
  5869. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5870. // completely stops working after triggering a few times... so, if native
  5871. // Promise is available, we will use it:
  5872. /* istanbul ignore next, $flow-disable-line */
  5873. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5874. var p = Promise.resolve();
  5875. timerFunc = function () {
  5876. p.then(flushCallbacks);
  5877. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5878. // it can get stuck in a weird state where callbacks are pushed into the
  5879. // microtask queue but the queue isn't being flushed, until the browser
  5880. // needs to do some other work, e.g. handle a timer. Therefore we can
  5881. // "force" the microtask queue to be flushed by adding an empty timer.
  5882. if (isIOS) { setTimeout(noop); }
  5883. };
  5884. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5885. isNative(MutationObserver) ||
  5886. // PhantomJS and iOS 7.x
  5887. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5888. )) {
  5889. // Use MutationObserver where native Promise is not available,
  5890. // e.g. PhantomJS, iOS7, Android 4.4
  5891. // (#6466 MutationObserver is unreliable in IE11)
  5892. var counter = 1;
  5893. var observer = new MutationObserver(flushCallbacks);
  5894. var textNode = document.createTextNode(String(counter));
  5895. observer.observe(textNode, {
  5896. characterData: true
  5897. });
  5898. timerFunc = function () {
  5899. counter = (counter + 1) % 2;
  5900. textNode.data = String(counter);
  5901. };
  5902. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5903. // Fallback to setImmediate.
  5904. // Technically it leverages the (macro) task queue,
  5905. // but it is still a better choice than setTimeout.
  5906. timerFunc = function () {
  5907. setImmediate(flushCallbacks);
  5908. };
  5909. } else {
  5910. // Fallback to setTimeout.
  5911. timerFunc = function () {
  5912. setTimeout(flushCallbacks, 0);
  5913. };
  5914. }
  5915. function nextTick (cb, ctx) {
  5916. var _resolve;
  5917. callbacks.push(function () {
  5918. if (cb) {
  5919. try {
  5920. cb.call(ctx);
  5921. } catch (e) {
  5922. handleError(e, ctx, 'nextTick');
  5923. }
  5924. } else if (_resolve) {
  5925. _resolve(ctx);
  5926. }
  5927. });
  5928. if (!pending) {
  5929. pending = true;
  5930. timerFunc();
  5931. }
  5932. // $flow-disable-line
  5933. if (!cb && typeof Promise !== 'undefined') {
  5934. return new Promise(function (resolve) {
  5935. _resolve = resolve;
  5936. })
  5937. }
  5938. }
  5939. /* */
  5940. /* not type checking this file because flow doesn't play well with Proxy */
  5941. var initProxy;
  5942. if (true) {
  5943. var allowedGlobals = makeMap(
  5944. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5945. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5946. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5947. 'require' // for Webpack/Browserify
  5948. );
  5949. var warnNonPresent = function (target, key) {
  5950. warn(
  5951. "Property or method \"" + key + "\" is not defined on the instance but " +
  5952. 'referenced during render. Make sure that this property is reactive, ' +
  5953. 'either in the data option, or for class-based components, by ' +
  5954. 'initializing the property. ' +
  5955. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5956. target
  5957. );
  5958. };
  5959. var warnReservedPrefix = function (target, key) {
  5960. warn(
  5961. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5962. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5963. 'prevent conflicts with Vue internals. ' +
  5964. 'See: https://vuejs.org/v2/api/#data',
  5965. target
  5966. );
  5967. };
  5968. var hasProxy =
  5969. typeof Proxy !== 'undefined' && isNative(Proxy);
  5970. if (hasProxy) {
  5971. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5972. config.keyCodes = new Proxy(config.keyCodes, {
  5973. set: function set (target, key, value) {
  5974. if (isBuiltInModifier(key)) {
  5975. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5976. return false
  5977. } else {
  5978. target[key] = value;
  5979. return true
  5980. }
  5981. }
  5982. });
  5983. }
  5984. var hasHandler = {
  5985. has: function has (target, key) {
  5986. var has = key in target;
  5987. var isAllowed = allowedGlobals(key) ||
  5988. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5989. if (!has && !isAllowed) {
  5990. if (key in target.$data) { warnReservedPrefix(target, key); }
  5991. else { warnNonPresent(target, key); }
  5992. }
  5993. return has || !isAllowed
  5994. }
  5995. };
  5996. var getHandler = {
  5997. get: function get (target, key) {
  5998. if (typeof key === 'string' && !(key in target)) {
  5999. if (key in target.$data) { warnReservedPrefix(target, key); }
  6000. else { warnNonPresent(target, key); }
  6001. }
  6002. return target[key]
  6003. }
  6004. };
  6005. initProxy = function initProxy (vm) {
  6006. if (hasProxy) {
  6007. // determine which proxy handler to use
  6008. var options = vm.$options;
  6009. var handlers = options.render && options.render._withStripped
  6010. ? getHandler
  6011. : hasHandler;
  6012. vm._renderProxy = new Proxy(vm, handlers);
  6013. } else {
  6014. vm._renderProxy = vm;
  6015. }
  6016. };
  6017. }
  6018. /* */
  6019. var seenObjects = new _Set();
  6020. /**
  6021. * Recursively traverse an object to evoke all converted
  6022. * getters, so that every nested property inside the object
  6023. * is collected as a "deep" dependency.
  6024. */
  6025. function traverse (val) {
  6026. _traverse(val, seenObjects);
  6027. seenObjects.clear();
  6028. }
  6029. function _traverse (val, seen) {
  6030. var i, keys;
  6031. var isA = Array.isArray(val);
  6032. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  6033. return
  6034. }
  6035. if (val.__ob__) {
  6036. var depId = val.__ob__.dep.id;
  6037. if (seen.has(depId)) {
  6038. return
  6039. }
  6040. seen.add(depId);
  6041. }
  6042. if (isA) {
  6043. i = val.length;
  6044. while (i--) { _traverse(val[i], seen); }
  6045. } else {
  6046. keys = Object.keys(val);
  6047. i = keys.length;
  6048. while (i--) { _traverse(val[keys[i]], seen); }
  6049. }
  6050. }
  6051. var mark;
  6052. var measure;
  6053. if (true) {
  6054. var perf = inBrowser && window.performance;
  6055. /* istanbul ignore if */
  6056. if (
  6057. perf &&
  6058. perf.mark &&
  6059. perf.measure &&
  6060. perf.clearMarks &&
  6061. perf.clearMeasures
  6062. ) {
  6063. mark = function (tag) { return perf.mark(tag); };
  6064. measure = function (name, startTag, endTag) {
  6065. perf.measure(name, startTag, endTag);
  6066. perf.clearMarks(startTag);
  6067. perf.clearMarks(endTag);
  6068. // perf.clearMeasures(name)
  6069. };
  6070. }
  6071. }
  6072. /* */
  6073. var normalizeEvent = cached(function (name) {
  6074. var passive = name.charAt(0) === '&';
  6075. name = passive ? name.slice(1) : name;
  6076. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  6077. name = once$$1 ? name.slice(1) : name;
  6078. var capture = name.charAt(0) === '!';
  6079. name = capture ? name.slice(1) : name;
  6080. return {
  6081. name: name,
  6082. once: once$$1,
  6083. capture: capture,
  6084. passive: passive
  6085. }
  6086. });
  6087. function createFnInvoker (fns, vm) {
  6088. function invoker () {
  6089. var arguments$1 = arguments;
  6090. var fns = invoker.fns;
  6091. if (Array.isArray(fns)) {
  6092. var cloned = fns.slice();
  6093. for (var i = 0; i < cloned.length; i++) {
  6094. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  6095. }
  6096. } else {
  6097. // return handler return value for single handlers
  6098. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  6099. }
  6100. }
  6101. invoker.fns = fns;
  6102. return invoker
  6103. }
  6104. function updateListeners (
  6105. on,
  6106. oldOn,
  6107. add,
  6108. remove$$1,
  6109. createOnceHandler,
  6110. vm
  6111. ) {
  6112. var name, def$$1, cur, old, event;
  6113. for (name in on) {
  6114. def$$1 = cur = on[name];
  6115. old = oldOn[name];
  6116. event = normalizeEvent(name);
  6117. if (isUndef(cur)) {
  6118. true && warn(
  6119. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  6120. vm
  6121. );
  6122. } else if (isUndef(old)) {
  6123. if (isUndef(cur.fns)) {
  6124. cur = on[name] = createFnInvoker(cur, vm);
  6125. }
  6126. if (isTrue(event.once)) {
  6127. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  6128. }
  6129. add(event.name, cur, event.capture, event.passive, event.params);
  6130. } else if (cur !== old) {
  6131. old.fns = cur;
  6132. on[name] = old;
  6133. }
  6134. }
  6135. for (name in oldOn) {
  6136. if (isUndef(on[name])) {
  6137. event = normalizeEvent(name);
  6138. remove$$1(event.name, oldOn[name], event.capture);
  6139. }
  6140. }
  6141. }
  6142. /* */
  6143. /* */
  6144. // fixed by xxxxxx (mp properties)
  6145. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  6146. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  6147. if (isUndef(propOptions)) {
  6148. return res
  6149. }
  6150. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  6151. var attrs = data.attrs;
  6152. var props = data.props;
  6153. if (isDef(attrs) || isDef(props)) {
  6154. for (var key in propOptions) {
  6155. var altKey = hyphenate(key);
  6156. var result = checkProp(res, props, key, altKey, true) ||
  6157. checkProp(res, attrs, key, altKey, false);
  6158. // externalClass
  6159. if (
  6160. result &&
  6161. res[key] &&
  6162. externalClasses.indexOf(altKey) !== -1 &&
  6163. context[camelize(res[key])]
  6164. ) {
  6165. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  6166. res[key] = context[camelize(res[key])];
  6167. }
  6168. }
  6169. }
  6170. return res
  6171. }
  6172. function extractPropsFromVNodeData (
  6173. data,
  6174. Ctor,
  6175. tag,
  6176. context// fixed by xxxxxx
  6177. ) {
  6178. // we are only extracting raw values here.
  6179. // validation and default values are handled in the child
  6180. // component itself.
  6181. var propOptions = Ctor.options.props;
  6182. if (isUndef(propOptions)) {
  6183. // fixed by xxxxxx
  6184. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  6185. }
  6186. var res = {};
  6187. var attrs = data.attrs;
  6188. var props = data.props;
  6189. if (isDef(attrs) || isDef(props)) {
  6190. for (var key in propOptions) {
  6191. var altKey = hyphenate(key);
  6192. if (true) {
  6193. var keyInLowerCase = key.toLowerCase();
  6194. if (
  6195. key !== keyInLowerCase &&
  6196. attrs && hasOwn(attrs, keyInLowerCase)
  6197. ) {
  6198. tip(
  6199. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  6200. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  6201. " \"" + key + "\". " +
  6202. "Note that HTML attributes are case-insensitive and camelCased " +
  6203. "props need to use their kebab-case equivalents when using in-DOM " +
  6204. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  6205. );
  6206. }
  6207. }
  6208. checkProp(res, props, key, altKey, true) ||
  6209. checkProp(res, attrs, key, altKey, false);
  6210. }
  6211. }
  6212. // fixed by xxxxxx
  6213. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  6214. }
  6215. function checkProp (
  6216. res,
  6217. hash,
  6218. key,
  6219. altKey,
  6220. preserve
  6221. ) {
  6222. if (isDef(hash)) {
  6223. if (hasOwn(hash, key)) {
  6224. res[key] = hash[key];
  6225. if (!preserve) {
  6226. delete hash[key];
  6227. }
  6228. return true
  6229. } else if (hasOwn(hash, altKey)) {
  6230. res[key] = hash[altKey];
  6231. if (!preserve) {
  6232. delete hash[altKey];
  6233. }
  6234. return true
  6235. }
  6236. }
  6237. return false
  6238. }
  6239. /* */
  6240. // The template compiler attempts to minimize the need for normalization by
  6241. // statically analyzing the template at compile time.
  6242. //
  6243. // For plain HTML markup, normalization can be completely skipped because the
  6244. // generated render function is guaranteed to return Array<VNode>. There are
  6245. // two cases where extra normalization is needed:
  6246. // 1. When the children contains components - because a functional component
  6247. // may return an Array instead of a single root. In this case, just a simple
  6248. // normalization is needed - if any child is an Array, we flatten the whole
  6249. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  6250. // because functional components already normalize their own children.
  6251. function simpleNormalizeChildren (children) {
  6252. for (var i = 0; i < children.length; i++) {
  6253. if (Array.isArray(children[i])) {
  6254. return Array.prototype.concat.apply([], children)
  6255. }
  6256. }
  6257. return children
  6258. }
  6259. // 2. When the children contains constructs that always generated nested Arrays,
  6260. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  6261. // with hand-written render functions / JSX. In such cases a full normalization
  6262. // is needed to cater to all possible types of children values.
  6263. function normalizeChildren (children) {
  6264. return isPrimitive(children)
  6265. ? [createTextVNode(children)]
  6266. : Array.isArray(children)
  6267. ? normalizeArrayChildren(children)
  6268. : undefined
  6269. }
  6270. function isTextNode (node) {
  6271. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  6272. }
  6273. function normalizeArrayChildren (children, nestedIndex) {
  6274. var res = [];
  6275. var i, c, lastIndex, last;
  6276. for (i = 0; i < children.length; i++) {
  6277. c = children[i];
  6278. if (isUndef(c) || typeof c === 'boolean') { continue }
  6279. lastIndex = res.length - 1;
  6280. last = res[lastIndex];
  6281. // nested
  6282. if (Array.isArray(c)) {
  6283. if (c.length > 0) {
  6284. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  6285. // merge adjacent text nodes
  6286. if (isTextNode(c[0]) && isTextNode(last)) {
  6287. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  6288. c.shift();
  6289. }
  6290. res.push.apply(res, c);
  6291. }
  6292. } else if (isPrimitive(c)) {
  6293. if (isTextNode(last)) {
  6294. // merge adjacent text nodes
  6295. // this is necessary for SSR hydration because text nodes are
  6296. // essentially merged when rendered to HTML strings
  6297. res[lastIndex] = createTextVNode(last.text + c);
  6298. } else if (c !== '') {
  6299. // convert primitive to vnode
  6300. res.push(createTextVNode(c));
  6301. }
  6302. } else {
  6303. if (isTextNode(c) && isTextNode(last)) {
  6304. // merge adjacent text nodes
  6305. res[lastIndex] = createTextVNode(last.text + c.text);
  6306. } else {
  6307. // default key for nested array children (likely generated by v-for)
  6308. if (isTrue(children._isVList) &&
  6309. isDef(c.tag) &&
  6310. isUndef(c.key) &&
  6311. isDef(nestedIndex)) {
  6312. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  6313. }
  6314. res.push(c);
  6315. }
  6316. }
  6317. }
  6318. return res
  6319. }
  6320. /* */
  6321. function initProvide (vm) {
  6322. var provide = vm.$options.provide;
  6323. if (provide) {
  6324. vm._provided = typeof provide === 'function'
  6325. ? provide.call(vm)
  6326. : provide;
  6327. }
  6328. }
  6329. function initInjections (vm) {
  6330. var result = resolveInject(vm.$options.inject, vm);
  6331. if (result) {
  6332. toggleObserving(false);
  6333. Object.keys(result).forEach(function (key) {
  6334. /* istanbul ignore else */
  6335. if (true) {
  6336. defineReactive$$1(vm, key, result[key], function () {
  6337. warn(
  6338. "Avoid mutating an injected value directly since the changes will be " +
  6339. "overwritten whenever the provided component re-renders. " +
  6340. "injection being mutated: \"" + key + "\"",
  6341. vm
  6342. );
  6343. });
  6344. } else {}
  6345. });
  6346. toggleObserving(true);
  6347. }
  6348. }
  6349. function resolveInject (inject, vm) {
  6350. if (inject) {
  6351. // inject is :any because flow is not smart enough to figure out cached
  6352. var result = Object.create(null);
  6353. var keys = hasSymbol
  6354. ? Reflect.ownKeys(inject)
  6355. : Object.keys(inject);
  6356. for (var i = 0; i < keys.length; i++) {
  6357. var key = keys[i];
  6358. // #6574 in case the inject object is observed...
  6359. if (key === '__ob__') { continue }
  6360. var provideKey = inject[key].from;
  6361. var source = vm;
  6362. while (source) {
  6363. if (source._provided && hasOwn(source._provided, provideKey)) {
  6364. result[key] = source._provided[provideKey];
  6365. break
  6366. }
  6367. source = source.$parent;
  6368. }
  6369. if (!source) {
  6370. if ('default' in inject[key]) {
  6371. var provideDefault = inject[key].default;
  6372. result[key] = typeof provideDefault === 'function'
  6373. ? provideDefault.call(vm)
  6374. : provideDefault;
  6375. } else if (true) {
  6376. warn(("Injection \"" + key + "\" not found"), vm);
  6377. }
  6378. }
  6379. }
  6380. return result
  6381. }
  6382. }
  6383. /* */
  6384. /**
  6385. * Runtime helper for resolving raw children VNodes into a slot object.
  6386. */
  6387. function resolveSlots (
  6388. children,
  6389. context
  6390. ) {
  6391. if (!children || !children.length) {
  6392. return {}
  6393. }
  6394. var slots = {};
  6395. for (var i = 0, l = children.length; i < l; i++) {
  6396. var child = children[i];
  6397. var data = child.data;
  6398. // remove slot attribute if the node is resolved as a Vue slot node
  6399. if (data && data.attrs && data.attrs.slot) {
  6400. delete data.attrs.slot;
  6401. }
  6402. // named slots should only be respected if the vnode was rendered in the
  6403. // same context.
  6404. if ((child.context === context || child.fnContext === context) &&
  6405. data && data.slot != null
  6406. ) {
  6407. var name = data.slot;
  6408. var slot = (slots[name] || (slots[name] = []));
  6409. if (child.tag === 'template') {
  6410. slot.push.apply(slot, child.children || []);
  6411. } else {
  6412. slot.push(child);
  6413. }
  6414. } else {
  6415. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  6416. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  6417. (slots['page'] || (slots['page'] = [])).push(child);
  6418. }else{
  6419. (slots.default || (slots.default = [])).push(child);
  6420. }
  6421. }
  6422. }
  6423. // ignore slots that contains only whitespace
  6424. for (var name$1 in slots) {
  6425. if (slots[name$1].every(isWhitespace)) {
  6426. delete slots[name$1];
  6427. }
  6428. }
  6429. return slots
  6430. }
  6431. function isWhitespace (node) {
  6432. return (node.isComment && !node.asyncFactory) || node.text === ' '
  6433. }
  6434. /* */
  6435. function normalizeScopedSlots (
  6436. slots,
  6437. normalSlots,
  6438. prevSlots
  6439. ) {
  6440. var res;
  6441. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  6442. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  6443. var key = slots && slots.$key;
  6444. if (!slots) {
  6445. res = {};
  6446. } else if (slots._normalized) {
  6447. // fast path 1: child component re-render only, parent did not change
  6448. return slots._normalized
  6449. } else if (
  6450. isStable &&
  6451. prevSlots &&
  6452. prevSlots !== emptyObject &&
  6453. key === prevSlots.$key &&
  6454. !hasNormalSlots &&
  6455. !prevSlots.$hasNormal
  6456. ) {
  6457. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  6458. // only need to normalize once
  6459. return prevSlots
  6460. } else {
  6461. res = {};
  6462. for (var key$1 in slots) {
  6463. if (slots[key$1] && key$1[0] !== '$') {
  6464. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  6465. }
  6466. }
  6467. }
  6468. // expose normal slots on scopedSlots
  6469. for (var key$2 in normalSlots) {
  6470. if (!(key$2 in res)) {
  6471. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  6472. }
  6473. }
  6474. // avoriaz seems to mock a non-extensible $scopedSlots object
  6475. // and when that is passed down this would cause an error
  6476. if (slots && Object.isExtensible(slots)) {
  6477. (slots)._normalized = res;
  6478. }
  6479. def(res, '$stable', isStable);
  6480. def(res, '$key', key);
  6481. def(res, '$hasNormal', hasNormalSlots);
  6482. return res
  6483. }
  6484. function normalizeScopedSlot(normalSlots, key, fn) {
  6485. var normalized = function () {
  6486. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  6487. res = res && typeof res === 'object' && !Array.isArray(res)
  6488. ? [res] // single vnode
  6489. : normalizeChildren(res);
  6490. return res && (
  6491. res.length === 0 ||
  6492. (res.length === 1 && res[0].isComment) // #9658
  6493. ) ? undefined
  6494. : res
  6495. };
  6496. // this is a slot using the new v-slot syntax without scope. although it is
  6497. // compiled as a scoped slot, render fn users would expect it to be present
  6498. // on this.$slots because the usage is semantically a normal slot.
  6499. if (fn.proxy) {
  6500. Object.defineProperty(normalSlots, key, {
  6501. get: normalized,
  6502. enumerable: true,
  6503. configurable: true
  6504. });
  6505. }
  6506. return normalized
  6507. }
  6508. function proxyNormalSlot(slots, key) {
  6509. return function () { return slots[key]; }
  6510. }
  6511. /* */
  6512. /**
  6513. * Runtime helper for rendering v-for lists.
  6514. */
  6515. function renderList (
  6516. val,
  6517. render
  6518. ) {
  6519. var ret, i, l, keys, key;
  6520. if (Array.isArray(val) || typeof val === 'string') {
  6521. ret = new Array(val.length);
  6522. for (i = 0, l = val.length; i < l; i++) {
  6523. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  6524. }
  6525. } else if (typeof val === 'number') {
  6526. ret = new Array(val);
  6527. for (i = 0; i < val; i++) {
  6528. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  6529. }
  6530. } else if (isObject(val)) {
  6531. if (hasSymbol && val[Symbol.iterator]) {
  6532. ret = [];
  6533. var iterator = val[Symbol.iterator]();
  6534. var result = iterator.next();
  6535. while (!result.done) {
  6536. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  6537. result = iterator.next();
  6538. }
  6539. } else {
  6540. keys = Object.keys(val);
  6541. ret = new Array(keys.length);
  6542. for (i = 0, l = keys.length; i < l; i++) {
  6543. key = keys[i];
  6544. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  6545. }
  6546. }
  6547. }
  6548. if (!isDef(ret)) {
  6549. ret = [];
  6550. }
  6551. (ret)._isVList = true;
  6552. return ret
  6553. }
  6554. /* */
  6555. /**
  6556. * Runtime helper for rendering <slot>
  6557. */
  6558. function renderSlot (
  6559. name,
  6560. fallback,
  6561. props,
  6562. bindObject
  6563. ) {
  6564. var scopedSlotFn = this.$scopedSlots[name];
  6565. var nodes;
  6566. if (scopedSlotFn) { // scoped slot
  6567. props = props || {};
  6568. if (bindObject) {
  6569. if ( true && !isObject(bindObject)) {
  6570. warn(
  6571. 'slot v-bind without argument expects an Object',
  6572. this
  6573. );
  6574. }
  6575. props = extend(extend({}, bindObject), props);
  6576. }
  6577. // fixed by xxxxxx app-plus scopedSlot
  6578. nodes = scopedSlotFn(props, this, props._i) || fallback;
  6579. } else {
  6580. nodes = this.$slots[name] || fallback;
  6581. }
  6582. var target = props && props.slot;
  6583. if (target) {
  6584. return this.$createElement('template', { slot: target }, nodes)
  6585. } else {
  6586. return nodes
  6587. }
  6588. }
  6589. /* */
  6590. /**
  6591. * Runtime helper for resolving filters
  6592. */
  6593. function resolveFilter (id) {
  6594. return resolveAsset(this.$options, 'filters', id, true) || identity
  6595. }
  6596. /* */
  6597. function isKeyNotMatch (expect, actual) {
  6598. if (Array.isArray(expect)) {
  6599. return expect.indexOf(actual) === -1
  6600. } else {
  6601. return expect !== actual
  6602. }
  6603. }
  6604. /**
  6605. * Runtime helper for checking keyCodes from config.
  6606. * exposed as Vue.prototype._k
  6607. * passing in eventKeyName as last argument separately for backwards compat
  6608. */
  6609. function checkKeyCodes (
  6610. eventKeyCode,
  6611. key,
  6612. builtInKeyCode,
  6613. eventKeyName,
  6614. builtInKeyName
  6615. ) {
  6616. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  6617. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  6618. return isKeyNotMatch(builtInKeyName, eventKeyName)
  6619. } else if (mappedKeyCode) {
  6620. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  6621. } else if (eventKeyName) {
  6622. return hyphenate(eventKeyName) !== key
  6623. }
  6624. }
  6625. /* */
  6626. /**
  6627. * Runtime helper for merging v-bind="object" into a VNode's data.
  6628. */
  6629. function bindObjectProps (
  6630. data,
  6631. tag,
  6632. value,
  6633. asProp,
  6634. isSync
  6635. ) {
  6636. if (value) {
  6637. if (!isObject(value)) {
  6638. true && warn(
  6639. 'v-bind without argument expects an Object or Array value',
  6640. this
  6641. );
  6642. } else {
  6643. if (Array.isArray(value)) {
  6644. value = toObject(value);
  6645. }
  6646. var hash;
  6647. var loop = function ( key ) {
  6648. if (
  6649. key === 'class' ||
  6650. key === 'style' ||
  6651. isReservedAttribute(key)
  6652. ) {
  6653. hash = data;
  6654. } else {
  6655. var type = data.attrs && data.attrs.type;
  6656. hash = asProp || config.mustUseProp(tag, type, key)
  6657. ? data.domProps || (data.domProps = {})
  6658. : data.attrs || (data.attrs = {});
  6659. }
  6660. var camelizedKey = camelize(key);
  6661. var hyphenatedKey = hyphenate(key);
  6662. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  6663. hash[key] = value[key];
  6664. if (isSync) {
  6665. var on = data.on || (data.on = {});
  6666. on[("update:" + key)] = function ($event) {
  6667. value[key] = $event;
  6668. };
  6669. }
  6670. }
  6671. };
  6672. for (var key in value) loop( key );
  6673. }
  6674. }
  6675. return data
  6676. }
  6677. /* */
  6678. /**
  6679. * Runtime helper for rendering static trees.
  6680. */
  6681. function renderStatic (
  6682. index,
  6683. isInFor
  6684. ) {
  6685. var cached = this._staticTrees || (this._staticTrees = []);
  6686. var tree = cached[index];
  6687. // if has already-rendered static tree and not inside v-for,
  6688. // we can reuse the same tree.
  6689. if (tree && !isInFor) {
  6690. return tree
  6691. }
  6692. // otherwise, render a fresh tree.
  6693. tree = cached[index] = this.$options.staticRenderFns[index].call(
  6694. this._renderProxy,
  6695. null,
  6696. this // for render fns generated for functional component templates
  6697. );
  6698. markStatic(tree, ("__static__" + index), false);
  6699. return tree
  6700. }
  6701. /**
  6702. * Runtime helper for v-once.
  6703. * Effectively it means marking the node as static with a unique key.
  6704. */
  6705. function markOnce (
  6706. tree,
  6707. index,
  6708. key
  6709. ) {
  6710. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  6711. return tree
  6712. }
  6713. function markStatic (
  6714. tree,
  6715. key,
  6716. isOnce
  6717. ) {
  6718. if (Array.isArray(tree)) {
  6719. for (var i = 0; i < tree.length; i++) {
  6720. if (tree[i] && typeof tree[i] !== 'string') {
  6721. markStaticNode(tree[i], (key + "_" + i), isOnce);
  6722. }
  6723. }
  6724. } else {
  6725. markStaticNode(tree, key, isOnce);
  6726. }
  6727. }
  6728. function markStaticNode (node, key, isOnce) {
  6729. node.isStatic = true;
  6730. node.key = key;
  6731. node.isOnce = isOnce;
  6732. }
  6733. /* */
  6734. function bindObjectListeners (data, value) {
  6735. if (value) {
  6736. if (!isPlainObject(value)) {
  6737. true && warn(
  6738. 'v-on without argument expects an Object value',
  6739. this
  6740. );
  6741. } else {
  6742. var on = data.on = data.on ? extend({}, data.on) : {};
  6743. for (var key in value) {
  6744. var existing = on[key];
  6745. var ours = value[key];
  6746. on[key] = existing ? [].concat(existing, ours) : ours;
  6747. }
  6748. }
  6749. }
  6750. return data
  6751. }
  6752. /* */
  6753. function resolveScopedSlots (
  6754. fns, // see flow/vnode
  6755. res,
  6756. // the following are added in 2.6
  6757. hasDynamicKeys,
  6758. contentHashKey
  6759. ) {
  6760. res = res || { $stable: !hasDynamicKeys };
  6761. for (var i = 0; i < fns.length; i++) {
  6762. var slot = fns[i];
  6763. if (Array.isArray(slot)) {
  6764. resolveScopedSlots(slot, res, hasDynamicKeys);
  6765. } else if (slot) {
  6766. // marker for reverse proxying v-slot without scope on this.$slots
  6767. if (slot.proxy) {
  6768. slot.fn.proxy = true;
  6769. }
  6770. res[slot.key] = slot.fn;
  6771. }
  6772. }
  6773. if (contentHashKey) {
  6774. (res).$key = contentHashKey;
  6775. }
  6776. return res
  6777. }
  6778. /* */
  6779. function bindDynamicKeys (baseObj, values) {
  6780. for (var i = 0; i < values.length; i += 2) {
  6781. var key = values[i];
  6782. if (typeof key === 'string' && key) {
  6783. baseObj[values[i]] = values[i + 1];
  6784. } else if ( true && key !== '' && key !== null) {
  6785. // null is a special value for explicitly removing a binding
  6786. warn(
  6787. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  6788. this
  6789. );
  6790. }
  6791. }
  6792. return baseObj
  6793. }
  6794. // helper to dynamically append modifier runtime markers to event names.
  6795. // ensure only append when value is already string, otherwise it will be cast
  6796. // to string and cause the type check to miss.
  6797. function prependModifier (value, symbol) {
  6798. return typeof value === 'string' ? symbol + value : value
  6799. }
  6800. /* */
  6801. function installRenderHelpers (target) {
  6802. target._o = markOnce;
  6803. target._n = toNumber;
  6804. target._s = toString;
  6805. target._l = renderList;
  6806. target._t = renderSlot;
  6807. target._q = looseEqual;
  6808. target._i = looseIndexOf;
  6809. target._m = renderStatic;
  6810. target._f = resolveFilter;
  6811. target._k = checkKeyCodes;
  6812. target._b = bindObjectProps;
  6813. target._v = createTextVNode;
  6814. target._e = createEmptyVNode;
  6815. target._u = resolveScopedSlots;
  6816. target._g = bindObjectListeners;
  6817. target._d = bindDynamicKeys;
  6818. target._p = prependModifier;
  6819. }
  6820. /* */
  6821. function FunctionalRenderContext (
  6822. data,
  6823. props,
  6824. children,
  6825. parent,
  6826. Ctor
  6827. ) {
  6828. var this$1 = this;
  6829. var options = Ctor.options;
  6830. // ensure the createElement function in functional components
  6831. // gets a unique context - this is necessary for correct named slot check
  6832. var contextVm;
  6833. if (hasOwn(parent, '_uid')) {
  6834. contextVm = Object.create(parent);
  6835. // $flow-disable-line
  6836. contextVm._original = parent;
  6837. } else {
  6838. // the context vm passed in is a functional context as well.
  6839. // in this case we want to make sure we are able to get a hold to the
  6840. // real context instance.
  6841. contextVm = parent;
  6842. // $flow-disable-line
  6843. parent = parent._original;
  6844. }
  6845. var isCompiled = isTrue(options._compiled);
  6846. var needNormalization = !isCompiled;
  6847. this.data = data;
  6848. this.props = props;
  6849. this.children = children;
  6850. this.parent = parent;
  6851. this.listeners = data.on || emptyObject;
  6852. this.injections = resolveInject(options.inject, parent);
  6853. this.slots = function () {
  6854. if (!this$1.$slots) {
  6855. normalizeScopedSlots(
  6856. data.scopedSlots,
  6857. this$1.$slots = resolveSlots(children, parent)
  6858. );
  6859. }
  6860. return this$1.$slots
  6861. };
  6862. Object.defineProperty(this, 'scopedSlots', ({
  6863. enumerable: true,
  6864. get: function get () {
  6865. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6866. }
  6867. }));
  6868. // support for compiled functional template
  6869. if (isCompiled) {
  6870. // exposing $options for renderStatic()
  6871. this.$options = options;
  6872. // pre-resolve slots for renderSlot()
  6873. this.$slots = this.slots();
  6874. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6875. }
  6876. if (options._scopeId) {
  6877. this._c = function (a, b, c, d) {
  6878. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6879. if (vnode && !Array.isArray(vnode)) {
  6880. vnode.fnScopeId = options._scopeId;
  6881. vnode.fnContext = parent;
  6882. }
  6883. return vnode
  6884. };
  6885. } else {
  6886. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6887. }
  6888. }
  6889. installRenderHelpers(FunctionalRenderContext.prototype);
  6890. function createFunctionalComponent (
  6891. Ctor,
  6892. propsData,
  6893. data,
  6894. contextVm,
  6895. children
  6896. ) {
  6897. var options = Ctor.options;
  6898. var props = {};
  6899. var propOptions = options.props;
  6900. if (isDef(propOptions)) {
  6901. for (var key in propOptions) {
  6902. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6903. }
  6904. } else {
  6905. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6906. if (isDef(data.props)) { mergeProps(props, data.props); }
  6907. }
  6908. var renderContext = new FunctionalRenderContext(
  6909. data,
  6910. props,
  6911. children,
  6912. contextVm,
  6913. Ctor
  6914. );
  6915. var vnode = options.render.call(null, renderContext._c, renderContext);
  6916. if (vnode instanceof VNode) {
  6917. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6918. } else if (Array.isArray(vnode)) {
  6919. var vnodes = normalizeChildren(vnode) || [];
  6920. var res = new Array(vnodes.length);
  6921. for (var i = 0; i < vnodes.length; i++) {
  6922. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6923. }
  6924. return res
  6925. }
  6926. }
  6927. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6928. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6929. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6930. // that should not be matched to match.
  6931. var clone = cloneVNode(vnode);
  6932. clone.fnContext = contextVm;
  6933. clone.fnOptions = options;
  6934. if (true) {
  6935. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6936. }
  6937. if (data.slot) {
  6938. (clone.data || (clone.data = {})).slot = data.slot;
  6939. }
  6940. return clone
  6941. }
  6942. function mergeProps (to, from) {
  6943. for (var key in from) {
  6944. to[camelize(key)] = from[key];
  6945. }
  6946. }
  6947. /* */
  6948. /* */
  6949. /* */
  6950. /* */
  6951. // inline hooks to be invoked on component VNodes during patch
  6952. var componentVNodeHooks = {
  6953. init: function init (vnode, hydrating) {
  6954. if (
  6955. vnode.componentInstance &&
  6956. !vnode.componentInstance._isDestroyed &&
  6957. vnode.data.keepAlive
  6958. ) {
  6959. // kept-alive components, treat as a patch
  6960. var mountedNode = vnode; // work around flow
  6961. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6962. } else {
  6963. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6964. vnode,
  6965. activeInstance
  6966. );
  6967. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6968. }
  6969. },
  6970. prepatch: function prepatch (oldVnode, vnode) {
  6971. var options = vnode.componentOptions;
  6972. var child = vnode.componentInstance = oldVnode.componentInstance;
  6973. updateChildComponent(
  6974. child,
  6975. options.propsData, // updated props
  6976. options.listeners, // updated listeners
  6977. vnode, // new parent vnode
  6978. options.children // new children
  6979. );
  6980. },
  6981. insert: function insert (vnode) {
  6982. var context = vnode.context;
  6983. var componentInstance = vnode.componentInstance;
  6984. if (!componentInstance._isMounted) {
  6985. callHook(componentInstance, 'onServiceCreated');
  6986. callHook(componentInstance, 'onServiceAttached');
  6987. componentInstance._isMounted = true;
  6988. callHook(componentInstance, 'mounted');
  6989. }
  6990. if (vnode.data.keepAlive) {
  6991. if (context._isMounted) {
  6992. // vue-router#1212
  6993. // During updates, a kept-alive component's child components may
  6994. // change, so directly walking the tree here may call activated hooks
  6995. // on incorrect children. Instead we push them into a queue which will
  6996. // be processed after the whole patch process ended.
  6997. queueActivatedComponent(componentInstance);
  6998. } else {
  6999. activateChildComponent(componentInstance, true /* direct */);
  7000. }
  7001. }
  7002. },
  7003. destroy: function destroy (vnode) {
  7004. var componentInstance = vnode.componentInstance;
  7005. if (!componentInstance._isDestroyed) {
  7006. if (!vnode.data.keepAlive) {
  7007. componentInstance.$destroy();
  7008. } else {
  7009. deactivateChildComponent(componentInstance, true /* direct */);
  7010. }
  7011. }
  7012. }
  7013. };
  7014. var hooksToMerge = Object.keys(componentVNodeHooks);
  7015. function createComponent (
  7016. Ctor,
  7017. data,
  7018. context,
  7019. children,
  7020. tag
  7021. ) {
  7022. if (isUndef(Ctor)) {
  7023. return
  7024. }
  7025. var baseCtor = context.$options._base;
  7026. // plain options object: turn it into a constructor
  7027. if (isObject(Ctor)) {
  7028. Ctor = baseCtor.extend(Ctor);
  7029. }
  7030. // if at this stage it's not a constructor or an async component factory,
  7031. // reject.
  7032. if (typeof Ctor !== 'function') {
  7033. if (true) {
  7034. warn(("Invalid Component definition: " + (String(Ctor))), context);
  7035. }
  7036. return
  7037. }
  7038. // async component
  7039. var asyncFactory;
  7040. if (isUndef(Ctor.cid)) {
  7041. asyncFactory = Ctor;
  7042. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  7043. if (Ctor === undefined) {
  7044. // return a placeholder node for async component, which is rendered
  7045. // as a comment node but preserves all the raw information for the node.
  7046. // the information will be used for async server-rendering and hydration.
  7047. return createAsyncPlaceholder(
  7048. asyncFactory,
  7049. data,
  7050. context,
  7051. children,
  7052. tag
  7053. )
  7054. }
  7055. }
  7056. data = data || {};
  7057. // resolve constructor options in case global mixins are applied after
  7058. // component constructor creation
  7059. resolveConstructorOptions(Ctor);
  7060. // transform component v-model data into props & events
  7061. if (isDef(data.model)) {
  7062. transformModel(Ctor.options, data);
  7063. }
  7064. // extract props
  7065. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  7066. // functional component
  7067. if (isTrue(Ctor.options.functional)) {
  7068. return createFunctionalComponent(Ctor, propsData, data, context, children)
  7069. }
  7070. // extract listeners, since these needs to be treated as
  7071. // child component listeners instead of DOM listeners
  7072. var listeners = data.on;
  7073. // replace with listeners with .native modifier
  7074. // so it gets processed during parent component patch.
  7075. data.on = data.nativeOn;
  7076. if (isTrue(Ctor.options.abstract)) {
  7077. // abstract components do not keep anything
  7078. // other than props & listeners & slot
  7079. // work around flow
  7080. var slot = data.slot;
  7081. data = {};
  7082. if (slot) {
  7083. data.slot = slot;
  7084. }
  7085. }
  7086. // install component management hooks onto the placeholder node
  7087. installComponentHooks(data);
  7088. // return a placeholder vnode
  7089. var name = Ctor.options.name || tag;
  7090. var vnode = new VNode(
  7091. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  7092. data, undefined, undefined, undefined, context,
  7093. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  7094. asyncFactory
  7095. );
  7096. return vnode
  7097. }
  7098. function createComponentInstanceForVnode (
  7099. vnode, // we know it's MountedComponentVNode but flow doesn't
  7100. parent // activeInstance in lifecycle state
  7101. ) {
  7102. var options = {
  7103. _isComponent: true,
  7104. _parentVnode: vnode,
  7105. parent: parent
  7106. };
  7107. // check inline-template render functions
  7108. var inlineTemplate = vnode.data.inlineTemplate;
  7109. if (isDef(inlineTemplate)) {
  7110. options.render = inlineTemplate.render;
  7111. options.staticRenderFns = inlineTemplate.staticRenderFns;
  7112. }
  7113. return new vnode.componentOptions.Ctor(options)
  7114. }
  7115. function installComponentHooks (data) {
  7116. var hooks = data.hook || (data.hook = {});
  7117. for (var i = 0; i < hooksToMerge.length; i++) {
  7118. var key = hooksToMerge[i];
  7119. var existing = hooks[key];
  7120. var toMerge = componentVNodeHooks[key];
  7121. if (existing !== toMerge && !(existing && existing._merged)) {
  7122. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  7123. }
  7124. }
  7125. }
  7126. function mergeHook$1 (f1, f2) {
  7127. var merged = function (a, b) {
  7128. // flow complains about extra args which is why we use any
  7129. f1(a, b);
  7130. f2(a, b);
  7131. };
  7132. merged._merged = true;
  7133. return merged
  7134. }
  7135. // transform component v-model info (value and callback) into
  7136. // prop and event handler respectively.
  7137. function transformModel (options, data) {
  7138. var prop = (options.model && options.model.prop) || 'value';
  7139. var event = (options.model && options.model.event) || 'input'
  7140. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  7141. var on = data.on || (data.on = {});
  7142. var existing = on[event];
  7143. var callback = data.model.callback;
  7144. if (isDef(existing)) {
  7145. if (
  7146. Array.isArray(existing)
  7147. ? existing.indexOf(callback) === -1
  7148. : existing !== callback
  7149. ) {
  7150. on[event] = [callback].concat(existing);
  7151. }
  7152. } else {
  7153. on[event] = callback;
  7154. }
  7155. }
  7156. /* */
  7157. var SIMPLE_NORMALIZE = 1;
  7158. var ALWAYS_NORMALIZE = 2;
  7159. // wrapper function for providing a more flexible interface
  7160. // without getting yelled at by flow
  7161. function createElement (
  7162. context,
  7163. tag,
  7164. data,
  7165. children,
  7166. normalizationType,
  7167. alwaysNormalize
  7168. ) {
  7169. if (Array.isArray(data) || isPrimitive(data)) {
  7170. normalizationType = children;
  7171. children = data;
  7172. data = undefined;
  7173. }
  7174. if (isTrue(alwaysNormalize)) {
  7175. normalizationType = ALWAYS_NORMALIZE;
  7176. }
  7177. return _createElement(context, tag, data, children, normalizationType)
  7178. }
  7179. function _createElement (
  7180. context,
  7181. tag,
  7182. data,
  7183. children,
  7184. normalizationType
  7185. ) {
  7186. if (isDef(data) && isDef((data).__ob__)) {
  7187. true && warn(
  7188. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  7189. 'Always create fresh vnode data objects in each render!',
  7190. context
  7191. );
  7192. return createEmptyVNode()
  7193. }
  7194. // object syntax in v-bind
  7195. if (isDef(data) && isDef(data.is)) {
  7196. tag = data.is;
  7197. }
  7198. if (!tag) {
  7199. // in case of component :is set to falsy value
  7200. return createEmptyVNode()
  7201. }
  7202. // warn against non-primitive key
  7203. if ( true &&
  7204. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  7205. ) {
  7206. {
  7207. warn(
  7208. 'Avoid using non-primitive value as key, ' +
  7209. 'use string/number value instead.',
  7210. context
  7211. );
  7212. }
  7213. }
  7214. // support single function children as default scoped slot
  7215. if (Array.isArray(children) &&
  7216. typeof children[0] === 'function'
  7217. ) {
  7218. data = data || {};
  7219. data.scopedSlots = { default: children[0] };
  7220. children.length = 0;
  7221. }
  7222. if (normalizationType === ALWAYS_NORMALIZE) {
  7223. children = normalizeChildren(children);
  7224. } else if (normalizationType === SIMPLE_NORMALIZE) {
  7225. children = simpleNormalizeChildren(children);
  7226. }
  7227. var vnode, ns;
  7228. if (typeof tag === 'string') {
  7229. var Ctor;
  7230. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  7231. if (config.isReservedTag(tag)) {
  7232. // platform built-in elements
  7233. if ( true && isDef(data) && isDef(data.nativeOn)) {
  7234. warn(
  7235. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  7236. context
  7237. );
  7238. }
  7239. vnode = new VNode(
  7240. config.parsePlatformTagName(tag), data, children,
  7241. undefined, undefined, context
  7242. );
  7243. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  7244. // component
  7245. vnode = createComponent(Ctor, data, context, children, tag);
  7246. } else {
  7247. // unknown or unlisted namespaced elements
  7248. // check at runtime because it may get assigned a namespace when its
  7249. // parent normalizes children
  7250. vnode = new VNode(
  7251. tag, data, children,
  7252. undefined, undefined, context
  7253. );
  7254. }
  7255. } else {
  7256. // direct component options / constructor
  7257. vnode = createComponent(tag, data, context, children);
  7258. }
  7259. if (Array.isArray(vnode)) {
  7260. return vnode
  7261. } else if (isDef(vnode)) {
  7262. if (isDef(ns)) { applyNS(vnode, ns); }
  7263. if (isDef(data)) { registerDeepBindings(data); }
  7264. return vnode
  7265. } else {
  7266. return createEmptyVNode()
  7267. }
  7268. }
  7269. function applyNS (vnode, ns, force) {
  7270. vnode.ns = ns;
  7271. if (vnode.tag === 'foreignObject') {
  7272. // use default namespace inside foreignObject
  7273. ns = undefined;
  7274. force = true;
  7275. }
  7276. if (isDef(vnode.children)) {
  7277. for (var i = 0, l = vnode.children.length; i < l; i++) {
  7278. var child = vnode.children[i];
  7279. if (isDef(child.tag) && (
  7280. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  7281. applyNS(child, ns, force);
  7282. }
  7283. }
  7284. }
  7285. }
  7286. // ref #5318
  7287. // necessary to ensure parent re-render when deep bindings like :style and
  7288. // :class are used on slot nodes
  7289. function registerDeepBindings (data) {
  7290. if (isObject(data.style)) {
  7291. traverse(data.style);
  7292. }
  7293. if (isObject(data.class)) {
  7294. traverse(data.class);
  7295. }
  7296. }
  7297. /* */
  7298. function initRender (vm) {
  7299. vm._vnode = null; // the root of the child tree
  7300. vm._staticTrees = null; // v-once cached trees
  7301. var options = vm.$options;
  7302. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  7303. var renderContext = parentVnode && parentVnode.context;
  7304. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  7305. vm.$scopedSlots = emptyObject;
  7306. // bind the createElement fn to this instance
  7307. // so that we get proper render context inside it.
  7308. // args order: tag, data, children, normalizationType, alwaysNormalize
  7309. // internal version is used by render functions compiled from templates
  7310. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  7311. // normalization is always applied for the public version, used in
  7312. // user-written render functions.
  7313. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  7314. // $attrs & $listeners are exposed for easier HOC creation.
  7315. // they need to be reactive so that HOCs using them are always updated
  7316. var parentData = parentVnode && parentVnode.data;
  7317. /* istanbul ignore else */
  7318. if (true) {
  7319. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  7320. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  7321. }, true);
  7322. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  7323. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  7324. }, true);
  7325. } else {}
  7326. }
  7327. var currentRenderingInstance = null;
  7328. function renderMixin (Vue) {
  7329. // install runtime convenience helpers
  7330. installRenderHelpers(Vue.prototype);
  7331. Vue.prototype.$nextTick = function (fn) {
  7332. return nextTick(fn, this)
  7333. };
  7334. Vue.prototype._render = function () {
  7335. var vm = this;
  7336. var ref = vm.$options;
  7337. var render = ref.render;
  7338. var _parentVnode = ref._parentVnode;
  7339. if (_parentVnode) {
  7340. vm.$scopedSlots = normalizeScopedSlots(
  7341. _parentVnode.data.scopedSlots,
  7342. vm.$slots,
  7343. vm.$scopedSlots
  7344. );
  7345. }
  7346. // set parent vnode. this allows render functions to have access
  7347. // to the data on the placeholder node.
  7348. vm.$vnode = _parentVnode;
  7349. // render self
  7350. var vnode;
  7351. try {
  7352. // There's no need to maintain a stack because all render fns are called
  7353. // separately from one another. Nested component's render fns are called
  7354. // when parent component is patched.
  7355. currentRenderingInstance = vm;
  7356. vnode = render.call(vm._renderProxy, vm.$createElement);
  7357. } catch (e) {
  7358. handleError(e, vm, "render");
  7359. // return error render result,
  7360. // or previous vnode to prevent render error causing blank component
  7361. /* istanbul ignore else */
  7362. if ( true && vm.$options.renderError) {
  7363. try {
  7364. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  7365. } catch (e) {
  7366. handleError(e, vm, "renderError");
  7367. vnode = vm._vnode;
  7368. }
  7369. } else {
  7370. vnode = vm._vnode;
  7371. }
  7372. } finally {
  7373. currentRenderingInstance = null;
  7374. }
  7375. // if the returned array contains only a single node, allow it
  7376. if (Array.isArray(vnode) && vnode.length === 1) {
  7377. vnode = vnode[0];
  7378. }
  7379. // return empty vnode in case the render function errored out
  7380. if (!(vnode instanceof VNode)) {
  7381. if ( true && Array.isArray(vnode)) {
  7382. warn(
  7383. 'Multiple root nodes returned from render function. Render function ' +
  7384. 'should return a single root node.',
  7385. vm
  7386. );
  7387. }
  7388. vnode = createEmptyVNode();
  7389. }
  7390. // set parent
  7391. vnode.parent = _parentVnode;
  7392. return vnode
  7393. };
  7394. }
  7395. /* */
  7396. function ensureCtor (comp, base) {
  7397. if (
  7398. comp.__esModule ||
  7399. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  7400. ) {
  7401. comp = comp.default;
  7402. }
  7403. return isObject(comp)
  7404. ? base.extend(comp)
  7405. : comp
  7406. }
  7407. function createAsyncPlaceholder (
  7408. factory,
  7409. data,
  7410. context,
  7411. children,
  7412. tag
  7413. ) {
  7414. var node = createEmptyVNode();
  7415. node.asyncFactory = factory;
  7416. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  7417. return node
  7418. }
  7419. function resolveAsyncComponent (
  7420. factory,
  7421. baseCtor
  7422. ) {
  7423. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  7424. return factory.errorComp
  7425. }
  7426. if (isDef(factory.resolved)) {
  7427. return factory.resolved
  7428. }
  7429. var owner = currentRenderingInstance;
  7430. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  7431. // already pending
  7432. factory.owners.push(owner);
  7433. }
  7434. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  7435. return factory.loadingComp
  7436. }
  7437. if (owner && !isDef(factory.owners)) {
  7438. var owners = factory.owners = [owner];
  7439. var sync = true;
  7440. var timerLoading = null;
  7441. var timerTimeout = null
  7442. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  7443. var forceRender = function (renderCompleted) {
  7444. for (var i = 0, l = owners.length; i < l; i++) {
  7445. (owners[i]).$forceUpdate();
  7446. }
  7447. if (renderCompleted) {
  7448. owners.length = 0;
  7449. if (timerLoading !== null) {
  7450. clearTimeout(timerLoading);
  7451. timerLoading = null;
  7452. }
  7453. if (timerTimeout !== null) {
  7454. clearTimeout(timerTimeout);
  7455. timerTimeout = null;
  7456. }
  7457. }
  7458. };
  7459. var resolve = once(function (res) {
  7460. // cache resolved
  7461. factory.resolved = ensureCtor(res, baseCtor);
  7462. // invoke callbacks only if this is not a synchronous resolve
  7463. // (async resolves are shimmed as synchronous during SSR)
  7464. if (!sync) {
  7465. forceRender(true);
  7466. } else {
  7467. owners.length = 0;
  7468. }
  7469. });
  7470. var reject = once(function (reason) {
  7471. true && warn(
  7472. "Failed to resolve async component: " + (String(factory)) +
  7473. (reason ? ("\nReason: " + reason) : '')
  7474. );
  7475. if (isDef(factory.errorComp)) {
  7476. factory.error = true;
  7477. forceRender(true);
  7478. }
  7479. });
  7480. var res = factory(resolve, reject);
  7481. if (isObject(res)) {
  7482. if (isPromise(res)) {
  7483. // () => Promise
  7484. if (isUndef(factory.resolved)) {
  7485. res.then(resolve, reject);
  7486. }
  7487. } else if (isPromise(res.component)) {
  7488. res.component.then(resolve, reject);
  7489. if (isDef(res.error)) {
  7490. factory.errorComp = ensureCtor(res.error, baseCtor);
  7491. }
  7492. if (isDef(res.loading)) {
  7493. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  7494. if (res.delay === 0) {
  7495. factory.loading = true;
  7496. } else {
  7497. timerLoading = setTimeout(function () {
  7498. timerLoading = null;
  7499. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  7500. factory.loading = true;
  7501. forceRender(false);
  7502. }
  7503. }, res.delay || 200);
  7504. }
  7505. }
  7506. if (isDef(res.timeout)) {
  7507. timerTimeout = setTimeout(function () {
  7508. timerTimeout = null;
  7509. if (isUndef(factory.resolved)) {
  7510. reject(
  7511. true
  7512. ? ("timeout (" + (res.timeout) + "ms)")
  7513. : undefined
  7514. );
  7515. }
  7516. }, res.timeout);
  7517. }
  7518. }
  7519. }
  7520. sync = false;
  7521. // return in case resolved synchronously
  7522. return factory.loading
  7523. ? factory.loadingComp
  7524. : factory.resolved
  7525. }
  7526. }
  7527. /* */
  7528. function isAsyncPlaceholder (node) {
  7529. return node.isComment && node.asyncFactory
  7530. }
  7531. /* */
  7532. function getFirstComponentChild (children) {
  7533. if (Array.isArray(children)) {
  7534. for (var i = 0; i < children.length; i++) {
  7535. var c = children[i];
  7536. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  7537. return c
  7538. }
  7539. }
  7540. }
  7541. }
  7542. /* */
  7543. /* */
  7544. function initEvents (vm) {
  7545. vm._events = Object.create(null);
  7546. vm._hasHookEvent = false;
  7547. // init parent attached events
  7548. var listeners = vm.$options._parentListeners;
  7549. if (listeners) {
  7550. updateComponentListeners(vm, listeners);
  7551. }
  7552. }
  7553. var target;
  7554. function add (event, fn) {
  7555. target.$on(event, fn);
  7556. }
  7557. function remove$1 (event, fn) {
  7558. target.$off(event, fn);
  7559. }
  7560. function createOnceHandler (event, fn) {
  7561. var _target = target;
  7562. return function onceHandler () {
  7563. var res = fn.apply(null, arguments);
  7564. if (res !== null) {
  7565. _target.$off(event, onceHandler);
  7566. }
  7567. }
  7568. }
  7569. function updateComponentListeners (
  7570. vm,
  7571. listeners,
  7572. oldListeners
  7573. ) {
  7574. target = vm;
  7575. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  7576. target = undefined;
  7577. }
  7578. function eventsMixin (Vue) {
  7579. var hookRE = /^hook:/;
  7580. Vue.prototype.$on = function (event, fn) {
  7581. var vm = this;
  7582. if (Array.isArray(event)) {
  7583. for (var i = 0, l = event.length; i < l; i++) {
  7584. vm.$on(event[i], fn);
  7585. }
  7586. } else {
  7587. (vm._events[event] || (vm._events[event] = [])).push(fn);
  7588. // optimize hook:event cost by using a boolean flag marked at registration
  7589. // instead of a hash lookup
  7590. if (hookRE.test(event)) {
  7591. vm._hasHookEvent = true;
  7592. }
  7593. }
  7594. return vm
  7595. };
  7596. Vue.prototype.$once = function (event, fn) {
  7597. var vm = this;
  7598. function on () {
  7599. vm.$off(event, on);
  7600. fn.apply(vm, arguments);
  7601. }
  7602. on.fn = fn;
  7603. vm.$on(event, on);
  7604. return vm
  7605. };
  7606. Vue.prototype.$off = function (event, fn) {
  7607. var vm = this;
  7608. // all
  7609. if (!arguments.length) {
  7610. vm._events = Object.create(null);
  7611. return vm
  7612. }
  7613. // array of events
  7614. if (Array.isArray(event)) {
  7615. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  7616. vm.$off(event[i$1], fn);
  7617. }
  7618. return vm
  7619. }
  7620. // specific event
  7621. var cbs = vm._events[event];
  7622. if (!cbs) {
  7623. return vm
  7624. }
  7625. if (!fn) {
  7626. vm._events[event] = null;
  7627. return vm
  7628. }
  7629. // specific handler
  7630. var cb;
  7631. var i = cbs.length;
  7632. while (i--) {
  7633. cb = cbs[i];
  7634. if (cb === fn || cb.fn === fn) {
  7635. cbs.splice(i, 1);
  7636. break
  7637. }
  7638. }
  7639. return vm
  7640. };
  7641. Vue.prototype.$emit = function (event) {
  7642. var vm = this;
  7643. if (true) {
  7644. var lowerCaseEvent = event.toLowerCase();
  7645. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  7646. tip(
  7647. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  7648. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  7649. "Note that HTML attributes are case-insensitive and you cannot use " +
  7650. "v-on to listen to camelCase events when using in-DOM templates. " +
  7651. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  7652. );
  7653. }
  7654. }
  7655. var cbs = vm._events[event];
  7656. if (cbs) {
  7657. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  7658. var args = toArray(arguments, 1);
  7659. var info = "event handler for \"" + event + "\"";
  7660. for (var i = 0, l = cbs.length; i < l; i++) {
  7661. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  7662. }
  7663. }
  7664. return vm
  7665. };
  7666. }
  7667. /* */
  7668. var activeInstance = null;
  7669. var isUpdatingChildComponent = false;
  7670. function setActiveInstance(vm) {
  7671. var prevActiveInstance = activeInstance;
  7672. activeInstance = vm;
  7673. return function () {
  7674. activeInstance = prevActiveInstance;
  7675. }
  7676. }
  7677. function initLifecycle (vm) {
  7678. var options = vm.$options;
  7679. // locate first non-abstract parent
  7680. var parent = options.parent;
  7681. if (parent && !options.abstract) {
  7682. while (parent.$options.abstract && parent.$parent) {
  7683. parent = parent.$parent;
  7684. }
  7685. parent.$children.push(vm);
  7686. }
  7687. vm.$parent = parent;
  7688. vm.$root = parent ? parent.$root : vm;
  7689. vm.$children = [];
  7690. vm.$refs = {};
  7691. vm._watcher = null;
  7692. vm._inactive = null;
  7693. vm._directInactive = false;
  7694. vm._isMounted = false;
  7695. vm._isDestroyed = false;
  7696. vm._isBeingDestroyed = false;
  7697. }
  7698. function lifecycleMixin (Vue) {
  7699. Vue.prototype._update = function (vnode, hydrating) {
  7700. var vm = this;
  7701. var prevEl = vm.$el;
  7702. var prevVnode = vm._vnode;
  7703. var restoreActiveInstance = setActiveInstance(vm);
  7704. vm._vnode = vnode;
  7705. // Vue.prototype.__patch__ is injected in entry points
  7706. // based on the rendering backend used.
  7707. if (!prevVnode) {
  7708. // initial render
  7709. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  7710. } else {
  7711. // updates
  7712. vm.$el = vm.__patch__(prevVnode, vnode);
  7713. }
  7714. restoreActiveInstance();
  7715. // update __vue__ reference
  7716. if (prevEl) {
  7717. prevEl.__vue__ = null;
  7718. }
  7719. if (vm.$el) {
  7720. vm.$el.__vue__ = vm;
  7721. }
  7722. // if parent is an HOC, update its $el as well
  7723. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  7724. vm.$parent.$el = vm.$el;
  7725. }
  7726. // updated hook is called by the scheduler to ensure that children are
  7727. // updated in a parent's updated hook.
  7728. };
  7729. Vue.prototype.$forceUpdate = function () {
  7730. var vm = this;
  7731. if (vm._watcher) {
  7732. vm._watcher.update();
  7733. }
  7734. };
  7735. Vue.prototype.$destroy = function () {
  7736. var vm = this;
  7737. if (vm._isBeingDestroyed) {
  7738. return
  7739. }
  7740. callHook(vm, 'beforeDestroy');
  7741. vm._isBeingDestroyed = true;
  7742. // remove self from parent
  7743. var parent = vm.$parent;
  7744. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  7745. remove(parent.$children, vm);
  7746. }
  7747. // teardown watchers
  7748. if (vm._watcher) {
  7749. vm._watcher.teardown();
  7750. }
  7751. var i = vm._watchers.length;
  7752. while (i--) {
  7753. vm._watchers[i].teardown();
  7754. }
  7755. // remove reference from data ob
  7756. // frozen object may not have observer.
  7757. if (vm._data.__ob__) {
  7758. vm._data.__ob__.vmCount--;
  7759. }
  7760. // call the last hook...
  7761. vm._isDestroyed = true;
  7762. // invoke destroy hooks on current rendered tree
  7763. vm.__patch__(vm._vnode, null);
  7764. // fire destroyed hook
  7765. callHook(vm, 'destroyed');
  7766. // turn off all instance listeners.
  7767. vm.$off();
  7768. // remove __vue__ reference
  7769. if (vm.$el) {
  7770. vm.$el.__vue__ = null;
  7771. }
  7772. // release circular reference (#6759)
  7773. if (vm.$vnode) {
  7774. vm.$vnode.parent = null;
  7775. }
  7776. };
  7777. }
  7778. function updateChildComponent (
  7779. vm,
  7780. propsData,
  7781. listeners,
  7782. parentVnode,
  7783. renderChildren
  7784. ) {
  7785. if (true) {
  7786. isUpdatingChildComponent = true;
  7787. }
  7788. // determine whether component has slot children
  7789. // we need to do this before overwriting $options._renderChildren.
  7790. // check if there are dynamic scopedSlots (hand-written or compiled but with
  7791. // dynamic slot names). Static scoped slots compiled from template has the
  7792. // "$stable" marker.
  7793. var newScopedSlots = parentVnode.data.scopedSlots;
  7794. var oldScopedSlots = vm.$scopedSlots;
  7795. var hasDynamicScopedSlot = !!(
  7796. (newScopedSlots && !newScopedSlots.$stable) ||
  7797. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  7798. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  7799. );
  7800. // Any static slot children from the parent may have changed during parent's
  7801. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  7802. // update is necessary to ensure correctness.
  7803. var needsForceUpdate = !!(
  7804. renderChildren || // has new static slots
  7805. vm.$options._renderChildren || // has old static slots
  7806. hasDynamicScopedSlot
  7807. );
  7808. vm.$options._parentVnode = parentVnode;
  7809. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  7810. if (vm._vnode) { // update child tree's parent
  7811. vm._vnode.parent = parentVnode;
  7812. }
  7813. vm.$options._renderChildren = renderChildren;
  7814. // update $attrs and $listeners hash
  7815. // these are also reactive so they may trigger child update if the child
  7816. // used them during render
  7817. vm.$attrs = parentVnode.data.attrs || emptyObject;
  7818. vm.$listeners = listeners || emptyObject;
  7819. // update props
  7820. if (propsData && vm.$options.props) {
  7821. toggleObserving(false);
  7822. var props = vm._props;
  7823. var propKeys = vm.$options._propKeys || [];
  7824. for (var i = 0; i < propKeys.length; i++) {
  7825. var key = propKeys[i];
  7826. var propOptions = vm.$options.props; // wtf flow?
  7827. props[key] = validateProp(key, propOptions, propsData, vm);
  7828. }
  7829. toggleObserving(true);
  7830. // keep a copy of raw propsData
  7831. vm.$options.propsData = propsData;
  7832. }
  7833. // fixed by xxxxxx update properties(mp runtime)
  7834. vm._$updateProperties && vm._$updateProperties(vm);
  7835. // update listeners
  7836. listeners = listeners || emptyObject;
  7837. var oldListeners = vm.$options._parentListeners;
  7838. vm.$options._parentListeners = listeners;
  7839. updateComponentListeners(vm, listeners, oldListeners);
  7840. // resolve slots + force update if has children
  7841. if (needsForceUpdate) {
  7842. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7843. vm.$forceUpdate();
  7844. }
  7845. if (true) {
  7846. isUpdatingChildComponent = false;
  7847. }
  7848. }
  7849. function isInInactiveTree (vm) {
  7850. while (vm && (vm = vm.$parent)) {
  7851. if (vm._inactive) { return true }
  7852. }
  7853. return false
  7854. }
  7855. function activateChildComponent (vm, direct) {
  7856. if (direct) {
  7857. vm._directInactive = false;
  7858. if (isInInactiveTree(vm)) {
  7859. return
  7860. }
  7861. } else if (vm._directInactive) {
  7862. return
  7863. }
  7864. if (vm._inactive || vm._inactive === null) {
  7865. vm._inactive = false;
  7866. for (var i = 0; i < vm.$children.length; i++) {
  7867. activateChildComponent(vm.$children[i]);
  7868. }
  7869. callHook(vm, 'activated');
  7870. }
  7871. }
  7872. function deactivateChildComponent (vm, direct) {
  7873. if (direct) {
  7874. vm._directInactive = true;
  7875. if (isInInactiveTree(vm)) {
  7876. return
  7877. }
  7878. }
  7879. if (!vm._inactive) {
  7880. vm._inactive = true;
  7881. for (var i = 0; i < vm.$children.length; i++) {
  7882. deactivateChildComponent(vm.$children[i]);
  7883. }
  7884. callHook(vm, 'deactivated');
  7885. }
  7886. }
  7887. function callHook (vm, hook) {
  7888. // #7573 disable dep collection when invoking lifecycle hooks
  7889. pushTarget();
  7890. var handlers = vm.$options[hook];
  7891. var info = hook + " hook";
  7892. if (handlers) {
  7893. for (var i = 0, j = handlers.length; i < j; i++) {
  7894. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7895. }
  7896. }
  7897. if (vm._hasHookEvent) {
  7898. vm.$emit('hook:' + hook);
  7899. }
  7900. popTarget();
  7901. }
  7902. /* */
  7903. var MAX_UPDATE_COUNT = 100;
  7904. var queue = [];
  7905. var activatedChildren = [];
  7906. var has = {};
  7907. var circular = {};
  7908. var waiting = false;
  7909. var flushing = false;
  7910. var index = 0;
  7911. /**
  7912. * Reset the scheduler's state.
  7913. */
  7914. function resetSchedulerState () {
  7915. index = queue.length = activatedChildren.length = 0;
  7916. has = {};
  7917. if (true) {
  7918. circular = {};
  7919. }
  7920. waiting = flushing = false;
  7921. }
  7922. // Async edge case #6566 requires saving the timestamp when event listeners are
  7923. // attached. However, calling performance.now() has a perf overhead especially
  7924. // if the page has thousands of event listeners. Instead, we take a timestamp
  7925. // every time the scheduler flushes and use that for all event listeners
  7926. // attached during that flush.
  7927. var currentFlushTimestamp = 0;
  7928. // Async edge case fix requires storing an event listener's attach timestamp.
  7929. var getNow = Date.now;
  7930. // Determine what event timestamp the browser is using. Annoyingly, the
  7931. // timestamp can either be hi-res (relative to page load) or low-res
  7932. // (relative to UNIX epoch), so in order to compare time we have to use the
  7933. // same timestamp type when saving the flush timestamp.
  7934. // All IE versions use low-res event timestamps, and have problematic clock
  7935. // implementations (#9632)
  7936. if (inBrowser && !isIE) {
  7937. var performance = window.performance;
  7938. if (
  7939. performance &&
  7940. typeof performance.now === 'function' &&
  7941. getNow() > document.createEvent('Event').timeStamp
  7942. ) {
  7943. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7944. // smaller than it, it means the event is using a hi-res timestamp,
  7945. // and we need to use the hi-res version for event listener timestamps as
  7946. // well.
  7947. getNow = function () { return performance.now(); };
  7948. }
  7949. }
  7950. /**
  7951. * Flush both queues and run the watchers.
  7952. */
  7953. function flushSchedulerQueue () {
  7954. currentFlushTimestamp = getNow();
  7955. flushing = true;
  7956. var watcher, id;
  7957. // Sort queue before flush.
  7958. // This ensures that:
  7959. // 1. Components are updated from parent to child. (because parent is always
  7960. // created before the child)
  7961. // 2. A component's user watchers are run before its render watcher (because
  7962. // user watchers are created before the render watcher)
  7963. // 3. If a component is destroyed during a parent component's watcher run,
  7964. // its watchers can be skipped.
  7965. queue.sort(function (a, b) { return a.id - b.id; });
  7966. // do not cache length because more watchers might be pushed
  7967. // as we run existing watchers
  7968. for (index = 0; index < queue.length; index++) {
  7969. watcher = queue[index];
  7970. if (watcher.before) {
  7971. watcher.before();
  7972. }
  7973. id = watcher.id;
  7974. has[id] = null;
  7975. watcher.run();
  7976. // in dev build, check and stop circular updates.
  7977. if ( true && has[id] != null) {
  7978. circular[id] = (circular[id] || 0) + 1;
  7979. if (circular[id] > MAX_UPDATE_COUNT) {
  7980. warn(
  7981. 'You may have an infinite update loop ' + (
  7982. watcher.user
  7983. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7984. : "in a component render function."
  7985. ),
  7986. watcher.vm
  7987. );
  7988. break
  7989. }
  7990. }
  7991. }
  7992. // keep copies of post queues before resetting state
  7993. var activatedQueue = activatedChildren.slice();
  7994. var updatedQueue = queue.slice();
  7995. resetSchedulerState();
  7996. // call component updated and activated hooks
  7997. callActivatedHooks(activatedQueue);
  7998. callUpdatedHooks(updatedQueue);
  7999. // devtool hook
  8000. /* istanbul ignore if */
  8001. if (devtools && config.devtools) {
  8002. devtools.emit('flush');
  8003. }
  8004. }
  8005. function callUpdatedHooks (queue) {
  8006. var i = queue.length;
  8007. while (i--) {
  8008. var watcher = queue[i];
  8009. var vm = watcher.vm;
  8010. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  8011. callHook(vm, 'updated');
  8012. }
  8013. }
  8014. }
  8015. /**
  8016. * Queue a kept-alive component that was activated during patch.
  8017. * The queue will be processed after the entire tree has been patched.
  8018. */
  8019. function queueActivatedComponent (vm) {
  8020. // setting _inactive to false here so that a render function can
  8021. // rely on checking whether it's in an inactive tree (e.g. router-view)
  8022. vm._inactive = false;
  8023. activatedChildren.push(vm);
  8024. }
  8025. function callActivatedHooks (queue) {
  8026. for (var i = 0; i < queue.length; i++) {
  8027. queue[i]._inactive = true;
  8028. activateChildComponent(queue[i], true /* true */);
  8029. }
  8030. }
  8031. /**
  8032. * Push a watcher into the watcher queue.
  8033. * Jobs with duplicate IDs will be skipped unless it's
  8034. * pushed when the queue is being flushed.
  8035. */
  8036. function queueWatcher (watcher) {
  8037. var id = watcher.id;
  8038. if (has[id] == null) {
  8039. has[id] = true;
  8040. if (!flushing) {
  8041. queue.push(watcher);
  8042. } else {
  8043. // if already flushing, splice the watcher based on its id
  8044. // if already past its id, it will be run next immediately.
  8045. var i = queue.length - 1;
  8046. while (i > index && queue[i].id > watcher.id) {
  8047. i--;
  8048. }
  8049. queue.splice(i + 1, 0, watcher);
  8050. }
  8051. // queue the flush
  8052. if (!waiting) {
  8053. waiting = true;
  8054. if ( true && !config.async) {
  8055. flushSchedulerQueue();
  8056. return
  8057. }
  8058. nextTick(flushSchedulerQueue);
  8059. }
  8060. }
  8061. }
  8062. /* */
  8063. var uid$2 = 0;
  8064. /**
  8065. * A watcher parses an expression, collects dependencies,
  8066. * and fires callback when the expression value changes.
  8067. * This is used for both the $watch() api and directives.
  8068. */
  8069. var Watcher = function Watcher (
  8070. vm,
  8071. expOrFn,
  8072. cb,
  8073. options,
  8074. isRenderWatcher
  8075. ) {
  8076. this.vm = vm;
  8077. if (isRenderWatcher) {
  8078. vm._watcher = this;
  8079. }
  8080. vm._watchers.push(this);
  8081. // options
  8082. if (options) {
  8083. this.deep = !!options.deep;
  8084. this.user = !!options.user;
  8085. this.lazy = !!options.lazy;
  8086. this.sync = !!options.sync;
  8087. this.before = options.before;
  8088. } else {
  8089. this.deep = this.user = this.lazy = this.sync = false;
  8090. }
  8091. this.cb = cb;
  8092. this.id = ++uid$2; // uid for batching
  8093. this.active = true;
  8094. this.dirty = this.lazy; // for lazy watchers
  8095. this.deps = [];
  8096. this.newDeps = [];
  8097. this.depIds = new _Set();
  8098. this.newDepIds = new _Set();
  8099. this.expression = true
  8100. ? expOrFn.toString()
  8101. : undefined;
  8102. // parse expression for getter
  8103. if (typeof expOrFn === 'function') {
  8104. this.getter = expOrFn;
  8105. } else {
  8106. this.getter = parsePath(expOrFn);
  8107. if (!this.getter) {
  8108. this.getter = noop;
  8109. true && warn(
  8110. "Failed watching path: \"" + expOrFn + "\" " +
  8111. 'Watcher only accepts simple dot-delimited paths. ' +
  8112. 'For full control, use a function instead.',
  8113. vm
  8114. );
  8115. }
  8116. }
  8117. this.value = this.lazy
  8118. ? undefined
  8119. : this.get();
  8120. };
  8121. /**
  8122. * Evaluate the getter, and re-collect dependencies.
  8123. */
  8124. Watcher.prototype.get = function get () {
  8125. pushTarget(this);
  8126. var value;
  8127. var vm = this.vm;
  8128. try {
  8129. value = this.getter.call(vm, vm);
  8130. } catch (e) {
  8131. if (this.user) {
  8132. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  8133. } else {
  8134. throw e
  8135. }
  8136. } finally {
  8137. // "touch" every property so they are all tracked as
  8138. // dependencies for deep watching
  8139. if (this.deep) {
  8140. traverse(value);
  8141. }
  8142. popTarget();
  8143. this.cleanupDeps();
  8144. }
  8145. return value
  8146. };
  8147. /**
  8148. * Add a dependency to this directive.
  8149. */
  8150. Watcher.prototype.addDep = function addDep (dep) {
  8151. var id = dep.id;
  8152. if (!this.newDepIds.has(id)) {
  8153. this.newDepIds.add(id);
  8154. this.newDeps.push(dep);
  8155. if (!this.depIds.has(id)) {
  8156. dep.addSub(this);
  8157. }
  8158. }
  8159. };
  8160. /**
  8161. * Clean up for dependency collection.
  8162. */
  8163. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  8164. var i = this.deps.length;
  8165. while (i--) {
  8166. var dep = this.deps[i];
  8167. if (!this.newDepIds.has(dep.id)) {
  8168. dep.removeSub(this);
  8169. }
  8170. }
  8171. var tmp = this.depIds;
  8172. this.depIds = this.newDepIds;
  8173. this.newDepIds = tmp;
  8174. this.newDepIds.clear();
  8175. tmp = this.deps;
  8176. this.deps = this.newDeps;
  8177. this.newDeps = tmp;
  8178. this.newDeps.length = 0;
  8179. };
  8180. /**
  8181. * Subscriber interface.
  8182. * Will be called when a dependency changes.
  8183. */
  8184. Watcher.prototype.update = function update () {
  8185. /* istanbul ignore else */
  8186. if (this.lazy) {
  8187. this.dirty = true;
  8188. } else if (this.sync) {
  8189. this.run();
  8190. } else {
  8191. queueWatcher(this);
  8192. }
  8193. };
  8194. /**
  8195. * Scheduler job interface.
  8196. * Will be called by the scheduler.
  8197. */
  8198. Watcher.prototype.run = function run () {
  8199. if (this.active) {
  8200. var value = this.get();
  8201. if (
  8202. value !== this.value ||
  8203. // Deep watchers and watchers on Object/Arrays should fire even
  8204. // when the value is the same, because the value may
  8205. // have mutated.
  8206. isObject(value) ||
  8207. this.deep
  8208. ) {
  8209. // set new value
  8210. var oldValue = this.value;
  8211. this.value = value;
  8212. if (this.user) {
  8213. try {
  8214. this.cb.call(this.vm, value, oldValue);
  8215. } catch (e) {
  8216. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  8217. }
  8218. } else {
  8219. this.cb.call(this.vm, value, oldValue);
  8220. }
  8221. }
  8222. }
  8223. };
  8224. /**
  8225. * Evaluate the value of the watcher.
  8226. * This only gets called for lazy watchers.
  8227. */
  8228. Watcher.prototype.evaluate = function evaluate () {
  8229. this.value = this.get();
  8230. this.dirty = false;
  8231. };
  8232. /**
  8233. * Depend on all deps collected by this watcher.
  8234. */
  8235. Watcher.prototype.depend = function depend () {
  8236. var i = this.deps.length;
  8237. while (i--) {
  8238. this.deps[i].depend();
  8239. }
  8240. };
  8241. /**
  8242. * Remove self from all dependencies' subscriber list.
  8243. */
  8244. Watcher.prototype.teardown = function teardown () {
  8245. if (this.active) {
  8246. // remove self from vm's watcher list
  8247. // this is a somewhat expensive operation so we skip it
  8248. // if the vm is being destroyed.
  8249. if (!this.vm._isBeingDestroyed) {
  8250. remove(this.vm._watchers, this);
  8251. }
  8252. var i = this.deps.length;
  8253. while (i--) {
  8254. this.deps[i].removeSub(this);
  8255. }
  8256. this.active = false;
  8257. }
  8258. };
  8259. /* */
  8260. var sharedPropertyDefinition = {
  8261. enumerable: true,
  8262. configurable: true,
  8263. get: noop,
  8264. set: noop
  8265. };
  8266. function proxy (target, sourceKey, key) {
  8267. sharedPropertyDefinition.get = function proxyGetter () {
  8268. return this[sourceKey][key]
  8269. };
  8270. sharedPropertyDefinition.set = function proxySetter (val) {
  8271. this[sourceKey][key] = val;
  8272. };
  8273. Object.defineProperty(target, key, sharedPropertyDefinition);
  8274. }
  8275. function initState (vm) {
  8276. vm._watchers = [];
  8277. var opts = vm.$options;
  8278. if (opts.props) { initProps(vm, opts.props); }
  8279. if (opts.methods) { initMethods(vm, opts.methods); }
  8280. if (opts.data) {
  8281. initData(vm);
  8282. } else {
  8283. observe(vm._data = {}, true /* asRootData */);
  8284. }
  8285. if (opts.computed) { initComputed(vm, opts.computed); }
  8286. if (opts.watch && opts.watch !== nativeWatch) {
  8287. initWatch(vm, opts.watch);
  8288. }
  8289. }
  8290. function initProps (vm, propsOptions) {
  8291. var propsData = vm.$options.propsData || {};
  8292. var props = vm._props = {};
  8293. // cache prop keys so that future props updates can iterate using Array
  8294. // instead of dynamic object key enumeration.
  8295. var keys = vm.$options._propKeys = [];
  8296. var isRoot = !vm.$parent;
  8297. // root instance props should be converted
  8298. if (!isRoot) {
  8299. toggleObserving(false);
  8300. }
  8301. var loop = function ( key ) {
  8302. keys.push(key);
  8303. var value = validateProp(key, propsOptions, propsData, vm);
  8304. /* istanbul ignore else */
  8305. if (true) {
  8306. var hyphenatedKey = hyphenate(key);
  8307. if (isReservedAttribute(hyphenatedKey) ||
  8308. config.isReservedAttr(hyphenatedKey)) {
  8309. warn(
  8310. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  8311. vm
  8312. );
  8313. }
  8314. defineReactive$$1(props, key, value, function () {
  8315. if (!isRoot && !isUpdatingChildComponent) {
  8316. {
  8317. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  8318. return
  8319. }
  8320. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  8321. if(
  8322. key === 'value' &&
  8323. Array.isArray(vm.$options.behaviors) &&
  8324. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8325. ){
  8326. return
  8327. }
  8328. if(vm._getFormData){
  8329. return
  8330. }
  8331. var $parent = vm.$parent;
  8332. while($parent){
  8333. if($parent.__next_tick_pending){
  8334. return
  8335. }
  8336. $parent = $parent.$parent;
  8337. }
  8338. }
  8339. warn(
  8340. "Avoid mutating a prop directly since the value will be " +
  8341. "overwritten whenever the parent component re-renders. " +
  8342. "Instead, use a data or computed property based on the prop's " +
  8343. "value. Prop being mutated: \"" + key + "\"",
  8344. vm
  8345. );
  8346. }
  8347. });
  8348. } else {}
  8349. // static props are already proxied on the component's prototype
  8350. // during Vue.extend(). We only need to proxy props defined at
  8351. // instantiation here.
  8352. if (!(key in vm)) {
  8353. proxy(vm, "_props", key);
  8354. }
  8355. };
  8356. for (var key in propsOptions) loop( key );
  8357. toggleObserving(true);
  8358. }
  8359. function initData (vm) {
  8360. var data = vm.$options.data;
  8361. data = vm._data = typeof data === 'function'
  8362. ? getData(data, vm)
  8363. : data || {};
  8364. if (!isPlainObject(data)) {
  8365. data = {};
  8366. true && warn(
  8367. 'data functions should return an object:\n' +
  8368. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  8369. vm
  8370. );
  8371. }
  8372. // proxy data on instance
  8373. var keys = Object.keys(data);
  8374. var props = vm.$options.props;
  8375. var methods = vm.$options.methods;
  8376. var i = keys.length;
  8377. while (i--) {
  8378. var key = keys[i];
  8379. if (true) {
  8380. if (methods && hasOwn(methods, key)) {
  8381. warn(
  8382. ("Method \"" + key + "\" has already been defined as a data property."),
  8383. vm
  8384. );
  8385. }
  8386. }
  8387. if (props && hasOwn(props, key)) {
  8388. true && warn(
  8389. "The data property \"" + key + "\" is already declared as a prop. " +
  8390. "Use prop default value instead.",
  8391. vm
  8392. );
  8393. } else if (!isReserved(key)) {
  8394. proxy(vm, "_data", key);
  8395. }
  8396. }
  8397. // observe data
  8398. observe(data, true /* asRootData */);
  8399. }
  8400. function getData (data, vm) {
  8401. // #7573 disable dep collection when invoking data getters
  8402. pushTarget();
  8403. try {
  8404. return data.call(vm, vm)
  8405. } catch (e) {
  8406. handleError(e, vm, "data()");
  8407. return {}
  8408. } finally {
  8409. popTarget();
  8410. }
  8411. }
  8412. var computedWatcherOptions = { lazy: true };
  8413. function initComputed (vm, computed) {
  8414. // $flow-disable-line
  8415. var watchers = vm._computedWatchers = Object.create(null);
  8416. // computed properties are just getters during SSR
  8417. var isSSR = isServerRendering();
  8418. for (var key in computed) {
  8419. var userDef = computed[key];
  8420. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  8421. if ( true && getter == null) {
  8422. warn(
  8423. ("Getter is missing for computed property \"" + key + "\"."),
  8424. vm
  8425. );
  8426. }
  8427. if (!isSSR) {
  8428. // create internal watcher for the computed property.
  8429. watchers[key] = new Watcher(
  8430. vm,
  8431. getter || noop,
  8432. noop,
  8433. computedWatcherOptions
  8434. );
  8435. }
  8436. // component-defined computed properties are already defined on the
  8437. // component prototype. We only need to define computed properties defined
  8438. // at instantiation here.
  8439. if (!(key in vm)) {
  8440. defineComputed(vm, key, userDef);
  8441. } else if (true) {
  8442. if (key in vm.$data) {
  8443. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  8444. } else if (vm.$options.props && key in vm.$options.props) {
  8445. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  8446. }
  8447. }
  8448. }
  8449. }
  8450. function defineComputed (
  8451. target,
  8452. key,
  8453. userDef
  8454. ) {
  8455. var shouldCache = !isServerRendering();
  8456. if (typeof userDef === 'function') {
  8457. sharedPropertyDefinition.get = shouldCache
  8458. ? createComputedGetter(key)
  8459. : createGetterInvoker(userDef);
  8460. sharedPropertyDefinition.set = noop;
  8461. } else {
  8462. sharedPropertyDefinition.get = userDef.get
  8463. ? shouldCache && userDef.cache !== false
  8464. ? createComputedGetter(key)
  8465. : createGetterInvoker(userDef.get)
  8466. : noop;
  8467. sharedPropertyDefinition.set = userDef.set || noop;
  8468. }
  8469. if ( true &&
  8470. sharedPropertyDefinition.set === noop) {
  8471. sharedPropertyDefinition.set = function () {
  8472. warn(
  8473. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  8474. this
  8475. );
  8476. };
  8477. }
  8478. Object.defineProperty(target, key, sharedPropertyDefinition);
  8479. }
  8480. function createComputedGetter (key) {
  8481. return function computedGetter () {
  8482. var watcher = this._computedWatchers && this._computedWatchers[key];
  8483. if (watcher) {
  8484. if (watcher.dirty) {
  8485. watcher.evaluate();
  8486. }
  8487. if (Dep.SharedObject.target) {// fixed by xxxxxx
  8488. watcher.depend();
  8489. }
  8490. return watcher.value
  8491. }
  8492. }
  8493. }
  8494. function createGetterInvoker(fn) {
  8495. return function computedGetter () {
  8496. return fn.call(this, this)
  8497. }
  8498. }
  8499. function initMethods (vm, methods) {
  8500. var props = vm.$options.props;
  8501. for (var key in methods) {
  8502. if (true) {
  8503. if (typeof methods[key] !== 'function') {
  8504. warn(
  8505. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  8506. "Did you reference the function correctly?",
  8507. vm
  8508. );
  8509. }
  8510. if (props && hasOwn(props, key)) {
  8511. warn(
  8512. ("Method \"" + key + "\" has already been defined as a prop."),
  8513. vm
  8514. );
  8515. }
  8516. if ((key in vm) && isReserved(key)) {
  8517. warn(
  8518. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  8519. "Avoid defining component methods that start with _ or $."
  8520. );
  8521. }
  8522. }
  8523. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  8524. }
  8525. }
  8526. function initWatch (vm, watch) {
  8527. for (var key in watch) {
  8528. var handler = watch[key];
  8529. if (Array.isArray(handler)) {
  8530. for (var i = 0; i < handler.length; i++) {
  8531. createWatcher(vm, key, handler[i]);
  8532. }
  8533. } else {
  8534. createWatcher(vm, key, handler);
  8535. }
  8536. }
  8537. }
  8538. function createWatcher (
  8539. vm,
  8540. expOrFn,
  8541. handler,
  8542. options
  8543. ) {
  8544. if (isPlainObject(handler)) {
  8545. options = handler;
  8546. handler = handler.handler;
  8547. }
  8548. if (typeof handler === 'string') {
  8549. handler = vm[handler];
  8550. }
  8551. return vm.$watch(expOrFn, handler, options)
  8552. }
  8553. function stateMixin (Vue) {
  8554. // flow somehow has problems with directly declared definition object
  8555. // when using Object.defineProperty, so we have to procedurally build up
  8556. // the object here.
  8557. var dataDef = {};
  8558. dataDef.get = function () { return this._data };
  8559. var propsDef = {};
  8560. propsDef.get = function () { return this._props };
  8561. if (true) {
  8562. dataDef.set = function () {
  8563. warn(
  8564. 'Avoid replacing instance root $data. ' +
  8565. 'Use nested data properties instead.',
  8566. this
  8567. );
  8568. };
  8569. propsDef.set = function () {
  8570. warn("$props is readonly.", this);
  8571. };
  8572. }
  8573. Object.defineProperty(Vue.prototype, '$data', dataDef);
  8574. Object.defineProperty(Vue.prototype, '$props', propsDef);
  8575. Vue.prototype.$set = set;
  8576. Vue.prototype.$delete = del;
  8577. Vue.prototype.$watch = function (
  8578. expOrFn,
  8579. cb,
  8580. options
  8581. ) {
  8582. var vm = this;
  8583. if (isPlainObject(cb)) {
  8584. return createWatcher(vm, expOrFn, cb, options)
  8585. }
  8586. options = options || {};
  8587. options.user = true;
  8588. var watcher = new Watcher(vm, expOrFn, cb, options);
  8589. if (options.immediate) {
  8590. try {
  8591. cb.call(vm, watcher.value);
  8592. } catch (error) {
  8593. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  8594. }
  8595. }
  8596. return function unwatchFn () {
  8597. watcher.teardown();
  8598. }
  8599. };
  8600. }
  8601. /* */
  8602. var uid$3 = 0;
  8603. function initMixin (Vue) {
  8604. Vue.prototype._init = function (options) {
  8605. var vm = this;
  8606. // a uid
  8607. vm._uid = uid$3++;
  8608. var startTag, endTag;
  8609. /* istanbul ignore if */
  8610. if ( true && config.performance && mark) {
  8611. startTag = "vue-perf-start:" + (vm._uid);
  8612. endTag = "vue-perf-end:" + (vm._uid);
  8613. mark(startTag);
  8614. }
  8615. // a flag to avoid this being observed
  8616. vm._isVue = true;
  8617. // merge options
  8618. if (options && options._isComponent) {
  8619. // optimize internal component instantiation
  8620. // since dynamic options merging is pretty slow, and none of the
  8621. // internal component options needs special treatment.
  8622. initInternalComponent(vm, options);
  8623. } else {
  8624. vm.$options = mergeOptions(
  8625. resolveConstructorOptions(vm.constructor),
  8626. options || {},
  8627. vm
  8628. );
  8629. }
  8630. /* istanbul ignore else */
  8631. if (true) {
  8632. initProxy(vm);
  8633. } else {}
  8634. // expose real self
  8635. vm._self = vm;
  8636. initLifecycle(vm);
  8637. initEvents(vm);
  8638. initRender(vm);
  8639. callHook(vm, 'beforeCreate');
  8640. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  8641. initState(vm);
  8642. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  8643. !vm._$fallback && callHook(vm, 'created');
  8644. /* istanbul ignore if */
  8645. if ( true && config.performance && mark) {
  8646. vm._name = formatComponentName(vm, false);
  8647. mark(endTag);
  8648. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  8649. }
  8650. if (vm.$options.el) {
  8651. vm.$mount(vm.$options.el);
  8652. }
  8653. };
  8654. }
  8655. function initInternalComponent (vm, options) {
  8656. var opts = vm.$options = Object.create(vm.constructor.options);
  8657. // doing this because it's faster than dynamic enumeration.
  8658. var parentVnode = options._parentVnode;
  8659. opts.parent = options.parent;
  8660. opts._parentVnode = parentVnode;
  8661. var vnodeComponentOptions = parentVnode.componentOptions;
  8662. opts.propsData = vnodeComponentOptions.propsData;
  8663. opts._parentListeners = vnodeComponentOptions.listeners;
  8664. opts._renderChildren = vnodeComponentOptions.children;
  8665. opts._componentTag = vnodeComponentOptions.tag;
  8666. if (options.render) {
  8667. opts.render = options.render;
  8668. opts.staticRenderFns = options.staticRenderFns;
  8669. }
  8670. }
  8671. function resolveConstructorOptions (Ctor) {
  8672. var options = Ctor.options;
  8673. if (Ctor.super) {
  8674. var superOptions = resolveConstructorOptions(Ctor.super);
  8675. var cachedSuperOptions = Ctor.superOptions;
  8676. if (superOptions !== cachedSuperOptions) {
  8677. // super option changed,
  8678. // need to resolve new options.
  8679. Ctor.superOptions = superOptions;
  8680. // check if there are any late-modified/attached options (#4976)
  8681. var modifiedOptions = resolveModifiedOptions(Ctor);
  8682. // update base extend options
  8683. if (modifiedOptions) {
  8684. extend(Ctor.extendOptions, modifiedOptions);
  8685. }
  8686. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  8687. if (options.name) {
  8688. options.components[options.name] = Ctor;
  8689. }
  8690. }
  8691. }
  8692. return options
  8693. }
  8694. function resolveModifiedOptions (Ctor) {
  8695. var modified;
  8696. var latest = Ctor.options;
  8697. var sealed = Ctor.sealedOptions;
  8698. for (var key in latest) {
  8699. if (latest[key] !== sealed[key]) {
  8700. if (!modified) { modified = {}; }
  8701. modified[key] = latest[key];
  8702. }
  8703. }
  8704. return modified
  8705. }
  8706. function Vue (options) {
  8707. if ( true &&
  8708. !(this instanceof Vue)
  8709. ) {
  8710. warn('Vue is a constructor and should be called with the `new` keyword');
  8711. }
  8712. this._init(options);
  8713. }
  8714. initMixin(Vue);
  8715. stateMixin(Vue);
  8716. eventsMixin(Vue);
  8717. lifecycleMixin(Vue);
  8718. renderMixin(Vue);
  8719. /* */
  8720. function initUse (Vue) {
  8721. Vue.use = function (plugin) {
  8722. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  8723. if (installedPlugins.indexOf(plugin) > -1) {
  8724. return this
  8725. }
  8726. // additional parameters
  8727. var args = toArray(arguments, 1);
  8728. args.unshift(this);
  8729. if (typeof plugin.install === 'function') {
  8730. plugin.install.apply(plugin, args);
  8731. } else if (typeof plugin === 'function') {
  8732. plugin.apply(null, args);
  8733. }
  8734. installedPlugins.push(plugin);
  8735. return this
  8736. };
  8737. }
  8738. /* */
  8739. function initMixin$1 (Vue) {
  8740. Vue.mixin = function (mixin) {
  8741. this.options = mergeOptions(this.options, mixin);
  8742. return this
  8743. };
  8744. }
  8745. /* */
  8746. function initExtend (Vue) {
  8747. /**
  8748. * Each instance constructor, including Vue, has a unique
  8749. * cid. This enables us to create wrapped "child
  8750. * constructors" for prototypal inheritance and cache them.
  8751. */
  8752. Vue.cid = 0;
  8753. var cid = 1;
  8754. /**
  8755. * Class inheritance
  8756. */
  8757. Vue.extend = function (extendOptions) {
  8758. extendOptions = extendOptions || {};
  8759. var Super = this;
  8760. var SuperId = Super.cid;
  8761. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  8762. if (cachedCtors[SuperId]) {
  8763. return cachedCtors[SuperId]
  8764. }
  8765. var name = extendOptions.name || Super.options.name;
  8766. if ( true && name) {
  8767. validateComponentName(name);
  8768. }
  8769. var Sub = function VueComponent (options) {
  8770. this._init(options);
  8771. };
  8772. Sub.prototype = Object.create(Super.prototype);
  8773. Sub.prototype.constructor = Sub;
  8774. Sub.cid = cid++;
  8775. Sub.options = mergeOptions(
  8776. Super.options,
  8777. extendOptions
  8778. );
  8779. Sub['super'] = Super;
  8780. // For props and computed properties, we define the proxy getters on
  8781. // the Vue instances at extension time, on the extended prototype. This
  8782. // avoids Object.defineProperty calls for each instance created.
  8783. if (Sub.options.props) {
  8784. initProps$1(Sub);
  8785. }
  8786. if (Sub.options.computed) {
  8787. initComputed$1(Sub);
  8788. }
  8789. // allow further extension/mixin/plugin usage
  8790. Sub.extend = Super.extend;
  8791. Sub.mixin = Super.mixin;
  8792. Sub.use = Super.use;
  8793. // create asset registers, so extended classes
  8794. // can have their private assets too.
  8795. ASSET_TYPES.forEach(function (type) {
  8796. Sub[type] = Super[type];
  8797. });
  8798. // enable recursive self-lookup
  8799. if (name) {
  8800. Sub.options.components[name] = Sub;
  8801. }
  8802. // keep a reference to the super options at extension time.
  8803. // later at instantiation we can check if Super's options have
  8804. // been updated.
  8805. Sub.superOptions = Super.options;
  8806. Sub.extendOptions = extendOptions;
  8807. Sub.sealedOptions = extend({}, Sub.options);
  8808. // cache constructor
  8809. cachedCtors[SuperId] = Sub;
  8810. return Sub
  8811. };
  8812. }
  8813. function initProps$1 (Comp) {
  8814. var props = Comp.options.props;
  8815. for (var key in props) {
  8816. proxy(Comp.prototype, "_props", key);
  8817. }
  8818. }
  8819. function initComputed$1 (Comp) {
  8820. var computed = Comp.options.computed;
  8821. for (var key in computed) {
  8822. defineComputed(Comp.prototype, key, computed[key]);
  8823. }
  8824. }
  8825. /* */
  8826. function initAssetRegisters (Vue) {
  8827. /**
  8828. * Create asset registration methods.
  8829. */
  8830. ASSET_TYPES.forEach(function (type) {
  8831. Vue[type] = function (
  8832. id,
  8833. definition
  8834. ) {
  8835. if (!definition) {
  8836. return this.options[type + 's'][id]
  8837. } else {
  8838. /* istanbul ignore if */
  8839. if ( true && type === 'component') {
  8840. validateComponentName(id);
  8841. }
  8842. if (type === 'component' && isPlainObject(definition)) {
  8843. definition.name = definition.name || id;
  8844. definition = this.options._base.extend(definition);
  8845. }
  8846. if (type === 'directive' && typeof definition === 'function') {
  8847. definition = { bind: definition, update: definition };
  8848. }
  8849. this.options[type + 's'][id] = definition;
  8850. return definition
  8851. }
  8852. };
  8853. });
  8854. }
  8855. /* */
  8856. function getComponentName (opts) {
  8857. return opts && (opts.Ctor.options.name || opts.tag)
  8858. }
  8859. function matches (pattern, name) {
  8860. if (Array.isArray(pattern)) {
  8861. return pattern.indexOf(name) > -1
  8862. } else if (typeof pattern === 'string') {
  8863. return pattern.split(',').indexOf(name) > -1
  8864. } else if (isRegExp(pattern)) {
  8865. return pattern.test(name)
  8866. }
  8867. /* istanbul ignore next */
  8868. return false
  8869. }
  8870. function pruneCache (keepAliveInstance, filter) {
  8871. var cache = keepAliveInstance.cache;
  8872. var keys = keepAliveInstance.keys;
  8873. var _vnode = keepAliveInstance._vnode;
  8874. for (var key in cache) {
  8875. var cachedNode = cache[key];
  8876. if (cachedNode) {
  8877. var name = getComponentName(cachedNode.componentOptions);
  8878. if (name && !filter(name)) {
  8879. pruneCacheEntry(cache, key, keys, _vnode);
  8880. }
  8881. }
  8882. }
  8883. }
  8884. function pruneCacheEntry (
  8885. cache,
  8886. key,
  8887. keys,
  8888. current
  8889. ) {
  8890. var cached$$1 = cache[key];
  8891. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8892. cached$$1.componentInstance.$destroy();
  8893. }
  8894. cache[key] = null;
  8895. remove(keys, key);
  8896. }
  8897. var patternTypes = [String, RegExp, Array];
  8898. var KeepAlive = {
  8899. name: 'keep-alive',
  8900. abstract: true,
  8901. props: {
  8902. include: patternTypes,
  8903. exclude: patternTypes,
  8904. max: [String, Number]
  8905. },
  8906. created: function created () {
  8907. this.cache = Object.create(null);
  8908. this.keys = [];
  8909. },
  8910. destroyed: function destroyed () {
  8911. for (var key in this.cache) {
  8912. pruneCacheEntry(this.cache, key, this.keys);
  8913. }
  8914. },
  8915. mounted: function mounted () {
  8916. var this$1 = this;
  8917. this.$watch('include', function (val) {
  8918. pruneCache(this$1, function (name) { return matches(val, name); });
  8919. });
  8920. this.$watch('exclude', function (val) {
  8921. pruneCache(this$1, function (name) { return !matches(val, name); });
  8922. });
  8923. },
  8924. render: function render () {
  8925. var slot = this.$slots.default;
  8926. var vnode = getFirstComponentChild(slot);
  8927. var componentOptions = vnode && vnode.componentOptions;
  8928. if (componentOptions) {
  8929. // check pattern
  8930. var name = getComponentName(componentOptions);
  8931. var ref = this;
  8932. var include = ref.include;
  8933. var exclude = ref.exclude;
  8934. if (
  8935. // not included
  8936. (include && (!name || !matches(include, name))) ||
  8937. // excluded
  8938. (exclude && name && matches(exclude, name))
  8939. ) {
  8940. return vnode
  8941. }
  8942. var ref$1 = this;
  8943. var cache = ref$1.cache;
  8944. var keys = ref$1.keys;
  8945. var key = vnode.key == null
  8946. // same constructor may get registered as different local components
  8947. // so cid alone is not enough (#3269)
  8948. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8949. : vnode.key;
  8950. if (cache[key]) {
  8951. vnode.componentInstance = cache[key].componentInstance;
  8952. // make current key freshest
  8953. remove(keys, key);
  8954. keys.push(key);
  8955. } else {
  8956. cache[key] = vnode;
  8957. keys.push(key);
  8958. // prune oldest entry
  8959. if (this.max && keys.length > parseInt(this.max)) {
  8960. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8961. }
  8962. }
  8963. vnode.data.keepAlive = true;
  8964. }
  8965. return vnode || (slot && slot[0])
  8966. }
  8967. };
  8968. var builtInComponents = {
  8969. KeepAlive: KeepAlive
  8970. };
  8971. /* */
  8972. function initGlobalAPI (Vue) {
  8973. // config
  8974. var configDef = {};
  8975. configDef.get = function () { return config; };
  8976. if (true) {
  8977. configDef.set = function () {
  8978. warn(
  8979. 'Do not replace the Vue.config object, set individual fields instead.'
  8980. );
  8981. };
  8982. }
  8983. Object.defineProperty(Vue, 'config', configDef);
  8984. // exposed util methods.
  8985. // NOTE: these are not considered part of the public API - avoid relying on
  8986. // them unless you are aware of the risk.
  8987. Vue.util = {
  8988. warn: warn,
  8989. extend: extend,
  8990. mergeOptions: mergeOptions,
  8991. defineReactive: defineReactive$$1
  8992. };
  8993. Vue.set = set;
  8994. Vue.delete = del;
  8995. Vue.nextTick = nextTick;
  8996. // 2.6 explicit observable API
  8997. Vue.observable = function (obj) {
  8998. observe(obj);
  8999. return obj
  9000. };
  9001. Vue.options = Object.create(null);
  9002. ASSET_TYPES.forEach(function (type) {
  9003. Vue.options[type + 's'] = Object.create(null);
  9004. });
  9005. // this is used to identify the "base" constructor to extend all plain-object
  9006. // components with in Weex's multi-instance scenarios.
  9007. Vue.options._base = Vue;
  9008. extend(Vue.options.components, builtInComponents);
  9009. initUse(Vue);
  9010. initMixin$1(Vue);
  9011. initExtend(Vue);
  9012. initAssetRegisters(Vue);
  9013. }
  9014. initGlobalAPI(Vue);
  9015. Object.defineProperty(Vue.prototype, '$isServer', {
  9016. get: isServerRendering
  9017. });
  9018. Object.defineProperty(Vue.prototype, '$ssrContext', {
  9019. get: function get () {
  9020. /* istanbul ignore next */
  9021. return this.$vnode && this.$vnode.ssrContext
  9022. }
  9023. });
  9024. // expose FunctionalRenderContext for ssr runtime helper installation
  9025. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  9026. value: FunctionalRenderContext
  9027. });
  9028. Vue.version = '2.6.11';
  9029. /**
  9030. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  9031. */
  9032. var ARRAYTYPE = '[object Array]';
  9033. var OBJECTTYPE = '[object Object]';
  9034. var NULLTYPE = '[object Null]';
  9035. var UNDEFINEDTYPE = '[object Undefined]';
  9036. // const FUNCTIONTYPE = '[object Function]'
  9037. function diff(current, pre) {
  9038. var result = {};
  9039. syncKeys(current, pre);
  9040. _diff(current, pre, '', result);
  9041. return result
  9042. }
  9043. function syncKeys(current, pre) {
  9044. if (current === pre) { return }
  9045. var rootCurrentType = type(current);
  9046. var rootPreType = type(pre);
  9047. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  9048. if(Object.keys(current).length >= Object.keys(pre).length){
  9049. for (var key in pre) {
  9050. var currentValue = current[key];
  9051. if (currentValue === undefined) {
  9052. current[key] = null;
  9053. } else {
  9054. syncKeys(currentValue, pre[key]);
  9055. }
  9056. }
  9057. }
  9058. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  9059. if (current.length >= pre.length) {
  9060. pre.forEach(function (item, index) {
  9061. syncKeys(current[index], item);
  9062. });
  9063. }
  9064. }
  9065. }
  9066. function nullOrUndefined(currentType, preType) {
  9067. if(
  9068. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  9069. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  9070. ) {
  9071. return false
  9072. }
  9073. return true
  9074. }
  9075. function _diff(current, pre, path, result) {
  9076. if (current === pre) { return }
  9077. var rootCurrentType = type(current);
  9078. var rootPreType = type(pre);
  9079. if (rootCurrentType == OBJECTTYPE) {
  9080. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  9081. setResult(result, path, current);
  9082. } else {
  9083. var loop = function ( key ) {
  9084. var currentValue = current[key];
  9085. var preValue = pre[key];
  9086. var currentType = type(currentValue);
  9087. var preType = type(preValue);
  9088. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  9089. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  9090. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9091. }
  9092. } else if (currentType == ARRAYTYPE) {
  9093. if (preType != ARRAYTYPE) {
  9094. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9095. } else {
  9096. if (currentValue.length < preValue.length) {
  9097. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9098. } else {
  9099. currentValue.forEach(function (item, index) {
  9100. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  9101. });
  9102. }
  9103. }
  9104. } else if (currentType == OBJECTTYPE) {
  9105. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  9106. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9107. } else {
  9108. for (var subKey in currentValue) {
  9109. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  9110. }
  9111. }
  9112. }
  9113. };
  9114. for (var key in current) loop( key );
  9115. }
  9116. } else if (rootCurrentType == ARRAYTYPE) {
  9117. if (rootPreType != ARRAYTYPE) {
  9118. setResult(result, path, current);
  9119. } else {
  9120. if (current.length < pre.length) {
  9121. setResult(result, path, current);
  9122. } else {
  9123. current.forEach(function (item, index) {
  9124. _diff(item, pre[index], path + '[' + index + ']', result);
  9125. });
  9126. }
  9127. }
  9128. } else {
  9129. setResult(result, path, current);
  9130. }
  9131. }
  9132. function setResult(result, k, v) {
  9133. // if (type(v) != FUNCTIONTYPE) {
  9134. result[k] = v;
  9135. // }
  9136. }
  9137. function type(obj) {
  9138. return Object.prototype.toString.call(obj)
  9139. }
  9140. /* */
  9141. function flushCallbacks$1(vm) {
  9142. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  9143. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  9144. var mpInstance = vm.$scope;
  9145. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  9146. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  9147. }
  9148. var copies = vm.__next_tick_callbacks.slice(0);
  9149. vm.__next_tick_callbacks.length = 0;
  9150. for (var i = 0; i < copies.length; i++) {
  9151. copies[i]();
  9152. }
  9153. }
  9154. }
  9155. function hasRenderWatcher(vm) {
  9156. return queue.find(function (watcher) { return vm._watcher === watcher; })
  9157. }
  9158. function nextTick$1(vm, cb) {
  9159. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  9160. //2.nextTick 之前存在 render watcher
  9161. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  9162. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  9163. var mpInstance = vm.$scope;
  9164. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  9165. ']:nextVueTick');
  9166. }
  9167. return nextTick(cb, vm)
  9168. }else{
  9169. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  9170. var mpInstance$1 = vm.$scope;
  9171. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  9172. ']:nextMPTick');
  9173. }
  9174. }
  9175. var _resolve;
  9176. if (!vm.__next_tick_callbacks) {
  9177. vm.__next_tick_callbacks = [];
  9178. }
  9179. vm.__next_tick_callbacks.push(function () {
  9180. if (cb) {
  9181. try {
  9182. cb.call(vm);
  9183. } catch (e) {
  9184. handleError(e, vm, 'nextTick');
  9185. }
  9186. } else if (_resolve) {
  9187. _resolve(vm);
  9188. }
  9189. });
  9190. // $flow-disable-line
  9191. if (!cb && typeof Promise !== 'undefined') {
  9192. return new Promise(function (resolve) {
  9193. _resolve = resolve;
  9194. })
  9195. }
  9196. }
  9197. /* */
  9198. function clearInstance(key, value) {
  9199. // 简易去除 Vue 和小程序组件实例
  9200. if (value) {
  9201. if (value._isVue || value.__v_isMPComponent) {
  9202. return {}
  9203. }
  9204. }
  9205. return value
  9206. }
  9207. function cloneWithData(vm) {
  9208. // 确保当前 vm 所有数据被同步
  9209. var ret = Object.create(null);
  9210. var dataKeys = [].concat(
  9211. Object.keys(vm._data || {}),
  9212. Object.keys(vm._computedWatchers || {}));
  9213. dataKeys.reduce(function(ret, key) {
  9214. ret[key] = vm[key];
  9215. return ret
  9216. }, ret);
  9217. // vue-composition-api
  9218. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  9219. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  9220. if (rawBindings) {
  9221. Object.keys(rawBindings).forEach(function (key) {
  9222. ret[key] = vm[key];
  9223. });
  9224. }
  9225. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  9226. Object.assign(ret, vm.$mp.data || {});
  9227. if (
  9228. Array.isArray(vm.$options.behaviors) &&
  9229. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  9230. ) { //form-field
  9231. ret['name'] = vm.name;
  9232. ret['value'] = vm.value;
  9233. }
  9234. return JSON.parse(JSON.stringify(ret, clearInstance))
  9235. }
  9236. var patch = function(oldVnode, vnode) {
  9237. var this$1 = this;
  9238. if (vnode === null) { //destroy
  9239. return
  9240. }
  9241. if (this.mpType === 'page' || this.mpType === 'component') {
  9242. var mpInstance = this.$scope;
  9243. var data = Object.create(null);
  9244. try {
  9245. data = cloneWithData(this);
  9246. } catch (err) {
  9247. console.error(err);
  9248. }
  9249. data.__webviewId__ = mpInstance.data.__webviewId__;
  9250. var mpData = Object.create(null);
  9251. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  9252. mpData[key] = mpInstance.data[key];
  9253. });
  9254. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  9255. if (Object.keys(diffData).length) {
  9256. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  9257. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  9258. ']差量更新',
  9259. JSON.stringify(diffData));
  9260. }
  9261. this.__next_tick_pending = true;
  9262. mpInstance.setData(diffData, function () {
  9263. this$1.__next_tick_pending = false;
  9264. flushCallbacks$1(this$1);
  9265. });
  9266. } else {
  9267. flushCallbacks$1(this);
  9268. }
  9269. }
  9270. };
  9271. /* */
  9272. function createEmptyRender() {
  9273. }
  9274. function mountComponent$1(
  9275. vm,
  9276. el,
  9277. hydrating
  9278. ) {
  9279. if (!vm.mpType) {//main.js 中的 new Vue
  9280. return vm
  9281. }
  9282. if (vm.mpType === 'app') {
  9283. vm.$options.render = createEmptyRender;
  9284. }
  9285. if (!vm.$options.render) {
  9286. vm.$options.render = createEmptyRender;
  9287. if (true) {
  9288. /* istanbul ignore if */
  9289. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  9290. vm.$options.el || el) {
  9291. warn(
  9292. 'You are using the runtime-only build of Vue where the template ' +
  9293. 'compiler is not available. Either pre-compile the templates into ' +
  9294. 'render functions, or use the compiler-included build.',
  9295. vm
  9296. );
  9297. } else {
  9298. warn(
  9299. 'Failed to mount component: template or render function not defined.',
  9300. vm
  9301. );
  9302. }
  9303. }
  9304. }
  9305. !vm._$fallback && callHook(vm, 'beforeMount');
  9306. var updateComponent = function () {
  9307. vm._update(vm._render(), hydrating);
  9308. };
  9309. // we set this to vm._watcher inside the watcher's constructor
  9310. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  9311. // component's mounted hook), which relies on vm._watcher being already defined
  9312. new Watcher(vm, updateComponent, noop, {
  9313. before: function before() {
  9314. if (vm._isMounted && !vm._isDestroyed) {
  9315. callHook(vm, 'beforeUpdate');
  9316. }
  9317. }
  9318. }, true /* isRenderWatcher */);
  9319. hydrating = false;
  9320. return vm
  9321. }
  9322. /* */
  9323. function renderClass (
  9324. staticClass,
  9325. dynamicClass
  9326. ) {
  9327. if (isDef(staticClass) || isDef(dynamicClass)) {
  9328. return concat(staticClass, stringifyClass(dynamicClass))
  9329. }
  9330. /* istanbul ignore next */
  9331. return ''
  9332. }
  9333. function concat (a, b) {
  9334. return a ? b ? (a + ' ' + b) : a : (b || '')
  9335. }
  9336. function stringifyClass (value) {
  9337. if (Array.isArray(value)) {
  9338. return stringifyArray(value)
  9339. }
  9340. if (isObject(value)) {
  9341. return stringifyObject(value)
  9342. }
  9343. if (typeof value === 'string') {
  9344. return value
  9345. }
  9346. /* istanbul ignore next */
  9347. return ''
  9348. }
  9349. function stringifyArray (value) {
  9350. var res = '';
  9351. var stringified;
  9352. for (var i = 0, l = value.length; i < l; i++) {
  9353. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  9354. if (res) { res += ' '; }
  9355. res += stringified;
  9356. }
  9357. }
  9358. return res
  9359. }
  9360. function stringifyObject (value) {
  9361. var res = '';
  9362. for (var key in value) {
  9363. if (value[key]) {
  9364. if (res) { res += ' '; }
  9365. res += key;
  9366. }
  9367. }
  9368. return res
  9369. }
  9370. /* */
  9371. var parseStyleText = cached(function (cssText) {
  9372. var res = {};
  9373. var listDelimiter = /;(?![^(]*\))/g;
  9374. var propertyDelimiter = /:(.+)/;
  9375. cssText.split(listDelimiter).forEach(function (item) {
  9376. if (item) {
  9377. var tmp = item.split(propertyDelimiter);
  9378. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  9379. }
  9380. });
  9381. return res
  9382. });
  9383. // normalize possible array / string values into Object
  9384. function normalizeStyleBinding (bindingStyle) {
  9385. if (Array.isArray(bindingStyle)) {
  9386. return toObject(bindingStyle)
  9387. }
  9388. if (typeof bindingStyle === 'string') {
  9389. return parseStyleText(bindingStyle)
  9390. }
  9391. return bindingStyle
  9392. }
  9393. /* */
  9394. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  9395. function getTarget(obj, path) {
  9396. var parts = path.split('.');
  9397. var key = parts[0];
  9398. if (key.indexOf('__$n') === 0) { //number index
  9399. key = parseInt(key.replace('__$n', ''));
  9400. }
  9401. if (parts.length === 1) {
  9402. return obj[key]
  9403. }
  9404. return getTarget(obj[key], parts.slice(1).join('.'))
  9405. }
  9406. function internalMixin(Vue) {
  9407. Vue.config.errorHandler = function(err, vm, info) {
  9408. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  9409. console.error(err);
  9410. /* eslint-disable no-undef */
  9411. var app = typeof getApp === 'function' && getApp();
  9412. if (app && app.onError) {
  9413. app.onError(err);
  9414. }
  9415. };
  9416. var oldEmit = Vue.prototype.$emit;
  9417. Vue.prototype.$emit = function(event) {
  9418. if (this.$scope && event) {
  9419. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  9420. if (triggerEvent) {
  9421. try {
  9422. triggerEvent.call(this.$scope, event, {
  9423. __args__: toArray(arguments, 1)
  9424. });
  9425. } catch (error) {
  9426. }
  9427. }
  9428. }
  9429. return oldEmit.apply(this, arguments)
  9430. };
  9431. Vue.prototype.$nextTick = function(fn) {
  9432. return nextTick$1(this, fn)
  9433. };
  9434. MP_METHODS.forEach(function (method) {
  9435. Vue.prototype[method] = function(args) {
  9436. if (this.$scope && this.$scope[method]) {
  9437. return this.$scope[method](args)
  9438. }
  9439. // mp-alipay
  9440. if (typeof my === 'undefined') {
  9441. return
  9442. }
  9443. if (method === 'createSelectorQuery') {
  9444. /* eslint-disable no-undef */
  9445. return my.createSelectorQuery(args)
  9446. } else if (method === 'createIntersectionObserver') {
  9447. /* eslint-disable no-undef */
  9448. return my.createIntersectionObserver(args)
  9449. }
  9450. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  9451. };
  9452. });
  9453. Vue.prototype.__init_provide = initProvide;
  9454. Vue.prototype.__init_injections = initInjections;
  9455. Vue.prototype.__call_hook = function(hook, args) {
  9456. var vm = this;
  9457. // #7573 disable dep collection when invoking lifecycle hooks
  9458. pushTarget();
  9459. var handlers = vm.$options[hook];
  9460. var info = hook + " hook";
  9461. var ret;
  9462. if (handlers) {
  9463. for (var i = 0, j = handlers.length; i < j; i++) {
  9464. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  9465. }
  9466. }
  9467. if (vm._hasHookEvent) {
  9468. vm.$emit('hook:' + hook, args);
  9469. }
  9470. popTarget();
  9471. return ret
  9472. };
  9473. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  9474. if (Array.isArray(modifiers)) {
  9475. if (modifiers.indexOf('trim') !== -1) {
  9476. value = value.trim();
  9477. }
  9478. if (modifiers.indexOf('number') !== -1) {
  9479. value = this._n(value);
  9480. }
  9481. }
  9482. if (!target) {
  9483. target = this;
  9484. }
  9485. // 解决动态属性添加
  9486. Vue.set(target, key, value);
  9487. };
  9488. Vue.prototype.__set_sync = function(target, key, value) {
  9489. if (!target) {
  9490. target = this;
  9491. }
  9492. // 解决动态属性添加
  9493. Vue.set(target, key, value);
  9494. };
  9495. Vue.prototype.__get_orig = function(item) {
  9496. if (isPlainObject(item)) {
  9497. return item['$orig'] || item
  9498. }
  9499. return item
  9500. };
  9501. Vue.prototype.__get_value = function(dataPath, target) {
  9502. return getTarget(target || this, dataPath)
  9503. };
  9504. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  9505. return renderClass(staticClass, dynamicClass)
  9506. };
  9507. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  9508. if (!dynamicStyle && !staticStyle) {
  9509. return ''
  9510. }
  9511. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  9512. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  9513. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  9514. };
  9515. Vue.prototype.__map = function(val, iteratee) {
  9516. //TODO 暂不考虑 string
  9517. var ret, i, l, keys, key;
  9518. if (Array.isArray(val)) {
  9519. ret = new Array(val.length);
  9520. for (i = 0, l = val.length; i < l; i++) {
  9521. ret[i] = iteratee(val[i], i);
  9522. }
  9523. return ret
  9524. } else if (isObject(val)) {
  9525. keys = Object.keys(val);
  9526. ret = Object.create(null);
  9527. for (i = 0, l = keys.length; i < l; i++) {
  9528. key = keys[i];
  9529. ret[key] = iteratee(val[key], key, i);
  9530. }
  9531. return ret
  9532. } else if (typeof val === 'number') {
  9533. ret = new Array(val);
  9534. for (i = 0, l = val; i < l; i++) {
  9535. // 第一个参数暂时仍和小程序一致
  9536. ret[i] = iteratee(i, i);
  9537. }
  9538. return ret
  9539. }
  9540. return []
  9541. };
  9542. }
  9543. /* */
  9544. var LIFECYCLE_HOOKS$1 = [
  9545. //App
  9546. 'onLaunch',
  9547. 'onShow',
  9548. 'onHide',
  9549. 'onUniNViewMessage',
  9550. 'onPageNotFound',
  9551. 'onThemeChange',
  9552. 'onError',
  9553. 'onUnhandledRejection',
  9554. //Page
  9555. 'onInit',
  9556. 'onLoad',
  9557. // 'onShow',
  9558. 'onReady',
  9559. // 'onHide',
  9560. 'onUnload',
  9561. 'onPullDownRefresh',
  9562. 'onReachBottom',
  9563. 'onTabItemTap',
  9564. 'onAddToFavorites',
  9565. 'onShareTimeline',
  9566. 'onShareAppMessage',
  9567. 'onResize',
  9568. 'onPageScroll',
  9569. 'onNavigationBarButtonTap',
  9570. 'onBackPress',
  9571. 'onNavigationBarSearchInputChanged',
  9572. 'onNavigationBarSearchInputConfirmed',
  9573. 'onNavigationBarSearchInputClicked',
  9574. //Component
  9575. // 'onReady', // 兼容旧版本,应该移除该事件
  9576. 'onPageShow',
  9577. 'onPageHide',
  9578. 'onPageResize',
  9579. 'onUploadDouyinVideo'
  9580. ];
  9581. function lifecycleMixin$1(Vue) {
  9582. //fixed vue-class-component
  9583. var oldExtend = Vue.extend;
  9584. Vue.extend = function(extendOptions) {
  9585. extendOptions = extendOptions || {};
  9586. var methods = extendOptions.methods;
  9587. if (methods) {
  9588. Object.keys(methods).forEach(function (methodName) {
  9589. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  9590. extendOptions[methodName] = methods[methodName];
  9591. delete methods[methodName];
  9592. }
  9593. });
  9594. }
  9595. return oldExtend.call(this, extendOptions)
  9596. };
  9597. var strategies = Vue.config.optionMergeStrategies;
  9598. var mergeHook = strategies.created;
  9599. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  9600. strategies[hook] = mergeHook;
  9601. });
  9602. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  9603. }
  9604. /* */
  9605. // install platform patch function
  9606. Vue.prototype.__patch__ = patch;
  9607. // public mount method
  9608. Vue.prototype.$mount = function(
  9609. el ,
  9610. hydrating
  9611. ) {
  9612. return mountComponent$1(this, el, hydrating)
  9613. };
  9614. lifecycleMixin$1(Vue);
  9615. internalMixin(Vue);
  9616. /* */
  9617. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  9618. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  9619. /***/ }),
  9620. /***/ 26:
  9621. /*!********************************!*\
  9622. !*** E:/work/mdapp/pages.json ***!
  9623. \********************************/
  9624. /*! no static exports found */
  9625. /***/ (function(module, exports) {
  9626. /***/ }),
  9627. /***/ 296:
  9628. /*!**************************************************!*\
  9629. !*** E:/work/mdapp/pages/estate/img/i_house.png ***!
  9630. \**************************************************/
  9631. /*! no static exports found */
  9632. /***/ (function(module, exports) {
  9633. module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAADqklEQVR4Xu1b71XbMBDXWQOUDQoTNH4+8xWYoGUDmKCwQTsBMEHTCcoGha9EfqYTlE7QZID4+o7KeY5t2VaebJxE/kZ8Pt39dLp/OkDs+QN7rr/wAHgL2HME/BHYcwOwc4JPT0+TIAhOAOCgb+CIaJ5l2ePx8fFzn2t1PgKz2ewGAK76FKaONxHdxnF83de6nQBIkuSKiG76EqKNLwBcR1F020a3yftOACilUiHEZJMFHH3zjIihI15rbLoCQH0sbsMTETvJasOTaTsxVUp5AJqQBYDHLMu+5DRBEEyafAYRfRVCPOT02rl+bFpjzBawkFIehmE4LyqglGKn9blGqe+IeFH+XSn1IoR4bwJhtADw7kdRdFoWfDabnQLAz/LvvPtxHK+sJX+fJMkDEZ14AAwIjNYChBAviHhUltuUO+ycBWjFrxDxLgchTdPD5XLJ5n9Ys6Gc4p4VU9wkSS6I6FtLCJsi4qVtmGuj35ow2KaIjir3xY3o8M325AFdlNE0VpaySxawwoiIzuI4XuUZjTlMF2THkAl2kTOnMTnaOh47aQGm3KRvABYA8ExE3Cz50GHHfgHAnIg4UhgzwA58KiSDAwAAl1EUTUthkM9gnWKcOk/CMOTU9/VRSn0SQvzYRNnaXTVkp31ZwB9ErMR714mQDTiDWsBQtYAHwAKBQS1ACDGXUh45KId/G1JnC9X/kw4NAK/Jpewtt7L5DynlKRFVSt5CnGbaey3sAQBwf4AdoZPnLQBwIrgrJh6AgcOgq41zxsdbgLeA+j5lX5kg810IIaZ5FAiCgKOAscGp2+jFtjhHAWf1wOBHQOcBq9xe5/cc5iq9/jrh0jQ9WC6X/P07F45gUABMi5kKnE2bojbAjAIA1/cCowVACFF7c2vq9O6cBfDOZFkWlic5lFLcFq/cGDFgUsqzYu2gJ0+Y3snkyaBHQJsm1wDFURbuD9TdCeSWzA6v6DR59sCk/ILrjOJlqq4huHbg6FFxnG8BgM0RtaJt6vCami47BUDTnaDJ0XoAdikV9hbQMBvkj4BhCMP7AO8Dhi+HrWK7DfGbO0Fdqv61EdolbV2pnfM3VZzOfIBWnmeEK2NtLpVs4fUgpTwv3zvoMRy+TzSN8J4j4mvrvelZXY/rgoSVrStg2vhsw3u+iZ6WJ89XACilajs426CZpYxrluEByNHjIyCl5CsrYzPTEumxkb82bhFx7Z8+Oo3IjE0Tl/J4AFyiuY28vAVs4665lHnvLeAf8XaCXwWtufUAAAAASUVORK5CYII="
  9634. /***/ }),
  9635. /***/ 297:
  9636. /*!************************************************!*\
  9637. !*** E:/work/mdapp/pages/estate/img/i_pos.png ***!
  9638. \************************************************/
  9639. /*! no static exports found */
  9640. /***/ (function(module, exports) {
  9641. module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAHDklEQVR4Xs1bfYhVRRQ/565uGSomWX8kFQlhmq28ObOsq0mitiFhYiSVUFFa4T+aEIaE2hdKkUYQfWBlJaWpRQlZoSmEtrt37t21WrOMRJCiDJfUlF323ROjd2Vddt+dmTvv7Q68v+45v3POb2bOfJx5CBVoR48evby9vf1GZta/cQAwPv31tn4EAL4MgmB/oVA4UQHXAMtpJI7jWUmS3AMA+jfGxhYz7waA/Yi4hYgO2+jayHonoKWlZVSxWFyUBl1n40w/skUA2MrMW6WUX3jAuwTCKwFKqXkAsBoAJvt2VOMhYlgsFlfV1tZ+5QvfCwG615MkWc3My3w5loGzkojW+rCVmwClVAEA3ilXr5cIcjszr5BS/p6HiFwExHE8PUmSDwHgujxO5NBtC4JgQaFQOOSK4UxAGIZzgiDYzMxXuhr3pJeLBCcCdLJj5u2IWOUpiLwwziRYE5Auc3sHYM5nkdQybNiw6RMnTjyTJdjzuzUBURRtqGC2t4lFy64lopU2SlYEpOv8ZzYGKi2LiNOFEN+Z2rUiIIqikJnJFHwg5BBxlxBijqltYwLCMHwQEd83BS4htw0AtgVB0NbZ2Xlcy1VXV49NkmQiANyb/vKaeZiIjHw1JkAppRPf7Tk8WwcAHxHRj6UwmpqaplRVVT2Zhwhm3imlnGviqxEBURTNZ+YdJoD9yCwgIt3zxi0MwzWIqM8VTi0IgsmFQuFglrIRAUqpnQBwVxaYr+C7ccIwnI2I3zjafZ6IVmXpZhLAzFVxHJ9w3PFZ93xvh5VS+tDzdFYgvb8j4iEhhM4rJVsmAXEcT0mS5EAWUO/vzLxBSrncVq+3fBzHY5Ik+R4A9E2SVWPmOVLKXaWUMglQSi0FgFetLAOcHjp06ISamprzWT5vU0otAYDXHXAyN0aZBERRpA88Cy2N7yOiGZY6/Yq3trZe29XV5ULmB0T0UK4REIbhAUScYhMMMz8rpVxjo5MlG0XRQWa+NUuu53dm3iOlnJWLAKWUXrdvsTS8SEqpL0m8NaXUJw57g8NEdHNeAo7ZXngg4p1CiK+9RQ8AYRiuR0S9QTJuzHxaSjkyFwFRFJ20XQKZeYaUcp+xpwaCjqfQf4io5HV8ZhIMw7DL9uKjHAQopfQpVN8627T9RDQt1whQSv0EAJkbil7Jx3sSVEr9ZrsXQMR3hRCP5iVgIwCUBOnDQBsRWSXOUk4qpXQp7Webrtey6a3xS3kJeAIA3rA1joiPCyHettXrS951OxwEwd2FQqFkNSkzBzQ3N9frYqVDIBER5b48SesOeit+ma0PzDxeSvlLrhGwd+/e4cOHDz+GiKNtHdAXH0S0wEHvoorLRqxbmYgyOzhTQIMppTYDgO12+LwfeXaFOe8EPiaiB7LINyIgiqKFzKxJcGqIuAkRXzat4Ohhz8xPIeJ9TgYvED9PSvl5lr4RAW1tbaPPnj17xHEadPtwSh+Ri8Xip3V1dT/0k+wmAYDuNb3js57zPTD/6+zsHFNfX3/OCwF5p0EfTuxj5uOIqE94IxFxbHrQuSHLYZPviPieEOIRI1kTIS2TdxqY2vEhx8z3Sym3mGAZTQEN5GkamPiUSwYR/+jo6JhUX19/0gTImAANFobhm3qDYwI8UDK2q44VAU1NTTVVVVXNupYxUAGWsqt7X1euiOhPU/+sCEiTob4f1PeEg67Z9r4OwJqA1tbWm7q6ukKdvQcTAy6970RAmgvWIeKKwUSAS+87E6CU0m+C9Ci4ejCQ4Nr7zgSkoyBX7c4nca69n4uANCHqut1sn8HYYjGzKhaLM+vq6k7Z6uYmoLGxsW7IkCF7AOAKF+OedBqIyLWAar8K9HY6juPlSZK84ikYW5jVRPScrVJPeetlsC9jURTtYOb5eRyx1WXmXVJK46cw/eF7ISCO4wlJknwLANfYBuIo387MM6WULY76F9W8EKDRoihazMxeLkENglpCRNYXtX3heiMgXRU2AUDJaqxBcFkimRXfLADvOaAbUCl1FQDot/zCxglTWWZura6ubqipqfnbVCdLzusISKfCbcysSfC9NOoSXYMQQucab807ASkJjzHzW968vAC0lIhe84yZfx/Qn0NhGG5ARF//INlIRIt9B6/xyjICeuQEPRUacjreSERWL1Rs7JWVgCiK9OuMXcx8vY1TPWTPdHR0jJs6daq3pNfbj7ISoI01NzfPD4LA6ZVpkiRza2tr9SPNsrWyE5AmxWW6KGITBSK+KIR4xkbHRbYiBKQkrGdmozc+iLhbCFGRY3bFCEhJ0H9103+jLdUy3/W49HR/OhUlQJfaR4wYoe8PaksEMYqI/vUZZCmsihKgHUmfu+gH0Jc8eGLmv4IguEMI0WfhtFyEVJyA7kB0rREAZjHzKET89dy5cy9MmzbtdLkC7Q/3fxMowF8w/lVXAAAAAElFTkSuQmCC"
  9642. /***/ }),
  9643. /***/ 3:
  9644. /*!***********************************!*\
  9645. !*** (webpack)/buildin/global.js ***!
  9646. \***********************************/
  9647. /*! no static exports found */
  9648. /***/ (function(module, exports) {
  9649. var g;
  9650. // This works in non-strict mode
  9651. g = (function() {
  9652. return this;
  9653. })();
  9654. try {
  9655. // This works if eval is allowed (see CSP)
  9656. g = g || new Function("return this")();
  9657. } catch (e) {
  9658. // This works if the window reference is available
  9659. if (typeof window === "object") g = window;
  9660. }
  9661. // g can still be undefined, but nothing to do about it...
  9662. // We return undefined, instead of nothing here, so it's
  9663. // easier to handle this case. if(!global) { ...}
  9664. module.exports = g;
  9665. /***/ }),
  9666. /***/ 32:
  9667. /*!**********************************************************************************************************!*\
  9668. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  9669. \**********************************************************************************************************/
  9670. /*! exports provided: default */
  9671. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9672. "use strict";
  9673. __webpack_require__.r(__webpack_exports__);
  9674. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  9675. /* globals __VUE_SSR_CONTEXT__ */
  9676. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  9677. // This module is a runtime utility for cleaner component module output and will
  9678. // be included in the final webpack user bundle.
  9679. function normalizeComponent (
  9680. scriptExports,
  9681. render,
  9682. staticRenderFns,
  9683. functionalTemplate,
  9684. injectStyles,
  9685. scopeId,
  9686. moduleIdentifier, /* server only */
  9687. shadowMode, /* vue-cli only */
  9688. components, // fixed by xxxxxx auto components
  9689. renderjs // fixed by xxxxxx renderjs
  9690. ) {
  9691. // Vue.extend constructor export interop
  9692. var options = typeof scriptExports === 'function'
  9693. ? scriptExports.options
  9694. : scriptExports
  9695. // fixed by xxxxxx auto components
  9696. if (components) {
  9697. if (!options.components) {
  9698. options.components = {}
  9699. }
  9700. var hasOwn = Object.prototype.hasOwnProperty
  9701. for (var name in components) {
  9702. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  9703. options.components[name] = components[name]
  9704. }
  9705. }
  9706. }
  9707. // fixed by xxxxxx renderjs
  9708. if (renderjs) {
  9709. if(typeof renderjs.beforeCreate === 'function'){
  9710. renderjs.beforeCreate = [renderjs.beforeCreate]
  9711. }
  9712. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  9713. this[renderjs.__module] = this
  9714. });
  9715. (options.mixins || (options.mixins = [])).push(renderjs)
  9716. }
  9717. // render functions
  9718. if (render) {
  9719. options.render = render
  9720. options.staticRenderFns = staticRenderFns
  9721. options._compiled = true
  9722. }
  9723. // functional template
  9724. if (functionalTemplate) {
  9725. options.functional = true
  9726. }
  9727. // scopedId
  9728. if (scopeId) {
  9729. options._scopeId = 'data-v-' + scopeId
  9730. }
  9731. var hook
  9732. if (moduleIdentifier) { // server build
  9733. hook = function (context) {
  9734. // 2.3 injection
  9735. context =
  9736. context || // cached call
  9737. (this.$vnode && this.$vnode.ssrContext) || // stateful
  9738. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  9739. // 2.2 with runInNewContext: true
  9740. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  9741. context = __VUE_SSR_CONTEXT__
  9742. }
  9743. // inject component styles
  9744. if (injectStyles) {
  9745. injectStyles.call(this, context)
  9746. }
  9747. // register component module identifier for async chunk inferrence
  9748. if (context && context._registeredComponents) {
  9749. context._registeredComponents.add(moduleIdentifier)
  9750. }
  9751. }
  9752. // used by ssr in case component is cached and beforeCreate
  9753. // never gets called
  9754. options._ssrRegister = hook
  9755. } else if (injectStyles) {
  9756. hook = shadowMode
  9757. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  9758. : injectStyles
  9759. }
  9760. if (hook) {
  9761. if (options.functional) {
  9762. // for template-only hot-reload because in that case the render fn doesn't
  9763. // go through the normalizer
  9764. options._injectStyles = hook
  9765. // register for functioal component in vue file
  9766. var originalRender = options.render
  9767. options.render = function renderWithStyleInjection (h, context) {
  9768. hook.call(context)
  9769. return originalRender(h, context)
  9770. }
  9771. } else {
  9772. // inject component registration as beforeCreate hook
  9773. var existing = options.beforeCreate
  9774. options.beforeCreate = existing
  9775. ? [].concat(existing, hook)
  9776. : [hook]
  9777. }
  9778. }
  9779. return {
  9780. exports: scriptExports,
  9781. options: options
  9782. }
  9783. }
  9784. /***/ }),
  9785. /***/ 33:
  9786. /*!******************************************************!*\
  9787. !*** E:/work/mdapp/uni_modules/vk-uview-ui/index.js ***!
  9788. \******************************************************/
  9789. /*! no static exports found */
  9790. /***/ (function(module, exports, __webpack_require__) {
  9791. "use strict";
  9792. /* WEBPACK VAR INJECTION */(function(uni) {
  9793. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9794. Object.defineProperty(exports, "__esModule", {
  9795. value: true
  9796. });
  9797. exports.default = void 0;
  9798. var _mixin = _interopRequireDefault(__webpack_require__(/*! ./libs/mixin/mixin.js */ 34));
  9799. var _request = _interopRequireDefault(__webpack_require__(/*! ./libs/request */ 35));
  9800. var _queryParams = _interopRequireDefault(__webpack_require__(/*! ./libs/function/queryParams.js */ 39));
  9801. var _route = _interopRequireDefault(__webpack_require__(/*! ./libs/function/route.js */ 40));
  9802. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFormat.js */ 44));
  9803. var _timeFrom = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFrom.js */ 45));
  9804. var _colorGradient = _interopRequireDefault(__webpack_require__(/*! ./libs/function/colorGradient.js */ 46));
  9805. var _guid = _interopRequireDefault(__webpack_require__(/*! ./libs/function/guid.js */ 47));
  9806. var _color = _interopRequireDefault(__webpack_require__(/*! ./libs/function/color.js */ 48));
  9807. var _type2icon = _interopRequireDefault(__webpack_require__(/*! ./libs/function/type2icon.js */ 49));
  9808. var _randomArray = _interopRequireDefault(__webpack_require__(/*! ./libs/function/randomArray.js */ 50));
  9809. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepClone.js */ 37));
  9810. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepMerge.js */ 36));
  9811. var _addUnit = _interopRequireDefault(__webpack_require__(/*! ./libs/function/addUnit.js */ 51));
  9812. var _test = _interopRequireDefault(__webpack_require__(/*! ./libs/function/test.js */ 38));
  9813. var _random = _interopRequireDefault(__webpack_require__(/*! ./libs/function/random.js */ 52));
  9814. var _trim = _interopRequireDefault(__webpack_require__(/*! ./libs/function/trim.js */ 53));
  9815. var _toast = _interopRequireDefault(__webpack_require__(/*! ./libs/function/toast.js */ 54));
  9816. var _getParent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/getParent.js */ 55));
  9817. var _$parent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/$parent.js */ 56));
  9818. var _sys = __webpack_require__(/*! ./libs/function/sys.js */ 57);
  9819. var _debounce = _interopRequireDefault(__webpack_require__(/*! ./libs/function/debounce.js */ 58));
  9820. var _throttle = _interopRequireDefault(__webpack_require__(/*! ./libs/function/throttle.js */ 59));
  9821. var _addStyle = _interopRequireDefault(__webpack_require__(/*! ./libs/function/addStyle.js */ 60));
  9822. var _config = _interopRequireDefault(__webpack_require__(/*! ./libs/config/config.js */ 61));
  9823. var _zIndex = _interopRequireDefault(__webpack_require__(/*! ./libs/config/zIndex.js */ 62));
  9824. // 引入全局mixin
  9825. // 引入关于是否mixin集成小程序分享的配置
  9826. // import wxshare from './libs/mixin/mpShare.js'
  9827. // 全局挂载引入http相关请求拦截插件
  9828. function wranning(str) {
  9829. // 开发环境进行信息输出,主要是一些报错信息
  9830. // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
  9831. // 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
  9832. if (true) {
  9833. console.warn(str);
  9834. }
  9835. }
  9836. // 尝试判断在根目录的/store中是否有$u.mixin.js,此文件uView默认为需要挂在到全局的vuex的state变量
  9837. // HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式,
  9838. // let vuexStore = {};
  9839. // try {
  9840. // vuexStore = require("@/store/$u.mixin.js");
  9841. // } catch (e) {
  9842. // //TODO handle the exception
  9843. // }
  9844. // post类型对象参数转为get类型url参数
  9845. var $u = {
  9846. queryParams: _queryParams.default,
  9847. route: _route.default,
  9848. timeFormat: _timeFormat.default,
  9849. date: _timeFormat.default,
  9850. // 另名date
  9851. timeFrom: _timeFrom.default,
  9852. colorGradient: _colorGradient.default.colorGradient,
  9853. colorToRgba: _colorGradient.default.colorToRgba,
  9854. guid: _guid.default,
  9855. color: _color.default,
  9856. sys: _sys.sys,
  9857. os: _sys.os,
  9858. type2icon: _type2icon.default,
  9859. randomArray: _randomArray.default,
  9860. wranning: wranning,
  9861. get: _request.default.get,
  9862. post: _request.default.post,
  9863. put: _request.default.put,
  9864. 'delete': _request.default.delete,
  9865. hexToRgb: _colorGradient.default.hexToRgb,
  9866. rgbToHex: _colorGradient.default.rgbToHex,
  9867. test: _test.default,
  9868. random: _random.default,
  9869. deepClone: _deepClone.default,
  9870. deepMerge: _deepMerge.default,
  9871. getParent: _getParent.default,
  9872. $parent: _$parent.default,
  9873. addUnit: _addUnit.default,
  9874. trim: _trim.default,
  9875. type: ['primary', 'success', 'error', 'warning', 'info'],
  9876. http: _request.default,
  9877. toast: _toast.default,
  9878. config: _config.default,
  9879. // uView配置信息相关,比如版本号
  9880. zIndex: _zIndex.default,
  9881. debounce: _debounce.default,
  9882. throttle: _throttle.default,
  9883. addStyle: _addStyle.default
  9884. };
  9885. // $u挂载到uni对象上
  9886. uni.$u = $u;
  9887. var install = function install(Vue) {
  9888. Vue.mixin(_mixin.default);
  9889. if (Vue.prototype.openShare) {
  9890. Vue.mixin(mpShare);
  9891. }
  9892. // Vue.mixin(vuexStore);
  9893. // 时间格式化,同时两个名称,date和timeFormat
  9894. Vue.filter('timeFormat', function (timestamp, format) {
  9895. return (0, _timeFormat.default)(timestamp, format);
  9896. });
  9897. Vue.filter('date', function (timestamp, format) {
  9898. return (0, _timeFormat.default)(timestamp, format);
  9899. });
  9900. // 将多久以前的方法,注入到全局过滤器
  9901. Vue.filter('timeFrom', function (timestamp, format) {
  9902. return (0, _timeFrom.default)(timestamp, format);
  9903. });
  9904. Vue.prototype.$u = $u;
  9905. };
  9906. var _default = {
  9907. install: install
  9908. };
  9909. exports.default = _default;
  9910. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  9911. /***/ }),
  9912. /***/ 34:
  9913. /*!*****************************************************************!*\
  9914. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/mixin/mixin.js ***!
  9915. \*****************************************************************/
  9916. /*! no static exports found */
  9917. /***/ (function(module, exports, __webpack_require__) {
  9918. "use strict";
  9919. /* WEBPACK VAR INJECTION */(function(uni) {
  9920. Object.defineProperty(exports, "__esModule", {
  9921. value: true
  9922. });
  9923. exports.default = void 0;
  9924. var _default = {
  9925. data: function data() {
  9926. return {};
  9927. },
  9928. onLoad: function onLoad() {
  9929. // getRect挂载到$u上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出
  9930. this.$u.getRect = this.$uGetRect;
  9931. },
  9932. methods: {
  9933. // 查询节点信息
  9934. // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
  9935. // 解决办法为在组件根部再套一个没有任何作用的view元素
  9936. $uGetRect: function $uGetRect(selector, all) {
  9937. var _this = this;
  9938. return new Promise(function (resolve) {
  9939. uni.createSelectorQuery().in(_this)[all ? 'selectAll' : 'select'](selector).boundingClientRect(function (rect) {
  9940. if (all && Array.isArray(rect) && rect.length) {
  9941. resolve(rect);
  9942. }
  9943. if (!all && rect) {
  9944. resolve(rect);
  9945. }
  9946. }).exec();
  9947. });
  9948. },
  9949. getParentData: function getParentData() {
  9950. var _this2 = this;
  9951. var parentName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  9952. // 避免在created中去定义parent变量
  9953. if (!this.parent) this.parent = false;
  9954. // 这里的本质原理是,通过获取父组件实例(也即u-radio-group的this)
  9955. // 将父组件this中对应的参数,赋值给本组件(u-radio的this)的parentData对象中对应的属性
  9956. // 之所以需要这么做,是因为所有端中,头条小程序不支持通过this.parent.xxx去监听父组件参数的变化
  9957. this.parent = this.$u.$parent.call(this, parentName);
  9958. if (this.parent) {
  9959. // 历遍parentData中的属性,将parent中的同名属性赋值给parentData
  9960. Object.keys(this.parentData).map(function (key) {
  9961. _this2.parentData[key] = _this2.parent[key];
  9962. });
  9963. }
  9964. },
  9965. // 阻止事件冒泡
  9966. preventEvent: function preventEvent(e) {
  9967. e && e.stopPropagation && e.stopPropagation();
  9968. }
  9969. },
  9970. onReachBottom: function onReachBottom() {
  9971. uni.$emit('uOnReachBottom');
  9972. },
  9973. beforeDestroy: function beforeDestroy() {
  9974. var _this3 = this;
  9975. // 判断当前页面是否存在parent和chldren,一般在checkbox和checkbox-group父子联动的场景会有此情况
  9976. // 组件销毁时,移除子组件在父组件children数组中的实例,释放资源,避免数据混乱
  9977. if (this.parent && uni.$u.test.array(this.parent.children)) {
  9978. // 组件销毁时,移除父组件中的children数组中对应的实例
  9979. var childrenList = this.parent.children;
  9980. childrenList.map(function (child, index) {
  9981. // 如果相等,则移除
  9982. if (child === _this3) {
  9983. childrenList.splice(index, 1);
  9984. }
  9985. });
  9986. }
  9987. }
  9988. };
  9989. exports.default = _default;
  9990. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  9991. /***/ }),
  9992. /***/ 35:
  9993. /*!*******************************************************************!*\
  9994. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/request/index.js ***!
  9995. \*******************************************************************/
  9996. /*! no static exports found */
  9997. /***/ (function(module, exports, __webpack_require__) {
  9998. "use strict";
  9999. /* WEBPACK VAR INJECTION */(function(uni) {
  10000. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10001. Object.defineProperty(exports, "__esModule", {
  10002. value: true
  10003. });
  10004. exports.default = void 0;
  10005. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  10006. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  10007. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ../function/deepMerge */ 36));
  10008. var _test = _interopRequireDefault(__webpack_require__(/*! ../function/test */ 38));
  10009. var Request = /*#__PURE__*/function () {
  10010. function Request() {
  10011. var _this = this;
  10012. (0, _classCallCheck2.default)(this, Request);
  10013. this.config = {
  10014. baseUrl: '',
  10015. // 请求的根域名
  10016. // 默认的请求头
  10017. header: {},
  10018. method: 'POST',
  10019. // 设置为json,返回后uni.request会对数据进行一次JSON.parse
  10020. dataType: 'json',
  10021. // 此参数无需处理,因为5+和支付宝小程序不支持,默认为text即可
  10022. responseType: 'text',
  10023. showLoading: true,
  10024. // 是否显示请求中的loading
  10025. loadingText: '请求中...',
  10026. loadingTime: 800,
  10027. // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
  10028. timer: null,
  10029. // 定时器
  10030. originalData: false,
  10031. // 是否在拦截器中返回服务端的原始数据,见文档说明
  10032. loadingMask: true // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
  10033. };
  10034. // 拦截器
  10035. this.interceptor = {
  10036. // 请求前的拦截
  10037. request: null,
  10038. // 请求后的拦截
  10039. response: null
  10040. };
  10041. // get请求
  10042. this.get = function (url) {
  10043. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10044. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  10045. return _this.request({
  10046. method: 'GET',
  10047. url: url,
  10048. header: header,
  10049. data: data
  10050. });
  10051. };
  10052. // post请求
  10053. this.post = function (url) {
  10054. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10055. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  10056. return _this.request({
  10057. url: url,
  10058. method: 'POST',
  10059. header: header,
  10060. data: data
  10061. });
  10062. };
  10063. // put请求,不支持支付宝小程序(HX2.6.15)
  10064. this.put = function (url) {
  10065. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10066. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  10067. return _this.request({
  10068. url: url,
  10069. method: 'PUT',
  10070. header: header,
  10071. data: data
  10072. });
  10073. };
  10074. // delete请求,不支持支付宝和头条小程序(HX2.6.15)
  10075. this.delete = function (url) {
  10076. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10077. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  10078. return _this.request({
  10079. url: url,
  10080. method: 'DELETE',
  10081. header: header,
  10082. data: data
  10083. });
  10084. };
  10085. }
  10086. (0, _createClass2.default)(Request, [{
  10087. key: "setConfig",
  10088. value:
  10089. // 设置全局默认配置
  10090. function setConfig(customConfig) {
  10091. // 深度合并对象,否则会造成对象深层属性丢失
  10092. this.config = (0, _deepMerge.default)(this.config, customConfig);
  10093. }
  10094. // 主要请求部分
  10095. }, {
  10096. key: "request",
  10097. value: function request() {
  10098. var _this2 = this;
  10099. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10100. // 检查请求拦截
  10101. if (this.interceptor.request && typeof this.interceptor.request === 'function') {
  10102. var tmpConfig = {};
  10103. var interceptorRequest = this.interceptor.request(options);
  10104. if (interceptorRequest === false) {
  10105. // 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调
  10106. return new Promise(function () {});
  10107. }
  10108. this.options = interceptorRequest;
  10109. }
  10110. options.dataType = options.dataType || this.config.dataType;
  10111. options.responseType = options.responseType || this.config.responseType;
  10112. options.url = options.url || '';
  10113. options.params = options.params || {};
  10114. options.header = Object.assign({}, this.config.header, options.header);
  10115. options.method = options.method || this.config.method;
  10116. return new Promise(function (resolve, reject) {
  10117. options.complete = function (response) {
  10118. // 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)
  10119. uni.hideLoading();
  10120. // 清除定时器,如果请求回来了,就无需loading
  10121. clearTimeout(_this2.config.timer);
  10122. _this2.config.timer = null;
  10123. // 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
  10124. if (_this2.config.originalData) {
  10125. // 判断是否存在拦截器
  10126. if (_this2.interceptor.response && typeof _this2.interceptor.response === 'function') {
  10127. var resInterceptors = _this2.interceptor.response(response);
  10128. // 如果拦截器不返回false,就将拦截器返回的内容给this.$u.post的then回调
  10129. if (resInterceptors !== false) {
  10130. resolve(resInterceptors);
  10131. } else {
  10132. // 如果拦截器返回false,意味着拦截器定义者认为返回有问题,直接接入catch回调
  10133. reject(response);
  10134. }
  10135. } else {
  10136. // 如果要求返回原始数据,就算没有拦截器,也返回最原始的数据
  10137. resolve(response);
  10138. }
  10139. } else {
  10140. if (response.statusCode == 200) {
  10141. if (_this2.interceptor.response && typeof _this2.interceptor.response === 'function') {
  10142. var _resInterceptors = _this2.interceptor.response(response.data);
  10143. if (_resInterceptors !== false) {
  10144. resolve(_resInterceptors);
  10145. } else {
  10146. reject(response.data);
  10147. }
  10148. } else {
  10149. // 如果不是返回原始数据(originalData=false),且没有拦截器的情况下,返回纯数据给then回调
  10150. resolve(response.data);
  10151. }
  10152. } else {
  10153. // 不返回原始数据的情况下,服务器状态码不为200,modal弹框提示
  10154. // if(response.errMsg) {
  10155. // uni.showModal({
  10156. // title: response.errMsg
  10157. // });
  10158. // }
  10159. reject(response);
  10160. }
  10161. }
  10162. };
  10163. // 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
  10164. options.url = _test.default.url(options.url) ? options.url : _this2.config.baseUrl + (options.url.indexOf('/') == 0 ? options.url : '/' + options.url);
  10165. // 是否显示loading
  10166. // 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id
  10167. // 而没有清除前者的定时器,导致前者超时,一直显示loading
  10168. if (_this2.config.showLoading && !_this2.config.timer) {
  10169. _this2.config.timer = setTimeout(function () {
  10170. uni.showLoading({
  10171. title: _this2.config.loadingText,
  10172. mask: _this2.config.loadingMask
  10173. });
  10174. _this2.config.timer = null;
  10175. }, _this2.config.loadingTime);
  10176. }
  10177. uni.request(options);
  10178. });
  10179. // .catch(res => {
  10180. // // 如果返回reject(),不让其进入this.$u.post().then().catch()后面的catct()
  10181. // // 因为很多人都会忘了写后面的catch(),导致报错捕获不到catch
  10182. // return new Promise(()=>{});
  10183. // })
  10184. }
  10185. }]);
  10186. return Request;
  10187. }();
  10188. var _default = new Request();
  10189. exports.default = _default;
  10190. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  10191. /***/ }),
  10192. /***/ 36:
  10193. /*!************************************************************************!*\
  10194. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/deepMerge.js ***!
  10195. \************************************************************************/
  10196. /*! no static exports found */
  10197. /***/ (function(module, exports, __webpack_require__) {
  10198. "use strict";
  10199. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10200. Object.defineProperty(exports, "__esModule", {
  10201. value: true
  10202. });
  10203. exports.default = void 0;
  10204. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  10205. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./deepClone */ 37));
  10206. // JS对象深度合并
  10207. function deepMerge() {
  10208. var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10209. var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10210. target = (0, _deepClone.default)(target);
  10211. if ((0, _typeof2.default)(target) !== 'object' || (0, _typeof2.default)(source) !== 'object') return false;
  10212. for (var prop in source) {
  10213. if (!source.hasOwnProperty(prop)) continue;
  10214. if (prop in target) {
  10215. if ((0, _typeof2.default)(target[prop]) !== 'object') {
  10216. target[prop] = source[prop];
  10217. } else {
  10218. if ((0, _typeof2.default)(source[prop]) !== 'object') {
  10219. target[prop] = source[prop];
  10220. } else {
  10221. if (target[prop].concat && source[prop].concat) {
  10222. target[prop] = target[prop].concat(source[prop]);
  10223. } else {
  10224. target[prop] = deepMerge(target[prop], source[prop]);
  10225. }
  10226. }
  10227. }
  10228. } else {
  10229. target[prop] = source[prop];
  10230. }
  10231. }
  10232. return target;
  10233. }
  10234. var _default = deepMerge;
  10235. exports.default = _default;
  10236. /***/ }),
  10237. /***/ 37:
  10238. /*!************************************************************************!*\
  10239. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/deepClone.js ***!
  10240. \************************************************************************/
  10241. /*! no static exports found */
  10242. /***/ (function(module, exports, __webpack_require__) {
  10243. "use strict";
  10244. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10245. Object.defineProperty(exports, "__esModule", {
  10246. value: true
  10247. });
  10248. exports.default = void 0;
  10249. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  10250. // 判断arr是否为一个数组,返回一个bool值
  10251. function isArray(arr) {
  10252. return Object.prototype.toString.call(arr) === '[object Array]';
  10253. }
  10254. // 深度克隆
  10255. function deepClone(obj) {
  10256. // 对常见的“非”值,直接返回原来值
  10257. if ([null, undefined, NaN, false].includes(obj)) return obj;
  10258. if ((0, _typeof2.default)(obj) !== "object" && typeof obj !== 'function') {
  10259. //原始类型直接返回
  10260. return obj;
  10261. }
  10262. var o = isArray(obj) ? [] : {};
  10263. for (var i in obj) {
  10264. if (obj.hasOwnProperty(i)) {
  10265. o[i] = (0, _typeof2.default)(obj[i]) === "object" ? deepClone(obj[i]) : obj[i];
  10266. }
  10267. }
  10268. return o;
  10269. }
  10270. var _default = deepClone;
  10271. exports.default = _default;
  10272. /***/ }),
  10273. /***/ 38:
  10274. /*!*******************************************************************!*\
  10275. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/test.js ***!
  10276. \*******************************************************************/
  10277. /*! no static exports found */
  10278. /***/ (function(module, exports, __webpack_require__) {
  10279. "use strict";
  10280. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10281. Object.defineProperty(exports, "__esModule", {
  10282. value: true
  10283. });
  10284. exports.default = void 0;
  10285. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  10286. /**
  10287. * 验证电子邮箱格式
  10288. */
  10289. function email(value) {
  10290. return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
  10291. }
  10292. /**
  10293. * 验证手机格式
  10294. */
  10295. function mobile(value) {
  10296. return /^1[23456789]\d{9}$/.test(value);
  10297. }
  10298. /**
  10299. * 验证URL格式
  10300. */
  10301. function url(value) {
  10302. return /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/.test(value);
  10303. }
  10304. /**
  10305. * 验证日期格式
  10306. */
  10307. function date(value) {
  10308. return !/Invalid|NaN/.test(new Date(value).toString());
  10309. }
  10310. /**
  10311. * 验证ISO类型的日期格式
  10312. */
  10313. function dateISO(value) {
  10314. return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
  10315. }
  10316. /**
  10317. * 验证十进制数字
  10318. */
  10319. function number(value) {
  10320. return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
  10321. }
  10322. /**
  10323. * 验证整数
  10324. */
  10325. function digits(value) {
  10326. return /^\d+$/.test(value);
  10327. }
  10328. /**
  10329. * 验证身份证号码
  10330. */
  10331. function idCard(value) {
  10332. 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(value);
  10333. }
  10334. /**
  10335. * 是否车牌号
  10336. */
  10337. function carNo(value) {
  10338. // 新能源车牌
  10339. var xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
  10340. // 旧车牌
  10341. var creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
  10342. if (value.length === 7) {
  10343. return creg.test(value);
  10344. } else if (value.length === 8) {
  10345. return xreg.test(value);
  10346. } else {
  10347. return false;
  10348. }
  10349. }
  10350. /**
  10351. * 金额,只允许2位小数
  10352. */
  10353. function amount(value) {
  10354. //金额,只允许保留两位小数
  10355. return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
  10356. }
  10357. /**
  10358. * 中文
  10359. */
  10360. function chinese(value) {
  10361. var reg = /^[\u4e00-\u9fa5]+$/gi;
  10362. return reg.test(value);
  10363. }
  10364. /**
  10365. * 只能输入字母
  10366. */
  10367. function letter(value) {
  10368. return /^[a-zA-Z]*$/.test(value);
  10369. }
  10370. /**
  10371. * 只能是字母或者数字
  10372. */
  10373. function enOrNum(value) {
  10374. //英文或者数字
  10375. var reg = /^[0-9a-zA-Z]*$/g;
  10376. return reg.test(value);
  10377. }
  10378. /**
  10379. * 验证是否包含某个值
  10380. */
  10381. function contains(value, param) {
  10382. return value.indexOf(param) >= 0;
  10383. }
  10384. /**
  10385. * 验证一个值范围[min, max]
  10386. */
  10387. function range(value, param) {
  10388. return value >= param[0] && value <= param[1];
  10389. }
  10390. /**
  10391. * 验证一个长度范围[min, max]
  10392. */
  10393. function rangeLength(value, param) {
  10394. return value.length >= param[0] && value.length <= param[1];
  10395. }
  10396. /**
  10397. * 是否固定电话
  10398. */
  10399. function landline(value) {
  10400. var reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
  10401. return reg.test(value);
  10402. }
  10403. /**
  10404. * 判断是否为空
  10405. */
  10406. function empty(value) {
  10407. switch ((0, _typeof2.default)(value)) {
  10408. case 'undefined':
  10409. return true;
  10410. case 'string':
  10411. if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
  10412. break;
  10413. case 'boolean':
  10414. if (!value) return true;
  10415. break;
  10416. case 'number':
  10417. if (0 === value || isNaN(value)) return true;
  10418. break;
  10419. case 'object':
  10420. if (null === value || value.length === 0) return true;
  10421. for (var i in value) {
  10422. return false;
  10423. }
  10424. return true;
  10425. }
  10426. return false;
  10427. }
  10428. /**
  10429. * 是否json字符串
  10430. */
  10431. function jsonString(value) {
  10432. if (typeof value == 'string') {
  10433. try {
  10434. var obj = JSON.parse(value);
  10435. if ((0, _typeof2.default)(obj) == 'object' && obj) {
  10436. return true;
  10437. } else {
  10438. return false;
  10439. }
  10440. } catch (e) {
  10441. return false;
  10442. }
  10443. }
  10444. return false;
  10445. }
  10446. /**
  10447. * 是否数组
  10448. */
  10449. function array(value) {
  10450. if (typeof Array.isArray === "function") {
  10451. return Array.isArray(value);
  10452. } else {
  10453. return Object.prototype.toString.call(value) === "[object Array]";
  10454. }
  10455. }
  10456. /**
  10457. * 是否对象
  10458. */
  10459. function object(value) {
  10460. return Object.prototype.toString.call(value) === '[object Object]';
  10461. }
  10462. /**
  10463. * 是否短信验证码
  10464. */
  10465. function code(value) {
  10466. var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
  10467. return new RegExp("^\\d{".concat(len, "}$")).test(value);
  10468. }
  10469. /**
  10470. * 是否函数方法
  10471. * @param {Object} value
  10472. */
  10473. function func(value) {
  10474. return typeof value === 'function';
  10475. }
  10476. /**
  10477. * 是否promise对象
  10478. * @param {Object} value
  10479. */
  10480. function promise(value) {
  10481. return object(value) && func(value.then) && func(value.catch);
  10482. }
  10483. /** 是否图片格式
  10484. * @param {Object} value
  10485. */
  10486. function image(value) {
  10487. var newValue = value.split('?')[0];
  10488. return new RegExp(/\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)$/).test(newValue);
  10489. }
  10490. /**
  10491. * 是否视频格式
  10492. * @param {Object} value
  10493. */
  10494. function video(value) {
  10495. var newValue = value.split('?')[0];
  10496. return new RegExp(/\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv|m3u8|3gp)$/).test(newValue);
  10497. }
  10498. /**
  10499. * 是否为正则对象
  10500. * @param {Object}
  10501. * @return {Boolean}
  10502. */
  10503. function regExp(o) {
  10504. return o && Object.prototype.toString.call(o) === '[object RegExp]';
  10505. }
  10506. /**
  10507. * 验证字符串
  10508. */
  10509. function string(value) {
  10510. return typeof value === 'string';
  10511. }
  10512. var _default = {
  10513. email: email,
  10514. mobile: mobile,
  10515. url: url,
  10516. date: date,
  10517. dateISO: dateISO,
  10518. number: number,
  10519. digits: digits,
  10520. idCard: idCard,
  10521. carNo: carNo,
  10522. amount: amount,
  10523. chinese: chinese,
  10524. letter: letter,
  10525. enOrNum: enOrNum,
  10526. contains: contains,
  10527. range: range,
  10528. rangeLength: rangeLength,
  10529. empty: empty,
  10530. isEmpty: empty,
  10531. jsonString: jsonString,
  10532. landline: landline,
  10533. object: object,
  10534. array: array,
  10535. code: code,
  10536. func: func,
  10537. promise: promise,
  10538. video: video,
  10539. image: image,
  10540. regExp: regExp,
  10541. string: string
  10542. };
  10543. exports.default = _default;
  10544. /***/ }),
  10545. /***/ 39:
  10546. /*!**************************************************************************!*\
  10547. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/queryParams.js ***!
  10548. \**************************************************************************/
  10549. /*! no static exports found */
  10550. /***/ (function(module, exports, __webpack_require__) {
  10551. "use strict";
  10552. Object.defineProperty(exports, "__esModule", {
  10553. value: true
  10554. });
  10555. exports.default = void 0;
  10556. /**
  10557. * 对象转url参数
  10558. * @param {*} data,对象
  10559. * @param {*} isPrefix,是否自动加上"?"
  10560. */
  10561. function queryParams() {
  10562. var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10563. var isPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  10564. var arrayFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'brackets';
  10565. var prefix = isPrefix ? '?' : '';
  10566. var _result = [];
  10567. if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets';
  10568. var _loop = function _loop(key) {
  10569. var value = data[key];
  10570. // 去掉为空的参数
  10571. if (['', undefined, null].indexOf(value) >= 0) {
  10572. return "continue";
  10573. }
  10574. // 如果值为数组,另行处理
  10575. if (value.constructor === Array) {
  10576. // e.g. {ids: [1, 2, 3]}
  10577. switch (arrayFormat) {
  10578. case 'indices':
  10579. // 结果: ids[0]=1&ids[1]=2&ids[2]=3
  10580. for (var i = 0; i < value.length; i++) {
  10581. _result.push(key + '[' + i + ']=' + value[i]);
  10582. }
  10583. break;
  10584. case 'brackets':
  10585. // 结果: ids[]=1&ids[]=2&ids[]=3
  10586. value.forEach(function (_value) {
  10587. _result.push(key + '[]=' + _value);
  10588. });
  10589. break;
  10590. case 'repeat':
  10591. // 结果: ids=1&ids=2&ids=3
  10592. value.forEach(function (_value) {
  10593. _result.push(key + '=' + _value);
  10594. });
  10595. break;
  10596. case 'comma':
  10597. // 结果: ids=1,2,3
  10598. var commaStr = "";
  10599. value.forEach(function (_value) {
  10600. commaStr += (commaStr ? "," : "") + _value;
  10601. });
  10602. _result.push(key + '=' + commaStr);
  10603. break;
  10604. default:
  10605. value.forEach(function (_value) {
  10606. _result.push(key + '[]=' + _value);
  10607. });
  10608. }
  10609. } else {
  10610. _result.push(key + '=' + value);
  10611. }
  10612. };
  10613. for (var key in data) {
  10614. var _ret = _loop(key);
  10615. if (_ret === "continue") continue;
  10616. }
  10617. return _result.length ? prefix + _result.join('&') : '';
  10618. }
  10619. var _default = queryParams;
  10620. exports.default = _default;
  10621. /***/ }),
  10622. /***/ 4:
  10623. /*!**********************************************************************!*\
  10624. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  10625. \**********************************************************************/
  10626. /*! no static exports found */
  10627. /***/ (function(module, exports) {
  10628. function _interopRequireDefault(obj) {
  10629. return obj && obj.__esModule ? obj : {
  10630. "default": obj
  10631. };
  10632. }
  10633. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  10634. /***/ }),
  10635. /***/ 40:
  10636. /*!********************************************************************!*\
  10637. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/route.js ***!
  10638. \********************************************************************/
  10639. /*! no static exports found */
  10640. /***/ (function(module, exports, __webpack_require__) {
  10641. "use strict";
  10642. /* WEBPACK VAR INJECTION */(function(uni) {
  10643. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10644. Object.defineProperty(exports, "__esModule", {
  10645. value: true
  10646. });
  10647. exports.default = void 0;
  10648. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 41));
  10649. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 43));
  10650. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  10651. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  10652. /**
  10653. * 路由跳转方法,该方法相对于直接使用uni.xxx的好处是使用更加简单快捷
  10654. * 并且带有路由拦截功能
  10655. */
  10656. var Router = /*#__PURE__*/function () {
  10657. function Router() {
  10658. (0, _classCallCheck2.default)(this, Router);
  10659. // 原始属性定义
  10660. this.config = {
  10661. type: 'navigateTo',
  10662. url: '',
  10663. delta: 1,
  10664. // navigateBack页面后退时,回退的层数
  10665. params: {},
  10666. // 传递的参数
  10667. animationType: 'pop-in',
  10668. // 窗口动画,只在APP有效
  10669. animationDuration: 300,
  10670. // 窗口动画持续时间,单位毫秒,只在APP有效
  10671. intercept: false // 是否需要拦截
  10672. };
  10673. // 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
  10674. // 这里在构造函数中进行this绑定
  10675. this.route = this.route.bind(this);
  10676. }
  10677. // 判断url前面是否有"/",如果没有则加上,否则无法跳转
  10678. (0, _createClass2.default)(Router, [{
  10679. key: "addRootPath",
  10680. value: function addRootPath(url) {
  10681. return url[0] === '/' ? url : "/".concat(url);
  10682. }
  10683. // 整合路由参数
  10684. }, {
  10685. key: "mixinParam",
  10686. value: function mixinParam(url, params) {
  10687. url = url && this.addRootPath(url);
  10688. // 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
  10689. // 如果有url中有get参数,转换后无需带上"?"
  10690. var query = '';
  10691. if (/.*\/.*\?.*=.*/.test(url)) {
  10692. // object对象转为get类型的参数
  10693. query = uni.$u.queryParams(params, false);
  10694. // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
  10695. return url += "&" + query;
  10696. } else {
  10697. // 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
  10698. query = uni.$u.queryParams(params);
  10699. return url += query;
  10700. }
  10701. }
  10702. // 对外的方法名称
  10703. }, {
  10704. key: "route",
  10705. value: function () {
  10706. var _route = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  10707. var options,
  10708. params,
  10709. mergeConfig,
  10710. isNext,
  10711. _args = arguments;
  10712. return _regenerator.default.wrap(function _callee$(_context) {
  10713. while (1) {
  10714. switch (_context.prev = _context.next) {
  10715. case 0:
  10716. options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
  10717. params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
  10718. // 合并用户的配置和内部的默认配置
  10719. mergeConfig = {};
  10720. if (typeof options === 'string') {
  10721. // 如果options为字符串,则为route(url, params)的形式
  10722. mergeConfig.url = this.mixinParam(options, params);
  10723. mergeConfig.type = 'navigateTo';
  10724. } else {
  10725. mergeConfig = uni.$u.deepClone(options, this.config);
  10726. // 否则正常使用mergeConfig中的url和params进行拼接
  10727. mergeConfig.url = this.mixinParam(options.url, options.params);
  10728. }
  10729. if (params.intercept) {
  10730. this.config.intercept = params.intercept;
  10731. }
  10732. // params参数也带给拦截器
  10733. mergeConfig.params = params;
  10734. // 合并内外部参数
  10735. mergeConfig = uni.$u.deepMerge(this.config, mergeConfig);
  10736. // 判断用户是否定义了拦截器
  10737. if (!(typeof uni.$u.routeIntercept === 'function')) {
  10738. _context.next = 14;
  10739. break;
  10740. }
  10741. _context.next = 10;
  10742. return new Promise(function (resolve, reject) {
  10743. uni.$u.routeIntercept(mergeConfig, resolve);
  10744. });
  10745. case 10:
  10746. isNext = _context.sent;
  10747. // 如果isNext为true,则执行路由跳转
  10748. isNext && this.openPage(mergeConfig);
  10749. _context.next = 15;
  10750. break;
  10751. case 14:
  10752. this.openPage(mergeConfig);
  10753. case 15:
  10754. case "end":
  10755. return _context.stop();
  10756. }
  10757. }
  10758. }, _callee, this);
  10759. }));
  10760. function route() {
  10761. return _route.apply(this, arguments);
  10762. }
  10763. return route;
  10764. }() // 执行路由跳转
  10765. }, {
  10766. key: "openPage",
  10767. value: function openPage(config) {
  10768. // 解构参数
  10769. var url = config.url,
  10770. type = config.type,
  10771. delta = config.delta,
  10772. animationType = config.animationType,
  10773. animationDuration = config.animationDuration;
  10774. if (config.type == 'navigateTo' || config.type == 'to') {
  10775. uni.navigateTo({
  10776. url: url,
  10777. animationType: animationType,
  10778. animationDuration: animationDuration
  10779. });
  10780. }
  10781. if (config.type == 'redirectTo' || config.type == 'redirect') {
  10782. uni.redirectTo({
  10783. url: url
  10784. });
  10785. }
  10786. if (config.type == 'switchTab' || config.type == 'tab') {
  10787. uni.switchTab({
  10788. url: url
  10789. });
  10790. }
  10791. if (config.type == 'reLaunch' || config.type == 'launch') {
  10792. uni.reLaunch({
  10793. url: url
  10794. });
  10795. }
  10796. if (config.type == 'navigateBack' || config.type == 'back') {
  10797. uni.navigateBack({
  10798. delta: delta
  10799. });
  10800. }
  10801. }
  10802. }]);
  10803. return Router;
  10804. }();
  10805. var _default = new Router().route;
  10806. exports.default = _default;
  10807. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  10808. /***/ }),
  10809. /***/ 41:
  10810. /*!************************************************************************************************!*\
  10811. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  10812. \************************************************************************************************/
  10813. /*! no static exports found */
  10814. /***/ (function(module, exports, __webpack_require__) {
  10815. // TODO(Babel 8): Remove this file.
  10816. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 42)();
  10817. module.exports = runtime;
  10818. /***/ }),
  10819. /***/ 42:
  10820. /*!*******************************************************************!*\
  10821. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  10822. \*******************************************************************/
  10823. /*! no static exports found */
  10824. /***/ (function(module, exports, __webpack_require__) {
  10825. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  10826. function _regeneratorRuntime() {
  10827. "use strict";
  10828. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  10829. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  10830. return exports;
  10831. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  10832. var exports = {},
  10833. Op = Object.prototype,
  10834. hasOwn = Op.hasOwnProperty,
  10835. defineProperty = Object.defineProperty || function (obj, key, desc) {
  10836. obj[key] = desc.value;
  10837. },
  10838. $Symbol = "function" == typeof Symbol ? Symbol : {},
  10839. iteratorSymbol = $Symbol.iterator || "@@iterator",
  10840. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  10841. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  10842. function define(obj, key, value) {
  10843. return Object.defineProperty(obj, key, {
  10844. value: value,
  10845. enumerable: !0,
  10846. configurable: !0,
  10847. writable: !0
  10848. }), obj[key];
  10849. }
  10850. try {
  10851. define({}, "");
  10852. } catch (err) {
  10853. define = function define(obj, key, value) {
  10854. return obj[key] = value;
  10855. };
  10856. }
  10857. function wrap(innerFn, outerFn, self, tryLocsList) {
  10858. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  10859. generator = Object.create(protoGenerator.prototype),
  10860. context = new Context(tryLocsList || []);
  10861. return defineProperty(generator, "_invoke", {
  10862. value: makeInvokeMethod(innerFn, self, context)
  10863. }), generator;
  10864. }
  10865. function tryCatch(fn, obj, arg) {
  10866. try {
  10867. return {
  10868. type: "normal",
  10869. arg: fn.call(obj, arg)
  10870. };
  10871. } catch (err) {
  10872. return {
  10873. type: "throw",
  10874. arg: err
  10875. };
  10876. }
  10877. }
  10878. exports.wrap = wrap;
  10879. var ContinueSentinel = {};
  10880. function Generator() {}
  10881. function GeneratorFunction() {}
  10882. function GeneratorFunctionPrototype() {}
  10883. var IteratorPrototype = {};
  10884. define(IteratorPrototype, iteratorSymbol, function () {
  10885. return this;
  10886. });
  10887. var getProto = Object.getPrototypeOf,
  10888. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  10889. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  10890. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  10891. function defineIteratorMethods(prototype) {
  10892. ["next", "throw", "return"].forEach(function (method) {
  10893. define(prototype, method, function (arg) {
  10894. return this._invoke(method, arg);
  10895. });
  10896. });
  10897. }
  10898. function AsyncIterator(generator, PromiseImpl) {
  10899. function invoke(method, arg, resolve, reject) {
  10900. var record = tryCatch(generator[method], generator, arg);
  10901. if ("throw" !== record.type) {
  10902. var result = record.arg,
  10903. value = result.value;
  10904. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  10905. invoke("next", value, resolve, reject);
  10906. }, function (err) {
  10907. invoke("throw", err, resolve, reject);
  10908. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  10909. result.value = unwrapped, resolve(result);
  10910. }, function (error) {
  10911. return invoke("throw", error, resolve, reject);
  10912. });
  10913. }
  10914. reject(record.arg);
  10915. }
  10916. var previousPromise;
  10917. defineProperty(this, "_invoke", {
  10918. value: function value(method, arg) {
  10919. function callInvokeWithMethodAndArg() {
  10920. return new PromiseImpl(function (resolve, reject) {
  10921. invoke(method, arg, resolve, reject);
  10922. });
  10923. }
  10924. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  10925. }
  10926. });
  10927. }
  10928. function makeInvokeMethod(innerFn, self, context) {
  10929. var state = "suspendedStart";
  10930. return function (method, arg) {
  10931. if ("executing" === state) throw new Error("Generator is already running");
  10932. if ("completed" === state) {
  10933. if ("throw" === method) throw arg;
  10934. return doneResult();
  10935. }
  10936. for (context.method = method, context.arg = arg;;) {
  10937. var delegate = context.delegate;
  10938. if (delegate) {
  10939. var delegateResult = maybeInvokeDelegate(delegate, context);
  10940. if (delegateResult) {
  10941. if (delegateResult === ContinueSentinel) continue;
  10942. return delegateResult;
  10943. }
  10944. }
  10945. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  10946. if ("suspendedStart" === state) throw state = "completed", context.arg;
  10947. context.dispatchException(context.arg);
  10948. } else "return" === context.method && context.abrupt("return", context.arg);
  10949. state = "executing";
  10950. var record = tryCatch(innerFn, self, context);
  10951. if ("normal" === record.type) {
  10952. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  10953. return {
  10954. value: record.arg,
  10955. done: context.done
  10956. };
  10957. }
  10958. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  10959. }
  10960. };
  10961. }
  10962. function maybeInvokeDelegate(delegate, context) {
  10963. var methodName = context.method,
  10964. method = delegate.iterator[methodName];
  10965. if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
  10966. var record = tryCatch(method, delegate.iterator, context.arg);
  10967. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  10968. var info = record.arg;
  10969. return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
  10970. }
  10971. function pushTryEntry(locs) {
  10972. var entry = {
  10973. tryLoc: locs[0]
  10974. };
  10975. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  10976. }
  10977. function resetTryEntry(entry) {
  10978. var record = entry.completion || {};
  10979. record.type = "normal", delete record.arg, entry.completion = record;
  10980. }
  10981. function Context(tryLocsList) {
  10982. this.tryEntries = [{
  10983. tryLoc: "root"
  10984. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  10985. }
  10986. function values(iterable) {
  10987. if (iterable) {
  10988. var iteratorMethod = iterable[iteratorSymbol];
  10989. if (iteratorMethod) return iteratorMethod.call(iterable);
  10990. if ("function" == typeof iterable.next) return iterable;
  10991. if (!isNaN(iterable.length)) {
  10992. var i = -1,
  10993. next = function next() {
  10994. for (; ++i < iterable.length;) {
  10995. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  10996. }
  10997. return next.value = undefined, next.done = !0, next;
  10998. };
  10999. return next.next = next;
  11000. }
  11001. }
  11002. return {
  11003. next: doneResult
  11004. };
  11005. }
  11006. function doneResult() {
  11007. return {
  11008. value: undefined,
  11009. done: !0
  11010. };
  11011. }
  11012. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  11013. value: GeneratorFunctionPrototype,
  11014. configurable: !0
  11015. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  11016. value: GeneratorFunction,
  11017. configurable: !0
  11018. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  11019. var ctor = "function" == typeof genFun && genFun.constructor;
  11020. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  11021. }, exports.mark = function (genFun) {
  11022. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  11023. }, exports.awrap = function (arg) {
  11024. return {
  11025. __await: arg
  11026. };
  11027. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  11028. return this;
  11029. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  11030. void 0 === PromiseImpl && (PromiseImpl = Promise);
  11031. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  11032. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  11033. return result.done ? result.value : iter.next();
  11034. });
  11035. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  11036. return this;
  11037. }), define(Gp, "toString", function () {
  11038. return "[object Generator]";
  11039. }), exports.keys = function (val) {
  11040. var object = Object(val),
  11041. keys = [];
  11042. for (var key in object) {
  11043. keys.push(key);
  11044. }
  11045. return keys.reverse(), function next() {
  11046. for (; keys.length;) {
  11047. var key = keys.pop();
  11048. if (key in object) return next.value = key, next.done = !1, next;
  11049. }
  11050. return next.done = !0, next;
  11051. };
  11052. }, exports.values = values, Context.prototype = {
  11053. constructor: Context,
  11054. reset: function reset(skipTempReset) {
  11055. if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {
  11056. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  11057. }
  11058. },
  11059. stop: function stop() {
  11060. this.done = !0;
  11061. var rootRecord = this.tryEntries[0].completion;
  11062. if ("throw" === rootRecord.type) throw rootRecord.arg;
  11063. return this.rval;
  11064. },
  11065. dispatchException: function dispatchException(exception) {
  11066. if (this.done) throw exception;
  11067. var context = this;
  11068. function handle(loc, caught) {
  11069. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  11070. }
  11071. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11072. var entry = this.tryEntries[i],
  11073. record = entry.completion;
  11074. if ("root" === entry.tryLoc) return handle("end");
  11075. if (entry.tryLoc <= this.prev) {
  11076. var hasCatch = hasOwn.call(entry, "catchLoc"),
  11077. hasFinally = hasOwn.call(entry, "finallyLoc");
  11078. if (hasCatch && hasFinally) {
  11079. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  11080. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  11081. } else if (hasCatch) {
  11082. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  11083. } else {
  11084. if (!hasFinally) throw new Error("try statement without catch or finally");
  11085. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  11086. }
  11087. }
  11088. }
  11089. },
  11090. abrupt: function abrupt(type, arg) {
  11091. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11092. var entry = this.tryEntries[i];
  11093. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  11094. var finallyEntry = entry;
  11095. break;
  11096. }
  11097. }
  11098. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  11099. var record = finallyEntry ? finallyEntry.completion : {};
  11100. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  11101. },
  11102. complete: function complete(record, afterLoc) {
  11103. if ("throw" === record.type) throw record.arg;
  11104. return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
  11105. },
  11106. finish: function finish(finallyLoc) {
  11107. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11108. var entry = this.tryEntries[i];
  11109. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  11110. }
  11111. },
  11112. "catch": function _catch(tryLoc) {
  11113. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11114. var entry = this.tryEntries[i];
  11115. if (entry.tryLoc === tryLoc) {
  11116. var record = entry.completion;
  11117. if ("throw" === record.type) {
  11118. var thrown = record.arg;
  11119. resetTryEntry(entry);
  11120. }
  11121. return thrown;
  11122. }
  11123. }
  11124. throw new Error("illegal catch attempt");
  11125. },
  11126. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  11127. return this.delegate = {
  11128. iterator: values(iterable),
  11129. resultName: resultName,
  11130. nextLoc: nextLoc
  11131. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  11132. }
  11133. }, exports;
  11134. }
  11135. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11136. /***/ }),
  11137. /***/ 43:
  11138. /*!*****************************************************************!*\
  11139. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  11140. \*****************************************************************/
  11141. /*! no static exports found */
  11142. /***/ (function(module, exports) {
  11143. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  11144. try {
  11145. var info = gen[key](arg);
  11146. var value = info.value;
  11147. } catch (error) {
  11148. reject(error);
  11149. return;
  11150. }
  11151. if (info.done) {
  11152. resolve(value);
  11153. } else {
  11154. Promise.resolve(value).then(_next, _throw);
  11155. }
  11156. }
  11157. function _asyncToGenerator(fn) {
  11158. return function () {
  11159. var self = this,
  11160. args = arguments;
  11161. return new Promise(function (resolve, reject) {
  11162. var gen = fn.apply(self, args);
  11163. function _next(value) {
  11164. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  11165. }
  11166. function _throw(err) {
  11167. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  11168. }
  11169. _next(undefined);
  11170. });
  11171. };
  11172. }
  11173. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11174. /***/ }),
  11175. /***/ 433:
  11176. /*!*************************************************************************************!*\
  11177. !*** E:/work/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/MpHtmlParser.js ***!
  11178. \*************************************************************************************/
  11179. /*! no static exports found */
  11180. /***/ (function(module, exports, __webpack_require__) {
  11181. "use strict";
  11182. /* WEBPACK VAR INJECTION */(function(uni) {
  11183. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11184. Object.defineProperty(exports, "__esModule", {
  11185. value: true
  11186. });
  11187. exports.default = void 0;
  11188. var _config = _interopRequireDefault(__webpack_require__(/*! ./config.js */ 434));
  11189. var _CssHandler = _interopRequireDefault(__webpack_require__(/*! ./CssHandler.js */ 435));
  11190. /**
  11191. * html 解析器
  11192. * @tutorial https://github.com/jin-yufeng/Parser
  11193. * @version 20201029
  11194. * @author JinYufeng
  11195. * @listens MIT
  11196. */
  11197. var blankChar = _config.default.blankChar;
  11198. var windowWidth = uni.getSystemInfoSync().windowWidth;
  11199. var emoji;
  11200. function MpHtmlParser(data) {
  11201. var _this = this;
  11202. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11203. this.attrs = {};
  11204. this.CssHandler = new _CssHandler.default(options.tagStyle, windowWidth);
  11205. this.data = data;
  11206. this.domain = options.domain;
  11207. this.DOM = [];
  11208. this.i = this.start = this.audioNum = this.imgNum = this.videoNum = 0;
  11209. options.prot = (this.domain || '').includes('://') ? this.domain.split('://')[0] : 'http';
  11210. this.options = options;
  11211. this.state = this.Text;
  11212. this.STACK = [];
  11213. // 工具函数
  11214. this.bubble = function () {
  11215. for (var i = _this.STACK.length, item; item = _this.STACK[--i];) {
  11216. if (_config.default.richOnlyTags[item.name]) return false;
  11217. item.c = 1;
  11218. }
  11219. return true;
  11220. };
  11221. this.decode = function (val, amp) {
  11222. var i = -1,
  11223. j,
  11224. en;
  11225. while (1) {
  11226. if ((i = val.indexOf('&', i + 1)) == -1) break;
  11227. if ((j = val.indexOf(';', i + 2)) == -1) break;
  11228. if (val[i + 1] == '#') {
  11229. en = parseInt((val[i + 2] == 'x' ? '0' : '') + val.substring(i + 2, j));
  11230. if (!isNaN(en)) val = val.substr(0, i) + String.fromCharCode(en) + val.substr(j + 1);
  11231. } else {
  11232. en = val.substring(i + 1, j);
  11233. if (_config.default.entities[en] || en == amp) val = val.substr(0, i) + (_config.default.entities[en] || '&') + val.substr(j + 1);
  11234. }
  11235. }
  11236. return val;
  11237. };
  11238. this.getUrl = function (url) {
  11239. if (url[0] == '/') {
  11240. if (url[1] == '/') url = _this.options.prot + ':' + url;else if (_this.domain) url = _this.domain + url;
  11241. } else if (_this.domain && url.indexOf('data:') != 0 && !url.includes('://')) url = _this.domain + '/' + url;
  11242. return url;
  11243. };
  11244. this.isClose = function () {
  11245. return _this.data[_this.i] == '>' || _this.data[_this.i] == '/' && _this.data[_this.i + 1] == '>';
  11246. };
  11247. this.section = function () {
  11248. return _this.data.substring(_this.start, _this.i);
  11249. };
  11250. this.parent = function () {
  11251. return _this.STACK[_this.STACK.length - 1];
  11252. };
  11253. this.siblings = function () {
  11254. return _this.STACK.length ? _this.parent().children : _this.DOM;
  11255. };
  11256. }
  11257. MpHtmlParser.prototype.parse = function () {
  11258. if (emoji) this.data = emoji.parseEmoji(this.data);
  11259. for (var c; c = this.data[this.i]; this.i++) {
  11260. this.state(c);
  11261. }
  11262. if (this.state == this.Text) this.setText();
  11263. while (this.STACK.length) {
  11264. this.popNode(this.STACK.pop());
  11265. }
  11266. return this.DOM;
  11267. };
  11268. // 设置属性
  11269. MpHtmlParser.prototype.setAttr = function () {
  11270. var name = this.attrName.toLowerCase(),
  11271. val = this.attrVal;
  11272. if (_config.default.boolAttrs[name]) this.attrs[name] = 'T';else if (val) {
  11273. if (name == 'src' || name == 'data-src' && !this.attrs.src) this.attrs.src = this.getUrl(this.decode(val, 'amp'));else if (name == 'href' || name == 'style') this.attrs[name] = this.decode(val, 'amp');else if (name.substr(0, 5) != 'data-') this.attrs[name] = val;
  11274. }
  11275. this.attrVal = '';
  11276. while (blankChar[this.data[this.i]]) {
  11277. this.i++;
  11278. }
  11279. if (this.isClose()) this.setNode();else {
  11280. this.start = this.i;
  11281. this.state = this.AttrName;
  11282. }
  11283. };
  11284. // 设置文本节点
  11285. MpHtmlParser.prototype.setText = function () {
  11286. var back,
  11287. text = this.section();
  11288. if (!text) return;
  11289. text = _config.default.onText && _config.default.onText(text, function () {
  11290. return back = true;
  11291. }) || text;
  11292. if (back) {
  11293. this.data = this.data.substr(0, this.start) + text + this.data.substr(this.i);
  11294. var j = this.start + text.length;
  11295. for (this.i = this.start; this.i < j; this.i++) {
  11296. this.state(this.data[this.i]);
  11297. }
  11298. return;
  11299. }
  11300. if (!this.pre) {
  11301. // 合并空白符
  11302. var flag,
  11303. tmp = [];
  11304. for (var i = text.length, c; c = text[--i];) {
  11305. if (!blankChar[c]) {
  11306. tmp.unshift(c);
  11307. if (!flag) flag = 1;
  11308. } else {
  11309. if (tmp[0] != ' ') tmp.unshift(' ');
  11310. if (c == '\n' && flag == void 0) flag = 0;
  11311. }
  11312. }
  11313. if (flag == 0) return;
  11314. text = tmp.join('');
  11315. }
  11316. this.siblings().push({
  11317. type: 'text',
  11318. text: this.decode(text)
  11319. });
  11320. };
  11321. // 设置元素节点
  11322. MpHtmlParser.prototype.setNode = function () {
  11323. var node = {
  11324. name: this.tagName.toLowerCase(),
  11325. attrs: this.attrs
  11326. },
  11327. close = _config.default.selfClosingTags[node.name];
  11328. if (this.options.nodes.length) node.type = 'node';
  11329. this.attrs = {};
  11330. if (!_config.default.ignoreTags[node.name]) {
  11331. // 处理属性
  11332. var attrs = node.attrs,
  11333. style = this.CssHandler.match(node.name, attrs, node) + (attrs.style || ''),
  11334. styleObj = {};
  11335. if (attrs.id) {
  11336. if (this.options.compress & 1) attrs.id = void 0;else if (this.options.useAnchor) this.bubble();
  11337. }
  11338. if (this.options.compress & 2 && attrs.class) attrs.class = void 0;
  11339. switch (node.name) {
  11340. case 'a':
  11341. case 'ad':
  11342. this.bubble();
  11343. break;
  11344. case 'font':
  11345. if (attrs.color) {
  11346. styleObj['color'] = attrs.color;
  11347. attrs.color = void 0;
  11348. }
  11349. if (attrs.face) {
  11350. styleObj['font-family'] = attrs.face;
  11351. attrs.face = void 0;
  11352. }
  11353. if (attrs.size) {
  11354. var size = parseInt(attrs.size);
  11355. if (size < 1) size = 1;else if (size > 7) size = 7;
  11356. var map = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'];
  11357. styleObj['font-size'] = map[size - 1];
  11358. attrs.size = void 0;
  11359. }
  11360. break;
  11361. case 'embed':
  11362. var src = node.attrs.src || '',
  11363. type = node.attrs.type || '';
  11364. if (type.includes('video') || src.includes('.mp4') || src.includes('.3gp') || src.includes('.m3u8')) node.name = 'video';else if (type.includes('audio') || src.includes('.m4a') || src.includes('.wav') || src.includes('.mp3') || src.includes('.aac')) node.name = 'audio';else break;
  11365. if (node.attrs.autostart) node.attrs.autoplay = 'T';
  11366. node.attrs.controls = 'T';
  11367. case 'video':
  11368. case 'audio':
  11369. if (!attrs.id) attrs.id = node.name + ++this["".concat(node.name, "Num")];else this["".concat(node.name, "Num")]++;
  11370. if (node.name == 'video') {
  11371. if (this.videoNum > 3) node.lazyLoad = 1;
  11372. if (attrs.width) {
  11373. styleObj.width = parseFloat(attrs.width) + (attrs.width.includes('%') ? '%' : 'px');
  11374. attrs.width = void 0;
  11375. }
  11376. if (attrs.height) {
  11377. styleObj.height = parseFloat(attrs.height) + (attrs.height.includes('%') ? '%' : 'px');
  11378. attrs.height = void 0;
  11379. }
  11380. }
  11381. if (!attrs.controls && !attrs.autoplay) attrs.controls = 'T';
  11382. attrs.source = [];
  11383. if (attrs.src) {
  11384. attrs.source.push(attrs.src);
  11385. attrs.src = void 0;
  11386. }
  11387. this.bubble();
  11388. break;
  11389. case 'td':
  11390. case 'th':
  11391. if (attrs.colspan || attrs.rowspan) for (var k = this.STACK.length, item; item = this.STACK[--k];) {
  11392. if (item.name == 'table') {
  11393. item.flag = 1;
  11394. break;
  11395. }
  11396. }
  11397. }
  11398. if (attrs.align) {
  11399. if (node.name == 'table') {
  11400. if (attrs.align == 'center') styleObj['margin-inline-start'] = styleObj['margin-inline-end'] = 'auto';else styleObj['float'] = attrs.align;
  11401. } else styleObj['text-align'] = attrs.align;
  11402. attrs.align = void 0;
  11403. }
  11404. // 压缩 style
  11405. var styles = style.split(';');
  11406. style = '';
  11407. for (var i = 0, len = styles.length; i < len; i++) {
  11408. var info = styles[i].split(':');
  11409. if (info.length < 2) continue;
  11410. var _key = info[0].trim().toLowerCase(),
  11411. _value = info.slice(1).join(':').trim();
  11412. if (_value[0] == '-' || _value.includes('safe')) style += ";".concat(_key, ":").concat(_value);else if (!styleObj[_key] || _value.includes('import') || !styleObj[_key].includes('import')) styleObj[_key] = _value;
  11413. }
  11414. if (node.name == 'img') {
  11415. if (attrs.src && !attrs.ignore) {
  11416. if (this.bubble()) attrs.i = (this.imgNum++).toString();else attrs.ignore = 'T';
  11417. }
  11418. if (attrs.ignore) {
  11419. style += ';-webkit-touch-callout:none';
  11420. styleObj['max-width'] = '100%';
  11421. }
  11422. var width;
  11423. if (styleObj.width) width = styleObj.width;else if (attrs.width) width = attrs.width.includes('%') ? attrs.width : parseFloat(attrs.width) + 'px';
  11424. if (width) {
  11425. styleObj.width = width;
  11426. attrs.width = '100%';
  11427. if (parseInt(width) > windowWidth) {
  11428. styleObj.height = '';
  11429. if (attrs.height) attrs.height = void 0;
  11430. }
  11431. }
  11432. if (styleObj.height) {
  11433. attrs.height = styleObj.height;
  11434. styleObj.height = '';
  11435. } else if (attrs.height && !attrs.height.includes('%')) attrs.height = parseFloat(attrs.height) + 'px';
  11436. }
  11437. for (var key in styleObj) {
  11438. var value = styleObj[key];
  11439. if (!value) continue;
  11440. if (key.includes('flex') || key == 'order' || key == 'self-align') node.c = 1;
  11441. // 填充链接
  11442. if (value.includes('url')) {
  11443. var j = value.indexOf('(');
  11444. if (j++ != -1) {
  11445. while (value[j] == '"' || value[j] == "'" || blankChar[value[j]]) {
  11446. j++;
  11447. }
  11448. value = value.substr(0, j) + this.getUrl(value.substr(j));
  11449. }
  11450. }
  11451. // 转换 rpx
  11452. else if (value.includes('rpx')) value = value.replace(/[0-9.]+\s*rpx/g, function ($) {
  11453. return parseFloat($) * windowWidth / 750 + 'px';
  11454. });else if (key == 'white-space' && value.includes('pre') && !close) this.pre = node.pre = true;
  11455. style += ";".concat(key, ":").concat(value);
  11456. }
  11457. style = style.substr(1);
  11458. if (style) attrs.style = style;
  11459. if (!close) {
  11460. node.children = [];
  11461. if (node.name == 'pre' && _config.default.highlight) {
  11462. this.remove(node);
  11463. this.pre = node.pre = true;
  11464. }
  11465. this.siblings().push(node);
  11466. this.STACK.push(node);
  11467. } else if (!_config.default.filter || _config.default.filter(node, this) != false) this.siblings().push(node);
  11468. } else {
  11469. if (!close) this.remove(node);else if (node.name == 'source') {
  11470. var parent = this.parent();
  11471. if (parent && (parent.name == 'video' || parent.name == 'audio') && node.attrs.src) parent.attrs.source.push(node.attrs.src);
  11472. } else if (node.name == 'base' && !this.domain) this.domain = node.attrs.href;
  11473. }
  11474. if (this.data[this.i] == '/') this.i++;
  11475. this.start = this.i + 1;
  11476. this.state = this.Text;
  11477. };
  11478. // 移除标签
  11479. MpHtmlParser.prototype.remove = function (node) {
  11480. var _this2 = this;
  11481. var name = node.name,
  11482. j = this.i;
  11483. // 处理 svg
  11484. var handleSvg = function handleSvg() {
  11485. var src = _this2.data.substring(j, _this2.i + 1);
  11486. node.attrs.xmlns = 'http://www.w3.org/2000/svg';
  11487. for (var key in node.attrs) {
  11488. if (key == 'viewbox') src = " viewBox=\"".concat(node.attrs.viewbox, "\"") + src;else if (key != 'style') src = " ".concat(key, "=\"").concat(node.attrs[key], "\"") + src;
  11489. }
  11490. src = '<svg' + src;
  11491. var parent = _this2.parent();
  11492. if (node.attrs.width == '100%' && parent && (parent.attrs.style || '').includes('inline')) parent.attrs.style = 'width:300px;max-width:100%;' + parent.attrs.style;
  11493. _this2.siblings().push({
  11494. name: 'img',
  11495. attrs: {
  11496. src: 'data:image/svg+xml;utf8,' + src.replace(/#/g, '%23'),
  11497. style: node.attrs.style,
  11498. ignore: 'T'
  11499. }
  11500. });
  11501. };
  11502. if (node.name == 'svg' && this.data[j] == '/') return handleSvg(this.i++);
  11503. while (1) {
  11504. if ((this.i = this.data.indexOf('</', this.i + 1)) == -1) {
  11505. if (name == 'pre' || name == 'svg') this.i = j;else this.i = this.data.length;
  11506. return;
  11507. }
  11508. this.start = this.i += 2;
  11509. while (!blankChar[this.data[this.i]] && !this.isClose()) {
  11510. this.i++;
  11511. }
  11512. if (this.section().toLowerCase() == name) {
  11513. // 代码块高亮
  11514. if (name == 'pre') {
  11515. this.data = this.data.substr(0, j + 1) + _config.default.highlight(this.data.substring(j + 1, this.i - 5), node.attrs) + this.data.substr(this.i - 5);
  11516. return this.i = j;
  11517. } else if (name == 'style') this.CssHandler.getStyle(this.data.substring(j + 1, this.i - 7));else if (name == 'title') this.DOM.title = this.data.substring(j + 1, this.i - 7);
  11518. if ((this.i = this.data.indexOf('>', this.i)) == -1) this.i = this.data.length;
  11519. if (name == 'svg') handleSvg();
  11520. return;
  11521. }
  11522. }
  11523. };
  11524. // 节点出栈处理
  11525. MpHtmlParser.prototype.popNode = function (node) {
  11526. // 空白符处理
  11527. if (node.pre) {
  11528. node.pre = this.pre = void 0;
  11529. for (var i = this.STACK.length; i--;) {
  11530. if (this.STACK[i].pre) this.pre = true;
  11531. }
  11532. }
  11533. var siblings = this.siblings(),
  11534. len = siblings.length,
  11535. childs = node.children;
  11536. if (node.name == 'head' || _config.default.filter && _config.default.filter(node, this) == false) return siblings.pop();
  11537. var attrs = node.attrs;
  11538. // 替换一些标签名
  11539. if (_config.default.blockTags[node.name]) node.name = 'div';else if (!_config.default.trustTags[node.name]) node.name = 'span';
  11540. // 处理列表
  11541. if (node.c && (node.name == 'ul' || node.name == 'ol')) {
  11542. if ((node.attrs.style || '').includes('list-style:none')) {
  11543. for (var _i = 0, child; child = childs[_i++];) {
  11544. if (child.name == 'li') child.name = 'div';
  11545. }
  11546. } else if (node.name == 'ul') {
  11547. var floor = 1;
  11548. for (var _i2 = this.STACK.length; _i2--;) {
  11549. if (this.STACK[_i2].name == 'ul') floor++;
  11550. }
  11551. if (floor != 1) for (var _i3 = childs.length; _i3--;) {
  11552. childs[_i3].floor = floor;
  11553. }
  11554. } else {
  11555. for (var _i4 = 0, num = 1, _child; _child = childs[_i4++];) {
  11556. if (_child.name == 'li') {
  11557. _child.type = 'ol';
  11558. _child.num = function (num, type) {
  11559. if (type == 'a') return String.fromCharCode(97 + (num - 1) % 26);
  11560. if (type == 'A') return String.fromCharCode(65 + (num - 1) % 26);
  11561. if (type == 'i' || type == 'I') {
  11562. num = (num - 1) % 99 + 1;
  11563. var one = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'],
  11564. ten = ['X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'],
  11565. res = (ten[Math.floor(num / 10) - 1] || '') + (one[num % 10 - 1] || '');
  11566. if (type == 'i') return res.toLowerCase();
  11567. return res;
  11568. }
  11569. return num;
  11570. }(num++, attrs.type) + '.';
  11571. }
  11572. }
  11573. }
  11574. }
  11575. // 处理表格
  11576. if (node.name == 'table') {
  11577. var padding = parseFloat(attrs.cellpadding),
  11578. spacing = parseFloat(attrs.cellspacing),
  11579. border = parseFloat(attrs.border);
  11580. if (node.c) {
  11581. if (isNaN(padding)) padding = 2;
  11582. if (isNaN(spacing)) spacing = 2;
  11583. }
  11584. if (border) attrs.style = "border:".concat(border, "px solid gray;").concat(attrs.style || '');
  11585. if (node.flag && node.c) {
  11586. // 有 colspan 或 rowspan 且含有链接的表格转为 grid 布局实现
  11587. attrs.style = "".concat(attrs.style || '', ";").concat(spacing ? ";grid-gap:".concat(spacing, "px") : ';border-left:0;border-top:0');
  11588. var row = 1,
  11589. col = 1,
  11590. colNum,
  11591. trs = [],
  11592. children = [],
  11593. map = {};
  11594. (function f(ns) {
  11595. for (var i = 0; i < ns.length; i++) {
  11596. if (ns[i].name == 'tr') trs.push(ns[i]);else f(ns[i].children || []);
  11597. }
  11598. })(node.children);
  11599. for (var _i5 = 0; _i5 < trs.length; _i5++) {
  11600. for (var j = 0, td; td = trs[_i5].children[j]; j++) {
  11601. if (td.name == 'td' || td.name == 'th') {
  11602. while (map[row + '.' + col]) {
  11603. col++;
  11604. }
  11605. var cell = {
  11606. name: 'div',
  11607. c: 1,
  11608. attrs: {
  11609. style: (td.attrs.style || '') + (border ? ";border:".concat(border, "px solid gray") + (spacing ? '' : ';border-right:0;border-bottom:0') : '') + (padding ? ";padding:".concat(padding, "px") : '')
  11610. },
  11611. children: td.children
  11612. };
  11613. if (td.attrs.colspan) {
  11614. cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + parseInt(td.attrs.colspan));
  11615. if (!td.attrs.rowspan) cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + 1);
  11616. col += parseInt(td.attrs.colspan) - 1;
  11617. }
  11618. if (td.attrs.rowspan) {
  11619. cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + parseInt(td.attrs.rowspan));
  11620. if (!td.attrs.colspan) cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + 1);
  11621. for (var k = 1; k < td.attrs.rowspan; k++) {
  11622. map[row + k + '.' + col] = 1;
  11623. }
  11624. }
  11625. children.push(cell);
  11626. col++;
  11627. }
  11628. }
  11629. if (!colNum) {
  11630. colNum = col - 1;
  11631. attrs.style += ";grid-template-columns:repeat(".concat(colNum, ",auto)");
  11632. }
  11633. col = 1;
  11634. row++;
  11635. }
  11636. node.children = children;
  11637. } else {
  11638. attrs.style = "border-spacing:".concat(spacing, "px;").concat(attrs.style || '');
  11639. if (border || padding) (function f(ns) {
  11640. for (var i = 0, n; n = ns[i]; i++) {
  11641. if (n.name == 'th' || n.name == 'td') {
  11642. if (border) n.attrs.style = "border:".concat(border, "px solid gray;").concat(n.attrs.style || '');
  11643. if (padding) n.attrs.style = "padding:".concat(padding, "px;").concat(n.attrs.style || '');
  11644. } else f(n.children || []);
  11645. }
  11646. })(childs);
  11647. }
  11648. if (this.options.autoscroll) {
  11649. var table = Object.assign({}, node);
  11650. node.name = 'div';
  11651. node.attrs = {
  11652. style: 'overflow:scroll'
  11653. };
  11654. node.children = [table];
  11655. }
  11656. }
  11657. this.CssHandler.pop && this.CssHandler.pop(node);
  11658. // 自动压缩
  11659. if (node.name == 'div' && !Object.keys(attrs).length && childs.length == 1 && childs[0].name == 'div') siblings[len - 1] = childs[0];
  11660. };
  11661. // 状态机
  11662. MpHtmlParser.prototype.Text = function (c) {
  11663. if (c == '<') {
  11664. var next = this.data[this.i + 1],
  11665. isLetter = function isLetter(c) {
  11666. return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';
  11667. };
  11668. if (isLetter(next)) {
  11669. this.setText();
  11670. this.start = this.i + 1;
  11671. this.state = this.TagName;
  11672. } else if (next == '/') {
  11673. this.setText();
  11674. if (isLetter(this.data[++this.i + 1])) {
  11675. this.start = this.i + 1;
  11676. this.state = this.EndTag;
  11677. } else this.Comment();
  11678. } else if (next == '!' || next == '?') {
  11679. this.setText();
  11680. this.Comment();
  11681. }
  11682. }
  11683. };
  11684. MpHtmlParser.prototype.Comment = function () {
  11685. var key;
  11686. if (this.data.substring(this.i + 2, this.i + 4) == '--') key = '-->';else if (this.data.substring(this.i + 2, this.i + 9) == '[CDATA[') key = ']]>';else key = '>';
  11687. if ((this.i = this.data.indexOf(key, this.i + 2)) == -1) this.i = this.data.length;else this.i += key.length - 1;
  11688. this.start = this.i + 1;
  11689. this.state = this.Text;
  11690. };
  11691. MpHtmlParser.prototype.TagName = function (c) {
  11692. if (blankChar[c]) {
  11693. this.tagName = this.section();
  11694. while (blankChar[this.data[this.i]]) {
  11695. this.i++;
  11696. }
  11697. if (this.isClose()) this.setNode();else {
  11698. this.start = this.i;
  11699. this.state = this.AttrName;
  11700. }
  11701. } else if (this.isClose()) {
  11702. this.tagName = this.section();
  11703. this.setNode();
  11704. }
  11705. };
  11706. MpHtmlParser.prototype.AttrName = function (c) {
  11707. if (c == '=' || blankChar[c] || this.isClose()) {
  11708. this.attrName = this.section();
  11709. if (blankChar[c]) while (blankChar[this.data[++this.i]]) {
  11710. ;
  11711. }
  11712. if (this.data[this.i] == '=') {
  11713. while (blankChar[this.data[++this.i]]) {
  11714. ;
  11715. }
  11716. this.start = this.i--;
  11717. this.state = this.AttrValue;
  11718. } else this.setAttr();
  11719. }
  11720. };
  11721. MpHtmlParser.prototype.AttrValue = function (c) {
  11722. if (c == '"' || c == "'") {
  11723. this.start++;
  11724. if ((this.i = this.data.indexOf(c, this.i + 1)) == -1) return this.i = this.data.length;
  11725. this.attrVal = this.section();
  11726. this.i++;
  11727. } else {
  11728. for (; !blankChar[this.data[this.i]] && !this.isClose(); this.i++) {
  11729. ;
  11730. }
  11731. this.attrVal = this.section();
  11732. }
  11733. this.setAttr();
  11734. };
  11735. MpHtmlParser.prototype.EndTag = function (c) {
  11736. if (blankChar[c] || c == '>' || c == '/') {
  11737. var name = this.section().toLowerCase();
  11738. for (var i = this.STACK.length; i--;) {
  11739. if (this.STACK[i].name == name) break;
  11740. }
  11741. if (i != -1) {
  11742. var node;
  11743. while ((node = this.STACK.pop()).name != name) {
  11744. this.popNode(node);
  11745. }
  11746. this.popNode(node);
  11747. } else if (name == 'p' || name == 'br') this.siblings().push({
  11748. name: name,
  11749. attrs: {}
  11750. });
  11751. this.i = this.data.indexOf('>', this.i);
  11752. this.start = this.i + 1;
  11753. if (this.i == -1) this.i = this.data.length;else this.state = this.Text;
  11754. }
  11755. };
  11756. var _default = MpHtmlParser;
  11757. exports.default = _default;
  11758. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  11759. /***/ }),
  11760. /***/ 434:
  11761. /*!*******************************************************************************!*\
  11762. !*** E:/work/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/config.js ***!
  11763. \*******************************************************************************/
  11764. /*! no static exports found */
  11765. /***/ (function(module, exports, __webpack_require__) {
  11766. "use strict";
  11767. /* WEBPACK VAR INJECTION */(function(wx) {
  11768. Object.defineProperty(exports, "__esModule", {
  11769. value: true
  11770. });
  11771. exports.default = void 0;
  11772. /* 配置文件 */
  11773. var cfg = {
  11774. // 出错占位图
  11775. errorImg: null,
  11776. // 过滤器函数
  11777. filter: null,
  11778. // 代码高亮函数
  11779. highlight: null,
  11780. // 文本处理函数
  11781. onText: null,
  11782. // 实体编码列表
  11783. entities: {
  11784. quot: '"',
  11785. apos: "'",
  11786. semi: ';',
  11787. nbsp: '\xA0',
  11788. ensp: "\u2002",
  11789. emsp: "\u2003",
  11790. ndash: '–',
  11791. mdash: '—',
  11792. middot: '·',
  11793. lsquo: '‘',
  11794. rsquo: '’',
  11795. ldquo: '“',
  11796. rdquo: '”',
  11797. bull: '•',
  11798. hellip: '…'
  11799. },
  11800. blankChar: makeMap(' ,\xA0,\t,\r,\n,\f'),
  11801. boolAttrs: makeMap('allowfullscreen,autoplay,autostart,controls,ignore,loop,muted'),
  11802. // 块级标签,将被转为 div
  11803. blockTags: makeMap('address,article,aside,body,caption,center,cite,footer,header,html,nav,pre,section'),
  11804. // 将被移除的标签
  11805. ignoreTags: makeMap('area,base,canvas,frame,iframe,input,link,map,meta,param,script,source,style,svg,textarea,title,track,wbr'),
  11806. // 只能被 rich-text 显示的标签
  11807. richOnlyTags: makeMap('a,colgroup,fieldset,legend'),
  11808. // 自闭合的标签
  11809. selfClosingTags: makeMap('area,base,br,col,circle,ellipse,embed,frame,hr,img,input,line,link,meta,param,path,polygon,rect,source,track,use,wbr'),
  11810. // 信任的标签
  11811. 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'),
  11812. // 默认的标签样式
  11813. userAgentStyles: {
  11814. address: 'font-style:italic',
  11815. big: 'display:inline;font-size:1.2em',
  11816. blockquote: 'background-color:#f6f6f6;border-left:3px solid #dbdbdb;color:#6c6c6c;padding:5px 0 5px 10px',
  11817. caption: 'display:table-caption;text-align:center',
  11818. center: 'text-align:center',
  11819. cite: 'font-style:italic',
  11820. dd: 'margin-left:40px',
  11821. mark: 'background-color:yellow',
  11822. pre: 'font-family:monospace;white-space:pre;overflow:scroll',
  11823. s: 'text-decoration:line-through',
  11824. small: 'display:inline;font-size:0.8em',
  11825. u: 'text-decoration:underline'
  11826. }
  11827. };
  11828. function makeMap(str) {
  11829. var map = Object.create(null),
  11830. list = str.split(',');
  11831. for (var i = list.length; i--;) {
  11832. map[list[i]] = true;
  11833. }
  11834. return map;
  11835. }
  11836. if (wx.canIUse('editor')) {
  11837. cfg.blockTags.pre = void 0;
  11838. cfg.ignoreTags.rp = true;
  11839. Object.assign(cfg.richOnlyTags, makeMap('bdi,bdo,caption,rt,ruby'));
  11840. Object.assign(cfg.trustTags, makeMap('bdi,bdo,caption,pre,rt,ruby'));
  11841. }
  11842. var _default = cfg;
  11843. exports.default = _default;
  11844. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  11845. /***/ }),
  11846. /***/ 435:
  11847. /*!***********************************************************************************!*\
  11848. !*** E:/work/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/CssHandler.js ***!
  11849. \***********************************************************************************/
  11850. /*! no static exports found */
  11851. /***/ (function(module, exports, __webpack_require__) {
  11852. "use strict";
  11853. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11854. Object.defineProperty(exports, "__esModule", {
  11855. value: true
  11856. });
  11857. exports.default = void 0;
  11858. var _config = _interopRequireDefault(__webpack_require__(/*! ./config.js */ 434));
  11859. var isLetter = function isLetter(c) {
  11860. return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';
  11861. };
  11862. function CssHandler(tagStyle) {
  11863. var styles = Object.assign(Object.create(null), _config.default.userAgentStyles);
  11864. for (var item in tagStyle) {
  11865. styles[item] = (styles[item] ? styles[item] + ';' : '') + tagStyle[item];
  11866. }
  11867. this.styles = styles;
  11868. }
  11869. CssHandler.prototype.getStyle = function (data) {
  11870. this.styles = new parser(data, this.styles).parse();
  11871. };
  11872. CssHandler.prototype.match = function (name, attrs) {
  11873. var tmp,
  11874. matched = (tmp = this.styles[name]) ? tmp + ';' : '';
  11875. if (attrs.class) {
  11876. var items = attrs.class.split(' ');
  11877. for (var i = 0, item; item = items[i]; i++) {
  11878. if (tmp = this.styles['.' + item]) matched += tmp + ';';
  11879. }
  11880. }
  11881. if (tmp = this.styles['#' + attrs.id]) matched += tmp + ';';
  11882. return matched;
  11883. };
  11884. var _default = CssHandler;
  11885. exports.default = _default;
  11886. function parser(data, init) {
  11887. this.data = data;
  11888. this.floor = 0;
  11889. this.i = 0;
  11890. this.list = [];
  11891. this.res = init;
  11892. this.state = this.Space;
  11893. }
  11894. parser.prototype.parse = function () {
  11895. for (var c; c = this.data[this.i]; this.i++) {
  11896. this.state(c);
  11897. }
  11898. return this.res;
  11899. };
  11900. parser.prototype.section = function () {
  11901. return this.data.substring(this.start, this.i);
  11902. };
  11903. // 状态机
  11904. parser.prototype.Space = function (c) {
  11905. if (c == '.' || c == '#' || isLetter(c)) {
  11906. this.start = this.i;
  11907. this.state = this.Name;
  11908. } else if (c == '/' && this.data[this.i + 1] == '*') this.Comment();else if (!_config.default.blankChar[c] && c != ';') this.state = this.Ignore;
  11909. };
  11910. parser.prototype.Comment = function () {
  11911. this.i = this.data.indexOf('*/', this.i) + 1;
  11912. if (!this.i) this.i = this.data.length;
  11913. this.state = this.Space;
  11914. };
  11915. parser.prototype.Ignore = function (c) {
  11916. if (c == '{') this.floor++;else if (c == '}' && ! --this.floor) {
  11917. this.list = [];
  11918. this.state = this.Space;
  11919. }
  11920. };
  11921. parser.prototype.Name = function (c) {
  11922. if (_config.default.blankChar[c]) {
  11923. this.list.push(this.section());
  11924. this.state = this.NameSpace;
  11925. } else if (c == '{') {
  11926. this.list.push(this.section());
  11927. this.Content();
  11928. } else if (c == ',') {
  11929. this.list.push(this.section());
  11930. this.Comma();
  11931. } else if (!isLetter(c) && (c < '0' || c > '9') && c != '-' && c != '_') this.state = this.Ignore;
  11932. };
  11933. parser.prototype.NameSpace = function (c) {
  11934. if (c == '{') this.Content();else if (c == ',') this.Comma();else if (!_config.default.blankChar[c]) this.state = this.Ignore;
  11935. };
  11936. parser.prototype.Comma = function () {
  11937. while (_config.default.blankChar[this.data[++this.i]]) {
  11938. ;
  11939. }
  11940. if (this.data[this.i] == '{') this.Content();else {
  11941. this.start = this.i--;
  11942. this.state = this.Name;
  11943. }
  11944. };
  11945. parser.prototype.Content = function () {
  11946. this.start = ++this.i;
  11947. if ((this.i = this.data.indexOf('}', this.i)) == -1) this.i = this.data.length;
  11948. var content = this.section();
  11949. for (var i = 0, item; item = this.list[i++];) {
  11950. if (this.res[item]) this.res[item] += ';' + content;else this.res[item] = content;
  11951. }
  11952. this.list = [];
  11953. this.state = this.Space;
  11954. };
  11955. /***/ }),
  11956. /***/ 44:
  11957. /*!*************************************************************************!*\
  11958. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/timeFormat.js ***!
  11959. \*************************************************************************/
  11960. /*! no static exports found */
  11961. /***/ (function(module, exports, __webpack_require__) {
  11962. "use strict";
  11963. Object.defineProperty(exports, "__esModule", {
  11964. value: true
  11965. });
  11966. exports.default = void 0;
  11967. // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
  11968. // 所以这里做一个兼容polyfill的兼容处理
  11969. if (!String.prototype.padStart) {
  11970. // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
  11971. String.prototype.padStart = function (maxLength) {
  11972. var fillString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
  11973. if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError('fillString must be String');
  11974. var str = this;
  11975. // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
  11976. if (str.length >= maxLength) return String(str);
  11977. var fillLength = maxLength - str.length,
  11978. times = Math.ceil(fillLength / fillString.length);
  11979. while (times >>= 1) {
  11980. fillString += fillString;
  11981. if (times === 1) {
  11982. fillString += fillString;
  11983. }
  11984. }
  11985. return fillString.slice(0, fillLength) + str;
  11986. };
  11987. }
  11988. // 其他更多是格式化有如下:
  11989. // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
  11990. function timeFormat() {
  11991. var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  11992. var fmt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  11993. // 如果为null,则格式化当前时间
  11994. if (!dateTime) dateTime = Number(new Date());
  11995. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  11996. if (dateTime.toString().length == 10) dateTime *= 1000;
  11997. var date = new Date(dateTime);
  11998. var ret;
  11999. var opt = {
  12000. "y+": date.getFullYear().toString(),
  12001. // 年
  12002. "m+": (date.getMonth() + 1).toString(),
  12003. // 月
  12004. "d+": date.getDate().toString(),
  12005. // 日
  12006. "h+": date.getHours().toString(),
  12007. // 时
  12008. "M+": date.getMinutes().toString(),
  12009. // 分
  12010. "s+": date.getSeconds().toString() // 秒
  12011. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  12012. };
  12013. for (var k in opt) {
  12014. ret = new RegExp("(" + k + ")").exec(fmt);
  12015. if (ret) {
  12016. fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
  12017. }
  12018. ;
  12019. }
  12020. ;
  12021. return fmt;
  12022. }
  12023. var _default = timeFormat;
  12024. exports.default = _default;
  12025. /***/ }),
  12026. /***/ 45:
  12027. /*!***********************************************************************!*\
  12028. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/timeFrom.js ***!
  12029. \***********************************************************************/
  12030. /*! no static exports found */
  12031. /***/ (function(module, exports, __webpack_require__) {
  12032. "use strict";
  12033. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  12034. Object.defineProperty(exports, "__esModule", {
  12035. value: true
  12036. });
  12037. exports.default = void 0;
  12038. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ../../libs/function/timeFormat.js */ 44));
  12039. /**
  12040. * 时间戳转为多久之前
  12041. * @param String timestamp 时间戳
  12042. * @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
  12043. * 如果为布尔值false,无论什么时间,都返回多久以前的格式
  12044. */
  12045. function timeFrom() {
  12046. var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  12047. var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  12048. // 如果为null,则格式化当前时间
  12049. if (!dateTime) dateTime = Number(new Date());
  12050. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  12051. if (dateTime.toString().length == 10) dateTime *= 1000;
  12052. var timestamp = +new Date(Number(dateTime));
  12053. var timer = (Number(new Date()) - timestamp) / 1000;
  12054. // 如果小于5分钟,则返回"刚刚",其他以此类推
  12055. var tips = '';
  12056. switch (true) {
  12057. case timer < 300:
  12058. tips = '刚刚';
  12059. break;
  12060. case timer >= 300 && timer < 3600:
  12061. tips = parseInt(timer / 60) + '分钟前';
  12062. break;
  12063. case timer >= 3600 && timer < 86400:
  12064. tips = parseInt(timer / 3600) + '小时前';
  12065. break;
  12066. case timer >= 86400 && timer < 2592000:
  12067. tips = parseInt(timer / 86400) + '天前';
  12068. break;
  12069. default:
  12070. // 如果format为false,则无论什么时间戳,都显示xx之前
  12071. if (format === false) {
  12072. if (timer >= 2592000 && timer < 365 * 86400) {
  12073. tips = parseInt(timer / (86400 * 30)) + '个月前';
  12074. } else {
  12075. tips = parseInt(timer / (86400 * 365)) + '年前';
  12076. }
  12077. } else {
  12078. tips = (0, _timeFormat.default)(timestamp, format);
  12079. }
  12080. }
  12081. return tips;
  12082. }
  12083. var _default = timeFrom;
  12084. exports.default = _default;
  12085. /***/ }),
  12086. /***/ 46:
  12087. /*!****************************************************************************!*\
  12088. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/colorGradient.js ***!
  12089. \****************************************************************************/
  12090. /*! no static exports found */
  12091. /***/ (function(module, exports, __webpack_require__) {
  12092. "use strict";
  12093. Object.defineProperty(exports, "__esModule", {
  12094. value: true
  12095. });
  12096. exports.default = void 0;
  12097. /**
  12098. * 求两个颜色之间的渐变值
  12099. * @param {string} startColor 开始的颜色
  12100. * @param {string} endColor 结束的颜色
  12101. * @param {number} step 颜色等分的份额
  12102. * */
  12103. function colorGradient() {
  12104. var startColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rgb(0, 0, 0)';
  12105. var endColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rgb(255, 255, 255)';
  12106. var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
  12107. var startRGB = hexToRgb(startColor, false); //转换为rgb数组模式
  12108. var startR = startRGB[0];
  12109. var startG = startRGB[1];
  12110. var startB = startRGB[2];
  12111. var endRGB = hexToRgb(endColor, false);
  12112. var endR = endRGB[0];
  12113. var endG = endRGB[1];
  12114. var endB = endRGB[2];
  12115. var sR = (endR - startR) / step; //总差值
  12116. var sG = (endG - startG) / step;
  12117. var sB = (endB - startB) / step;
  12118. var colorArr = [];
  12119. for (var i = 0; i < step; i++) {
  12120. //计算每一步的hex值
  12121. var hex = rgbToHex('rgb(' + Math.round(sR * i + startR) + ',' + Math.round(sG * i + startG) + ',' + Math.round(sB * i + startB) + ')');
  12122. colorArr.push(hex);
  12123. }
  12124. return colorArr;
  12125. }
  12126. // 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式)
  12127. function hexToRgb(sColor) {
  12128. var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  12129. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  12130. sColor = sColor.toLowerCase();
  12131. if (sColor && reg.test(sColor)) {
  12132. if (sColor.length === 4) {
  12133. var sColorNew = "#";
  12134. for (var i = 1; i < 4; i += 1) {
  12135. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  12136. }
  12137. sColor = sColorNew;
  12138. }
  12139. //处理六位的颜色值
  12140. var sColorChange = [];
  12141. for (var _i = 1; _i < 7; _i += 2) {
  12142. sColorChange.push(parseInt("0x" + sColor.slice(_i, _i + 2)));
  12143. }
  12144. if (!str) {
  12145. return sColorChange;
  12146. } else {
  12147. return "rgb(".concat(sColorChange[0], ",").concat(sColorChange[1], ",").concat(sColorChange[2], ")");
  12148. }
  12149. } else if (/^(rgb|RGB)/.test(sColor)) {
  12150. var arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  12151. return arr.map(function (val) {
  12152. return Number(val);
  12153. });
  12154. } else {
  12155. return sColor;
  12156. }
  12157. }
  12158. ;
  12159. // 将rgb表示方式转换为hex表示方式
  12160. function rgbToHex(rgb) {
  12161. var _this = rgb;
  12162. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  12163. if (/^(rgb|RGB)/.test(_this)) {
  12164. var aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  12165. var strHex = "#";
  12166. for (var i = 0; i < aColor.length; i++) {
  12167. var hex = Number(aColor[i]).toString(16);
  12168. hex = String(hex).length == 1 ? 0 + '' + hex : hex; // 保证每个rgb的值为2位
  12169. if (hex === "0") {
  12170. hex += hex;
  12171. }
  12172. strHex += hex;
  12173. }
  12174. if (strHex.length !== 7) {
  12175. strHex = _this;
  12176. }
  12177. return strHex;
  12178. } else if (reg.test(_this)) {
  12179. var aNum = _this.replace(/#/, "").split("");
  12180. if (aNum.length === 6) {
  12181. return _this;
  12182. } else if (aNum.length === 3) {
  12183. var numHex = "#";
  12184. for (var _i2 = 0; _i2 < aNum.length; _i2 += 1) {
  12185. numHex += aNum[_i2] + aNum[_i2];
  12186. }
  12187. return numHex;
  12188. }
  12189. } else {
  12190. return _this;
  12191. }
  12192. }
  12193. /**
  12194. * JS颜色十六进制转换为rgb或rgba,返回的格式为 rgba(255,255,255,0.5)字符串
  12195. * sHex为传入的十六进制的色值
  12196. * alpha为rgba的透明度
  12197. */
  12198. function colorToRgba(color) {
  12199. var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.3;
  12200. color = rgbToHex(color);
  12201. // 十六进制颜色值的正则表达式
  12202. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  12203. /* 16进制颜色转为RGB格式 */
  12204. var sColor = color.toLowerCase();
  12205. if (sColor && reg.test(sColor)) {
  12206. if (sColor.length === 4) {
  12207. var sColorNew = '#';
  12208. for (var i = 1; i < 4; i += 1) {
  12209. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  12210. }
  12211. sColor = sColorNew;
  12212. }
  12213. // 处理六位的颜色值
  12214. var sColorChange = [];
  12215. for (var _i3 = 1; _i3 < 7; _i3 += 2) {
  12216. sColorChange.push(parseInt('0x' + sColor.slice(_i3, _i3 + 2)));
  12217. }
  12218. // return sColorChange.join(',')
  12219. return 'rgba(' + sColorChange.join(',') + ',' + alpha + ')';
  12220. } else {
  12221. return sColor;
  12222. }
  12223. }
  12224. var _default = {
  12225. colorGradient: colorGradient,
  12226. hexToRgb: hexToRgb,
  12227. rgbToHex: rgbToHex,
  12228. colorToRgba: colorToRgba
  12229. };
  12230. exports.default = _default;
  12231. /***/ }),
  12232. /***/ 47:
  12233. /*!*******************************************************************!*\
  12234. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/guid.js ***!
  12235. \*******************************************************************/
  12236. /*! no static exports found */
  12237. /***/ (function(module, exports, __webpack_require__) {
  12238. "use strict";
  12239. Object.defineProperty(exports, "__esModule", {
  12240. value: true
  12241. });
  12242. exports.default = void 0;
  12243. /**
  12244. * 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85
  12245. * 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier)
  12246. * 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题
  12247. * 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱
  12248. * v-for的时候,推荐使用后端返回的id而不是循环的index
  12249. * @param {Number} len uuid的长度
  12250. * @param {Boolean} firstU 将返回的首字母置为"u"
  12251. * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
  12252. */
  12253. function guid() {
  12254. var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;
  12255. var firstU = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  12256. var radix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  12257. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  12258. var uuid = [];
  12259. radix = radix || chars.length;
  12260. if (len) {
  12261. // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
  12262. for (var i = 0; i < len; i++) {
  12263. uuid[i] = chars[0 | Math.random() * radix];
  12264. }
  12265. } else {
  12266. var r;
  12267. // rfc4122标准要求返回的uuid中,某些位为固定的字符
  12268. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  12269. uuid[14] = '4';
  12270. for (var _i = 0; _i < 36; _i++) {
  12271. if (!uuid[_i]) {
  12272. r = 0 | Math.random() * 16;
  12273. uuid[_i] = chars[_i == 19 ? r & 0x3 | 0x8 : r];
  12274. }
  12275. }
  12276. }
  12277. // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
  12278. if (firstU) {
  12279. uuid.shift();
  12280. return 'u' + uuid.join('');
  12281. } else {
  12282. return uuid.join('');
  12283. }
  12284. }
  12285. var _default = guid;
  12286. exports.default = _default;
  12287. /***/ }),
  12288. /***/ 471:
  12289. /*!******************************************************************!*\
  12290. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/util/emitter.js ***!
  12291. \******************************************************************/
  12292. /*! no static exports found */
  12293. /***/ (function(module, exports, __webpack_require__) {
  12294. "use strict";
  12295. Object.defineProperty(exports, "__esModule", {
  12296. value: true
  12297. });
  12298. exports.default = void 0;
  12299. /**
  12300. * 递归使用 call 方式this指向
  12301. * @param componentName // 需要找的组件的名称
  12302. * @param eventName // 事件名称
  12303. * @param params // 需要传递的参数
  12304. */
  12305. function _broadcast(componentName, eventName, params) {
  12306. // 循环子节点找到名称一样的子节点 否则 递归 当前子节点
  12307. var $children;
  12308. $children = this.$children;
  12309. $children.map(function (child) {
  12310. if (componentName === child.$options.name) {
  12311. child.$emit.apply(child, [eventName].concat(params));
  12312. } else {
  12313. _broadcast.apply(child, [componentName, eventName].concat(params));
  12314. }
  12315. });
  12316. }
  12317. var _default = {
  12318. methods: {
  12319. /**
  12320. * 派发 (向上查找) (一个)
  12321. * @param componentName // 需要找的组件的名称
  12322. * @param eventName // 事件名称
  12323. * @param params // 需要传递的参数
  12324. */
  12325. dispatch: function dispatch(componentName, eventName, params) {
  12326. var parent = this.$parent || this.$root; //$parent 找到最近的父节点 $root 根节点
  12327. var name = parent.$options.name; // 获取当前组件实例的name
  12328. // 如果当前有节点 && 当前没名称 且 当前名称等于需要传进来的名称的时候就去查找当前的节点
  12329. // 循环出当前名称的一样的组件实例
  12330. while (parent && (!name || name !== componentName)) {
  12331. parent = parent.$parent;
  12332. if (parent) {
  12333. name = parent.$options.name;
  12334. }
  12335. }
  12336. // 有节点表示当前找到了name一样的实例
  12337. if (parent) {
  12338. parent.$emit.apply(parent, [eventName].concat(params));
  12339. }
  12340. },
  12341. /**
  12342. * 广播 (向下查找) (广播多个)
  12343. * @param componentName // 需要找的组件的名称
  12344. * @param eventName // 事件名称
  12345. * @param params // 需要传递的参数
  12346. */
  12347. broadcast: function broadcast(componentName, eventName, params) {
  12348. _broadcast.call(this, componentName, eventName, params);
  12349. }
  12350. }
  12351. };
  12352. exports.default = _default;
  12353. /***/ }),
  12354. /***/ 472:
  12355. /*!**************************************************************************!*\
  12356. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/util/async-validator.js ***!
  12357. \**************************************************************************/
  12358. /*! no static exports found */
  12359. /***/ (function(module, exports, __webpack_require__) {
  12360. "use strict";
  12361. /* WEBPACK VAR INJECTION */(function(process) {
  12362. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  12363. Object.defineProperty(exports, "__esModule", {
  12364. value: true
  12365. });
  12366. exports.default = void 0;
  12367. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  12368. function _extends() {
  12369. _extends = Object.assign || function (target) {
  12370. for (var i = 1; i < arguments.length; i++) {
  12371. var source = arguments[i];
  12372. for (var key in source) {
  12373. if (Object.prototype.hasOwnProperty.call(source, key)) {
  12374. target[key] = source[key];
  12375. }
  12376. }
  12377. }
  12378. return target;
  12379. };
  12380. return _extends.apply(this, arguments);
  12381. }
  12382. /* eslint no-console:0 */
  12383. var formatRegExp = /%[sdj%]/g;
  12384. var warning = function warning() {}; // don't print warning message when in production env or node runtime
  12385. if (typeof process !== 'undefined' && Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}) && "development" !== 'production' && typeof window !== 'undefined' && typeof document !== 'undefined') {
  12386. warning = function warning(type, errors) {
  12387. if (typeof console !== 'undefined' && console.warn) {
  12388. if (errors.every(function (e) {
  12389. return typeof e === 'string';
  12390. })) {
  12391. console.warn(type, errors);
  12392. }
  12393. }
  12394. };
  12395. }
  12396. function convertFieldsError(errors) {
  12397. if (!errors || !errors.length) return null;
  12398. var fields = {};
  12399. errors.forEach(function (error) {
  12400. var field = error.field;
  12401. fields[field] = fields[field] || [];
  12402. fields[field].push(error);
  12403. });
  12404. return fields;
  12405. }
  12406. function format() {
  12407. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  12408. args[_key] = arguments[_key];
  12409. }
  12410. var i = 1;
  12411. var f = args[0];
  12412. var len = args.length;
  12413. if (typeof f === 'function') {
  12414. return f.apply(null, args.slice(1));
  12415. }
  12416. if (typeof f === 'string') {
  12417. var str = String(f).replace(formatRegExp, function (x) {
  12418. if (x === '%%') {
  12419. return '%';
  12420. }
  12421. if (i >= len) {
  12422. return x;
  12423. }
  12424. switch (x) {
  12425. case '%s':
  12426. return String(args[i++]);
  12427. case '%d':
  12428. return Number(args[i++]);
  12429. case '%j':
  12430. try {
  12431. return JSON.stringify(args[i++]);
  12432. } catch (_) {
  12433. return '[Circular]';
  12434. }
  12435. break;
  12436. default:
  12437. return x;
  12438. }
  12439. });
  12440. for (var arg = args[i]; i < len; arg = args[++i]) {
  12441. str += " " + arg;
  12442. }
  12443. return str;
  12444. }
  12445. return f;
  12446. }
  12447. function isNativeStringType(type) {
  12448. return type === 'string' || type === 'url' || type === 'hex' || type === 'email' || type === 'pattern';
  12449. }
  12450. function isEmptyValue(value, type) {
  12451. if (value === undefined || value === null) {
  12452. return true;
  12453. }
  12454. if (type === 'array' && Array.isArray(value) && !value.length) {
  12455. return true;
  12456. }
  12457. if (isNativeStringType(type) && typeof value === 'string' && !value) {
  12458. return true;
  12459. }
  12460. return false;
  12461. }
  12462. function asyncParallelArray(arr, func, callback) {
  12463. var results = [];
  12464. var total = 0;
  12465. var arrLength = arr.length;
  12466. function count(errors) {
  12467. results.push.apply(results, errors);
  12468. total++;
  12469. if (total === arrLength) {
  12470. callback(results);
  12471. }
  12472. }
  12473. arr.forEach(function (a) {
  12474. func(a, count);
  12475. });
  12476. }
  12477. function asyncSerialArray(arr, func, callback) {
  12478. var index = 0;
  12479. var arrLength = arr.length;
  12480. function next(errors) {
  12481. if (errors && errors.length) {
  12482. callback(errors);
  12483. return;
  12484. }
  12485. var original = index;
  12486. index = index + 1;
  12487. if (original < arrLength) {
  12488. func(arr[original], next);
  12489. } else {
  12490. callback([]);
  12491. }
  12492. }
  12493. next([]);
  12494. }
  12495. function flattenObjArr(objArr) {
  12496. var ret = [];
  12497. Object.keys(objArr).forEach(function (k) {
  12498. ret.push.apply(ret, objArr[k]);
  12499. });
  12500. return ret;
  12501. }
  12502. function asyncMap(objArr, option, func, callback) {
  12503. if (option.first) {
  12504. var _pending = new Promise(function (resolve, reject) {
  12505. var next = function next(errors) {
  12506. callback(errors);
  12507. return errors.length ? reject({
  12508. errors: errors,
  12509. fields: convertFieldsError(errors)
  12510. }) : resolve();
  12511. };
  12512. var flattenArr = flattenObjArr(objArr);
  12513. asyncSerialArray(flattenArr, func, next);
  12514. });
  12515. _pending["catch"](function (e) {
  12516. return e;
  12517. });
  12518. return _pending;
  12519. }
  12520. var firstFields = option.firstFields || [];
  12521. if (firstFields === true) {
  12522. firstFields = Object.keys(objArr);
  12523. }
  12524. var objArrKeys = Object.keys(objArr);
  12525. var objArrLength = objArrKeys.length;
  12526. var total = 0;
  12527. var results = [];
  12528. var pending = new Promise(function (resolve, reject) {
  12529. var next = function next(errors) {
  12530. results.push.apply(results, errors);
  12531. total++;
  12532. if (total === objArrLength) {
  12533. callback(results);
  12534. return results.length ? reject({
  12535. errors: results,
  12536. fields: convertFieldsError(results)
  12537. }) : resolve();
  12538. }
  12539. };
  12540. if (!objArrKeys.length) {
  12541. callback(results);
  12542. resolve();
  12543. }
  12544. objArrKeys.forEach(function (key) {
  12545. var arr = objArr[key];
  12546. if (firstFields.indexOf(key) !== -1) {
  12547. asyncSerialArray(arr, func, next);
  12548. } else {
  12549. asyncParallelArray(arr, func, next);
  12550. }
  12551. });
  12552. });
  12553. pending["catch"](function (e) {
  12554. return e;
  12555. });
  12556. return pending;
  12557. }
  12558. function complementError(rule) {
  12559. return function (oe) {
  12560. if (oe && oe.message) {
  12561. oe.field = oe.field || rule.fullField;
  12562. return oe;
  12563. }
  12564. return {
  12565. message: typeof oe === 'function' ? oe() : oe,
  12566. field: oe.field || rule.fullField
  12567. };
  12568. };
  12569. }
  12570. function deepMerge(target, source) {
  12571. if (source) {
  12572. for (var s in source) {
  12573. if (source.hasOwnProperty(s)) {
  12574. var value = source[s];
  12575. if ((0, _typeof2.default)(value) === 'object' && (0, _typeof2.default)(target[s]) === 'object') {
  12576. target[s] = _extends({}, target[s], {}, value);
  12577. } else {
  12578. target[s] = value;
  12579. }
  12580. }
  12581. }
  12582. }
  12583. return target;
  12584. }
  12585. /**
  12586. * Rule for validating required fields.
  12587. *
  12588. * @param rule The validation rule.
  12589. * @param value The value of the field on the source object.
  12590. * @param source The source object being validated.
  12591. * @param errors An array of errors that this rule may add
  12592. * validation errors to.
  12593. * @param options The validation options.
  12594. * @param options.messages The validation messages.
  12595. */
  12596. function required(rule, value, source, errors, options, type) {
  12597. if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) {
  12598. errors.push(format(options.messages.required, rule.fullField));
  12599. }
  12600. }
  12601. /**
  12602. * Rule for validating whitespace.
  12603. *
  12604. * @param rule The validation rule.
  12605. * @param value The value of the field on the source object.
  12606. * @param source The source object being validated.
  12607. * @param errors An array of errors that this rule may add
  12608. * validation errors to.
  12609. * @param options The validation options.
  12610. * @param options.messages The validation messages.
  12611. */
  12612. function whitespace(rule, value, source, errors, options) {
  12613. if (/^\s+$/.test(value) || value === '') {
  12614. errors.push(format(options.messages.whitespace, rule.fullField));
  12615. }
  12616. }
  12617. /* eslint max-len:0 */
  12618. var pattern = {
  12619. // http://emailregex.com/
  12620. 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,}))$/,
  12621. url: new RegExp("^(?!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]*)?$", 'i'),
  12622. hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
  12623. };
  12624. var types = {
  12625. integer: function integer(value) {
  12626. return types.number(value) && parseInt(value, 10) === value;
  12627. },
  12628. "float": function float(value) {
  12629. return types.number(value) && !types.integer(value);
  12630. },
  12631. array: function array(value) {
  12632. return Array.isArray(value);
  12633. },
  12634. regexp: function regexp(value) {
  12635. if (value instanceof RegExp) {
  12636. return true;
  12637. }
  12638. try {
  12639. return !!new RegExp(value);
  12640. } catch (e) {
  12641. return false;
  12642. }
  12643. },
  12644. date: function date(value) {
  12645. return typeof value.getTime === 'function' && typeof value.getMonth === 'function' && typeof value.getYear === 'function';
  12646. },
  12647. number: function number(value) {
  12648. if (isNaN(value)) {
  12649. return false;
  12650. }
  12651. // 修改源码,将字符串数值先转为数值
  12652. return typeof +value === 'number';
  12653. },
  12654. object: function object(value) {
  12655. return (0, _typeof2.default)(value) === 'object' && !types.array(value);
  12656. },
  12657. method: function method(value) {
  12658. return typeof value === 'function';
  12659. },
  12660. email: function email(value) {
  12661. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  12662. },
  12663. url: function url(value) {
  12664. return typeof value === 'string' && !!value.match(pattern.url);
  12665. },
  12666. hex: function hex(value) {
  12667. return typeof value === 'string' && !!value.match(pattern.hex);
  12668. }
  12669. };
  12670. /**
  12671. * Rule for validating the type of a value.
  12672. *
  12673. * @param rule The validation rule.
  12674. * @param value The value of the field on the source object.
  12675. * @param source The source object being validated.
  12676. * @param errors An array of errors that this rule may add
  12677. * validation errors to.
  12678. * @param options The validation options.
  12679. * @param options.messages The validation messages.
  12680. */
  12681. function type(rule, value, source, errors, options) {
  12682. if (rule.required && value === undefined) {
  12683. required(rule, value, source, errors, options);
  12684. return;
  12685. }
  12686. var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];
  12687. var ruleType = rule.type;
  12688. if (custom.indexOf(ruleType) > -1) {
  12689. if (!types[ruleType](value)) {
  12690. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  12691. } // straight typeof check
  12692. } else if (ruleType && (0, _typeof2.default)(value) !== rule.type) {
  12693. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  12694. }
  12695. }
  12696. /**
  12697. * Rule for validating minimum and maximum allowed values.
  12698. *
  12699. * @param rule The validation rule.
  12700. * @param value The value of the field on the source object.
  12701. * @param source The source object being validated.
  12702. * @param errors An array of errors that this rule may add
  12703. * validation errors to.
  12704. * @param options The validation options.
  12705. * @param options.messages The validation messages.
  12706. */
  12707. function range(rule, value, source, errors, options) {
  12708. var len = typeof rule.len === 'number';
  12709. var min = typeof rule.min === 'number';
  12710. var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)
  12711. var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
  12712. var val = value;
  12713. var key = null;
  12714. var num = typeof value === 'number';
  12715. var str = typeof value === 'string';
  12716. var arr = Array.isArray(value);
  12717. if (num) {
  12718. key = 'number';
  12719. } else if (str) {
  12720. key = 'string';
  12721. } else if (arr) {
  12722. key = 'array';
  12723. } // if the value is not of a supported type for range validation
  12724. // the validation rule rule should use the
  12725. // type property to also test for a particular type
  12726. if (!key) {
  12727. return false;
  12728. }
  12729. if (arr) {
  12730. val = value.length;
  12731. }
  12732. if (str) {
  12733. // 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3
  12734. val = value.replace(spRegexp, '_').length;
  12735. }
  12736. if (len) {
  12737. if (val !== rule.len) {
  12738. errors.push(format(options.messages[key].len, rule.fullField, rule.len));
  12739. }
  12740. } else if (min && !max && val < rule.min) {
  12741. errors.push(format(options.messages[key].min, rule.fullField, rule.min));
  12742. } else if (max && !min && val > rule.max) {
  12743. errors.push(format(options.messages[key].max, rule.fullField, rule.max));
  12744. } else if (min && max && (val < rule.min || val > rule.max)) {
  12745. errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
  12746. }
  12747. }
  12748. var ENUM = 'enum';
  12749. /**
  12750. * Rule for validating a value exists in an enumerable list.
  12751. *
  12752. * @param rule The validation rule.
  12753. * @param value The value of the field on the source object.
  12754. * @param source The source object being validated.
  12755. * @param errors An array of errors that this rule may add
  12756. * validation errors to.
  12757. * @param options The validation options.
  12758. * @param options.messages The validation messages.
  12759. */
  12760. function enumerable(rule, value, source, errors, options) {
  12761. rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
  12762. if (rule[ENUM].indexOf(value) === -1) {
  12763. errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));
  12764. }
  12765. }
  12766. /**
  12767. * Rule for validating a regular expression pattern.
  12768. *
  12769. * @param rule The validation rule.
  12770. * @param value The value of the field on the source object.
  12771. * @param source The source object being validated.
  12772. * @param errors An array of errors that this rule may add
  12773. * validation errors to.
  12774. * @param options The validation options.
  12775. * @param options.messages The validation messages.
  12776. */
  12777. function pattern$1(rule, value, source, errors, options) {
  12778. if (rule.pattern) {
  12779. if (rule.pattern instanceof RegExp) {
  12780. // if a RegExp instance is passed, reset `lastIndex` in case its `global`
  12781. // flag is accidentally set to `true`, which in a validation scenario
  12782. // is not necessary and the result might be misleading
  12783. rule.pattern.lastIndex = 0;
  12784. if (!rule.pattern.test(value)) {
  12785. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  12786. }
  12787. } else if (typeof rule.pattern === 'string') {
  12788. var _pattern = new RegExp(rule.pattern);
  12789. if (!_pattern.test(value)) {
  12790. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  12791. }
  12792. }
  12793. }
  12794. }
  12795. var rules = {
  12796. required: required,
  12797. whitespace: whitespace,
  12798. type: type,
  12799. range: range,
  12800. "enum": enumerable,
  12801. pattern: pattern$1
  12802. };
  12803. /**
  12804. * Performs validation for string types.
  12805. *
  12806. * @param rule The validation rule.
  12807. * @param value The value of the field on the source object.
  12808. * @param callback The callback function.
  12809. * @param source The source object being validated.
  12810. * @param options The validation options.
  12811. * @param options.messages The validation messages.
  12812. */
  12813. function string(rule, value, callback, source, options) {
  12814. var errors = [];
  12815. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12816. if (validate) {
  12817. if (isEmptyValue(value, 'string') && !rule.required) {
  12818. return callback();
  12819. }
  12820. rules.required(rule, value, source, errors, options, 'string');
  12821. if (!isEmptyValue(value, 'string')) {
  12822. rules.type(rule, value, source, errors, options);
  12823. rules.range(rule, value, source, errors, options);
  12824. rules.pattern(rule, value, source, errors, options);
  12825. if (rule.whitespace === true) {
  12826. rules.whitespace(rule, value, source, errors, options);
  12827. }
  12828. }
  12829. }
  12830. callback(errors);
  12831. }
  12832. /**
  12833. * Validates a function.
  12834. *
  12835. * @param rule The validation rule.
  12836. * @param value The value of the field on the source object.
  12837. * @param callback The callback function.
  12838. * @param source The source object being validated.
  12839. * @param options The validation options.
  12840. * @param options.messages The validation messages.
  12841. */
  12842. function method(rule, value, callback, source, options) {
  12843. var errors = [];
  12844. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12845. if (validate) {
  12846. if (isEmptyValue(value) && !rule.required) {
  12847. return callback();
  12848. }
  12849. rules.required(rule, value, source, errors, options);
  12850. if (value !== undefined) {
  12851. rules.type(rule, value, source, errors, options);
  12852. }
  12853. }
  12854. callback(errors);
  12855. }
  12856. /**
  12857. * Validates a number.
  12858. *
  12859. * @param rule The validation rule.
  12860. * @param value The value of the field on the source object.
  12861. * @param callback The callback function.
  12862. * @param source The source object being validated.
  12863. * @param options The validation options.
  12864. * @param options.messages The validation messages.
  12865. */
  12866. function number(rule, value, callback, source, options) {
  12867. var errors = [];
  12868. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12869. if (validate) {
  12870. if (value === '') {
  12871. value = undefined;
  12872. }
  12873. if (isEmptyValue(value) && !rule.required) {
  12874. return callback();
  12875. }
  12876. rules.required(rule, value, source, errors, options);
  12877. if (value !== undefined) {
  12878. rules.type(rule, value, source, errors, options);
  12879. rules.range(rule, value, source, errors, options);
  12880. }
  12881. }
  12882. callback(errors);
  12883. }
  12884. /**
  12885. * Validates a boolean.
  12886. *
  12887. * @param rule The validation rule.
  12888. * @param value The value of the field on the source object.
  12889. * @param callback The callback function.
  12890. * @param source The source object being validated.
  12891. * @param options The validation options.
  12892. * @param options.messages The validation messages.
  12893. */
  12894. function _boolean(rule, value, callback, source, options) {
  12895. var errors = [];
  12896. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12897. if (validate) {
  12898. if (isEmptyValue(value) && !rule.required) {
  12899. return callback();
  12900. }
  12901. rules.required(rule, value, source, errors, options);
  12902. if (value !== undefined) {
  12903. rules.type(rule, value, source, errors, options);
  12904. }
  12905. }
  12906. callback(errors);
  12907. }
  12908. /**
  12909. * Validates the regular expression type.
  12910. *
  12911. * @param rule The validation rule.
  12912. * @param value The value of the field on the source object.
  12913. * @param callback The callback function.
  12914. * @param source The source object being validated.
  12915. * @param options The validation options.
  12916. * @param options.messages The validation messages.
  12917. */
  12918. function regexp(rule, value, callback, source, options) {
  12919. var errors = [];
  12920. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12921. if (validate) {
  12922. if (isEmptyValue(value) && !rule.required) {
  12923. return callback();
  12924. }
  12925. rules.required(rule, value, source, errors, options);
  12926. if (!isEmptyValue(value)) {
  12927. rules.type(rule, value, source, errors, options);
  12928. }
  12929. }
  12930. callback(errors);
  12931. }
  12932. /**
  12933. * Validates a number is an integer.
  12934. *
  12935. * @param rule The validation rule.
  12936. * @param value The value of the field on the source object.
  12937. * @param callback The callback function.
  12938. * @param source The source object being validated.
  12939. * @param options The validation options.
  12940. * @param options.messages The validation messages.
  12941. */
  12942. function integer(rule, value, callback, source, options) {
  12943. var errors = [];
  12944. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12945. if (validate) {
  12946. if (isEmptyValue(value) && !rule.required) {
  12947. return callback();
  12948. }
  12949. rules.required(rule, value, source, errors, options);
  12950. if (value !== undefined) {
  12951. rules.type(rule, value, source, errors, options);
  12952. rules.range(rule, value, source, errors, options);
  12953. }
  12954. }
  12955. callback(errors);
  12956. }
  12957. /**
  12958. * Validates a number is a floating point number.
  12959. *
  12960. * @param rule The validation rule.
  12961. * @param value The value of the field on the source object.
  12962. * @param callback The callback function.
  12963. * @param source The source object being validated.
  12964. * @param options The validation options.
  12965. * @param options.messages The validation messages.
  12966. */
  12967. function floatFn(rule, value, callback, source, options) {
  12968. var errors = [];
  12969. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12970. if (validate) {
  12971. if (isEmptyValue(value) && !rule.required) {
  12972. return callback();
  12973. }
  12974. rules.required(rule, value, source, errors, options);
  12975. if (value !== undefined) {
  12976. rules.type(rule, value, source, errors, options);
  12977. rules.range(rule, value, source, errors, options);
  12978. }
  12979. }
  12980. callback(errors);
  12981. }
  12982. /**
  12983. * Validates an array.
  12984. *
  12985. * @param rule The validation rule.
  12986. * @param value The value of the field on the source object.
  12987. * @param callback The callback function.
  12988. * @param source The source object being validated.
  12989. * @param options The validation options.
  12990. * @param options.messages The validation messages.
  12991. */
  12992. function array(rule, value, callback, source, options) {
  12993. var errors = [];
  12994. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  12995. if (validate) {
  12996. if (isEmptyValue(value, 'array') && !rule.required) {
  12997. return callback();
  12998. }
  12999. rules.required(rule, value, source, errors, options, 'array');
  13000. if (!isEmptyValue(value, 'array')) {
  13001. rules.type(rule, value, source, errors, options);
  13002. rules.range(rule, value, source, errors, options);
  13003. }
  13004. }
  13005. callback(errors);
  13006. }
  13007. /**
  13008. * Validates an object.
  13009. *
  13010. * @param rule The validation rule.
  13011. * @param value The value of the field on the source object.
  13012. * @param callback The callback function.
  13013. * @param source The source object being validated.
  13014. * @param options The validation options.
  13015. * @param options.messages The validation messages.
  13016. */
  13017. function object(rule, value, callback, source, options) {
  13018. var errors = [];
  13019. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  13020. if (validate) {
  13021. if (isEmptyValue(value) && !rule.required) {
  13022. return callback();
  13023. }
  13024. rules.required(rule, value, source, errors, options);
  13025. if (value !== undefined) {
  13026. rules.type(rule, value, source, errors, options);
  13027. }
  13028. }
  13029. callback(errors);
  13030. }
  13031. var ENUM$1 = 'enum';
  13032. /**
  13033. * Validates an enumerable list.
  13034. *
  13035. * @param rule The validation rule.
  13036. * @param value The value of the field on the source object.
  13037. * @param callback The callback function.
  13038. * @param source The source object being validated.
  13039. * @param options The validation options.
  13040. * @param options.messages The validation messages.
  13041. */
  13042. function enumerable$1(rule, value, callback, source, options) {
  13043. var errors = [];
  13044. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  13045. if (validate) {
  13046. if (isEmptyValue(value) && !rule.required) {
  13047. return callback();
  13048. }
  13049. rules.required(rule, value, source, errors, options);
  13050. if (value !== undefined) {
  13051. rules[ENUM$1](rule, value, source, errors, options);
  13052. }
  13053. }
  13054. callback(errors);
  13055. }
  13056. /**
  13057. * Validates a regular expression pattern.
  13058. *
  13059. * Performs validation when a rule only contains
  13060. * a pattern property but is not declared as a string type.
  13061. *
  13062. * @param rule The validation rule.
  13063. * @param value The value of the field on the source object.
  13064. * @param callback The callback function.
  13065. * @param source The source object being validated.
  13066. * @param options The validation options.
  13067. * @param options.messages The validation messages.
  13068. */
  13069. function pattern$2(rule, value, callback, source, options) {
  13070. var errors = [];
  13071. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  13072. if (validate) {
  13073. if (isEmptyValue(value, 'string') && !rule.required) {
  13074. return callback();
  13075. }
  13076. rules.required(rule, value, source, errors, options);
  13077. if (!isEmptyValue(value, 'string')) {
  13078. rules.pattern(rule, value, source, errors, options);
  13079. }
  13080. }
  13081. callback(errors);
  13082. }
  13083. function date(rule, value, callback, source, options) {
  13084. var errors = [];
  13085. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  13086. if (validate) {
  13087. if (isEmptyValue(value) && !rule.required) {
  13088. return callback();
  13089. }
  13090. rules.required(rule, value, source, errors, options);
  13091. if (!isEmptyValue(value)) {
  13092. var dateObject;
  13093. if (typeof value === 'number') {
  13094. dateObject = new Date(value);
  13095. } else {
  13096. dateObject = value;
  13097. }
  13098. rules.type(rule, dateObject, source, errors, options);
  13099. if (dateObject) {
  13100. rules.range(rule, dateObject.getTime(), source, errors, options);
  13101. }
  13102. }
  13103. }
  13104. callback(errors);
  13105. }
  13106. function required$1(rule, value, callback, source, options) {
  13107. var errors = [];
  13108. var type = Array.isArray(value) ? 'array' : (0, _typeof2.default)(value);
  13109. rules.required(rule, value, source, errors, options, type);
  13110. callback(errors);
  13111. }
  13112. function type$1(rule, value, callback, source, options) {
  13113. var ruleType = rule.type;
  13114. var errors = [];
  13115. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  13116. if (validate) {
  13117. if (isEmptyValue(value, ruleType) && !rule.required) {
  13118. return callback();
  13119. }
  13120. rules.required(rule, value, source, errors, options, ruleType);
  13121. if (!isEmptyValue(value, ruleType)) {
  13122. rules.type(rule, value, source, errors, options);
  13123. }
  13124. }
  13125. callback(errors);
  13126. }
  13127. /**
  13128. * Performs validation for any type.
  13129. *
  13130. * @param rule The validation rule.
  13131. * @param value The value of the field on the source object.
  13132. * @param callback The callback function.
  13133. * @param source The source object being validated.
  13134. * @param options The validation options.
  13135. * @param options.messages The validation messages.
  13136. */
  13137. function any(rule, value, callback, source, options) {
  13138. var errors = [];
  13139. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  13140. if (validate) {
  13141. if (isEmptyValue(value) && !rule.required) {
  13142. return callback();
  13143. }
  13144. rules.required(rule, value, source, errors, options);
  13145. }
  13146. callback(errors);
  13147. }
  13148. var validators = {
  13149. string: string,
  13150. method: method,
  13151. number: number,
  13152. "boolean": _boolean,
  13153. regexp: regexp,
  13154. integer: integer,
  13155. "float": floatFn,
  13156. array: array,
  13157. object: object,
  13158. "enum": enumerable$1,
  13159. pattern: pattern$2,
  13160. date: date,
  13161. url: type$1,
  13162. hex: type$1,
  13163. email: type$1,
  13164. required: required$1,
  13165. any: any
  13166. };
  13167. function newMessages() {
  13168. return {
  13169. "default": 'Validation error on field %s',
  13170. required: '%s is required',
  13171. "enum": '%s must be one of %s',
  13172. whitespace: '%s cannot be empty',
  13173. date: {
  13174. format: '%s date %s is invalid for format %s',
  13175. parse: '%s date could not be parsed, %s is invalid ',
  13176. invalid: '%s date %s is invalid'
  13177. },
  13178. types: {
  13179. string: '%s is not a %s',
  13180. method: '%s is not a %s (function)',
  13181. array: '%s is not an %s',
  13182. object: '%s is not an %s',
  13183. number: '%s is not a %s',
  13184. date: '%s is not a %s',
  13185. "boolean": '%s is not a %s',
  13186. integer: '%s is not an %s',
  13187. "float": '%s is not a %s',
  13188. regexp: '%s is not a valid %s',
  13189. email: '%s is not a valid %s',
  13190. url: '%s is not a valid %s',
  13191. hex: '%s is not a valid %s'
  13192. },
  13193. string: {
  13194. len: '%s must be exactly %s characters',
  13195. min: '%s must be at least %s characters',
  13196. max: '%s cannot be longer than %s characters',
  13197. range: '%s must be between %s and %s characters'
  13198. },
  13199. number: {
  13200. len: '%s must equal %s',
  13201. min: '%s cannot be less than %s',
  13202. max: '%s cannot be greater than %s',
  13203. range: '%s must be between %s and %s'
  13204. },
  13205. array: {
  13206. len: '%s must be exactly %s in length',
  13207. min: '%s cannot be less than %s in length',
  13208. max: '%s cannot be greater than %s in length',
  13209. range: '%s must be between %s and %s in length'
  13210. },
  13211. pattern: {
  13212. mismatch: '%s value %s does not match pattern %s'
  13213. },
  13214. clone: function clone() {
  13215. var cloned = JSON.parse(JSON.stringify(this));
  13216. cloned.clone = this.clone;
  13217. return cloned;
  13218. }
  13219. };
  13220. }
  13221. var messages = newMessages();
  13222. /**
  13223. * Encapsulates a validation schema.
  13224. *
  13225. * @param descriptor An object declaring validation rules
  13226. * for this schema.
  13227. */
  13228. function Schema(descriptor) {
  13229. this.rules = null;
  13230. this._messages = messages;
  13231. this.define(descriptor);
  13232. }
  13233. Schema.prototype = {
  13234. messages: function messages(_messages) {
  13235. if (_messages) {
  13236. this._messages = deepMerge(newMessages(), _messages);
  13237. }
  13238. return this._messages;
  13239. },
  13240. define: function define(rules) {
  13241. if (!rules) {
  13242. throw new Error('Cannot configure a schema with no rules');
  13243. }
  13244. if ((0, _typeof2.default)(rules) !== 'object' || Array.isArray(rules)) {
  13245. throw new Error('Rules must be an object');
  13246. }
  13247. this.rules = {};
  13248. var z;
  13249. var item;
  13250. for (z in rules) {
  13251. if (rules.hasOwnProperty(z)) {
  13252. item = rules[z];
  13253. this.rules[z] = Array.isArray(item) ? item : [item];
  13254. }
  13255. }
  13256. },
  13257. validate: function validate(source_, o, oc) {
  13258. var _this = this;
  13259. if (o === void 0) {
  13260. o = {};
  13261. }
  13262. if (oc === void 0) {
  13263. oc = function oc() {};
  13264. }
  13265. var source = source_;
  13266. var options = o;
  13267. var callback = oc;
  13268. if (typeof options === 'function') {
  13269. callback = options;
  13270. options = {};
  13271. }
  13272. if (!this.rules || Object.keys(this.rules).length === 0) {
  13273. if (callback) {
  13274. callback();
  13275. }
  13276. return Promise.resolve();
  13277. }
  13278. function complete(results) {
  13279. var i;
  13280. var errors = [];
  13281. var fields = {};
  13282. function add(e) {
  13283. if (Array.isArray(e)) {
  13284. var _errors;
  13285. errors = (_errors = errors).concat.apply(_errors, e);
  13286. } else {
  13287. errors.push(e);
  13288. }
  13289. }
  13290. for (i = 0; i < results.length; i++) {
  13291. add(results[i]);
  13292. }
  13293. if (!errors.length) {
  13294. errors = null;
  13295. fields = null;
  13296. } else {
  13297. fields = convertFieldsError(errors);
  13298. }
  13299. callback(errors, fields);
  13300. }
  13301. if (options.messages) {
  13302. var messages$1 = this.messages();
  13303. if (messages$1 === messages) {
  13304. messages$1 = newMessages();
  13305. }
  13306. deepMerge(messages$1, options.messages);
  13307. options.messages = messages$1;
  13308. } else {
  13309. options.messages = this.messages();
  13310. }
  13311. var arr;
  13312. var value;
  13313. var series = {};
  13314. var keys = options.keys || Object.keys(this.rules);
  13315. keys.forEach(function (z) {
  13316. arr = _this.rules[z];
  13317. value = source[z];
  13318. arr.forEach(function (r) {
  13319. var rule = r;
  13320. if (typeof rule.transform === 'function') {
  13321. if (source === source_) {
  13322. source = _extends({}, source);
  13323. }
  13324. value = source[z] = rule.transform(value);
  13325. }
  13326. if (typeof rule === 'function') {
  13327. rule = {
  13328. validator: rule
  13329. };
  13330. } else {
  13331. rule = _extends({}, rule);
  13332. }
  13333. rule.validator = _this.getValidationMethod(rule);
  13334. rule.field = z;
  13335. rule.fullField = rule.fullField || z;
  13336. rule.type = _this.getType(rule);
  13337. if (!rule.validator) {
  13338. return;
  13339. }
  13340. series[z] = series[z] || [];
  13341. series[z].push({
  13342. rule: rule,
  13343. value: value,
  13344. source: source,
  13345. field: z
  13346. });
  13347. });
  13348. });
  13349. var errorFields = {};
  13350. return asyncMap(series, options, function (data, doIt) {
  13351. var rule = data.rule;
  13352. var deep = (rule.type === 'object' || rule.type === 'array') && ((0, _typeof2.default)(rule.fields) === 'object' || (0, _typeof2.default)(rule.defaultField) === 'object');
  13353. deep = deep && (rule.required || !rule.required && data.value);
  13354. rule.field = data.field;
  13355. function addFullfield(key, schema) {
  13356. return _extends({}, schema, {
  13357. fullField: rule.fullField + "." + key
  13358. });
  13359. }
  13360. function cb(e) {
  13361. if (e === void 0) {
  13362. e = [];
  13363. }
  13364. var errors = e;
  13365. if (!Array.isArray(errors)) {
  13366. errors = [errors];
  13367. }
  13368. if (!options.suppressWarning && errors.length) {
  13369. Schema.warning('async-validator:', errors);
  13370. }
  13371. if (errors.length && rule.message) {
  13372. errors = [].concat(rule.message);
  13373. }
  13374. errors = errors.map(complementError(rule));
  13375. if (options.first && errors.length) {
  13376. errorFields[rule.field] = 1;
  13377. return doIt(errors);
  13378. }
  13379. if (!deep) {
  13380. doIt(errors);
  13381. } else {
  13382. // if rule is required but the target object
  13383. // does not exist fail at the rule level and don't
  13384. // go deeper
  13385. if (rule.required && !data.value) {
  13386. if (rule.message) {
  13387. errors = [].concat(rule.message).map(complementError(rule));
  13388. } else if (options.error) {
  13389. errors = [options.error(rule, format(options.messages.required, rule.field))];
  13390. } else {
  13391. errors = [];
  13392. }
  13393. return doIt(errors);
  13394. }
  13395. var fieldsSchema = {};
  13396. if (rule.defaultField) {
  13397. for (var k in data.value) {
  13398. if (data.value.hasOwnProperty(k)) {
  13399. fieldsSchema[k] = rule.defaultField;
  13400. }
  13401. }
  13402. }
  13403. fieldsSchema = _extends({}, fieldsSchema, {}, data.rule.fields);
  13404. for (var f in fieldsSchema) {
  13405. if (fieldsSchema.hasOwnProperty(f)) {
  13406. var fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]];
  13407. fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f));
  13408. }
  13409. }
  13410. var schema = new Schema(fieldsSchema);
  13411. schema.messages(options.messages);
  13412. if (data.rule.options) {
  13413. data.rule.options.messages = options.messages;
  13414. data.rule.options.error = options.error;
  13415. }
  13416. schema.validate(data.value, data.rule.options || options, function (errs) {
  13417. var finalErrors = [];
  13418. if (errors && errors.length) {
  13419. finalErrors.push.apply(finalErrors, errors);
  13420. }
  13421. if (errs && errs.length) {
  13422. finalErrors.push.apply(finalErrors, errs);
  13423. }
  13424. doIt(finalErrors.length ? finalErrors : null);
  13425. });
  13426. }
  13427. }
  13428. var res;
  13429. if (rule.asyncValidator) {
  13430. res = rule.asyncValidator(rule, data.value, cb, data.source, options);
  13431. } else if (rule.validator) {
  13432. res = rule.validator(rule, data.value, cb, data.source, options);
  13433. if (res === true) {
  13434. cb();
  13435. } else if (res === false) {
  13436. cb(rule.message || rule.field + " fails");
  13437. } else if (res instanceof Array) {
  13438. cb(res);
  13439. } else if (res instanceof Error) {
  13440. cb(res.message);
  13441. }
  13442. }
  13443. if (res && res.then) {
  13444. res.then(function () {
  13445. return cb();
  13446. }, function (e) {
  13447. return cb(e);
  13448. });
  13449. }
  13450. }, function (results) {
  13451. complete(results);
  13452. });
  13453. },
  13454. getType: function getType(rule) {
  13455. if (rule.type === undefined && rule.pattern instanceof RegExp) {
  13456. rule.type = 'pattern';
  13457. }
  13458. if (typeof rule.validator !== 'function' && rule.type && !validators.hasOwnProperty(rule.type)) {
  13459. throw new Error(format('Unknown rule type %s', rule.type));
  13460. }
  13461. return rule.type || 'string';
  13462. },
  13463. getValidationMethod: function getValidationMethod(rule) {
  13464. if (typeof rule.validator === 'function') {
  13465. return rule.validator;
  13466. }
  13467. var keys = Object.keys(rule);
  13468. var messageIndex = keys.indexOf('message');
  13469. if (messageIndex !== -1) {
  13470. keys.splice(messageIndex, 1);
  13471. }
  13472. if (keys.length === 1 && keys[0] === 'required') {
  13473. return validators.required;
  13474. }
  13475. return validators[this.getType(rule)] || false;
  13476. }
  13477. };
  13478. Schema.register = function register(type, validator) {
  13479. if (typeof validator !== 'function') {
  13480. throw new Error('Cannot register a validator by type, validator is not a function');
  13481. }
  13482. validators[type] = validator;
  13483. };
  13484. Schema.warning = warning;
  13485. Schema.messages = messages;
  13486. var _default = Schema;
  13487. exports.default = _default;
  13488. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/node-libs-browser/mock/process.js */ 473)))
  13489. /***/ }),
  13490. /***/ 473:
  13491. /*!********************************************************!*\
  13492. !*** ./node_modules/node-libs-browser/mock/process.js ***!
  13493. \********************************************************/
  13494. /*! no static exports found */
  13495. /***/ (function(module, exports, __webpack_require__) {
  13496. exports.nextTick = function nextTick(fn) {
  13497. var args = Array.prototype.slice.call(arguments);
  13498. args.shift();
  13499. setTimeout(function () {
  13500. fn.apply(null, args);
  13501. }, 0);
  13502. };
  13503. exports.platform = exports.arch =
  13504. exports.execPath = exports.title = 'browser';
  13505. exports.pid = 1;
  13506. exports.browser = true;
  13507. exports.env = {};
  13508. exports.argv = [];
  13509. exports.binding = function (name) {
  13510. throw new Error('No such module. (Possibly not yet loaded)')
  13511. };
  13512. (function () {
  13513. var cwd = '/';
  13514. var path;
  13515. exports.cwd = function () { return cwd };
  13516. exports.chdir = function (dir) {
  13517. if (!path) path = __webpack_require__(/*! path */ 474);
  13518. cwd = path.resolve(dir, cwd);
  13519. };
  13520. })();
  13521. exports.exit = exports.kill =
  13522. exports.umask = exports.dlopen =
  13523. exports.uptime = exports.memoryUsage =
  13524. exports.uvCounters = function() {};
  13525. exports.features = {};
  13526. /***/ }),
  13527. /***/ 474:
  13528. /*!***********************************************!*\
  13529. !*** ./node_modules/path-browserify/index.js ***!
  13530. \***********************************************/
  13531. /*! no static exports found */
  13532. /***/ (function(module, exports, __webpack_require__) {
  13533. /* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
  13534. // backported and transplited with Babel, with backwards-compat fixes
  13535. // Copyright Joyent, Inc. and other Node contributors.
  13536. //
  13537. // Permission is hereby granted, free of charge, to any person obtaining a
  13538. // copy of this software and associated documentation files (the
  13539. // "Software"), to deal in the Software without restriction, including
  13540. // without limitation the rights to use, copy, modify, merge, publish,
  13541. // distribute, sublicense, and/or sell copies of the Software, and to permit
  13542. // persons to whom the Software is furnished to do so, subject to the
  13543. // following conditions:
  13544. //
  13545. // The above copyright notice and this permission notice shall be included
  13546. // in all copies or substantial portions of the Software.
  13547. //
  13548. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  13549. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  13550. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  13551. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  13552. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  13553. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  13554. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  13555. // resolves . and .. elements in a path array with directory names there
  13556. // must be no slashes, empty elements, or device names (c:\) in the array
  13557. // (so also no leading and trailing slashes - it does not distinguish
  13558. // relative and absolute paths)
  13559. function normalizeArray(parts, allowAboveRoot) {
  13560. // if the path tries to go above the root, `up` ends up > 0
  13561. var up = 0;
  13562. for (var i = parts.length - 1; i >= 0; i--) {
  13563. var last = parts[i];
  13564. if (last === '.') {
  13565. parts.splice(i, 1);
  13566. } else if (last === '..') {
  13567. parts.splice(i, 1);
  13568. up++;
  13569. } else if (up) {
  13570. parts.splice(i, 1);
  13571. up--;
  13572. }
  13573. }
  13574. // if the path is allowed to go above the root, restore leading ..s
  13575. if (allowAboveRoot) {
  13576. for (; up--; up) {
  13577. parts.unshift('..');
  13578. }
  13579. }
  13580. return parts;
  13581. }
  13582. // path.resolve([from ...], to)
  13583. // posix version
  13584. exports.resolve = function() {
  13585. var resolvedPath = '',
  13586. resolvedAbsolute = false;
  13587. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  13588. var path = (i >= 0) ? arguments[i] : process.cwd();
  13589. // Skip empty and invalid entries
  13590. if (typeof path !== 'string') {
  13591. throw new TypeError('Arguments to path.resolve must be strings');
  13592. } else if (!path) {
  13593. continue;
  13594. }
  13595. resolvedPath = path + '/' + resolvedPath;
  13596. resolvedAbsolute = path.charAt(0) === '/';
  13597. }
  13598. // At this point the path should be resolved to a full absolute path, but
  13599. // handle relative paths to be safe (might happen when process.cwd() fails)
  13600. // Normalize the path
  13601. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  13602. return !!p;
  13603. }), !resolvedAbsolute).join('/');
  13604. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  13605. };
  13606. // path.normalize(path)
  13607. // posix version
  13608. exports.normalize = function(path) {
  13609. var isAbsolute = exports.isAbsolute(path),
  13610. trailingSlash = substr(path, -1) === '/';
  13611. // Normalize the path
  13612. path = normalizeArray(filter(path.split('/'), function(p) {
  13613. return !!p;
  13614. }), !isAbsolute).join('/');
  13615. if (!path && !isAbsolute) {
  13616. path = '.';
  13617. }
  13618. if (path && trailingSlash) {
  13619. path += '/';
  13620. }
  13621. return (isAbsolute ? '/' : '') + path;
  13622. };
  13623. // posix version
  13624. exports.isAbsolute = function(path) {
  13625. return path.charAt(0) === '/';
  13626. };
  13627. // posix version
  13628. exports.join = function() {
  13629. var paths = Array.prototype.slice.call(arguments, 0);
  13630. return exports.normalize(filter(paths, function(p, index) {
  13631. if (typeof p !== 'string') {
  13632. throw new TypeError('Arguments to path.join must be strings');
  13633. }
  13634. return p;
  13635. }).join('/'));
  13636. };
  13637. // path.relative(from, to)
  13638. // posix version
  13639. exports.relative = function(from, to) {
  13640. from = exports.resolve(from).substr(1);
  13641. to = exports.resolve(to).substr(1);
  13642. function trim(arr) {
  13643. var start = 0;
  13644. for (; start < arr.length; start++) {
  13645. if (arr[start] !== '') break;
  13646. }
  13647. var end = arr.length - 1;
  13648. for (; end >= 0; end--) {
  13649. if (arr[end] !== '') break;
  13650. }
  13651. if (start > end) return [];
  13652. return arr.slice(start, end - start + 1);
  13653. }
  13654. var fromParts = trim(from.split('/'));
  13655. var toParts = trim(to.split('/'));
  13656. var length = Math.min(fromParts.length, toParts.length);
  13657. var samePartsLength = length;
  13658. for (var i = 0; i < length; i++) {
  13659. if (fromParts[i] !== toParts[i]) {
  13660. samePartsLength = i;
  13661. break;
  13662. }
  13663. }
  13664. var outputParts = [];
  13665. for (var i = samePartsLength; i < fromParts.length; i++) {
  13666. outputParts.push('..');
  13667. }
  13668. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  13669. return outputParts.join('/');
  13670. };
  13671. exports.sep = '/';
  13672. exports.delimiter = ':';
  13673. exports.dirname = function (path) {
  13674. if (typeof path !== 'string') path = path + '';
  13675. if (path.length === 0) return '.';
  13676. var code = path.charCodeAt(0);
  13677. var hasRoot = code === 47 /*/*/;
  13678. var end = -1;
  13679. var matchedSlash = true;
  13680. for (var i = path.length - 1; i >= 1; --i) {
  13681. code = path.charCodeAt(i);
  13682. if (code === 47 /*/*/) {
  13683. if (!matchedSlash) {
  13684. end = i;
  13685. break;
  13686. }
  13687. } else {
  13688. // We saw the first non-path separator
  13689. matchedSlash = false;
  13690. }
  13691. }
  13692. if (end === -1) return hasRoot ? '/' : '.';
  13693. if (hasRoot && end === 1) {
  13694. // return '//';
  13695. // Backwards-compat fix:
  13696. return '/';
  13697. }
  13698. return path.slice(0, end);
  13699. };
  13700. function basename(path) {
  13701. if (typeof path !== 'string') path = path + '';
  13702. var start = 0;
  13703. var end = -1;
  13704. var matchedSlash = true;
  13705. var i;
  13706. for (i = path.length - 1; i >= 0; --i) {
  13707. if (path.charCodeAt(i) === 47 /*/*/) {
  13708. // If we reached a path separator that was not part of a set of path
  13709. // separators at the end of the string, stop now
  13710. if (!matchedSlash) {
  13711. start = i + 1;
  13712. break;
  13713. }
  13714. } else if (end === -1) {
  13715. // We saw the first non-path separator, mark this as the end of our
  13716. // path component
  13717. matchedSlash = false;
  13718. end = i + 1;
  13719. }
  13720. }
  13721. if (end === -1) return '';
  13722. return path.slice(start, end);
  13723. }
  13724. // Uses a mixed approach for backwards-compatibility, as ext behavior changed
  13725. // in new Node.js versions, so only basename() above is backported here
  13726. exports.basename = function (path, ext) {
  13727. var f = basename(path);
  13728. if (ext && f.substr(-1 * ext.length) === ext) {
  13729. f = f.substr(0, f.length - ext.length);
  13730. }
  13731. return f;
  13732. };
  13733. exports.extname = function (path) {
  13734. if (typeof path !== 'string') path = path + '';
  13735. var startDot = -1;
  13736. var startPart = 0;
  13737. var end = -1;
  13738. var matchedSlash = true;
  13739. // Track the state of characters (if any) we see before our first dot and
  13740. // after any path separator we find
  13741. var preDotState = 0;
  13742. for (var i = path.length - 1; i >= 0; --i) {
  13743. var code = path.charCodeAt(i);
  13744. if (code === 47 /*/*/) {
  13745. // If we reached a path separator that was not part of a set of path
  13746. // separators at the end of the string, stop now
  13747. if (!matchedSlash) {
  13748. startPart = i + 1;
  13749. break;
  13750. }
  13751. continue;
  13752. }
  13753. if (end === -1) {
  13754. // We saw the first non-path separator, mark this as the end of our
  13755. // extension
  13756. matchedSlash = false;
  13757. end = i + 1;
  13758. }
  13759. if (code === 46 /*.*/) {
  13760. // If this is our first dot, mark it as the start of our extension
  13761. if (startDot === -1)
  13762. startDot = i;
  13763. else if (preDotState !== 1)
  13764. preDotState = 1;
  13765. } else if (startDot !== -1) {
  13766. // We saw a non-dot and non-path separator before our dot, so we should
  13767. // have a good chance at having a non-empty extension
  13768. preDotState = -1;
  13769. }
  13770. }
  13771. if (startDot === -1 || end === -1 ||
  13772. // We saw a non-dot character immediately before the dot
  13773. preDotState === 0 ||
  13774. // The (right-most) trimmed path component is exactly '..'
  13775. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  13776. return '';
  13777. }
  13778. return path.slice(startDot, end);
  13779. };
  13780. function filter (xs, f) {
  13781. if (xs.filter) return xs.filter(f);
  13782. var res = [];
  13783. for (var i = 0; i < xs.length; i++) {
  13784. if (f(xs[i], i, xs)) res.push(xs[i]);
  13785. }
  13786. return res;
  13787. }
  13788. // String.prototype.substr - negative index don't work in IE8
  13789. var substr = 'ab'.substr(-1) === 'b'
  13790. ? function (str, start, len) { return str.substr(start, len) }
  13791. : function (str, start, len) {
  13792. if (start < 0) start = str.length + start;
  13793. return str.substr(start, len);
  13794. }
  13795. ;
  13796. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 473)))
  13797. /***/ }),
  13798. /***/ 48:
  13799. /*!********************************************************************!*\
  13800. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/color.js ***!
  13801. \********************************************************************/
  13802. /*! no static exports found */
  13803. /***/ (function(module, exports, __webpack_require__) {
  13804. "use strict";
  13805. Object.defineProperty(exports, "__esModule", {
  13806. value: true
  13807. });
  13808. exports.default = void 0;
  13809. // 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
  13810. // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
  13811. var color = {
  13812. primary: "#2979ff",
  13813. primaryDark: "#2b85e4",
  13814. primaryDisabled: "#a0cfff",
  13815. primaryLight: "#ecf5ff",
  13816. bgColor: "#f3f4f6",
  13817. info: "#909399",
  13818. infoDark: "#82848a",
  13819. infoDisabled: "#c8c9cc",
  13820. infoLight: "#f4f4f5",
  13821. warning: "#ff9900",
  13822. warningDark: "#f29100",
  13823. warningDisabled: "#fcbd71",
  13824. warningLight: "#fdf6ec",
  13825. error: "#fa3534",
  13826. errorDark: "#dd6161",
  13827. errorDisabled: "#fab6b6",
  13828. errorLight: "#fef0f0",
  13829. success: "#19be6b",
  13830. successDark: "#18b566",
  13831. successDisabled: "#71d5a1",
  13832. successLight: "#dbf1e1",
  13833. mainColor: "#303133",
  13834. contentColor: "#606266",
  13835. tipsColor: "#909399",
  13836. lightColor: "#c0c4cc",
  13837. borderColor: "#e4e7ed"
  13838. };
  13839. var _default = color;
  13840. exports.default = _default;
  13841. /***/ }),
  13842. /***/ 49:
  13843. /*!************************************************************************!*\
  13844. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/type2icon.js ***!
  13845. \************************************************************************/
  13846. /*! no static exports found */
  13847. /***/ (function(module, exports, __webpack_require__) {
  13848. "use strict";
  13849. Object.defineProperty(exports, "__esModule", {
  13850. value: true
  13851. });
  13852. exports.default = void 0;
  13853. /**
  13854. * 根据主题type值,获取对应的图标
  13855. * @param String type 主题名称,primary|info|error|warning|success
  13856. * @param String fill 是否使用fill填充实体的图标
  13857. */
  13858. function type2icon() {
  13859. var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'success';
  13860. var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  13861. // 如果非预置值,默认为success
  13862. if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success';
  13863. var iconName = '';
  13864. // 目前(2019-12-12),info和primary使用同一个图标
  13865. switch (type) {
  13866. case 'primary':
  13867. iconName = 'info-circle';
  13868. break;
  13869. case 'info':
  13870. iconName = 'info-circle';
  13871. break;
  13872. case 'error':
  13873. iconName = 'close-circle';
  13874. break;
  13875. case 'warning':
  13876. iconName = 'error-circle';
  13877. break;
  13878. case 'success':
  13879. iconName = 'checkmark-circle';
  13880. break;
  13881. default:
  13882. iconName = 'checkmark-circle';
  13883. }
  13884. // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
  13885. if (fill) iconName += '-fill';
  13886. return iconName;
  13887. }
  13888. var _default = type2icon;
  13889. exports.default = _default;
  13890. /***/ }),
  13891. /***/ 5:
  13892. /*!**************************************************************!*\
  13893. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  13894. \**************************************************************/
  13895. /*! no static exports found */
  13896. /***/ (function(module, exports, __webpack_require__) {
  13897. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  13898. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  13899. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  13900. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  13901. function _slicedToArray(arr, i) {
  13902. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  13903. }
  13904. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  13905. /***/ }),
  13906. /***/ 50:
  13907. /*!**************************************************************************!*\
  13908. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/randomArray.js ***!
  13909. \**************************************************************************/
  13910. /*! no static exports found */
  13911. /***/ (function(module, exports, __webpack_require__) {
  13912. "use strict";
  13913. Object.defineProperty(exports, "__esModule", {
  13914. value: true
  13915. });
  13916. exports.default = void 0;
  13917. // 打乱数组
  13918. function randomArray() {
  13919. var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  13920. // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
  13921. return array.sort(function () {
  13922. return Math.random() - 0.5;
  13923. });
  13924. }
  13925. var _default = randomArray;
  13926. exports.default = _default;
  13927. /***/ }),
  13928. /***/ 51:
  13929. /*!**********************************************************************!*\
  13930. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/addUnit.js ***!
  13931. \**********************************************************************/
  13932. /*! no static exports found */
  13933. /***/ (function(module, exports, __webpack_require__) {
  13934. "use strict";
  13935. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13936. Object.defineProperty(exports, "__esModule", {
  13937. value: true
  13938. });
  13939. exports.default = addUnit;
  13940. var _test = _interopRequireDefault(__webpack_require__(/*! ./test.js */ 38));
  13941. // 添加单位,如果有rpx,%,px等单位结尾或者值为auto,直接返回,否则加上rpx单位结尾
  13942. function addUnit() {
  13943. var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'auto';
  13944. var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rpx';
  13945. value = String(value);
  13946. // 用uView内置验证规则中的number判断是否为数值
  13947. return _test.default.number(value) ? "".concat(value).concat(unit) : value;
  13948. }
  13949. /***/ }),
  13950. /***/ 52:
  13951. /*!*********************************************************************!*\
  13952. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/random.js ***!
  13953. \*********************************************************************/
  13954. /*! no static exports found */
  13955. /***/ (function(module, exports, __webpack_require__) {
  13956. "use strict";
  13957. Object.defineProperty(exports, "__esModule", {
  13958. value: true
  13959. });
  13960. exports.default = void 0;
  13961. function random(min, max) {
  13962. if (min >= 0 && max > 0 && max >= min) {
  13963. var gab = max - min + 1;
  13964. return Math.floor(Math.random() * gab + min);
  13965. } else {
  13966. return 0;
  13967. }
  13968. }
  13969. var _default = random;
  13970. exports.default = _default;
  13971. /***/ }),
  13972. /***/ 53:
  13973. /*!*******************************************************************!*\
  13974. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/trim.js ***!
  13975. \*******************************************************************/
  13976. /*! no static exports found */
  13977. /***/ (function(module, exports, __webpack_require__) {
  13978. "use strict";
  13979. Object.defineProperty(exports, "__esModule", {
  13980. value: true
  13981. });
  13982. exports.default = void 0;
  13983. function trim(str) {
  13984. var pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'both';
  13985. if (pos == 'both') {
  13986. return str.replace(/^\s+|\s+$/g, "");
  13987. } else if (pos == "left") {
  13988. return str.replace(/^\s*/, '');
  13989. } else if (pos == 'right') {
  13990. return str.replace(/(\s*$)/g, "");
  13991. } else if (pos == 'all') {
  13992. return str.replace(/\s+/g, "");
  13993. } else {
  13994. return str;
  13995. }
  13996. }
  13997. var _default = trim;
  13998. exports.default = _default;
  13999. /***/ }),
  14000. /***/ 54:
  14001. /*!********************************************************************!*\
  14002. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/toast.js ***!
  14003. \********************************************************************/
  14004. /*! no static exports found */
  14005. /***/ (function(module, exports, __webpack_require__) {
  14006. "use strict";
  14007. /* WEBPACK VAR INJECTION */(function(uni) {
  14008. Object.defineProperty(exports, "__esModule", {
  14009. value: true
  14010. });
  14011. exports.default = void 0;
  14012. function toast(title) {
  14013. var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1500;
  14014. uni.showToast({
  14015. title: title,
  14016. icon: 'none',
  14017. duration: duration
  14018. });
  14019. }
  14020. var _default = toast;
  14021. exports.default = _default;
  14022. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  14023. /***/ }),
  14024. /***/ 55:
  14025. /*!************************************************************************!*\
  14026. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/getParent.js ***!
  14027. \************************************************************************/
  14028. /*! no static exports found */
  14029. /***/ (function(module, exports, __webpack_require__) {
  14030. "use strict";
  14031. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14032. Object.defineProperty(exports, "__esModule", {
  14033. value: true
  14034. });
  14035. exports.default = getParent;
  14036. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  14037. // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  14038. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  14039. function getParent(name, keys) {
  14040. var parent = this.$parent;
  14041. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  14042. while (parent) {
  14043. // 父组件
  14044. if (parent.$options.name !== name) {
  14045. // 如果组件的name不相等,继续上一级寻找
  14046. parent = parent.$parent;
  14047. } else {
  14048. var _ret = function () {
  14049. var data = {};
  14050. // 判断keys是否数组,如果传过来的是一个数组,那么直接使用数组元素值当做键值去父组件寻找
  14051. if (Array.isArray(keys)) {
  14052. keys.map(function (val) {
  14053. data[val] = parent[val] ? parent[val] : '';
  14054. });
  14055. } else {
  14056. // 历遍传过来的对象参数
  14057. for (var i in keys) {
  14058. // 如果子组件有此值则用,无此值则用父组件的值
  14059. // 判断是否空数组,如果是,则用父组件的值,否则用子组件的值
  14060. if (Array.isArray(keys[i])) {
  14061. if (keys[i].length) {
  14062. data[i] = keys[i];
  14063. } else {
  14064. data[i] = parent[i];
  14065. }
  14066. } else if (keys[i].constructor === Object) {
  14067. // 判断是否对象,如果是对象,且有属性,那么使用子组件的值,否则使用父组件的值
  14068. if (Object.keys(keys[i]).length) {
  14069. data[i] = keys[i];
  14070. } else {
  14071. data[i] = parent[i];
  14072. }
  14073. } else {
  14074. // 只要子组件有传值,即使是false值,也是“传值”了,也需要覆盖父组件的同名参数
  14075. data[i] = keys[i] || keys[i] === false ? keys[i] : parent[i];
  14076. }
  14077. }
  14078. }
  14079. return {
  14080. v: data
  14081. };
  14082. }();
  14083. if ((0, _typeof2.default)(_ret) === "object") return _ret.v;
  14084. }
  14085. }
  14086. return {};
  14087. }
  14088. /***/ }),
  14089. /***/ 56:
  14090. /*!**********************************************************************!*\
  14091. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/$parent.js ***!
  14092. \**********************************************************************/
  14093. /*! no static exports found */
  14094. /***/ (function(module, exports, __webpack_require__) {
  14095. "use strict";
  14096. Object.defineProperty(exports, "__esModule", {
  14097. value: true
  14098. });
  14099. exports.default = $parent;
  14100. // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  14101. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  14102. // 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
  14103. // 值(默认为undefined),就是查找最顶层的$parent
  14104. function $parent() {
  14105. var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  14106. var parent = this.$parent;
  14107. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  14108. while (parent) {
  14109. // 父组件
  14110. if (parent.$options && parent.$options.name !== name) {
  14111. // 如果组件的name不相等,继续上一级寻找
  14112. parent = parent.$parent;
  14113. } else {
  14114. return parent;
  14115. }
  14116. }
  14117. return false;
  14118. }
  14119. /***/ }),
  14120. /***/ 57:
  14121. /*!******************************************************************!*\
  14122. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/sys.js ***!
  14123. \******************************************************************/
  14124. /*! no static exports found */
  14125. /***/ (function(module, exports, __webpack_require__) {
  14126. "use strict";
  14127. /* WEBPACK VAR INJECTION */(function(uni) {
  14128. Object.defineProperty(exports, "__esModule", {
  14129. value: true
  14130. });
  14131. exports.os = os;
  14132. exports.sys = sys;
  14133. function os() {
  14134. return uni.getSystemInfoSync().platform;
  14135. }
  14136. ;
  14137. function sys() {
  14138. return uni.getSystemInfoSync();
  14139. }
  14140. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  14141. /***/ }),
  14142. /***/ 58:
  14143. /*!***********************************************************************!*\
  14144. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/debounce.js ***!
  14145. \***********************************************************************/
  14146. /*! no static exports found */
  14147. /***/ (function(module, exports, __webpack_require__) {
  14148. "use strict";
  14149. Object.defineProperty(exports, "__esModule", {
  14150. value: true
  14151. });
  14152. exports.default = void 0;
  14153. var timeout = null;
  14154. /**
  14155. * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
  14156. *
  14157. * @param {Function} func 要执行的回调函数
  14158. * @param {Number} wait 延时的时间
  14159. * @param {Boolean} immediate 是否立即执行
  14160. * @return null
  14161. */
  14162. function debounce(func) {
  14163. var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
  14164. var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  14165. // 清除定时器
  14166. if (timeout !== null) clearTimeout(timeout);
  14167. // 立即执行,此类情况一般用不到
  14168. if (immediate) {
  14169. var callNow = !timeout;
  14170. timeout = setTimeout(function () {
  14171. timeout = null;
  14172. }, wait);
  14173. if (callNow) typeof func === 'function' && func();
  14174. } else {
  14175. // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
  14176. timeout = setTimeout(function () {
  14177. typeof func === 'function' && func();
  14178. }, wait);
  14179. }
  14180. }
  14181. var _default = debounce;
  14182. exports.default = _default;
  14183. /***/ }),
  14184. /***/ 59:
  14185. /*!***********************************************************************!*\
  14186. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/throttle.js ***!
  14187. \***********************************************************************/
  14188. /*! no static exports found */
  14189. /***/ (function(module, exports, __webpack_require__) {
  14190. "use strict";
  14191. Object.defineProperty(exports, "__esModule", {
  14192. value: true
  14193. });
  14194. exports.default = void 0;
  14195. var timeoutArr = [];
  14196. var flagArr = [];
  14197. /**
  14198. * 节流函数
  14199. * 节流原理:在一定时间内,只能触发一次
  14200. * @param {Function} fn 要执行的回调函数
  14201. * @param {Number} time 延时的时间
  14202. * @param {Boolean} isImmediate 是否立即执行
  14203. * @param {String} timeoutName 定时器ID
  14204. * @return null
  14205. */
  14206. function throttle(fn) {
  14207. var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
  14208. var isImmediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  14209. var timeoutName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "default";
  14210. if (!timeoutArr[timeoutName]) timeoutArr[timeoutName] = null;
  14211. if (isImmediate) {
  14212. if (!flagArr[timeoutName]) {
  14213. flagArr[timeoutName] = true;
  14214. // 如果是立即执行,则在time毫秒内开始时执行
  14215. if (typeof fn === 'function') fn();
  14216. timeoutArr[timeoutName] = setTimeout(function () {
  14217. flagArr[timeoutName] = false;
  14218. }, time);
  14219. }
  14220. } else {
  14221. if (!flagArr[timeoutName]) {
  14222. flagArr[timeoutName] = true;
  14223. // 如果是非立即执行,则在time毫秒内的结束处执行
  14224. timeoutArr[timeoutName] = setTimeout(function () {
  14225. flagArr[timeoutName] = false;
  14226. if (typeof fn === 'function') fn();
  14227. }, time);
  14228. }
  14229. }
  14230. }
  14231. ;
  14232. var _default = throttle;
  14233. exports.default = _default;
  14234. /***/ }),
  14235. /***/ 6:
  14236. /*!***************************************************************!*\
  14237. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  14238. \***************************************************************/
  14239. /*! no static exports found */
  14240. /***/ (function(module, exports) {
  14241. function _arrayWithHoles(arr) {
  14242. if (Array.isArray(arr)) return arr;
  14243. }
  14244. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  14245. /***/ }),
  14246. /***/ 60:
  14247. /*!***********************************************************************!*\
  14248. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/addStyle.js ***!
  14249. \***********************************************************************/
  14250. /*! no static exports found */
  14251. /***/ (function(module, exports, __webpack_require__) {
  14252. "use strict";
  14253. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14254. Object.defineProperty(exports, "__esModule", {
  14255. value: true
  14256. });
  14257. exports.default = void 0;
  14258. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  14259. var _test = _interopRequireDefault(__webpack_require__(/*! ./test.js */ 38));
  14260. /**
  14261. * @description 样式转换
  14262. * 对象转字符串,或者字符串转对象
  14263. * @param {object | string} customStyle 需要转换的目标
  14264. * @param {String} target 转换的目的,object-转为对象,string-转为字符串
  14265. * @returns {object|string}
  14266. */
  14267. function addStyle(customStyle) {
  14268. var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'object';
  14269. // 字符串转字符串,对象转对象情形,直接返回
  14270. if (_test.default.empty(customStyle) || (0, _typeof2.default)(customStyle) === 'object' && target === 'object' || target === 'string' && typeof customStyle === 'string') {
  14271. return customStyle;
  14272. }
  14273. // 字符串转对象
  14274. if (target === 'object') {
  14275. // 去除字符串样式中的两端空格(中间的空格不能去掉,比如padding: 20px 0如果去掉了就错了),空格是无用的
  14276. customStyle = trim(customStyle);
  14277. // 根据";"将字符串转为数组形式
  14278. var styleArray = customStyle.split(';');
  14279. var style = {};
  14280. // 历遍数组,拼接成对象
  14281. for (var i = 0; i < styleArray.length; i++) {
  14282. // 'font-size:20px;color:red;',如此最后字符串有";"的话,会导致styleArray最后一个元素为空字符串,这里需要过滤
  14283. if (styleArray[i]) {
  14284. var item = styleArray[i].split(':');
  14285. style[trim(item[0])] = trim(item[1]);
  14286. }
  14287. }
  14288. return style;
  14289. }
  14290. // 这里为对象转字符串形式
  14291. var string = '';
  14292. for (var _i in customStyle) {
  14293. // 驼峰转为中划线的形式,否则css内联样式,无法识别驼峰样式属性名
  14294. var key = _i.replace(/([A-Z])/g, '-$1').toLowerCase();
  14295. string += "".concat(key, ":").concat(customStyle[_i], ";");
  14296. }
  14297. // 去除两端空格
  14298. return trim(string);
  14299. }
  14300. var _default = addStyle;
  14301. exports.default = _default;
  14302. /***/ }),
  14303. /***/ 61:
  14304. /*!*******************************************************************!*\
  14305. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/config/config.js ***!
  14306. \*******************************************************************/
  14307. /*! no static exports found */
  14308. /***/ (function(module, exports, __webpack_require__) {
  14309. "use strict";
  14310. Object.defineProperty(exports, "__esModule", {
  14311. value: true
  14312. });
  14313. exports.default = void 0;
  14314. // 第一版 1.10.1 版本发布于2021-11-18
  14315. var version = '1.10.1';
  14316. var _default = {
  14317. v: version,
  14318. version: version,
  14319. // 主题名称
  14320. type: ['primary', 'success', 'info', 'error', 'warning']
  14321. };
  14322. exports.default = _default;
  14323. /***/ }),
  14324. /***/ 62:
  14325. /*!*******************************************************************!*\
  14326. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/config/zIndex.js ***!
  14327. \*******************************************************************/
  14328. /*! no static exports found */
  14329. /***/ (function(module, exports, __webpack_require__) {
  14330. "use strict";
  14331. Object.defineProperty(exports, "__esModule", {
  14332. value: true
  14333. });
  14334. exports.default = void 0;
  14335. // uniapp在H5中各API的z-index值如下:
  14336. /**
  14337. * actionsheet: 999
  14338. * modal: 999
  14339. * navigate: 998
  14340. * tabbar: 998
  14341. * toast: 999
  14342. */
  14343. var _default = {
  14344. toast: 10090,
  14345. noNetwork: 10080,
  14346. // popup包含popup,actionsheet,keyboard,picker的值
  14347. popup: 10075,
  14348. mask: 10070,
  14349. navbar: 980,
  14350. topTips: 975,
  14351. sticky: 970,
  14352. indexListSticky: 965
  14353. };
  14354. exports.default = _default;
  14355. /***/ }),
  14356. /***/ 63:
  14357. /*!**********************************!*\
  14358. !*** E:/work/mdapp/api/index.js ***!
  14359. \**********************************/
  14360. /*! no static exports found */
  14361. /***/ (function(module, exports, __webpack_require__) {
  14362. "use strict";
  14363. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14364. Object.defineProperty(exports, "__esModule", {
  14365. value: true
  14366. });
  14367. exports.default = void 0;
  14368. var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ 64));
  14369. var _estate = _interopRequireDefault(__webpack_require__(/*! ./estate */ 67));
  14370. var _cust = _interopRequireDefault(__webpack_require__(/*! ./cust */ 68));
  14371. var _default = {
  14372. base: _base.default,
  14373. estate: _estate.default,
  14374. cust: _cust.default
  14375. };
  14376. exports.default = _default;
  14377. /***/ }),
  14378. /***/ 64:
  14379. /*!*********************************!*\
  14380. !*** E:/work/mdapp/api/base.js ***!
  14381. \*********************************/
  14382. /*! no static exports found */
  14383. /***/ (function(module, exports, __webpack_require__) {
  14384. "use strict";
  14385. Object.defineProperty(exports, "__esModule", {
  14386. value: true
  14387. });
  14388. exports.default = void 0;
  14389. var _http = __webpack_require__(/*! @/utils/http */ 65);
  14390. var _default = {
  14391. apilogin: function apilogin(params) {
  14392. // 登录
  14393. return (0, _http.request)('api/login', params, 'loading');
  14394. },
  14395. apiregister: function apiregister(params) {
  14396. // 注册
  14397. return (0, _http.request)('api/register', params, 'loading');
  14398. },
  14399. apisendsms: function apisendsms(params) {
  14400. // 发送短信
  14401. return (0, _http.request)('api/send/sms', params, 'loading');
  14402. },
  14403. apicaptcha: function apicaptcha(params) {
  14404. // 验证码图片
  14405. return (0, _http.request)('api/captcha', params, 'loading');
  14406. },
  14407. apicheckcaptcha: function apicheckcaptcha(params) {
  14408. // 检查手机号
  14409. return (0, _http.request)('api/check/captcha', params);
  14410. },
  14411. apiwxlogin: function apiwxlogin(params) {
  14412. // 微信登录
  14413. return (0, _http.request)('api/wx/login', params, 'loading');
  14414. },
  14415. apiwxautologin: function apiwxautologin(params) {
  14416. // 微信登录 自动
  14417. return (0, _http.request)('api/wx/autologin', params, 'loading');
  14418. },
  14419. apiuserinfo: function apiuserinfo(params) {
  14420. // 用户信息
  14421. return (0, _http.request)('api/user/info', params, 'loading');
  14422. },
  14423. apiuseredit: function apiuseredit(params) {
  14424. // 用户编辑
  14425. return (0, _http.request)('api/user/edit', params, 'loading');
  14426. },
  14427. apiuserbindwechat: function apiuserbindwechat(params) {
  14428. // 绑定微信
  14429. return (0, _http.request)('api/user/bind/wechat', params, 'loading');
  14430. },
  14431. apiuserauthadd: function apiuserauthadd(params) {
  14432. // 用户认证 - 提交认证
  14433. return (0, _http.request)('api/user/auth/add', params, 'loading');
  14434. },
  14435. apiuserauthinfo: function apiuserauthinfo(params) {
  14436. // 用户认证 - 认证详情
  14437. return (0, _http.request)('api/user/auth/info', params, 'loading');
  14438. },
  14439. apiuploadcloudpiv: function apiuploadcloudpiv(params) {
  14440. // 图片上传云接口
  14441. return (0, _http.request)('api/upload/cloudpiv', params, 'loading');
  14442. },
  14443. apidicttree: function apidicttree(params) {
  14444. // 字典
  14445. return (0, _http.request)('api/dict/tree', params, 'loading');
  14446. },
  14447. apiuserauthlist: function apiuserauthlist(params) {
  14448. // 认证列表
  14449. return (0, _http.request)('api/user/auth/list', params, 'loading');
  14450. },
  14451. apiuserauthedit: function apiuserauthedit(params) {
  14452. // 认证 审核 中介
  14453. return (0, _http.request)('api/user/auth/edit', params, 'loading');
  14454. },
  14455. apideptauthedit: function apideptauthedit(params) {
  14456. // 认证 审核 渠道
  14457. return (0, _http.request)('api/dept/auth/edit', params, 'loading');
  14458. },
  14459. apiuserreferreredit: function apiuserreferreredit(params) {
  14460. // 修改推荐人
  14461. return (0, _http.request)('api/user/referrer/edit', params, 'loading');
  14462. },
  14463. apiusernoticeopen: function apiusernoticeopen(params) {
  14464. // 公众号 推送 打开
  14465. return (0, _http.request)('api/user/notice/open', params, 'loading');
  14466. },
  14467. apiusernoticeclose: function apiusernoticeclose(params) {
  14468. // 公众号 推送 关闭
  14469. return (0, _http.request)('api/user/notice/close', params, 'loading');
  14470. }
  14471. };
  14472. exports.default = _default;
  14473. /***/ }),
  14474. /***/ 65:
  14475. /*!***********************************!*\
  14476. !*** E:/work/mdapp/utils/http.js ***!
  14477. \***********************************/
  14478. /*! no static exports found */
  14479. /***/ (function(module, exports, __webpack_require__) {
  14480. "use strict";
  14481. /* WEBPACK VAR INJECTION */(function(uni) {
  14482. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14483. Object.defineProperty(exports, "__esModule", {
  14484. value: true
  14485. });
  14486. exports.request = request;
  14487. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  14488. var _utils = __webpack_require__(/*! @utils */ 66);
  14489. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  14490. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  14491. var Http = function Http() {
  14492. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  14493. data: {}
  14494. };
  14495. return new Promise(function (resolve, reject) {
  14496. if (options.loadingStr === 'loading') {
  14497. uni.showLoading({
  14498. mask: true,
  14499. title: '加载中..'
  14500. });
  14501. }
  14502. var token = uni.getStorageSync('MD_token') || '';
  14503. var header = {
  14504. 'Content-Type': 'application/json',
  14505. 'token': token
  14506. // 'Content-Type': 'application/x-www-form-urlencoded'
  14507. };
  14508. var params = _objectSpread({}, options.data);
  14509. if (uni.getStorageSync('APP_token')) params.token = uni.getStorageSync('APP_token');
  14510. for (var key in options.data) {
  14511. if (options.data[key] === undefined || options.data[key] === 'undefined') {
  14512. params[key] = '';
  14513. }
  14514. }
  14515. var url = uni.baseUrl + options.url;
  14516. // let url = options.url
  14517. if (options.queryData) {
  14518. var qStr = '';
  14519. for (var k in options.queryData) {
  14520. qStr += "".concat(k, "=").concat(options.queryData[k], "&");
  14521. }
  14522. qStr = qStr.substr(0, qStr.length - 1);
  14523. url += "?".concat(qStr);
  14524. }
  14525. uni.request({
  14526. url: url,
  14527. data: _objectSpread({}, params),
  14528. header: header,
  14529. method: options.method || 'POST',
  14530. complete: function complete(res) {
  14531. if (options.loadingStr === 'loading') {
  14532. uni.hideLoading();
  14533. }
  14534. },
  14535. success: function success(res) {
  14536. var cData = res.data;
  14537. var code = cData.errno;
  14538. switch (code) {
  14539. case 0:
  14540. return resolve((0, _utils.noEmpty)(cData.data) ? cData.data : cData);
  14541. break;
  14542. case 401:
  14543. case 404:
  14544. case 405:
  14545. uni.removeStorageSync('MD_userInfo');
  14546. var u2 = uni.getStorageSync('MD_userInfo2');
  14547. if (u2.bind_wechat === '1' && uni.getStorageSync('MD_token')) {
  14548. uni.login({
  14549. success: function success(res) {
  14550. if (res.code) {
  14551. uni.api.base.apiwxautologin({
  14552. code: res.code
  14553. }).then(function (cData) {
  14554. if (cData.token === 'error') {
  14555. uni.removeStorageSync('MD_token');
  14556. } else {
  14557. uni.setStorageSync('MD_userInfo', cData);
  14558. uni.setStorageSync('MD_token', cData.token);
  14559. uni.api.base.apidicttree().then(function (res) {
  14560. var cObj = res || {};
  14561. var newDict = {};
  14562. for (var _k in cObj) {
  14563. var cArr = cObj[_k].map(function (item) {
  14564. return _objectSpread(_objectSpread({}, item), {}, {
  14565. key: item.dict_label,
  14566. val: item.dict_value
  14567. });
  14568. });
  14569. newDict[_k] = cArr;
  14570. }
  14571. uni.setStorageSync('MD_dict', newDict);
  14572. });
  14573. uni.api.base.apiuserinfo().then(function (res2) {
  14574. uni.setStorageSync('MD_userInfo2', res2);
  14575. uni.reLaunch({
  14576. url: '/pages/index/index'
  14577. });
  14578. });
  14579. }
  14580. });
  14581. }
  14582. }
  14583. });
  14584. } else {
  14585. uni.showToast({
  14586. title: "\u8BF7\u5148\u767B\u5F55~",
  14587. icon: 'none'
  14588. });
  14589. uni.navigateTo({
  14590. url: '/pages/user/login/login'
  14591. });
  14592. }
  14593. break;
  14594. default:
  14595. uni.showModal({
  14596. title: '提示',
  14597. content: "".concat(cData.errmsg, "(").concat(code, ")")
  14598. });
  14599. return reject(cData);
  14600. }
  14601. // resolve()
  14602. },
  14603. fail: function fail(err) {
  14604. console.log(err);
  14605. reject(err);
  14606. }
  14607. });
  14608. });
  14609. };
  14610. // export default Http
  14611. function request(url, data, loadingStr, queryData) {
  14612. return Http({
  14613. url: url,
  14614. data: data,
  14615. loadingStr: loadingStr,
  14616. queryData: queryData
  14617. });
  14618. }
  14619. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  14620. /***/ }),
  14621. /***/ 66:
  14622. /*!************************************!*\
  14623. !*** E:/work/mdapp/utils/index.js ***!
  14624. \************************************/
  14625. /*! no static exports found */
  14626. /***/ (function(module, exports, __webpack_require__) {
  14627. "use strict";
  14628. Object.defineProperty(exports, "__esModule", {
  14629. value: true
  14630. });
  14631. exports.arrToObj = arrToObj;
  14632. exports.comGetTime = comGetTime;
  14633. exports.noEmpty = noEmpty;
  14634. exports.numFormat3 = numFormat3;
  14635. exports.strTrim = strTrim;
  14636. /**
  14637. * @param {string} str
  14638. * @returns {string}
  14639. */
  14640. function strTrim(str) {
  14641. return str.replace(/(^\s*)|(\s*$)/g, '');
  14642. }
  14643. /**
  14644. * @param {Number} num
  14645. * @returns {string}
  14646. */
  14647. function numFormat3(num) {
  14648. var dotNum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  14649. var numArr = Number(num).toFixed(dotNum).toString().split('.');
  14650. var arr = numArr[0].split('').reverse();
  14651. var res = [];
  14652. for (var i = 0; i < arr.length; i++) {
  14653. if (i % 3 === 0 && i !== 0) {
  14654. res.push(',');
  14655. }
  14656. res.push(arr[i]);
  14657. }
  14658. res.reverse();
  14659. if (numArr[1]) {
  14660. res = res.join('').concat('.' + numArr[1]);
  14661. } else {
  14662. res = res.join('');
  14663. }
  14664. // let res = num.toString().replace(/\d+/, function(n){
  14665. // return n.replace(/(\d)(?=(\d{3})+$)/g,function($1){
  14666. // return $1 + ","
  14667. // })
  14668. // })
  14669. // toLocaleString()
  14670. return res;
  14671. }
  14672. /**
  14673. * @param {Array} arr
  14674. * @returns {Object}
  14675. */
  14676. function arrToObj(arr) {
  14677. var obj = {};
  14678. if (Object.prototype.toString.call(arr) === '[object Array]') {
  14679. if (arr.length > 0) {
  14680. arr.forEach(function (item) {
  14681. obj[item.val] = item.key;
  14682. });
  14683. }
  14684. }
  14685. return obj;
  14686. }
  14687. /**
  14688. * @param {any} val
  14689. * @returns {Boolean}
  14690. */
  14691. function noEmpty(val) {
  14692. if (val === null || val === undefined || val === '') {
  14693. return false;
  14694. } else {
  14695. return true;
  14696. }
  14697. }
  14698. /**
  14699. * @param {Number} date
  14700. * @param {Boolean} onlyDate
  14701. * @returns {String}
  14702. * function time(time = +new Date()) {
  14703. var date = new Date(time + 8 * 3600 * 1000); // 增加8小时
  14704. return date.toJSON().substr(0, 19).replace('T', ' ');
  14705. }
  14706. */
  14707. function comGetTime() {
  14708. var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
  14709. var onlyDate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  14710. var year = date.getFullYear();
  14711. var month = date.getMonth() + 1;
  14712. month = month > 9 ? month : '0' + month;
  14713. var day = date.getDate();
  14714. day = day > 9 ? day : '0' + day;
  14715. var hour = date.getHours();
  14716. hour = hour > 9 ? hour : '0' + hour;
  14717. var minute = date.getMinutes();
  14718. minute = minute > 9 ? minute : '0' + minute;
  14719. var second = date.getSeconds();
  14720. second = second > 9 ? second : '0' + second;
  14721. var milli = date.getMilliseconds();
  14722. milli = milli > 100 ? milli : milli > 10 ? '0' + milli : '00' + milli;
  14723. return onlyDate ? "".concat(year, "-").concat(month, "-").concat(day) : "".concat(year).concat(month).concat(day).concat(hour).concat(minute).concat(second).concat(milli);
  14724. }
  14725. /***/ }),
  14726. /***/ 67:
  14727. /*!***********************************!*\
  14728. !*** E:/work/mdapp/api/estate.js ***!
  14729. \***********************************/
  14730. /*! no static exports found */
  14731. /***/ (function(module, exports, __webpack_require__) {
  14732. "use strict";
  14733. Object.defineProperty(exports, "__esModule", {
  14734. value: true
  14735. });
  14736. exports.default = void 0;
  14737. var _http = __webpack_require__(/*! @/utils/http */ 65);
  14738. var _default = {
  14739. apiestatelist: function apiestatelist(params) {
  14740. // 楼盘列表
  14741. return (0, _http.request)('api/estate/list', params, 'loading');
  14742. },
  14743. apiestatecontentdetail: function apiestatecontentdetail(params) {
  14744. // 楼盘 介绍详情
  14745. return (0, _http.request)('api/estate/content/detail', params, 'loading');
  14746. },
  14747. apireportadd: function apireportadd(params) {
  14748. // 报备 - 添加报备
  14749. return (0, _http.request)('api/report/add', params, 'loading');
  14750. },
  14751. apireportlist: function apireportlist(params) {
  14752. // 报备 - 报备列表
  14753. return (0, _http.request)('api/report/list', params, 'loading');
  14754. },
  14755. apireportdetail: function apireportdetail(params) {
  14756. // 报备 - 报备详情
  14757. return (0, _http.request)('api/report/detail', params, 'loading');
  14758. },
  14759. apireport2detail: function apireport2detail(params) {
  14760. // 报备 - 报备详情2 普通的报备详情
  14761. return (0, _http.request)('api/report2/detail', params, 'loading');
  14762. },
  14763. apigoverndetail: function apigoverndetail(params) {
  14764. // 报备 - 报备详情 /govern/detail
  14765. return (0, _http.request)('api/govern/detail', params, 'loading');
  14766. },
  14767. apireportsite: function apireportsite(params) {
  14768. // 案场 - 报备详情
  14769. return (0, _http.request)('api/report/site', params, 'loading');
  14770. },
  14771. apireportconfirm: function apireportconfirm(params) {
  14772. // 报备 - 报备确认
  14773. return (0, _http.request)('api/report/confirm', params, 'loading');
  14774. },
  14775. apireportcount: function apireportcount(params) {
  14776. // 报备 - 报备统计
  14777. return (0, _http.request)('api/report/count', params, 'loading');
  14778. },
  14779. apireportgroupcount: function apireportgroupcount(params) {
  14780. // 报备 - 报备分组统计
  14781. return (0, _http.request)('api/report/group/count', params, 'loading');
  14782. },
  14783. apiestateinfodetail: function apiestateinfodetail(params) {
  14784. // 楼盘一页纸
  14785. return (0, _http.request)('api/estate/info/detail', params, 'loading');
  14786. },
  14787. apiestatedetail: function apiestatedetail(params) {
  14788. // 楼盘详情 copy plus
  14789. return (0, _http.request)('api/estate/detail', params, 'loading');
  14790. },
  14791. apigovernlist: function apigovernlist(params) {
  14792. // 案场缺课列表
  14793. return (0, _http.request)('api/govern/list', params, 'loading');
  14794. },
  14795. apireportedit: function apireportedit(params) {
  14796. // 报备修改 接口
  14797. return (0, _http.request)('api/report/edit', params, 'loading');
  14798. },
  14799. apireportsubscrlist: function apireportsubscrlist(params) {
  14800. // 认购审核列表
  14801. return (0, _http.request)('api/report/subscr/list', params, 'loading');
  14802. },
  14803. apireportsubscrDeal: function apireportsubscrDeal(params) {
  14804. // 已认购审核
  14805. return (0, _http.request)('api/report/subscr', params, 'loading');
  14806. },
  14807. apireportsignupDeal: function apireportsignupDeal(params) {
  14808. // 已签约审核
  14809. return (0, _http.request)('api/report/signup', params, 'loading');
  14810. },
  14811. apiestateliblist: function apiestateliblist(params) {
  14812. // 内部 各楼盘各平台佣金汇集
  14813. return (0, _http.request)('api/estate/lib/list', params, 'loading');
  14814. },
  14815. apiestatelibdetail: function apiestatelibdetail(params) {
  14816. // 内部 各楼盘各平台佣金汇集 详情
  14817. return (0, _http.request)('api/estate/lib/detail', params, 'loading');
  14818. }
  14819. };
  14820. exports.default = _default;
  14821. /***/ }),
  14822. /***/ 68:
  14823. /*!*********************************!*\
  14824. !*** E:/work/mdapp/api/cust.js ***!
  14825. \*********************************/
  14826. /*! no static exports found */
  14827. /***/ (function(module, exports, __webpack_require__) {
  14828. "use strict";
  14829. Object.defineProperty(exports, "__esModule", {
  14830. value: true
  14831. });
  14832. exports.default = void 0;
  14833. var _http = __webpack_require__(/*! @/utils/http */ 65);
  14834. var _default = {
  14835. apicustomerlist: function apicustomerlist(params) {
  14836. // 客户 列表
  14837. return (0, _http.request)('api/customer/list', params);
  14838. },
  14839. apicustomeradd: function apicustomeradd(params) {
  14840. // 客户 添加
  14841. return (0, _http.request)('api/customer/add', params, 'loading');
  14842. },
  14843. apicustomeredit: function apicustomeredit(params) {
  14844. // 客户 编辑
  14845. return (0, _http.request)('api/customer/edit', params, 'loading');
  14846. },
  14847. apicustomerdel: function apicustomerdel(params) {
  14848. // 客户 删除
  14849. return (0, _http.request)('api/customer/del', params, 'loading');
  14850. },
  14851. apicustomerdetail: function apicustomerdetail(params) {
  14852. // 客户 详情
  14853. return (0, _http.request)('api/customer/detail', params, 'loading');
  14854. },
  14855. apireportvisitchange: function apireportvisitchange(params) {
  14856. // 到访材料添加
  14857. return (0, _http.request)('api/report/visit/change', params, 'loading');
  14858. },
  14859. apireportvisitdetail: function apireportvisitdetail(params) {
  14860. // 到访材料详情
  14861. return (0, _http.request)('api/report/visit/detail', params, 'loading');
  14862. },
  14863. apireportvisit: function apireportvisit(params) {
  14864. // 报备到访
  14865. return (0, _http.request)('api/report/visit', params, 'loading');
  14866. },
  14867. apireportverify: function apireportverify(params) {
  14868. // 报备审核
  14869. return (0, _http.request)('api/report/verify', params, 'loading');
  14870. },
  14871. apideptuserlist: function apideptuserlist(params) {
  14872. // 我的门店下级人员
  14873. return (0, _http.request)('api/dept/user/list', params, 'loading');
  14874. },
  14875. apiprivatecustomerlist: function apiprivatecustomerlist(params) {
  14876. // 内部客户 列表
  14877. return (0, _http.request)('api/private/customer/list', params);
  14878. },
  14879. apiprivatecustomeradd: function apiprivatecustomeradd(params) {
  14880. // 内部客户 添加
  14881. return (0, _http.request)('api/private/customer/add', params, 'loading');
  14882. },
  14883. apiprivatecustomeredit: function apiprivatecustomeredit(params) {
  14884. // 内部客户 编辑
  14885. return (0, _http.request)('api/private/customer/edit', params, 'loading');
  14886. },
  14887. apiprivatecustomerdel: function apiprivatecustomerdel(params) {
  14888. // 内部客户 删除
  14889. return (0, _http.request)('api/private/customer/del', params, 'loading');
  14890. },
  14891. apiprivatecustomerdetail: function apiprivatecustomerdetail(params) {
  14892. // 内部客户 详情
  14893. return (0, _http.request)('api/private/customer/detail', params, 'loading');
  14894. },
  14895. apiprivaterecordlist: function apiprivaterecordlist(params) {
  14896. // 内部客户 - 跟进记录 - 列表
  14897. return (0, _http.request)('api/private/record/list', params);
  14898. },
  14899. apiprivaterecordadd: function apiprivaterecordadd(params) {
  14900. // 内部客户 - 跟进记录 - 添加
  14901. return (0, _http.request)('api/private/record/add', params, 'loading');
  14902. },
  14903. apiprivaterecordedit: function apiprivaterecordedit(params) {
  14904. // 内部客户 - 跟进记录 - 编辑
  14905. return (0, _http.request)('api/private/record/edit', params, 'loading');
  14906. },
  14907. apiprivaterecorddel: function apiprivaterecorddel(params) {
  14908. // 内部客户 - 跟进记录 - 删除
  14909. return (0, _http.request)('api/private/record/del', params, 'loading');
  14910. },
  14911. apirecordremindcount: function apirecordremindcount(params) {
  14912. // 内部客户 - 跟进记录 - 数量统计
  14913. return (0, _http.request)('api/record/remind/count', params, 'loading');
  14914. },
  14915. apitradelist: function apitradelist(params) {
  14916. // 成交 - 列表
  14917. return (0, _http.request)('api/trade/list', params);
  14918. },
  14919. apitradeadd: function apitradeadd(params) {
  14920. // 成交 - 添加
  14921. return (0, _http.request)('api/trade/add', params, 'loading');
  14922. },
  14923. apitradeedit: function apitradeedit(params) {
  14924. // 成交 - 编辑
  14925. return (0, _http.request)('api/trade/edit', params, 'loading');
  14926. },
  14927. apitradedetail: function apitradedetail(params) {
  14928. // 成交 - 详情
  14929. return (0, _http.request)('api/trade/detail', params, 'loading');
  14930. },
  14931. apitradedel: function apitradedel(params) {
  14932. // 成交 - 删除
  14933. return (0, _http.request)('api/trade/del', params, 'loading');
  14934. },
  14935. apitraderecordlist: function apitraderecordlist(params) {
  14936. // 成交 更新记录 - 列表
  14937. return (0, _http.request)('api/trade/record/list', params);
  14938. },
  14939. apitraderecordadd: function apitraderecordadd(params) {
  14940. // 成交 更新记录 - 添加
  14941. return (0, _http.request)('api/trade/record/add', params, 'loading');
  14942. },
  14943. apitraderecordedit: function apitraderecordedit(params) {
  14944. // 成交 更新记录 - 编辑
  14945. return (0, _http.request)('api/trade/record/edit', params, 'loading');
  14946. },
  14947. apitraderecorddel: function apitraderecorddel(params) {
  14948. // 成交 更新记录 - 删除
  14949. return (0, _http.request)('api/trade/record/del', params, 'loading');
  14950. }
  14951. };
  14952. exports.default = _default;
  14953. /***/ }),
  14954. /***/ 69:
  14955. /*!***********************************!*\
  14956. !*** E:/work/mdapp/utils/tool.js ***!
  14957. \***********************************/
  14958. /*! no static exports found */
  14959. /***/ (function(module, exports, __webpack_require__) {
  14960. "use strict";
  14961. /* WEBPACK VAR INJECTION */(function(uni) {
  14962. Object.defineProperty(exports, "__esModule", {
  14963. value: true
  14964. });
  14965. exports.msgBase = exports.getRandomNum = exports.confirmMsgFn = void 0;
  14966. var getRandomNum = function getRandomNum(len, radix) {
  14967. // getRandomNum(24, 16)
  14968. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  14969. var uuid = [];
  14970. radix = radix || chars.length;
  14971. if (len) {
  14972. // Compact form
  14973. for (var i = 0; i < len; i++) {
  14974. uuid[i] = chars[0 | Math.random() * radix];
  14975. }
  14976. } else {
  14977. // rfc4122, version 4 form
  14978. var r;
  14979. // rfc4122 requires these characters
  14980. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  14981. uuid[14] = '4';
  14982. // Fill in random data.  At i==19 set the high bits of clock sequence as
  14983. // per rfc4122, sec. 4.1.5
  14984. for (var _i = 0; _i < 36; _i++) {
  14985. if (!uuid[_i]) {
  14986. r = 0 | Math.random() * 16;
  14987. uuid[_i] = chars[_i === 19 ? r & 0x3 | 0x8 : r];
  14988. }
  14989. }
  14990. }
  14991. return uuid.join('') + new Date().getTime();
  14992. };
  14993. exports.getRandomNum = getRandomNum;
  14994. var msgBase = function msgBase(msgText, bc) {
  14995. uni.showToast({
  14996. title: msgText,
  14997. icon: 'none',
  14998. duration: 2000
  14999. }).then(function () {
  15000. if (bc) bc();
  15001. });
  15002. };
  15003. exports.msgBase = msgBase;
  15004. var confirmMsgFn = function confirmMsgFn(msgText, successBc, errorBc) {
  15005. var title = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '提示';
  15006. uni.showModal({
  15007. title: title,
  15008. content: msgText,
  15009. success: function success(res) {
  15010. if (res.confirm) {
  15011. if (successBc) successBc();
  15012. } else if (res.cancel) {
  15013. if (errorBc) errorBc();
  15014. }
  15015. }
  15016. });
  15017. };
  15018. exports.confirmMsgFn = confirmMsgFn;
  15019. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  15020. /***/ }),
  15021. /***/ 7:
  15022. /*!*********************************************************************!*\
  15023. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  15024. \*********************************************************************/
  15025. /*! no static exports found */
  15026. /***/ (function(module, exports) {
  15027. function _iterableToArrayLimit(arr, i) {
  15028. var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  15029. if (null != _i) {
  15030. var _s,
  15031. _e,
  15032. _x,
  15033. _r,
  15034. _arr = [],
  15035. _n = !0,
  15036. _d = !1;
  15037. try {
  15038. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  15039. if (Object(_i) !== _i) return;
  15040. _n = !1;
  15041. } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  15042. ;
  15043. }
  15044. } catch (err) {
  15045. _d = !0, _e = err;
  15046. } finally {
  15047. try {
  15048. if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
  15049. } finally {
  15050. if (_d) throw _e;
  15051. }
  15052. }
  15053. return _arr;
  15054. }
  15055. }
  15056. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  15057. /***/ }),
  15058. /***/ 8:
  15059. /*!***************************************************************************!*\
  15060. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  15061. \***************************************************************************/
  15062. /*! no static exports found */
  15063. /***/ (function(module, exports, __webpack_require__) {
  15064. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  15065. function _unsupportedIterableToArray(o, minLen) {
  15066. if (!o) return;
  15067. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  15068. var n = Object.prototype.toString.call(o).slice(8, -1);
  15069. if (n === "Object" && o.constructor) n = o.constructor.name;
  15070. if (n === "Map" || n === "Set") return Array.from(o);
  15071. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  15072. }
  15073. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  15074. /***/ }),
  15075. /***/ 9:
  15076. /*!*****************************************************************!*\
  15077. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  15078. \*****************************************************************/
  15079. /*! no static exports found */
  15080. /***/ (function(module, exports) {
  15081. function _arrayLikeToArray(arr, len) {
  15082. if (len == null || len > arr.length) len = arr.length;
  15083. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  15084. arr2[i] = arr[i];
  15085. }
  15086. return arr2;
  15087. }
  15088. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  15089. /***/ })
  15090. }]);
  15091. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map