vendor.js 474 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!************************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  5. \************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. /* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createPlugin = createPlugin;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 3);
  10. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 4));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  11. var realAtob;
  12. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  13. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  14. if (typeof atob !== 'function') {
  15. realAtob = function realAtob(str) {
  16. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  17. if (!b64re.test(str)) {throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");}
  18. // Adding the padding if missing, for semplicity
  19. str += '=='.slice(2 - (str.length & 3));
  20. var bitmap;var result = '';var r1;var r2;var i = 0;
  21. for (; i < str.length;) {
  22. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 |
  23. (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  24. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) :
  25. r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) :
  26. String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  27. }
  28. return result;
  29. };
  30. } else {
  31. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  32. realAtob = atob;
  33. }
  34. function b64DecodeUnicode(str) {
  35. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  36. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  37. }).join(''));
  38. }
  39. function getCurrentUserInfo() {
  40. var token = wx.getStorageSync('uni_id_token') || '';
  41. var tokenArr = token.split('.');
  42. if (!token || tokenArr.length !== 3) {
  43. return {
  44. uid: null,
  45. role: [],
  46. permission: [],
  47. tokenExpired: 0 };
  48. }
  49. var userInfo;
  50. try {
  51. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  52. } catch (error) {
  53. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  54. }
  55. userInfo.tokenExpired = userInfo.exp * 1000;
  56. delete userInfo.exp;
  57. delete userInfo.iat;
  58. return userInfo;
  59. }
  60. function uniIdMixin(Vue) {
  61. Vue.prototype.uniIDHasRole = function (roleId) {var _getCurrentUserInfo =
  62. getCurrentUserInfo(),role = _getCurrentUserInfo.role;
  63. return role.indexOf(roleId) > -1;
  64. };
  65. Vue.prototype.uniIDHasPermission = function (permissionId) {var _getCurrentUserInfo2 =
  66. getCurrentUserInfo(),permission = _getCurrentUserInfo2.permission;
  67. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  68. };
  69. Vue.prototype.uniIDTokenValid = function () {var _getCurrentUserInfo3 =
  70. getCurrentUserInfo(),tokenExpired = _getCurrentUserInfo3.tokenExpired;
  71. return tokenExpired > Date.now();
  72. };
  73. }
  74. var _toString = Object.prototype.toString;
  75. var hasOwnProperty = Object.prototype.hasOwnProperty;
  76. function isFn(fn) {
  77. return typeof fn === 'function';
  78. }
  79. function isStr(str) {
  80. return typeof str === 'string';
  81. }
  82. function isPlainObject(obj) {
  83. return _toString.call(obj) === '[object Object]';
  84. }
  85. function hasOwn(obj, key) {
  86. return hasOwnProperty.call(obj, key);
  87. }
  88. function noop() {}
  89. /**
  90. * Create a cached version of a pure function.
  91. */
  92. function cached(fn) {
  93. var cache = Object.create(null);
  94. return function cachedFn(str) {
  95. var hit = cache[str];
  96. return hit || (cache[str] = fn(str));
  97. };
  98. }
  99. /**
  100. * Camelize a hyphen-delimited string.
  101. */
  102. var camelizeRE = /-(\w)/g;
  103. var camelize = cached(function (str) {
  104. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  105. });
  106. function sortObject(obj) {
  107. var sortObj = {};
  108. if (isPlainObject(obj)) {
  109. Object.keys(obj).sort().forEach(function (key) {
  110. sortObj[key] = obj[key];
  111. });
  112. }
  113. return !Object.keys(sortObj) ? obj : sortObj;
  114. }
  115. var HOOKS = [
  116. 'invoke',
  117. 'success',
  118. 'fail',
  119. 'complete',
  120. 'returnValue'];
  121. var globalInterceptors = {};
  122. var scopedInterceptors = {};
  123. function mergeHook(parentVal, childVal) {
  124. var res = childVal ?
  125. parentVal ?
  126. parentVal.concat(childVal) :
  127. Array.isArray(childVal) ?
  128. childVal : [childVal] :
  129. parentVal;
  130. return res ?
  131. dedupeHooks(res) :
  132. res;
  133. }
  134. function dedupeHooks(hooks) {
  135. var res = [];
  136. for (var i = 0; i < hooks.length; i++) {
  137. if (res.indexOf(hooks[i]) === -1) {
  138. res.push(hooks[i]);
  139. }
  140. }
  141. return res;
  142. }
  143. function removeHook(hooks, hook) {
  144. var index = hooks.indexOf(hook);
  145. if (index !== -1) {
  146. hooks.splice(index, 1);
  147. }
  148. }
  149. function mergeInterceptorHook(interceptor, option) {
  150. Object.keys(option).forEach(function (hook) {
  151. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  152. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  153. }
  154. });
  155. }
  156. function removeInterceptorHook(interceptor, option) {
  157. if (!interceptor || !option) {
  158. return;
  159. }
  160. Object.keys(option).forEach(function (hook) {
  161. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  162. removeHook(interceptor[hook], option[hook]);
  163. }
  164. });
  165. }
  166. function addInterceptor(method, option) {
  167. if (typeof method === 'string' && isPlainObject(option)) {
  168. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  169. } else if (isPlainObject(method)) {
  170. mergeInterceptorHook(globalInterceptors, method);
  171. }
  172. }
  173. function removeInterceptor(method, option) {
  174. if (typeof method === 'string') {
  175. if (isPlainObject(option)) {
  176. removeInterceptorHook(scopedInterceptors[method], option);
  177. } else {
  178. delete scopedInterceptors[method];
  179. }
  180. } else if (isPlainObject(method)) {
  181. removeInterceptorHook(globalInterceptors, method);
  182. }
  183. }
  184. function wrapperHook(hook) {
  185. return function (data) {
  186. return hook(data) || data;
  187. };
  188. }
  189. function isPromise(obj) {
  190. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  191. }
  192. function queue(hooks, data) {
  193. var promise = false;
  194. for (var i = 0; i < hooks.length; i++) {
  195. var hook = hooks[i];
  196. if (promise) {
  197. promise = Promise.resolve(wrapperHook(hook));
  198. } else {
  199. var res = hook(data);
  200. if (isPromise(res)) {
  201. promise = Promise.resolve(res);
  202. }
  203. if (res === false) {
  204. return {
  205. then: function then() {} };
  206. }
  207. }
  208. }
  209. return promise || {
  210. then: function then(callback) {
  211. return callback(data);
  212. } };
  213. }
  214. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  215. ['success', 'fail', 'complete'].forEach(function (name) {
  216. if (Array.isArray(interceptor[name])) {
  217. var oldCallback = options[name];
  218. options[name] = function callbackInterceptor(res) {
  219. queue(interceptor[name], res).then(function (res) {
  220. /* eslint-disable no-mixed-operators */
  221. return isFn(oldCallback) && oldCallback(res) || res;
  222. });
  223. };
  224. }
  225. });
  226. return options;
  227. }
  228. function wrapperReturnValue(method, returnValue) {
  229. var returnValueHooks = [];
  230. if (Array.isArray(globalInterceptors.returnValue)) {
  231. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  232. }
  233. var interceptor = scopedInterceptors[method];
  234. if (interceptor && Array.isArray(interceptor.returnValue)) {
  235. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  236. }
  237. returnValueHooks.forEach(function (hook) {
  238. returnValue = hook(returnValue) || returnValue;
  239. });
  240. return returnValue;
  241. }
  242. function getApiInterceptorHooks(method) {
  243. var interceptor = Object.create(null);
  244. Object.keys(globalInterceptors).forEach(function (hook) {
  245. if (hook !== 'returnValue') {
  246. interceptor[hook] = globalInterceptors[hook].slice();
  247. }
  248. });
  249. var scopedInterceptor = scopedInterceptors[method];
  250. if (scopedInterceptor) {
  251. Object.keys(scopedInterceptor).forEach(function (hook) {
  252. if (hook !== 'returnValue') {
  253. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  254. }
  255. });
  256. }
  257. return interceptor;
  258. }
  259. function invokeApi(method, api, options) {for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {params[_key - 3] = arguments[_key];}
  260. var interceptor = getApiInterceptorHooks(method);
  261. if (interceptor && Object.keys(interceptor).length) {
  262. if (Array.isArray(interceptor.invoke)) {
  263. var res = queue(interceptor.invoke, options);
  264. return res.then(function (options) {
  265. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  266. });
  267. } else {
  268. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  269. }
  270. }
  271. return api.apply(void 0, [options].concat(params));
  272. }
  273. var promiseInterceptor = {
  274. returnValue: function returnValue(res) {
  275. if (!isPromise(res)) {
  276. return res;
  277. }
  278. return new Promise(function (resolve, reject) {
  279. res.then(function (res) {
  280. if (res[0]) {
  281. reject(res[0]);
  282. } else {
  283. resolve(res[1]);
  284. }
  285. });
  286. });
  287. } };
  288. var SYNC_API_RE =
  289. /^\$|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/;
  290. var CONTEXT_API_RE = /^create|Manager$/;
  291. // Context例外情况
  292. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  293. // 同步例外情况
  294. var ASYNC_API = ['createBLEConnection'];
  295. var CALLBACK_API_RE = /^on|^off/;
  296. function isContextApi(name) {
  297. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  298. }
  299. function isSyncApi(name) {
  300. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  301. }
  302. function isCallbackApi(name) {
  303. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  304. }
  305. function handlePromise(promise) {
  306. return promise.then(function (data) {
  307. return [null, data];
  308. }).
  309. catch(function (err) {return [err];});
  310. }
  311. function shouldPromise(name) {
  312. if (
  313. isContextApi(name) ||
  314. isSyncApi(name) ||
  315. isCallbackApi(name))
  316. {
  317. return false;
  318. }
  319. return true;
  320. }
  321. /* eslint-disable no-extend-native */
  322. if (!Promise.prototype.finally) {
  323. Promise.prototype.finally = function (callback) {
  324. var promise = this.constructor;
  325. return this.then(
  326. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  327. function (reason) {return promise.resolve(callback()).then(function () {
  328. throw reason;
  329. });});
  330. };
  331. }
  332. function promisify(name, api) {
  333. if (!shouldPromise(name)) {
  334. return api;
  335. }
  336. return function promiseApi() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {params[_key2 - 1] = arguments[_key2];}
  337. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  338. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  339. }
  340. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  341. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  342. success: resolve,
  343. fail: reject })].concat(
  344. params));
  345. })));
  346. };
  347. }
  348. var EPS = 1e-4;
  349. var BASE_DEVICE_WIDTH = 750;
  350. var isIOS = false;
  351. var deviceWidth = 0;
  352. var deviceDPR = 0;
  353. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  354. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  355. deviceWidth = windowWidth;
  356. deviceDPR = pixelRatio;
  357. isIOS = platform === 'ios';
  358. }
  359. function upx2px(number, newDeviceWidth) {
  360. if (deviceWidth === 0) {
  361. checkDeviceWidth();
  362. }
  363. number = Number(number);
  364. if (number === 0) {
  365. return 0;
  366. }
  367. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  368. if (result < 0) {
  369. result = -result;
  370. }
  371. result = Math.floor(result + EPS);
  372. if (result === 0) {
  373. if (deviceDPR === 1 || !isIOS) {
  374. result = 1;
  375. } else {
  376. result = 0.5;
  377. }
  378. }
  379. return number < 0 ? -result : result;
  380. }
  381. var LOCALE_ZH_HANS = 'zh-Hans';
  382. var LOCALE_ZH_HANT = 'zh-Hant';
  383. var LOCALE_EN = 'en';
  384. var LOCALE_FR = 'fr';
  385. var LOCALE_ES = 'es';
  386. var messages = {};
  387. var locale;
  388. {
  389. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  390. }
  391. function initI18nMessages() {
  392. if (!isEnableLocale()) {
  393. return;
  394. }
  395. var localeKeys = Object.keys(__uniConfig.locales);
  396. if (localeKeys.length) {
  397. localeKeys.forEach(function (locale) {
  398. var curMessages = messages[locale];
  399. var userMessages = __uniConfig.locales[locale];
  400. if (curMessages) {
  401. Object.assign(curMessages, userMessages);
  402. } else {
  403. messages[locale] = userMessages;
  404. }
  405. });
  406. }
  407. }
  408. initI18nMessages();
  409. var i18n = (0, _uniI18n.initVueI18n)(
  410. locale,
  411. {});
  412. var t = i18n.t;
  413. var i18nMixin = i18n.mixin = {
  414. beforeCreate: function beforeCreate() {var _this = this;
  415. var unwatch = i18n.i18n.watchLocale(function () {
  416. _this.$forceUpdate();
  417. });
  418. this.$once('hook:beforeDestroy', function () {
  419. unwatch();
  420. });
  421. },
  422. methods: {
  423. $$t: function $$t(key, values) {
  424. return t(key, values);
  425. } } };
  426. var setLocale = i18n.setLocale;
  427. var getLocale = i18n.getLocale;
  428. function initAppLocale(Vue, appVm, locale) {
  429. var state = Vue.observable({
  430. locale: locale || i18n.getLocale() });
  431. var localeWatchers = [];
  432. appVm.$watchLocale = function (fn) {
  433. localeWatchers.push(fn);
  434. };
  435. Object.defineProperty(appVm, '$locale', {
  436. get: function get() {
  437. return state.locale;
  438. },
  439. set: function set(v) {
  440. state.locale = v;
  441. localeWatchers.forEach(function (watch) {return watch(v);});
  442. } });
  443. }
  444. function isEnableLocale() {
  445. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  446. }
  447. function include(str, parts) {
  448. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  449. }
  450. function startsWith(str, parts) {
  451. return parts.find(function (part) {return str.indexOf(part) === 0;});
  452. }
  453. function normalizeLocale(locale, messages) {
  454. if (!locale) {
  455. return;
  456. }
  457. locale = locale.trim().replace(/_/g, '-');
  458. if (messages && messages[locale]) {
  459. return locale;
  460. }
  461. locale = locale.toLowerCase();
  462. if (locale === 'chinese') {
  463. // 支付宝
  464. return LOCALE_ZH_HANS;
  465. }
  466. if (locale.indexOf('zh') === 0) {
  467. if (locale.indexOf('-hans') > -1) {
  468. return LOCALE_ZH_HANS;
  469. }
  470. if (locale.indexOf('-hant') > -1) {
  471. return LOCALE_ZH_HANT;
  472. }
  473. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  474. return LOCALE_ZH_HANT;
  475. }
  476. return LOCALE_ZH_HANS;
  477. }
  478. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  479. if (lang) {
  480. return lang;
  481. }
  482. }
  483. // export function initI18n() {
  484. // const localeKeys = Object.keys(__uniConfig.locales || {})
  485. // if (localeKeys.length) {
  486. // localeKeys.forEach((locale) =>
  487. // i18n.add(locale, __uniConfig.locales[locale])
  488. // )
  489. // }
  490. // }
  491. function getLocale$1() {
  492. // 优先使用 $locale
  493. var app = getApp({
  494. allowDefault: true });
  495. if (app && app.$vm) {
  496. return app.$vm.$locale;
  497. }
  498. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  499. }
  500. function setLocale$1(locale) {
  501. var app = getApp();
  502. if (!app) {
  503. return false;
  504. }
  505. var oldLocale = app.$vm.$locale;
  506. if (oldLocale !== locale) {
  507. app.$vm.$locale = locale;
  508. onLocaleChangeCallbacks.forEach(function (fn) {return fn({
  509. locale: locale });});
  510. return true;
  511. }
  512. return false;
  513. }
  514. var onLocaleChangeCallbacks = [];
  515. function onLocaleChange(fn) {
  516. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  517. onLocaleChangeCallbacks.push(fn);
  518. }
  519. }
  520. if (typeof global !== 'undefined') {
  521. global.getLocale = getLocale$1;
  522. }
  523. var interceptors = {
  524. promiseInterceptor: promiseInterceptor };
  525. var baseApi = /*#__PURE__*/Object.freeze({
  526. __proto__: null,
  527. upx2px: upx2px,
  528. getLocale: getLocale$1,
  529. setLocale: setLocale$1,
  530. onLocaleChange: onLocaleChange,
  531. addInterceptor: addInterceptor,
  532. removeInterceptor: removeInterceptor,
  533. interceptors: interceptors });
  534. function findExistsPageIndex(url) {
  535. var pages = getCurrentPages();
  536. var len = pages.length;
  537. while (len--) {
  538. var page = pages[len];
  539. if (page.$page && page.$page.fullPath === url) {
  540. return len;
  541. }
  542. }
  543. return -1;
  544. }
  545. var redirectTo = {
  546. name: function name(fromArgs) {
  547. if (fromArgs.exists === 'back' && fromArgs.delta) {
  548. return 'navigateBack';
  549. }
  550. return 'redirectTo';
  551. },
  552. args: function args(fromArgs) {
  553. if (fromArgs.exists === 'back' && fromArgs.url) {
  554. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  555. if (existsPageIndex !== -1) {
  556. var delta = getCurrentPages().length - 1 - existsPageIndex;
  557. if (delta > 0) {
  558. fromArgs.delta = delta;
  559. }
  560. }
  561. }
  562. } };
  563. var previewImage = {
  564. args: function args(fromArgs) {
  565. var currentIndex = parseInt(fromArgs.current);
  566. if (isNaN(currentIndex)) {
  567. return;
  568. }
  569. var urls = fromArgs.urls;
  570. if (!Array.isArray(urls)) {
  571. return;
  572. }
  573. var len = urls.length;
  574. if (!len) {
  575. return;
  576. }
  577. if (currentIndex < 0) {
  578. currentIndex = 0;
  579. } else if (currentIndex >= len) {
  580. currentIndex = len - 1;
  581. }
  582. if (currentIndex > 0) {
  583. fromArgs.current = urls[currentIndex];
  584. fromArgs.urls = urls.filter(
  585. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  586. } else {
  587. fromArgs.current = urls[0];
  588. }
  589. return {
  590. indicator: false,
  591. loop: false };
  592. } };
  593. var UUID_KEY = '__DC_STAT_UUID';
  594. var deviceId;
  595. function useDeviceId(result) {
  596. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  597. if (!deviceId) {
  598. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  599. wx.setStorage({
  600. key: UUID_KEY,
  601. data: deviceId });
  602. }
  603. result.deviceId = deviceId;
  604. }
  605. function addSafeAreaInsets(result) {
  606. if (result.safeArea) {
  607. var safeArea = result.safeArea;
  608. result.safeAreaInsets = {
  609. top: safeArea.top,
  610. left: safeArea.left,
  611. right: result.windowWidth - safeArea.right,
  612. bottom: result.screenHeight - safeArea.bottom };
  613. }
  614. }
  615. function populateParameters(result) {var _result$brand =
  616. result.brand,brand = _result$brand === void 0 ? '' : _result$brand,_result$model = result.model,model = _result$model === void 0 ? '' : _result$model,_result$system = result.system,system = _result$system === void 0 ? '' : _result$system,_result$language = result.language,language = _result$language === void 0 ? '' : _result$language,theme = result.theme,version = result.version,platform = result.platform,fontSizeSetting = result.fontSizeSetting,SDKVersion = result.SDKVersion,pixelRatio = result.pixelRatio,deviceOrientation = result.deviceOrientation;
  617. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  618. // osName osVersion
  619. var osName = '';
  620. var osVersion = '';
  621. {
  622. osName = system.split(' ')[0] || '';
  623. osVersion = system.split(' ')[1] || '';
  624. }
  625. var hostVersion = version;
  626. // deviceType
  627. var deviceType = getGetDeviceType(result, model);
  628. // deviceModel
  629. var deviceBrand = getDeviceBrand(brand);
  630. // hostName
  631. var _hostName = getHostName(result);
  632. // deviceOrientation
  633. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  634. // devicePixelRatio
  635. var _devicePixelRatio = pixelRatio;
  636. // SDKVersion
  637. var _SDKVersion = SDKVersion;
  638. // hostLanguage
  639. var hostLanguage = language.replace(/_/g, '-');
  640. // wx.getAccountInfoSync
  641. var parameters = {
  642. appId: "__UNI__1C40FB4",
  643. appName: "房票科技",
  644. appVersion: "1.0.0",
  645. appVersionCode: "100",
  646. appLanguage: getAppLanguage(hostLanguage),
  647. uniCompileVersion: "3.4.18",
  648. uniRuntimeVersion: "3.4.18",
  649. uniPlatform: undefined || "mp-weixin",
  650. deviceBrand: deviceBrand,
  651. deviceModel: model,
  652. deviceType: deviceType,
  653. devicePixelRatio: _devicePixelRatio,
  654. deviceOrientation: _deviceOrientation,
  655. osName: osName.toLocaleLowerCase(),
  656. osVersion: osVersion,
  657. hostTheme: theme,
  658. hostVersion: hostVersion,
  659. hostLanguage: hostLanguage,
  660. hostName: _hostName,
  661. hostSDKVersion: _SDKVersion,
  662. hostFontSizeSetting: fontSizeSetting,
  663. windowTop: 0,
  664. windowBottom: 0,
  665. // TODO
  666. osLanguage: undefined,
  667. osTheme: undefined,
  668. ua: undefined,
  669. hostPackageName: undefined,
  670. browserName: undefined,
  671. browserVersion: undefined };
  672. Object.assign(result, parameters);
  673. }
  674. function getGetDeviceType(result, model) {
  675. var deviceType = result.deviceType || 'phone';
  676. {
  677. var deviceTypeMaps = {
  678. ipad: 'pad',
  679. windows: 'pc',
  680. mac: 'pc' };
  681. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  682. var _model = model.toLocaleLowerCase();
  683. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  684. var _m = deviceTypeMapsKeys[index];
  685. if (_model.indexOf(_m) !== -1) {
  686. deviceType = deviceTypeMaps[_m];
  687. break;
  688. }
  689. }
  690. }
  691. return deviceType;
  692. }
  693. function getDeviceBrand(brand) {
  694. var deviceBrand = brand;
  695. if (deviceBrand) {
  696. deviceBrand = brand.toLocaleLowerCase();
  697. }
  698. return deviceBrand;
  699. }
  700. function getAppLanguage(defaultLanguage) {
  701. return getLocale$1 ?
  702. getLocale$1() :
  703. defaultLanguage;
  704. }
  705. function getHostName(result) {
  706. var _platform = 'WeChat';
  707. var _hostName = result.hostName || _platform; // mp-jd
  708. {
  709. if (result.environment) {
  710. _hostName = result.environment;
  711. } else if (result.host && result.host.env) {
  712. _hostName = result.host.env;
  713. }
  714. }
  715. return _hostName;
  716. }
  717. var getSystemInfo = {
  718. returnValue: function returnValue(result) {
  719. useDeviceId(result);
  720. addSafeAreaInsets(result);
  721. populateParameters(result);
  722. } };
  723. var showActionSheet = {
  724. args: function args(fromArgs) {
  725. if (typeof fromArgs === 'object') {
  726. fromArgs.alertText = fromArgs.title;
  727. }
  728. } };
  729. var getAppBaseInfo = {
  730. returnValue: function returnValue(result) {var _result =
  731. result,version = _result.version,language = _result.language,SDKVersion = _result.SDKVersion,theme = _result.theme;
  732. var _hostName = getHostName(result);
  733. var hostLanguage = language.replace('_', '-');
  734. result = sortObject(Object.assign(result, {
  735. appId: "__UNI__1C40FB4",
  736. appName: "房票科技",
  737. appVersion: "1.0.0",
  738. appVersionCode: "100",
  739. appLanguage: getAppLanguage(hostLanguage),
  740. hostVersion: version,
  741. hostLanguage: hostLanguage,
  742. hostName: _hostName,
  743. hostSDKVersion: SDKVersion,
  744. hostTheme: theme }));
  745. } };
  746. var getDeviceInfo = {
  747. returnValue: function returnValue(result) {var _result2 =
  748. result,brand = _result2.brand,model = _result2.model;
  749. var deviceType = getGetDeviceType(result, model);
  750. var deviceBrand = getDeviceBrand(brand);
  751. useDeviceId(result);
  752. result = sortObject(Object.assign(result, {
  753. deviceType: deviceType,
  754. deviceBrand: deviceBrand,
  755. deviceModel: model }));
  756. } };
  757. var getWindowInfo = {
  758. returnValue: function returnValue(result) {
  759. addSafeAreaInsets(result);
  760. result = sortObject(Object.assign(result, {
  761. windowTop: 0,
  762. windowBottom: 0 }));
  763. } };
  764. // import navigateTo from 'uni-helpers/navigate-to'
  765. var protocols = {
  766. redirectTo: redirectTo,
  767. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  768. previewImage: previewImage,
  769. getSystemInfo: getSystemInfo,
  770. getSystemInfoSync: getSystemInfo,
  771. showActionSheet: showActionSheet,
  772. getAppBaseInfo: getAppBaseInfo,
  773. getDeviceInfo: getDeviceInfo,
  774. getWindowInfo: getWindowInfo };
  775. var todos = [
  776. 'vibrate',
  777. 'preloadPage',
  778. 'unPreloadPage',
  779. 'loadSubPackage'];
  780. var canIUses = [];
  781. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  782. function processCallback(methodName, method, returnValue) {
  783. return function (res) {
  784. return method(processReturnValue(methodName, res, returnValue));
  785. };
  786. }
  787. function processArgs(methodName, fromArgs) {var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  788. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  789. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  790. if (isFn(argsOption)) {
  791. argsOption = argsOption(fromArgs, toArgs) || {};
  792. }
  793. for (var key in fromArgs) {
  794. if (hasOwn(argsOption, key)) {
  795. var keyOption = argsOption[key];
  796. if (isFn(keyOption)) {
  797. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  798. }
  799. if (!keyOption) {// 不支持的参数
  800. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  801. } else if (isStr(keyOption)) {// 重写参数 key
  802. toArgs[keyOption] = fromArgs[key];
  803. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  804. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  805. }
  806. } else if (CALLBACKS.indexOf(key) !== -1) {
  807. if (isFn(fromArgs[key])) {
  808. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  809. }
  810. } else {
  811. if (!keepFromArgs) {
  812. toArgs[key] = fromArgs[key];
  813. }
  814. }
  815. }
  816. return toArgs;
  817. } else if (isFn(fromArgs)) {
  818. fromArgs = processCallback(methodName, fromArgs, returnValue);
  819. }
  820. return fromArgs;
  821. }
  822. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  823. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  824. res = protocols.returnValue(methodName, res);
  825. }
  826. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  827. }
  828. function wrapper(methodName, method) {
  829. if (hasOwn(protocols, methodName)) {
  830. var protocol = protocols[methodName];
  831. if (!protocol) {// 暂不支持的 api
  832. return function () {
  833. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  834. };
  835. }
  836. return function (arg1, arg2) {// 目前 api 最多两个参数
  837. var options = protocol;
  838. if (isFn(protocol)) {
  839. options = protocol(arg1);
  840. }
  841. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  842. var args = [arg1];
  843. if (typeof arg2 !== 'undefined') {
  844. args.push(arg2);
  845. }
  846. if (isFn(options.name)) {
  847. methodName = options.name(arg1);
  848. } else if (isStr(options.name)) {
  849. methodName = options.name;
  850. }
  851. var returnValue = wx[methodName].apply(wx, args);
  852. if (isSyncApi(methodName)) {// 同步 api
  853. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  854. }
  855. return returnValue;
  856. };
  857. }
  858. return method;
  859. }
  860. var todoApis = Object.create(null);
  861. var TODOS = [
  862. 'onTabBarMidButtonTap',
  863. 'subscribePush',
  864. 'unsubscribePush',
  865. 'onPush',
  866. 'offPush',
  867. 'share'];
  868. function createTodoApi(name) {
  869. return function todoApi(_ref)
  870. {var fail = _ref.fail,complete = _ref.complete;
  871. var res = {
  872. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  873. isFn(fail) && fail(res);
  874. isFn(complete) && complete(res);
  875. };
  876. }
  877. TODOS.forEach(function (name) {
  878. todoApis[name] = createTodoApi(name);
  879. });
  880. var providers = {
  881. oauth: ['weixin'],
  882. share: ['weixin'],
  883. payment: ['wxpay'],
  884. push: ['weixin'] };
  885. function getProvider(_ref2)
  886. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  887. var res = false;
  888. if (providers[service]) {
  889. res = {
  890. errMsg: 'getProvider:ok',
  891. service: service,
  892. provider: providers[service] };
  893. isFn(success) && success(res);
  894. } else {
  895. res = {
  896. errMsg: 'getProvider:fail service not found' };
  897. isFn(fail) && fail(res);
  898. }
  899. isFn(complete) && complete(res);
  900. }
  901. var extraApi = /*#__PURE__*/Object.freeze({
  902. __proto__: null,
  903. getProvider: getProvider });
  904. var getEmitter = function () {
  905. var Emitter;
  906. return function getUniEmitter() {
  907. if (!Emitter) {
  908. Emitter = new _vue.default();
  909. }
  910. return Emitter;
  911. };
  912. }();
  913. function apply(ctx, method, args) {
  914. return ctx[method].apply(ctx, args);
  915. }
  916. function $on() {
  917. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  918. }
  919. function $off() {
  920. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  921. }
  922. function $once() {
  923. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  924. }
  925. function $emit() {
  926. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  927. }
  928. var eventApi = /*#__PURE__*/Object.freeze({
  929. __proto__: null,
  930. $on: $on,
  931. $off: $off,
  932. $once: $once,
  933. $emit: $emit });
  934. /**
  935. * 框架内 try-catch
  936. */
  937. /**
  938. * 开发者 try-catch
  939. */
  940. function tryCatch(fn) {
  941. return function () {
  942. try {
  943. return fn.apply(fn, arguments);
  944. } catch (e) {
  945. // TODO
  946. console.error(e);
  947. }
  948. };
  949. }
  950. function getApiCallbacks(params) {
  951. var apiCallbacks = {};
  952. for (var name in params) {
  953. var param = params[name];
  954. if (isFn(param)) {
  955. apiCallbacks[name] = tryCatch(param);
  956. delete params[name];
  957. }
  958. }
  959. return apiCallbacks;
  960. }
  961. var cid;
  962. var cidErrMsg;
  963. function normalizePushMessage(message) {
  964. try {
  965. return JSON.parse(message);
  966. } catch (e) {}
  967. return message;
  968. }
  969. function invokePushCallback(
  970. args)
  971. {
  972. if (args.type === 'clientId') {
  973. cid = args.cid;
  974. cidErrMsg = args.errMsg;
  975. invokeGetPushCidCallbacks(cid, args.errMsg);
  976. } else if (args.type === 'pushMsg') {
  977. onPushMessageCallbacks.forEach(function (callback) {
  978. callback({
  979. type: 'receive',
  980. data: normalizePushMessage(args.message) });
  981. });
  982. } else if (args.type === 'click') {
  983. onPushMessageCallbacks.forEach(function (callback) {
  984. callback({
  985. type: 'click',
  986. data: normalizePushMessage(args.message) });
  987. });
  988. }
  989. }
  990. var getPushCidCallbacks = [];
  991. function invokeGetPushCidCallbacks(cid, errMsg) {
  992. getPushCidCallbacks.forEach(function (callback) {
  993. callback(cid, errMsg);
  994. });
  995. getPushCidCallbacks.length = 0;
  996. }
  997. function getPushClientid(args) {
  998. if (!isPlainObject(args)) {
  999. args = {};
  1000. }var _getApiCallbacks =
  1001. getApiCallbacks(args),success = _getApiCallbacks.success,fail = _getApiCallbacks.fail,complete = _getApiCallbacks.complete;
  1002. var hasSuccess = isFn(success);
  1003. var hasFail = isFn(fail);
  1004. var hasComplete = isFn(complete);
  1005. getPushCidCallbacks.push(function (cid, errMsg) {
  1006. var res;
  1007. if (cid) {
  1008. res = {
  1009. errMsg: 'getPushClientid:ok',
  1010. cid: cid };
  1011. hasSuccess && success(res);
  1012. } else {
  1013. res = {
  1014. errMsg: 'getPushClientid:fail' + (errMsg ? ' ' + errMsg : '') };
  1015. hasFail && fail(res);
  1016. }
  1017. hasComplete && complete(res);
  1018. });
  1019. if (typeof cid !== 'undefined') {
  1020. Promise.resolve().then(function () {return invokeGetPushCidCallbacks(cid, cidErrMsg);});
  1021. }
  1022. }
  1023. var onPushMessageCallbacks = [];
  1024. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1025. var onPushMessage = function onPushMessage(fn) {
  1026. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1027. onPushMessageCallbacks.push(fn);
  1028. }
  1029. };
  1030. var offPushMessage = function offPushMessage(fn) {
  1031. if (!fn) {
  1032. onPushMessageCallbacks.length = 0;
  1033. } else {
  1034. var index = onPushMessageCallbacks.indexOf(fn);
  1035. if (index > -1) {
  1036. onPushMessageCallbacks.splice(index, 1);
  1037. }
  1038. }
  1039. };
  1040. var api = /*#__PURE__*/Object.freeze({
  1041. __proto__: null,
  1042. getPushClientid: getPushClientid,
  1043. onPushMessage: onPushMessage,
  1044. offPushMessage: offPushMessage,
  1045. invokePushCallback: invokePushCallback });
  1046. var MPPage = Page;
  1047. var MPComponent = Component;
  1048. var customizeRE = /:/g;
  1049. var customize = cached(function (str) {
  1050. return camelize(str.replace(customizeRE, '-'));
  1051. });
  1052. function initTriggerEvent(mpInstance) {
  1053. var oldTriggerEvent = mpInstance.triggerEvent;
  1054. var newTriggerEvent = function newTriggerEvent(event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  1055. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  1056. };
  1057. try {
  1058. // 京东小程序 triggerEvent 为只读
  1059. mpInstance.triggerEvent = newTriggerEvent;
  1060. } catch (error) {
  1061. mpInstance._triggerEvent = newTriggerEvent;
  1062. }
  1063. }
  1064. function initHook(name, options, isComponent) {
  1065. var oldHook = options[name];
  1066. if (!oldHook) {
  1067. options[name] = function () {
  1068. initTriggerEvent(this);
  1069. };
  1070. } else {
  1071. options[name] = function () {
  1072. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  1073. return oldHook.apply(this, args);
  1074. };
  1075. }
  1076. }
  1077. if (!MPPage.__$wrappered) {
  1078. MPPage.__$wrappered = true;
  1079. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1080. initHook('onLoad', options);
  1081. return MPPage(options);
  1082. };
  1083. Page.after = MPPage.after;
  1084. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1085. initHook('created', options);
  1086. return MPComponent(options);
  1087. };
  1088. }
  1089. var PAGE_EVENT_HOOKS = [
  1090. 'onPullDownRefresh',
  1091. 'onReachBottom',
  1092. 'onAddToFavorites',
  1093. 'onShareTimeline',
  1094. 'onShareAppMessage',
  1095. 'onPageScroll',
  1096. 'onResize',
  1097. 'onTabItemTap'];
  1098. function initMocks(vm, mocks) {
  1099. var mpInstance = vm.$mp[vm.mpType];
  1100. mocks.forEach(function (mock) {
  1101. if (hasOwn(mpInstance, mock)) {
  1102. vm[mock] = mpInstance[mock];
  1103. }
  1104. });
  1105. }
  1106. function hasHook(hook, vueOptions) {
  1107. if (!vueOptions) {
  1108. return true;
  1109. }
  1110. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  1111. return true;
  1112. }
  1113. vueOptions = vueOptions.default || vueOptions;
  1114. if (isFn(vueOptions)) {
  1115. if (isFn(vueOptions.extendOptions[hook])) {
  1116. return true;
  1117. }
  1118. if (vueOptions.super &&
  1119. vueOptions.super.options &&
  1120. Array.isArray(vueOptions.super.options[hook])) {
  1121. return true;
  1122. }
  1123. return false;
  1124. }
  1125. if (isFn(vueOptions[hook])) {
  1126. return true;
  1127. }
  1128. var mixins = vueOptions.mixins;
  1129. if (Array.isArray(mixins)) {
  1130. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  1131. }
  1132. }
  1133. function initHooks(mpOptions, hooks, vueOptions) {
  1134. hooks.forEach(function (hook) {
  1135. if (hasHook(hook, vueOptions)) {
  1136. mpOptions[hook] = function (args) {
  1137. return this.$vm && this.$vm.__call_hook(hook, args);
  1138. };
  1139. }
  1140. });
  1141. }
  1142. function initVueComponent(Vue, vueOptions) {
  1143. vueOptions = vueOptions.default || vueOptions;
  1144. var VueComponent;
  1145. if (isFn(vueOptions)) {
  1146. VueComponent = vueOptions;
  1147. } else {
  1148. VueComponent = Vue.extend(vueOptions);
  1149. }
  1150. vueOptions = VueComponent.options;
  1151. return [VueComponent, vueOptions];
  1152. }
  1153. function initSlots(vm, vueSlots) {
  1154. if (Array.isArray(vueSlots) && vueSlots.length) {
  1155. var $slots = Object.create(null);
  1156. vueSlots.forEach(function (slotName) {
  1157. $slots[slotName] = true;
  1158. });
  1159. vm.$scopedSlots = vm.$slots = $slots;
  1160. }
  1161. }
  1162. function initVueIds(vueIds, mpInstance) {
  1163. vueIds = (vueIds || '').split(',');
  1164. var len = vueIds.length;
  1165. if (len === 1) {
  1166. mpInstance._$vueId = vueIds[0];
  1167. } else if (len === 2) {
  1168. mpInstance._$vueId = vueIds[0];
  1169. mpInstance._$vuePid = vueIds[1];
  1170. }
  1171. }
  1172. function initData(vueOptions, context) {
  1173. var data = vueOptions.data || {};
  1174. var methods = vueOptions.methods || {};
  1175. if (typeof data === 'function') {
  1176. try {
  1177. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  1178. } catch (e) {
  1179. if (Object({"VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  1180. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  1181. }
  1182. }
  1183. } else {
  1184. try {
  1185. // 对 data 格式化
  1186. data = JSON.parse(JSON.stringify(data));
  1187. } catch (e) {}
  1188. }
  1189. if (!isPlainObject(data)) {
  1190. data = {};
  1191. }
  1192. Object.keys(methods).forEach(function (methodName) {
  1193. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  1194. data[methodName] = methods[methodName];
  1195. }
  1196. });
  1197. return data;
  1198. }
  1199. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  1200. function createObserver(name) {
  1201. return function observer(newVal, oldVal) {
  1202. if (this.$vm) {
  1203. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  1204. }
  1205. };
  1206. }
  1207. function initBehaviors(vueOptions, initBehavior) {
  1208. var vueBehaviors = vueOptions.behaviors;
  1209. var vueExtends = vueOptions.extends;
  1210. var vueMixins = vueOptions.mixins;
  1211. var vueProps = vueOptions.props;
  1212. if (!vueProps) {
  1213. vueOptions.props = vueProps = [];
  1214. }
  1215. var behaviors = [];
  1216. if (Array.isArray(vueBehaviors)) {
  1217. vueBehaviors.forEach(function (behavior) {
  1218. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  1219. if (behavior === 'uni://form-field') {
  1220. if (Array.isArray(vueProps)) {
  1221. vueProps.push('name');
  1222. vueProps.push('value');
  1223. } else {
  1224. vueProps.name = {
  1225. type: String,
  1226. default: '' };
  1227. vueProps.value = {
  1228. type: [String, Number, Boolean, Array, Object, Date],
  1229. default: '' };
  1230. }
  1231. }
  1232. });
  1233. }
  1234. if (isPlainObject(vueExtends) && vueExtends.props) {
  1235. behaviors.push(
  1236. initBehavior({
  1237. properties: initProperties(vueExtends.props, true) }));
  1238. }
  1239. if (Array.isArray(vueMixins)) {
  1240. vueMixins.forEach(function (vueMixin) {
  1241. if (isPlainObject(vueMixin) && vueMixin.props) {
  1242. behaviors.push(
  1243. initBehavior({
  1244. properties: initProperties(vueMixin.props, true) }));
  1245. }
  1246. });
  1247. }
  1248. return behaviors;
  1249. }
  1250. function parsePropType(key, type, defaultValue, file) {
  1251. // [String]=>String
  1252. if (Array.isArray(type) && type.length === 1) {
  1253. return type[0];
  1254. }
  1255. return type;
  1256. }
  1257. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  1258. var properties = {};
  1259. if (!isBehavior) {
  1260. properties.vueId = {
  1261. type: String,
  1262. value: '' };
  1263. // 用于字节跳动小程序模拟抽象节点
  1264. properties.generic = {
  1265. type: Object,
  1266. value: null };
  1267. // scopedSlotsCompiler auto
  1268. properties.scopedSlotsCompiler = {
  1269. type: String,
  1270. value: '' };
  1271. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  1272. type: null,
  1273. value: [],
  1274. observer: function observer(newVal, oldVal) {
  1275. var $slots = Object.create(null);
  1276. newVal.forEach(function (slotName) {
  1277. $slots[slotName] = true;
  1278. });
  1279. this.setData({
  1280. $slots: $slots });
  1281. } };
  1282. }
  1283. if (Array.isArray(props)) {// ['title']
  1284. props.forEach(function (key) {
  1285. properties[key] = {
  1286. type: null,
  1287. observer: createObserver(key) };
  1288. });
  1289. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  1290. Object.keys(props).forEach(function (key) {
  1291. var opts = props[key];
  1292. if (isPlainObject(opts)) {// title:{type:String,default:''}
  1293. var value = opts.default;
  1294. if (isFn(value)) {
  1295. value = value();
  1296. }
  1297. opts.type = parsePropType(key, opts.type);
  1298. properties[key] = {
  1299. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  1300. value: value,
  1301. observer: createObserver(key) };
  1302. } else {// content:String
  1303. var type = parsePropType(key, opts);
  1304. properties[key] = {
  1305. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  1306. observer: createObserver(key) };
  1307. }
  1308. });
  1309. }
  1310. return properties;
  1311. }
  1312. function wrapper$1(event) {
  1313. // TODO 又得兼容 mpvue 的 mp 对象
  1314. try {
  1315. event.mp = JSON.parse(JSON.stringify(event));
  1316. } catch (e) {}
  1317. event.stopPropagation = noop;
  1318. event.preventDefault = noop;
  1319. event.target = event.target || {};
  1320. if (!hasOwn(event, 'detail')) {
  1321. event.detail = {};
  1322. }
  1323. if (hasOwn(event, 'markerId')) {
  1324. event.detail = typeof event.detail === 'object' ? event.detail : {};
  1325. event.detail.markerId = event.markerId;
  1326. }
  1327. if (isPlainObject(event.detail)) {
  1328. event.target = Object.assign({}, event.target, event.detail);
  1329. }
  1330. return event;
  1331. }
  1332. function getExtraValue(vm, dataPathsArray) {
  1333. var context = vm;
  1334. dataPathsArray.forEach(function (dataPathArray) {
  1335. var dataPath = dataPathArray[0];
  1336. var value = dataPathArray[2];
  1337. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  1338. var propPath = dataPathArray[1];
  1339. var valuePath = dataPathArray[3];
  1340. var vFor;
  1341. if (Number.isInteger(dataPath)) {
  1342. vFor = dataPath;
  1343. } else if (!dataPath) {
  1344. vFor = context;
  1345. } else if (typeof dataPath === 'string' && dataPath) {
  1346. if (dataPath.indexOf('#s#') === 0) {
  1347. vFor = dataPath.substr(3);
  1348. } else {
  1349. vFor = vm.__get_value(dataPath, context);
  1350. }
  1351. }
  1352. if (Number.isInteger(vFor)) {
  1353. context = value;
  1354. } else if (!propPath) {
  1355. context = vFor[value];
  1356. } else {
  1357. if (Array.isArray(vFor)) {
  1358. context = vFor.find(function (vForItem) {
  1359. return vm.__get_value(propPath, vForItem) === value;
  1360. });
  1361. } else if (isPlainObject(vFor)) {
  1362. context = Object.keys(vFor).find(function (vForKey) {
  1363. return vm.__get_value(propPath, vFor[vForKey]) === value;
  1364. });
  1365. } else {
  1366. console.error('v-for 暂不支持循环数据:', vFor);
  1367. }
  1368. }
  1369. if (valuePath) {
  1370. context = vm.__get_value(valuePath, context);
  1371. }
  1372. }
  1373. });
  1374. return context;
  1375. }
  1376. function processEventExtra(vm, extra, event) {
  1377. var extraObj = {};
  1378. if (Array.isArray(extra) && extra.length) {
  1379. /**
  1380. *[
  1381. * ['data.items', 'data.id', item.data.id],
  1382. * ['metas', 'id', meta.id]
  1383. *],
  1384. *[
  1385. * ['data.items', 'data.id', item.data.id],
  1386. * ['metas', 'id', meta.id]
  1387. *],
  1388. *'test'
  1389. */
  1390. extra.forEach(function (dataPath, index) {
  1391. if (typeof dataPath === 'string') {
  1392. if (!dataPath) {// model,prop.sync
  1393. extraObj['$' + index] = vm;
  1394. } else {
  1395. if (dataPath === '$event') {// $event
  1396. extraObj['$' + index] = event;
  1397. } else if (dataPath === 'arguments') {
  1398. if (event.detail && event.detail.__args__) {
  1399. extraObj['$' + index] = event.detail.__args__;
  1400. } else {
  1401. extraObj['$' + index] = [event];
  1402. }
  1403. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1404. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1405. } else {
  1406. extraObj['$' + index] = vm.__get_value(dataPath);
  1407. }
  1408. }
  1409. } else {
  1410. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1411. }
  1412. });
  1413. }
  1414. return extraObj;
  1415. }
  1416. function getObjByArray(arr) {
  1417. var obj = {};
  1418. for (var i = 1; i < arr.length; i++) {
  1419. var element = arr[i];
  1420. obj[element[0]] = element[1];
  1421. }
  1422. return obj;
  1423. }
  1424. function processEventArgs(vm, event) {var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];var isCustom = arguments.length > 4 ? arguments[4] : undefined;var methodName = arguments.length > 5 ? arguments[5] : undefined;
  1425. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1426. if (isCustom) {// 自定义事件
  1427. isCustomMPEvent = event.currentTarget &&
  1428. event.currentTarget.dataset &&
  1429. event.currentTarget.dataset.comType === 'wx';
  1430. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1431. if (isCustomMPEvent) {
  1432. return [event];
  1433. }
  1434. return event.detail.__args__ || event.detail;
  1435. }
  1436. }
  1437. var extraObj = processEventExtra(vm, extra, event);
  1438. var ret = [];
  1439. args.forEach(function (arg) {
  1440. if (arg === '$event') {
  1441. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1442. ret.push(event.target.value);
  1443. } else {
  1444. if (isCustom && !isCustomMPEvent) {
  1445. ret.push(event.detail.__args__[0]);
  1446. } else {// wxcomponent 组件或内置组件
  1447. ret.push(event);
  1448. }
  1449. }
  1450. } else {
  1451. if (Array.isArray(arg) && arg[0] === 'o') {
  1452. ret.push(getObjByArray(arg));
  1453. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1454. ret.push(extraObj[arg]);
  1455. } else {
  1456. ret.push(arg);
  1457. }
  1458. }
  1459. });
  1460. return ret;
  1461. }
  1462. var ONCE = '~';
  1463. var CUSTOM = '^';
  1464. function isMatchEventType(eventType, optType) {
  1465. return eventType === optType ||
  1466. optType === 'regionchange' && (
  1467. eventType === 'begin' ||
  1468. eventType === 'end');
  1469. }
  1470. function getContextVm(vm) {
  1471. var $parent = vm.$parent;
  1472. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1473. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1474. $parent = $parent.$parent;
  1475. }
  1476. return $parent && $parent.$parent;
  1477. }
  1478. function handleEvent(event) {var _this2 = this;
  1479. event = wrapper$1(event);
  1480. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1481. var dataset = (event.currentTarget || event.target).dataset;
  1482. if (!dataset) {
  1483. return console.warn('事件信息不存在');
  1484. }
  1485. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1486. if (!eventOpts) {
  1487. return console.warn('事件信息不存在');
  1488. }
  1489. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1490. var eventType = event.type;
  1491. var ret = [];
  1492. eventOpts.forEach(function (eventOpt) {
  1493. var type = eventOpt[0];
  1494. var eventsArray = eventOpt[1];
  1495. var isCustom = type.charAt(0) === CUSTOM;
  1496. type = isCustom ? type.slice(1) : type;
  1497. var isOnce = type.charAt(0) === ONCE;
  1498. type = isOnce ? type.slice(1) : type;
  1499. if (eventsArray && isMatchEventType(eventType, type)) {
  1500. eventsArray.forEach(function (eventArray) {
  1501. var methodName = eventArray[0];
  1502. if (methodName) {
  1503. var handlerCtx = _this2.$vm;
  1504. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1505. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1506. }
  1507. if (methodName === '$emit') {
  1508. handlerCtx.$emit.apply(handlerCtx,
  1509. processEventArgs(
  1510. _this2.$vm,
  1511. event,
  1512. eventArray[1],
  1513. eventArray[2],
  1514. isCustom,
  1515. methodName));
  1516. return;
  1517. }
  1518. var handler = handlerCtx[methodName];
  1519. if (!isFn(handler)) {
  1520. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1521. }
  1522. if (isOnce) {
  1523. if (handler.once) {
  1524. return;
  1525. }
  1526. handler.once = true;
  1527. }
  1528. var params = processEventArgs(
  1529. _this2.$vm,
  1530. event,
  1531. eventArray[1],
  1532. eventArray[2],
  1533. isCustom,
  1534. methodName);
  1535. params = Array.isArray(params) ? params : [];
  1536. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1537. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1538. // eslint-disable-next-line no-sparse-arrays
  1539. params = params.concat([,,,,,,,,,, event]);
  1540. }
  1541. ret.push(handler.apply(handlerCtx, params));
  1542. }
  1543. });
  1544. }
  1545. });
  1546. if (
  1547. eventType === 'input' &&
  1548. ret.length === 1 &&
  1549. typeof ret[0] !== 'undefined')
  1550. {
  1551. return ret[0];
  1552. }
  1553. }
  1554. var eventChannels = {};
  1555. var eventChannelStack = [];
  1556. function getEventChannel(id) {
  1557. if (id) {
  1558. var eventChannel = eventChannels[id];
  1559. delete eventChannels[id];
  1560. return eventChannel;
  1561. }
  1562. return eventChannelStack.shift();
  1563. }
  1564. var hooks = [
  1565. 'onShow',
  1566. 'onHide',
  1567. 'onError',
  1568. 'onPageNotFound',
  1569. 'onThemeChange',
  1570. 'onUnhandledRejection'];
  1571. function initEventChannel() {
  1572. _vue.default.prototype.getOpenerEventChannel = function () {
  1573. // 微信小程序使用自身getOpenerEventChannel
  1574. {
  1575. return this.$scope.getOpenerEventChannel();
  1576. }
  1577. };
  1578. var callHook = _vue.default.prototype.__call_hook;
  1579. _vue.default.prototype.__call_hook = function (hook, args) {
  1580. if (hook === 'onLoad' && args && args.__id__) {
  1581. this.__eventChannel__ = getEventChannel(args.__id__);
  1582. delete args.__id__;
  1583. }
  1584. return callHook.call(this, hook, args);
  1585. };
  1586. }
  1587. function initScopedSlotsParams() {
  1588. var center = {};
  1589. var parents = {};
  1590. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1591. var has = center[vueId];
  1592. if (!has) {
  1593. parents[vueId] = this;
  1594. this.$on('hook:destroyed', function () {
  1595. delete parents[vueId];
  1596. });
  1597. }
  1598. return has;
  1599. };
  1600. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1601. var data = center[vueId];
  1602. if (data) {
  1603. var object = data[name] || {};
  1604. return key ? object[key] : object;
  1605. } else {
  1606. parents[vueId] = this;
  1607. this.$on('hook:destroyed', function () {
  1608. delete parents[vueId];
  1609. });
  1610. }
  1611. };
  1612. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1613. var vueIds = this.$options.propsData.vueId;
  1614. if (vueIds) {
  1615. var vueId = vueIds.split(',')[0];
  1616. var object = center[vueId] = center[vueId] || {};
  1617. object[name] = value;
  1618. if (parents[vueId]) {
  1619. parents[vueId].$forceUpdate();
  1620. }
  1621. }
  1622. };
  1623. _vue.default.mixin({
  1624. destroyed: function destroyed() {
  1625. var propsData = this.$options.propsData;
  1626. var vueId = propsData && propsData.vueId;
  1627. if (vueId) {
  1628. delete center[vueId];
  1629. delete parents[vueId];
  1630. }
  1631. } });
  1632. }
  1633. function parseBaseApp(vm, _ref3)
  1634. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1635. initEventChannel();
  1636. {
  1637. initScopedSlotsParams();
  1638. }
  1639. if (vm.$options.store) {
  1640. _vue.default.prototype.$store = vm.$options.store;
  1641. }
  1642. uniIdMixin(_vue.default);
  1643. _vue.default.prototype.mpHost = "mp-weixin";
  1644. _vue.default.mixin({
  1645. beforeCreate: function beforeCreate() {
  1646. if (!this.$options.mpType) {
  1647. return;
  1648. }
  1649. this.mpType = this.$options.mpType;
  1650. this.$mp = _defineProperty({
  1651. data: {} },
  1652. this.mpType, this.$options.mpInstance);
  1653. this.$scope = this.$options.mpInstance;
  1654. delete this.$options.mpType;
  1655. delete this.$options.mpInstance;
  1656. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1657. var app = getApp();
  1658. if (app.$vm && app.$vm.$i18n) {
  1659. this._i18n = app.$vm.$i18n;
  1660. }
  1661. }
  1662. if (this.mpType !== 'app') {
  1663. initRefs(this);
  1664. initMocks(this, mocks);
  1665. }
  1666. } });
  1667. var appOptions = {
  1668. onLaunch: function onLaunch(args) {
  1669. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1670. return;
  1671. }
  1672. {
  1673. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1674. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1675. }
  1676. }
  1677. this.$vm = vm;
  1678. this.$vm.$mp = {
  1679. app: this };
  1680. this.$vm.$scope = this;
  1681. // vm 上也挂载 globalData
  1682. this.$vm.globalData = this.globalData;
  1683. this.$vm._isMounted = true;
  1684. this.$vm.__call_hook('mounted', args);
  1685. this.$vm.__call_hook('onLaunch', args);
  1686. } };
  1687. // 兼容旧版本 globalData
  1688. appOptions.globalData = vm.$options.globalData || {};
  1689. // 将 methods 中的方法挂在 getApp() 中
  1690. var methods = vm.$options.methods;
  1691. if (methods) {
  1692. Object.keys(methods).forEach(function (name) {
  1693. appOptions[name] = methods[name];
  1694. });
  1695. }
  1696. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  1697. initHooks(appOptions, hooks);
  1698. return appOptions;
  1699. }
  1700. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1701. function findVmByVueId(vm, vuePid) {
  1702. var $children = vm.$children;
  1703. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1704. for (var i = $children.length - 1; i >= 0; i--) {
  1705. var childVm = $children[i];
  1706. if (childVm.$scope._$vueId === vuePid) {
  1707. return childVm;
  1708. }
  1709. }
  1710. // 反向递归查找
  1711. var parentVm;
  1712. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1713. parentVm = findVmByVueId($children[_i], vuePid);
  1714. if (parentVm) {
  1715. return parentVm;
  1716. }
  1717. }
  1718. }
  1719. function initBehavior(options) {
  1720. return Behavior(options);
  1721. }
  1722. function isPage() {
  1723. return !!this.route;
  1724. }
  1725. function initRelation(detail) {
  1726. this.triggerEvent('__l', detail);
  1727. }
  1728. function selectAllComponents(mpInstance, selector, $refs) {
  1729. var components = mpInstance.selectAllComponents(selector);
  1730. components.forEach(function (component) {
  1731. var ref = component.dataset.ref;
  1732. $refs[ref] = component.$vm || component;
  1733. {
  1734. if (component.dataset.vueGeneric === 'scoped') {
  1735. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1736. selectAllComponents(scopedComponent, selector, $refs);
  1737. });
  1738. }
  1739. }
  1740. });
  1741. }
  1742. function initRefs(vm) {
  1743. var mpInstance = vm.$scope;
  1744. Object.defineProperty(vm, '$refs', {
  1745. get: function get() {
  1746. var $refs = {};
  1747. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1748. // TODO 暂不考虑 for 中的 scoped
  1749. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1750. forComponents.forEach(function (component) {
  1751. var ref = component.dataset.ref;
  1752. if (!$refs[ref]) {
  1753. $refs[ref] = [];
  1754. }
  1755. $refs[ref].push(component.$vm || component);
  1756. });
  1757. return $refs;
  1758. } });
  1759. }
  1760. function handleLink(event) {var _ref4 =
  1761. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1762. var parentVm;
  1763. if (vuePid) {
  1764. parentVm = findVmByVueId(this.$vm, vuePid);
  1765. }
  1766. if (!parentVm) {
  1767. parentVm = this.$vm;
  1768. }
  1769. vueOptions.parent = parentVm;
  1770. }
  1771. function parseApp(vm) {
  1772. return parseBaseApp(vm, {
  1773. mocks: mocks,
  1774. initRefs: initRefs });
  1775. }
  1776. function createApp(vm) {
  1777. App(parseApp(vm));
  1778. return vm;
  1779. }
  1780. var encodeReserveRE = /[!'()*]/g;
  1781. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1782. var commaRE = /%2C/g;
  1783. // fixed encodeURIComponent which is more conformant to RFC3986:
  1784. // - escapes [!'()*]
  1785. // - preserve commas
  1786. var encode = function encode(str) {return encodeURIComponent(str).
  1787. replace(encodeReserveRE, encodeReserveReplacer).
  1788. replace(commaRE, ',');};
  1789. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1790. var res = obj ? Object.keys(obj).map(function (key) {
  1791. var val = obj[key];
  1792. if (val === undefined) {
  1793. return '';
  1794. }
  1795. if (val === null) {
  1796. return encodeStr(key);
  1797. }
  1798. if (Array.isArray(val)) {
  1799. var result = [];
  1800. val.forEach(function (val2) {
  1801. if (val2 === undefined) {
  1802. return;
  1803. }
  1804. if (val2 === null) {
  1805. result.push(encodeStr(key));
  1806. } else {
  1807. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1808. }
  1809. });
  1810. return result.join('&');
  1811. }
  1812. return encodeStr(key) + '=' + encodeStr(val);
  1813. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1814. return res ? "?".concat(res) : '';
  1815. }
  1816. function parseBaseComponent(vueComponentOptions)
  1817. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1818. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1819. var options = _objectSpread({
  1820. multipleSlots: true,
  1821. addGlobalClass: true },
  1822. vueOptions.options || {});
  1823. {
  1824. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1825. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1826. Object.assign(options, vueOptions['mp-weixin'].options);
  1827. }
  1828. }
  1829. var componentOptions = {
  1830. options: options,
  1831. data: initData(vueOptions, _vue.default.prototype),
  1832. behaviors: initBehaviors(vueOptions, initBehavior),
  1833. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1834. lifetimes: {
  1835. attached: function attached() {
  1836. var properties = this.properties;
  1837. var options = {
  1838. mpType: isPage.call(this) ? 'page' : 'component',
  1839. mpInstance: this,
  1840. propsData: properties };
  1841. initVueIds(properties.vueId, this);
  1842. // 处理父子关系
  1843. initRelation.call(this, {
  1844. vuePid: this._$vuePid,
  1845. vueOptions: options });
  1846. // 初始化 vue 实例
  1847. this.$vm = new VueComponent(options);
  1848. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1849. initSlots(this.$vm, properties.vueSlots);
  1850. // 触发首次 setData
  1851. this.$vm.$mount();
  1852. },
  1853. ready: function ready() {
  1854. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1855. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1856. if (this.$vm) {
  1857. this.$vm._isMounted = true;
  1858. this.$vm.__call_hook('mounted');
  1859. this.$vm.__call_hook('onReady');
  1860. }
  1861. },
  1862. detached: function detached() {
  1863. this.$vm && this.$vm.$destroy();
  1864. } },
  1865. pageLifetimes: {
  1866. show: function show(args) {
  1867. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1868. },
  1869. hide: function hide() {
  1870. this.$vm && this.$vm.__call_hook('onPageHide');
  1871. },
  1872. resize: function resize(size) {
  1873. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1874. } },
  1875. methods: {
  1876. __l: handleLink,
  1877. __e: handleEvent } };
  1878. // externalClasses
  1879. if (vueOptions.externalClasses) {
  1880. componentOptions.externalClasses = vueOptions.externalClasses;
  1881. }
  1882. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1883. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1884. componentOptions.methods[callMethod] = function (args) {
  1885. return this.$vm[callMethod](args);
  1886. };
  1887. });
  1888. }
  1889. if (isPage) {
  1890. return componentOptions;
  1891. }
  1892. return [componentOptions, VueComponent];
  1893. }
  1894. function parseComponent(vueComponentOptions) {
  1895. return parseBaseComponent(vueComponentOptions, {
  1896. isPage: isPage,
  1897. initRelation: initRelation });
  1898. }
  1899. var hooks$1 = [
  1900. 'onShow',
  1901. 'onHide',
  1902. 'onUnload'];
  1903. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1904. function parseBasePage(vuePageOptions, _ref6)
  1905. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1906. var pageOptions = parseComponent(vuePageOptions);
  1907. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1908. pageOptions.methods.onLoad = function (query) {
  1909. this.options = query;
  1910. var copyQuery = Object.assign({}, query);
  1911. delete copyQuery.__id__;
  1912. this.$page = {
  1913. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1914. this.$vm.$mp.query = query; // 兼容 mpvue
  1915. this.$vm.__call_hook('onLoad', query);
  1916. };
  1917. return pageOptions;
  1918. }
  1919. function parsePage(vuePageOptions) {
  1920. return parseBasePage(vuePageOptions, {
  1921. isPage: isPage,
  1922. initRelation: initRelation });
  1923. }
  1924. function createPage(vuePageOptions) {
  1925. {
  1926. return Component(parsePage(vuePageOptions));
  1927. }
  1928. }
  1929. function createComponent(vueOptions) {
  1930. {
  1931. return Component(parseComponent(vueOptions));
  1932. }
  1933. }
  1934. function createSubpackageApp(vm) {
  1935. var appOptions = parseApp(vm);
  1936. var app = getApp({
  1937. allowDefault: true });
  1938. vm.$scope = app;
  1939. var globalData = app.globalData;
  1940. if (globalData) {
  1941. Object.keys(appOptions.globalData).forEach(function (name) {
  1942. if (!hasOwn(globalData, name)) {
  1943. globalData[name] = appOptions.globalData[name];
  1944. }
  1945. });
  1946. }
  1947. Object.keys(appOptions).forEach(function (name) {
  1948. if (!hasOwn(app, name)) {
  1949. app[name] = appOptions[name];
  1950. }
  1951. });
  1952. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1953. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1954. vm.__call_hook('onShow', args);
  1955. });
  1956. }
  1957. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1958. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1959. vm.__call_hook('onHide', args);
  1960. });
  1961. }
  1962. if (isFn(appOptions.onLaunch)) {
  1963. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1964. vm.__call_hook('onLaunch', args);
  1965. }
  1966. return vm;
  1967. }
  1968. function createPlugin(vm) {
  1969. var appOptions = parseApp(vm);
  1970. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1971. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  1972. vm.__call_hook('onShow', args);
  1973. });
  1974. }
  1975. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1976. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  1977. vm.__call_hook('onHide', args);
  1978. });
  1979. }
  1980. if (isFn(appOptions.onLaunch)) {
  1981. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1982. vm.__call_hook('onLaunch', args);
  1983. }
  1984. return vm;
  1985. }
  1986. todos.forEach(function (todoApi) {
  1987. protocols[todoApi] = false;
  1988. });
  1989. canIUses.forEach(function (canIUseApi) {
  1990. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1991. canIUseApi;
  1992. if (!wx.canIUse(apiName)) {
  1993. protocols[canIUseApi] = false;
  1994. }
  1995. });
  1996. var uni = {};
  1997. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1998. uni = new Proxy({}, {
  1999. get: function get(target, name) {
  2000. if (hasOwn(target, name)) {
  2001. return target[name];
  2002. }
  2003. if (baseApi[name]) {
  2004. return baseApi[name];
  2005. }
  2006. if (api[name]) {
  2007. return promisify(name, api[name]);
  2008. }
  2009. {
  2010. if (extraApi[name]) {
  2011. return promisify(name, extraApi[name]);
  2012. }
  2013. if (todoApis[name]) {
  2014. return promisify(name, todoApis[name]);
  2015. }
  2016. }
  2017. if (eventApi[name]) {
  2018. return eventApi[name];
  2019. }
  2020. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  2021. return;
  2022. }
  2023. return promisify(name, wrapper(name, wx[name]));
  2024. },
  2025. set: function set(target, name, value) {
  2026. target[name] = value;
  2027. return true;
  2028. } });
  2029. } else {
  2030. Object.keys(baseApi).forEach(function (name) {
  2031. uni[name] = baseApi[name];
  2032. });
  2033. {
  2034. Object.keys(todoApis).forEach(function (name) {
  2035. uni[name] = promisify(name, todoApis[name]);
  2036. });
  2037. Object.keys(extraApi).forEach(function (name) {
  2038. uni[name] = promisify(name, todoApis[name]);
  2039. });
  2040. }
  2041. Object.keys(eventApi).forEach(function (name) {
  2042. uni[name] = eventApi[name];
  2043. });
  2044. Object.keys(api).forEach(function (name) {
  2045. uni[name] = promisify(name, api[name]);
  2046. });
  2047. Object.keys(wx).forEach(function (name) {
  2048. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2049. uni[name] = promisify(name, wrapper(name, wx[name]));
  2050. }
  2051. });
  2052. }
  2053. wx.createApp = createApp;
  2054. wx.createPage = createPage;
  2055. wx.createComponent = createComponent;
  2056. wx.createSubpackageApp = createSubpackageApp;
  2057. wx.createPlugin = createPlugin;
  2058. var uni$1 = uni;var _default =
  2059. uni$1;exports.default = _default;
  2060. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  2061. /***/ }),
  2062. /***/ 11:
  2063. /*!**********************************************************************************************************!*\
  2064. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  2065. \**********************************************************************************************************/
  2066. /*! exports provided: default */
  2067. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2068. "use strict";
  2069. __webpack_require__.r(__webpack_exports__);
  2070. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  2071. /* globals __VUE_SSR_CONTEXT__ */
  2072. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  2073. // This module is a runtime utility for cleaner component module output and will
  2074. // be included in the final webpack user bundle.
  2075. function normalizeComponent (
  2076. scriptExports,
  2077. render,
  2078. staticRenderFns,
  2079. functionalTemplate,
  2080. injectStyles,
  2081. scopeId,
  2082. moduleIdentifier, /* server only */
  2083. shadowMode, /* vue-cli only */
  2084. components, // fixed by xxxxxx auto components
  2085. renderjs // fixed by xxxxxx renderjs
  2086. ) {
  2087. // Vue.extend constructor export interop
  2088. var options = typeof scriptExports === 'function'
  2089. ? scriptExports.options
  2090. : scriptExports
  2091. // fixed by xxxxxx auto components
  2092. if (components) {
  2093. if (!options.components) {
  2094. options.components = {}
  2095. }
  2096. var hasOwn = Object.prototype.hasOwnProperty
  2097. for (var name in components) {
  2098. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  2099. options.components[name] = components[name]
  2100. }
  2101. }
  2102. }
  2103. // fixed by xxxxxx renderjs
  2104. if (renderjs) {
  2105. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  2106. this[renderjs.__module] = this
  2107. });
  2108. (options.mixins || (options.mixins = [])).push(renderjs)
  2109. }
  2110. // render functions
  2111. if (render) {
  2112. options.render = render
  2113. options.staticRenderFns = staticRenderFns
  2114. options._compiled = true
  2115. }
  2116. // functional template
  2117. if (functionalTemplate) {
  2118. options.functional = true
  2119. }
  2120. // scopedId
  2121. if (scopeId) {
  2122. options._scopeId = 'data-v-' + scopeId
  2123. }
  2124. var hook
  2125. if (moduleIdentifier) { // server build
  2126. hook = function (context) {
  2127. // 2.3 injection
  2128. context =
  2129. context || // cached call
  2130. (this.$vnode && this.$vnode.ssrContext) || // stateful
  2131. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  2132. // 2.2 with runInNewContext: true
  2133. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  2134. context = __VUE_SSR_CONTEXT__
  2135. }
  2136. // inject component styles
  2137. if (injectStyles) {
  2138. injectStyles.call(this, context)
  2139. }
  2140. // register component module identifier for async chunk inferrence
  2141. if (context && context._registeredComponents) {
  2142. context._registeredComponents.add(moduleIdentifier)
  2143. }
  2144. }
  2145. // used by ssr in case component is cached and beforeCreate
  2146. // never gets called
  2147. options._ssrRegister = hook
  2148. } else if (injectStyles) {
  2149. hook = shadowMode
  2150. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  2151. : injectStyles
  2152. }
  2153. if (hook) {
  2154. if (options.functional) {
  2155. // for template-only hot-reload because in that case the render fn doesn't
  2156. // go through the normalizer
  2157. options._injectStyles = hook
  2158. // register for functioal component in vue file
  2159. var originalRender = options.render
  2160. options.render = function renderWithStyleInjection (h, context) {
  2161. hook.call(context)
  2162. return originalRender(h, context)
  2163. }
  2164. } else {
  2165. // inject component registration as beforeCreate hook
  2166. var existing = options.beforeCreate
  2167. options.beforeCreate = existing
  2168. ? [].concat(existing, hook)
  2169. : [hook]
  2170. }
  2171. }
  2172. return {
  2173. exports: scriptExports,
  2174. options: options
  2175. }
  2176. }
  2177. /***/ }),
  2178. /***/ 12:
  2179. /*!*******************************************************!*\
  2180. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/index.js ***!
  2181. \*******************************************************/
  2182. /*! no static exports found */
  2183. /***/ (function(module, exports, __webpack_require__) {
  2184. "use strict";
  2185. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  2186. var _mixin = _interopRequireDefault(__webpack_require__(/*! ./libs/mixin/mixin.js */ 13));
  2187. var _request = _interopRequireDefault(__webpack_require__(/*! ./libs/request */ 14));
  2188. var _queryParams = _interopRequireDefault(__webpack_require__(/*! ./libs/function/queryParams.js */ 18));
  2189. var _route = _interopRequireDefault(__webpack_require__(/*! ./libs/function/route.js */ 19));
  2190. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFormat.js */ 23));
  2191. var _timeFrom = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFrom.js */ 24));
  2192. var _colorGradient = _interopRequireDefault(__webpack_require__(/*! ./libs/function/colorGradient.js */ 25));
  2193. var _guid = _interopRequireDefault(__webpack_require__(/*! ./libs/function/guid.js */ 26));
  2194. var _color = _interopRequireDefault(__webpack_require__(/*! ./libs/function/color.js */ 27));
  2195. var _type2icon = _interopRequireDefault(__webpack_require__(/*! ./libs/function/type2icon.js */ 28));
  2196. var _randomArray = _interopRequireDefault(__webpack_require__(/*! ./libs/function/randomArray.js */ 29));
  2197. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepClone.js */ 16));
  2198. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepMerge.js */ 15));
  2199. var _addUnit = _interopRequireDefault(__webpack_require__(/*! ./libs/function/addUnit.js */ 30));
  2200. var _test = _interopRequireDefault(__webpack_require__(/*! ./libs/function/test.js */ 17));
  2201. var _random = _interopRequireDefault(__webpack_require__(/*! ./libs/function/random.js */ 31));
  2202. var _trim = _interopRequireDefault(__webpack_require__(/*! ./libs/function/trim.js */ 32));
  2203. var _toast = _interopRequireDefault(__webpack_require__(/*! ./libs/function/toast.js */ 33));
  2204. var _getParent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/getParent.js */ 34));
  2205. var _$parent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/$parent.js */ 35));
  2206. var _sys = __webpack_require__(/*! ./libs/function/sys.js */ 36);
  2207. var _debounce = _interopRequireDefault(__webpack_require__(/*! ./libs/function/debounce.js */ 37));
  2208. var _throttle = _interopRequireDefault(__webpack_require__(/*! ./libs/function/throttle.js */ 38));
  2209. var _config = _interopRequireDefault(__webpack_require__(/*! ./libs/config/config.js */ 39));
  2210. var _zIndex = _interopRequireDefault(__webpack_require__(/*! ./libs/config/zIndex.js */ 40));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // 引入全局mixin
  2211. // 引入关于是否mixin集成小程序分享的配置
  2212. // import wxshare from './libs/mixin/mpShare.js'
  2213. // 全局挂载引入http相关请求拦截插件
  2214. function wranning(str) {// 开发环境进行信息输出,主要是一些报错信息
  2215. // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
  2216. // 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
  2217. if (true) {console.warn(str);}} // 尝试判断在根目录的/store中是否有$u.mixin.js,此文件uView默认为需要挂在到全局的vuex的state变量
  2218. // HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式,
  2219. // let vuexStore = {};
  2220. // try {
  2221. // vuexStore = require("@/store/$u.mixin.js");
  2222. // } catch (e) {
  2223. // //TODO handle the exception
  2224. // }
  2225. // post类型对象参数转为get类型url参数
  2226. var $u = { queryParams: _queryParams.default, route: _route.default, timeFormat: _timeFormat.default, date: _timeFormat.default, // 另名date
  2227. timeFrom: _timeFrom.default, colorGradient: _colorGradient.default.colorGradient, colorToRgba: _colorGradient.default.colorToRgba, guid: _guid.default, color: _color.default, sys: _sys.sys, os: _sys.os, type2icon: _type2icon.default, randomArray: _randomArray.default, wranning: wranning, get: _request.default.get,
  2228. post: _request.default.post,
  2229. put: _request.default.put,
  2230. 'delete': _request.default.delete,
  2231. hexToRgb: _colorGradient.default.hexToRgb,
  2232. rgbToHex: _colorGradient.default.rgbToHex,
  2233. test: _test.default,
  2234. random: _random.default,
  2235. deepClone: _deepClone.default,
  2236. deepMerge: _deepMerge.default,
  2237. getParent: _getParent.default,
  2238. $parent: _$parent.default,
  2239. addUnit: _addUnit.default,
  2240. trim: _trim.default,
  2241. type: ['primary', 'success', 'error', 'warning', 'info'],
  2242. http: _request.default,
  2243. toast: _toast.default,
  2244. config: _config.default, // uView配置信息相关,比如版本号
  2245. zIndex: _zIndex.default,
  2246. debounce: _debounce.default,
  2247. throttle: _throttle.default };
  2248. // $u挂载到uni对象上
  2249. uni.$u = $u;
  2250. var install = function install(Vue) {
  2251. Vue.mixin(_mixin.default);
  2252. if (Vue.prototype.openShare) {
  2253. Vue.mixin(mpShare);
  2254. }
  2255. // Vue.mixin(vuexStore);
  2256. // 时间格式化,同时两个名称,date和timeFormat
  2257. Vue.filter('timeFormat', function (timestamp, format) {
  2258. return (0, _timeFormat.default)(timestamp, format);
  2259. });
  2260. Vue.filter('date', function (timestamp, format) {
  2261. return (0, _timeFormat.default)(timestamp, format);
  2262. });
  2263. // 将多久以前的方法,注入到全局过滤器
  2264. Vue.filter('timeFrom', function (timestamp, format) {
  2265. return (0, _timeFrom.default)(timestamp, format);
  2266. });
  2267. Vue.prototype.$u = $u;
  2268. };var _default =
  2269. {
  2270. install: install };exports.default = _default;
  2271. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2272. /***/ }),
  2273. /***/ 13:
  2274. /*!******************************************************************!*\
  2275. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/mixin/mixin.js ***!
  2276. \******************************************************************/
  2277. /*! no static exports found */
  2278. /***/ (function(module, exports, __webpack_require__) {
  2279. "use strict";
  2280. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  2281. data: function data() {
  2282. return {};
  2283. },
  2284. onLoad: function onLoad() {
  2285. // getRect挂载到$u上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出
  2286. this.$u.getRect = this.$uGetRect;
  2287. },
  2288. methods: {
  2289. // 查询节点信息
  2290. // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
  2291. // 解决办法为在组件根部再套一个没有任何作用的view元素
  2292. $uGetRect: function $uGetRect(selector, all) {var _this = this;
  2293. return new Promise(function (resolve) {
  2294. uni.createSelectorQuery().
  2295. in(_this)[all ? 'selectAll' : 'select'](selector).
  2296. boundingClientRect(function (rect) {
  2297. if (all && Array.isArray(rect) && rect.length) {
  2298. resolve(rect);
  2299. }
  2300. if (!all && rect) {
  2301. resolve(rect);
  2302. }
  2303. }).
  2304. exec();
  2305. });
  2306. },
  2307. getParentData: function getParentData() {var _this2 = this;var parentName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  2308. // 避免在created中去定义parent变量
  2309. if (!this.parent) this.parent = false;
  2310. // 这里的本质原理是,通过获取父组件实例(也即u-radio-group的this)
  2311. // 将父组件this中对应的参数,赋值给本组件(u-radio的this)的parentData对象中对应的属性
  2312. // 之所以需要这么做,是因为所有端中,头条小程序不支持通过this.parent.xxx去监听父组件参数的变化
  2313. this.parent = this.$u.$parent.call(this, parentName);
  2314. if (this.parent) {
  2315. // 历遍parentData中的属性,将parent中的同名属性赋值给parentData
  2316. Object.keys(this.parentData).map(function (key) {
  2317. _this2.parentData[key] = _this2.parent[key];
  2318. });
  2319. }
  2320. },
  2321. // 阻止事件冒泡
  2322. preventEvent: function preventEvent(e) {
  2323. e && e.stopPropagation && e.stopPropagation();
  2324. } },
  2325. onReachBottom: function onReachBottom() {
  2326. uni.$emit('uOnReachBottom');
  2327. },
  2328. beforeDestroy: function beforeDestroy() {var _this3 = this;
  2329. // 判断当前页面是否存在parent和chldren,一般在checkbox和checkbox-group父子联动的场景会有此情况
  2330. // 组件销毁时,移除子组件在父组件children数组中的实例,释放资源,避免数据混乱
  2331. if (this.parent && uni.$u.test.array(this.parent.children)) {
  2332. // 组件销毁时,移除父组件中的children数组中对应的实例
  2333. var childrenList = this.parent.children;
  2334. childrenList.map(function (child, index) {
  2335. // 如果相等,则移除
  2336. if (child === _this3) {
  2337. childrenList.splice(index, 1);
  2338. }
  2339. });
  2340. }
  2341. } };exports.default = _default;
  2342. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2343. /***/ }),
  2344. /***/ 14:
  2345. /*!********************************************************************!*\
  2346. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/request/index.js ***!
  2347. \********************************************************************/
  2348. /*! no static exports found */
  2349. /***/ (function(module, exports, __webpack_require__) {
  2350. "use strict";
  2351. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ../function/deepMerge */ 15));
  2352. var _test = _interopRequireDefault(__webpack_require__(/*! ../function/test */ 17));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var
  2353. Request = /*#__PURE__*/function () {_createClass(Request, [{ key: "setConfig",
  2354. // 设置全局默认配置
  2355. value: function setConfig(customConfig) {
  2356. // 深度合并对象,否则会造成对象深层属性丢失
  2357. this.config = (0, _deepMerge.default)(this.config, customConfig);
  2358. }
  2359. // 主要请求部分
  2360. }, { key: "request", value: function request() {var _this = this;var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2361. // 检查请求拦截
  2362. if (this.interceptor.request && typeof this.interceptor.request === 'function') {
  2363. var tmpConfig = {};
  2364. var interceptorRequest = this.interceptor.request(options);
  2365. if (interceptorRequest === false) {
  2366. // 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调
  2367. return new Promise(function () {});
  2368. }
  2369. this.options = interceptorRequest;
  2370. }
  2371. options.dataType = options.dataType || this.config.dataType;
  2372. options.responseType = options.responseType || this.config.responseType;
  2373. options.url = options.url || '';
  2374. options.params = options.params || {};
  2375. options.header = Object.assign({}, this.config.header, options.header);
  2376. options.method = options.method || this.config.method;
  2377. return new Promise(function (resolve, reject) {
  2378. options.complete = function (response) {
  2379. // 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)
  2380. uni.hideLoading();
  2381. // 清除定时器,如果请求回来了,就无需loading
  2382. clearTimeout(_this.config.timer);
  2383. _this.config.timer = null;
  2384. // 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
  2385. if (_this.config.originalData) {
  2386. // 判断是否存在拦截器
  2387. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  2388. var resInterceptors = _this.interceptor.response(response);
  2389. // 如果拦截器不返回false,就将拦截器返回的内容给this.$u.post的then回调
  2390. if (resInterceptors !== false) {
  2391. resolve(resInterceptors);
  2392. } else {
  2393. // 如果拦截器返回false,意味着拦截器定义者认为返回有问题,直接接入catch回调
  2394. reject(response);
  2395. }
  2396. } else {
  2397. // 如果要求返回原始数据,就算没有拦截器,也返回最原始的数据
  2398. resolve(response);
  2399. }
  2400. } else {
  2401. if (response.statusCode == 200) {
  2402. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  2403. var _resInterceptors = _this.interceptor.response(response.data);
  2404. if (_resInterceptors !== false) {
  2405. resolve(_resInterceptors);
  2406. } else {
  2407. reject(response.data);
  2408. }
  2409. } else {
  2410. // 如果不是返回原始数据(originalData=false),且没有拦截器的情况下,返回纯数据给then回调
  2411. resolve(response.data);
  2412. }
  2413. } else {
  2414. // 不返回原始数据的情况下,服务器状态码不为200,modal弹框提示
  2415. // if(response.errMsg) {
  2416. // uni.showModal({
  2417. // title: response.errMsg
  2418. // });
  2419. // }
  2420. reject(response);
  2421. }
  2422. }
  2423. };
  2424. // 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
  2425. options.url = _test.default.url(options.url) ? options.url : _this.config.baseUrl + (options.url.indexOf('/') == 0 ?
  2426. options.url : '/' + options.url);
  2427. // 是否显示loading
  2428. // 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id
  2429. // 而没有清除前者的定时器,导致前者超时,一直显示loading
  2430. if (_this.config.showLoading && !_this.config.timer) {
  2431. _this.config.timer = setTimeout(function () {
  2432. uni.showLoading({
  2433. title: _this.config.loadingText,
  2434. mask: _this.config.loadingMask });
  2435. _this.config.timer = null;
  2436. }, _this.config.loadingTime);
  2437. }
  2438. uni.request(options);
  2439. });
  2440. // .catch(res => {
  2441. // // 如果返回reject(),不让其进入this.$u.post().then().catch()后面的catct()
  2442. // // 因为很多人都会忘了写后面的catch(),导致报错捕获不到catch
  2443. // return new Promise(()=>{});
  2444. // })
  2445. } }]);
  2446. function Request() {var _this2 = this;_classCallCheck(this, Request);
  2447. this.config = {
  2448. baseUrl: '', // 请求的根域名
  2449. // 默认的请求头
  2450. header: {},
  2451. method: 'POST',
  2452. // 设置为json,返回后uni.request会对数据进行一次JSON.parse
  2453. dataType: 'json',
  2454. // 此参数无需处理,因为5+和支付宝小程序不支持,默认为text即可
  2455. responseType: 'text',
  2456. showLoading: true, // 是否显示请求中的loading
  2457. loadingText: '请求中...',
  2458. loadingTime: 800, // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
  2459. timer: null, // 定时器
  2460. originalData: false, // 是否在拦截器中返回服务端的原始数据,见文档说明
  2461. loadingMask: true // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
  2462. };
  2463. // 拦截器
  2464. this.interceptor = {
  2465. // 请求前的拦截
  2466. request: null,
  2467. // 请求后的拦截
  2468. response: null };
  2469. // get请求
  2470. this.get = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2471. return _this2.request({
  2472. method: 'GET',
  2473. url: url,
  2474. header: header,
  2475. data: data });
  2476. };
  2477. // post请求
  2478. this.post = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2479. return _this2.request({
  2480. url: url,
  2481. method: 'POST',
  2482. header: header,
  2483. data: data });
  2484. };
  2485. // put请求,不支持支付宝小程序(HX2.6.15)
  2486. this.put = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2487. return _this2.request({
  2488. url: url,
  2489. method: 'PUT',
  2490. header: header,
  2491. data: data });
  2492. };
  2493. // delete请求,不支持支付宝和头条小程序(HX2.6.15)
  2494. this.delete = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2495. return _this2.request({
  2496. url: url,
  2497. method: 'DELETE',
  2498. header: header,
  2499. data: data });
  2500. };
  2501. }return Request;}();var _default =
  2502. new Request();exports.default = _default;
  2503. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2504. /***/ }),
  2505. /***/ 15:
  2506. /*!*************************************************************************!*\
  2507. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/deepMerge.js ***!
  2508. \*************************************************************************/
  2509. /*! no static exports found */
  2510. /***/ (function(module, exports, __webpack_require__) {
  2511. "use strict";
  2512. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./deepClone */ 16));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  2513. // JS对象深度合并
  2514. function deepMerge() {var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  2515. target = (0, _deepClone.default)(target);
  2516. if (typeof target !== 'object' || typeof source !== 'object') return false;
  2517. for (var prop in source) {
  2518. if (!source.hasOwnProperty(prop)) continue;
  2519. if (prop in target) {
  2520. if (typeof target[prop] !== 'object') {
  2521. target[prop] = source[prop];
  2522. } else {
  2523. if (typeof source[prop] !== 'object') {
  2524. target[prop] = source[prop];
  2525. } else {
  2526. if (target[prop].concat && source[prop].concat) {
  2527. target[prop] = target[prop].concat(source[prop]);
  2528. } else {
  2529. target[prop] = deepMerge(target[prop], source[prop]);
  2530. }
  2531. }
  2532. }
  2533. } else {
  2534. target[prop] = source[prop];
  2535. }
  2536. }
  2537. return target;
  2538. }var _default =
  2539. deepMerge;exports.default = _default;
  2540. /***/ }),
  2541. /***/ 16:
  2542. /*!*************************************************************************!*\
  2543. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/deepClone.js ***!
  2544. \*************************************************************************/
  2545. /*! no static exports found */
  2546. /***/ (function(module, exports, __webpack_require__) {
  2547. "use strict";
  2548. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 判断arr是否为一个数组,返回一个bool值
  2549. function isArray(arr) {
  2550. return Object.prototype.toString.call(arr) === '[object Array]';
  2551. }
  2552. // 深度克隆
  2553. function deepClone(obj) {
  2554. // 对常见的“非”值,直接返回原来值
  2555. if ([null, undefined, NaN, false].includes(obj)) return obj;
  2556. if (typeof obj !== "object" && typeof obj !== 'function') {
  2557. //原始类型直接返回
  2558. return obj;
  2559. }
  2560. var o = isArray(obj) ? [] : {};
  2561. for (var i in obj) {
  2562. if (obj.hasOwnProperty(i)) {
  2563. o[i] = typeof obj[i] === "object" ? deepClone(obj[i]) : obj[i];
  2564. }
  2565. }
  2566. return o;
  2567. }var _default =
  2568. deepClone;exports.default = _default;
  2569. /***/ }),
  2570. /***/ 17:
  2571. /*!********************************************************************!*\
  2572. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/test.js ***!
  2573. \********************************************************************/
  2574. /*! no static exports found */
  2575. /***/ (function(module, exports, __webpack_require__) {
  2576. "use strict";
  2577. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  2578. * 验证电子邮箱格式
  2579. */
  2580. function email(value) {
  2581. return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
  2582. }
  2583. /**
  2584. * 验证手机格式
  2585. */
  2586. function mobile(value) {
  2587. return /^1[23456789]\d{9}$/.test(value);
  2588. }
  2589. /**
  2590. * 验证URL格式
  2591. */
  2592. function url(value) {
  2593. return /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/.test(value);
  2594. }
  2595. /**
  2596. * 验证日期格式
  2597. */
  2598. function date(value) {
  2599. return !/Invalid|NaN/.test(new Date(value).toString());
  2600. }
  2601. /**
  2602. * 验证ISO类型的日期格式
  2603. */
  2604. function dateISO(value) {
  2605. return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
  2606. }
  2607. /**
  2608. * 验证十进制数字
  2609. */
  2610. function number(value) {
  2611. return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
  2612. }
  2613. /**
  2614. * 验证整数
  2615. */
  2616. function digits(value) {
  2617. return /^\d+$/.test(value);
  2618. }
  2619. /**
  2620. * 验证身份证号码
  2621. */
  2622. function idCard(value) {
  2623. 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(
  2624. value);
  2625. }
  2626. /**
  2627. * 是否车牌号
  2628. */
  2629. function carNo(value) {
  2630. // 新能源车牌
  2631. var xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
  2632. // 旧车牌
  2633. var creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
  2634. if (value.length === 7) {
  2635. return creg.test(value);
  2636. } else if (value.length === 8) {
  2637. return xreg.test(value);
  2638. } else {
  2639. return false;
  2640. }
  2641. }
  2642. /**
  2643. * 金额,只允许2位小数
  2644. */
  2645. function amount(value) {
  2646. //金额,只允许保留两位小数
  2647. return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
  2648. }
  2649. /**
  2650. * 中文
  2651. */
  2652. function chinese(value) {
  2653. var reg = /^[\u4e00-\u9fa5]+$/gi;
  2654. return reg.test(value);
  2655. }
  2656. /**
  2657. * 只能输入字母
  2658. */
  2659. function letter(value) {
  2660. return /^[a-zA-Z]*$/.test(value);
  2661. }
  2662. /**
  2663. * 只能是字母或者数字
  2664. */
  2665. function enOrNum(value) {
  2666. //英文或者数字
  2667. var reg = /^[0-9a-zA-Z]*$/g;
  2668. return reg.test(value);
  2669. }
  2670. /**
  2671. * 验证是否包含某个值
  2672. */
  2673. function contains(value, param) {
  2674. return value.indexOf(param) >= 0;
  2675. }
  2676. /**
  2677. * 验证一个值范围[min, max]
  2678. */
  2679. function range(value, param) {
  2680. return value >= param[0] && value <= param[1];
  2681. }
  2682. /**
  2683. * 验证一个长度范围[min, max]
  2684. */
  2685. function rangeLength(value, param) {
  2686. return value.length >= param[0] && value.length <= param[1];
  2687. }
  2688. /**
  2689. * 是否固定电话
  2690. */
  2691. function landline(value) {
  2692. var reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
  2693. return reg.test(value);
  2694. }
  2695. /**
  2696. * 判断是否为空
  2697. */
  2698. function empty(value) {
  2699. switch (typeof value) {
  2700. case 'undefined':
  2701. return true;
  2702. case 'string':
  2703. if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
  2704. break;
  2705. case 'boolean':
  2706. if (!value) return true;
  2707. break;
  2708. case 'number':
  2709. if (0 === value || isNaN(value)) return true;
  2710. break;
  2711. case 'object':
  2712. if (null === value || value.length === 0) return true;
  2713. for (var i in value) {
  2714. return false;
  2715. }
  2716. return true;}
  2717. return false;
  2718. }
  2719. /**
  2720. * 是否json字符串
  2721. */
  2722. function jsonString(value) {
  2723. if (typeof value == 'string') {
  2724. try {
  2725. var obj = JSON.parse(value);
  2726. if (typeof obj == 'object' && obj) {
  2727. return true;
  2728. } else {
  2729. return false;
  2730. }
  2731. } catch (e) {
  2732. return false;
  2733. }
  2734. }
  2735. return false;
  2736. }
  2737. /**
  2738. * 是否数组
  2739. */
  2740. function array(value) {
  2741. if (typeof Array.isArray === "function") {
  2742. return Array.isArray(value);
  2743. } else {
  2744. return Object.prototype.toString.call(value) === "[object Array]";
  2745. }
  2746. }
  2747. /**
  2748. * 是否对象
  2749. */
  2750. function object(value) {
  2751. return Object.prototype.toString.call(value) === '[object Object]';
  2752. }
  2753. /**
  2754. * 是否短信验证码
  2755. */
  2756. function code(value) {var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
  2757. return new RegExp("^\\d{".concat(len, "}$")).test(value);
  2758. }var _default =
  2759. {
  2760. email: email,
  2761. mobile: mobile,
  2762. url: url,
  2763. date: date,
  2764. dateISO: dateISO,
  2765. number: number,
  2766. digits: digits,
  2767. idCard: idCard,
  2768. carNo: carNo,
  2769. amount: amount,
  2770. chinese: chinese,
  2771. letter: letter,
  2772. enOrNum: enOrNum,
  2773. contains: contains,
  2774. range: range,
  2775. rangeLength: rangeLength,
  2776. empty: empty,
  2777. isEmpty: empty,
  2778. jsonString: jsonString,
  2779. landline: landline,
  2780. object: object,
  2781. array: array,
  2782. code: code };exports.default = _default;
  2783. /***/ }),
  2784. /***/ 18:
  2785. /*!***************************************************************************!*\
  2786. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/queryParams.js ***!
  2787. \***************************************************************************/
  2788. /*! no static exports found */
  2789. /***/ (function(module, exports, __webpack_require__) {
  2790. "use strict";
  2791. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  2792. * 对象转url参数
  2793. * @param {*} data,对象
  2794. * @param {*} isPrefix,是否自动加上"?"
  2795. */
  2796. function queryParams() {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var isPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var arrayFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'brackets';
  2797. var prefix = isPrefix ? '?' : '';
  2798. var _result = [];
  2799. if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets';var _loop = function _loop(
  2800. key) {
  2801. var value = data[key];
  2802. // 去掉为空的参数
  2803. if (['', undefined, null].indexOf(value) >= 0) {
  2804. return "continue";
  2805. }
  2806. // 如果值为数组,另行处理
  2807. if (value.constructor === Array) {
  2808. // e.g. {ids: [1, 2, 3]}
  2809. switch (arrayFormat) {
  2810. case 'indices':
  2811. // 结果: ids[0]=1&ids[1]=2&ids[2]=3
  2812. for (var i = 0; i < value.length; i++) {
  2813. _result.push(key + '[' + i + ']=' + value[i]);
  2814. }
  2815. break;
  2816. case 'brackets':
  2817. // 结果: ids[]=1&ids[]=2&ids[]=3
  2818. value.forEach(function (_value) {
  2819. _result.push(key + '[]=' + _value);
  2820. });
  2821. break;
  2822. case 'repeat':
  2823. // 结果: ids=1&ids=2&ids=3
  2824. value.forEach(function (_value) {
  2825. _result.push(key + '=' + _value);
  2826. });
  2827. break;
  2828. case 'comma':
  2829. // 结果: ids=1,2,3
  2830. var commaStr = "";
  2831. value.forEach(function (_value) {
  2832. commaStr += (commaStr ? "," : "") + _value;
  2833. });
  2834. _result.push(key + '=' + commaStr);
  2835. break;
  2836. default:
  2837. value.forEach(function (_value) {
  2838. _result.push(key + '[]=' + _value);
  2839. });}
  2840. } else {
  2841. _result.push(key + '=' + value);
  2842. }};for (var key in data) {var _ret = _loop(key);if (_ret === "continue") continue;
  2843. }
  2844. return _result.length ? prefix + _result.join('&') : '';
  2845. }var _default =
  2846. queryParams;exports.default = _default;
  2847. /***/ }),
  2848. /***/ 19:
  2849. /*!*********************************************************************!*\
  2850. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/route.js ***!
  2851. \*********************************************************************/
  2852. /*! no static exports found */
  2853. /***/ (function(module, exports, __webpack_require__) {
  2854. "use strict";
  2855. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 20));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;} /**
  2856. * 路由跳转方法,该方法相对于直接使用uni.xxx的好处是使用更加简单快捷
  2857. * 并且带有路由拦截功能
  2858. */var
  2859. Router = /*#__PURE__*/function () {
  2860. function Router() {_classCallCheck(this, Router);
  2861. // 原始属性定义
  2862. this.config = {
  2863. type: 'navigateTo',
  2864. url: '',
  2865. delta: 1, // navigateBack页面后退时,回退的层数
  2866. params: {}, // 传递的参数
  2867. animationType: 'pop-in', // 窗口动画,只在APP有效
  2868. animationDuration: 300, // 窗口动画持续时间,单位毫秒,只在APP有效
  2869. intercept: false // 是否需要拦截
  2870. };
  2871. // 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
  2872. // 这里在构造函数中进行this绑定
  2873. this.route = this.route.bind(this);
  2874. }
  2875. // 判断url前面是否有"/",如果没有则加上,否则无法跳转
  2876. _createClass(Router, [{ key: "addRootPath", value: function addRootPath(url) {
  2877. return url[0] === '/' ? url : "/".concat(url);
  2878. }
  2879. // 整合路由参数
  2880. }, { key: "mixinParam", value: function mixinParam(url, params) {
  2881. url = url && this.addRootPath(url);
  2882. // 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
  2883. // 如果有url中有get参数,转换后无需带上"?"
  2884. var query = '';
  2885. if (/.*\/.*\?.*=.*/.test(url)) {
  2886. // object对象转为get类型的参数
  2887. query = uni.$u.queryParams(params, false);
  2888. // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
  2889. return url += "&" + query;
  2890. } else {
  2891. // 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
  2892. query = uni.$u.queryParams(params);
  2893. return url += query;
  2894. }
  2895. }
  2896. // 对外的方法名称
  2897. }, { key: "route", value: function () {var _route = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var options,params,mergeConfig,isNext,_args = arguments;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
  2898. // 合并用户的配置和内部的默认配置
  2899. mergeConfig = {};
  2900. if (typeof options === 'string') {
  2901. // 如果options为字符串,则为route(url, params)的形式
  2902. mergeConfig.url = this.mixinParam(options, params);
  2903. mergeConfig.type = 'navigateTo';
  2904. } else {
  2905. mergeConfig = uni.$u.deepClone(options, this.config);
  2906. // 否则正常使用mergeConfig中的url和params进行拼接
  2907. mergeConfig.url = this.mixinParam(options.url, options.params);
  2908. }
  2909. if (params.intercept) {
  2910. this.config.intercept = params.intercept;
  2911. }
  2912. // params参数也带给拦截器
  2913. mergeConfig.params = params;
  2914. // 合并内外部参数
  2915. mergeConfig = uni.$u.deepMerge(this.config, mergeConfig);
  2916. // 判断用户是否定义了拦截器
  2917. if (!(typeof uni.$u.routeIntercept === 'function')) {_context.next = 14;break;}_context.next = 10;return (
  2918. new Promise(function (resolve, reject) {
  2919. uni.$u.routeIntercept(mergeConfig, resolve);
  2920. }));case 10:isNext = _context.sent;
  2921. // 如果isNext为true,则执行路由跳转
  2922. isNext && this.openPage(mergeConfig);_context.next = 15;break;case 14:
  2923. this.openPage(mergeConfig);case 15:case "end":return _context.stop();}}}, _callee, this);}));function route() {return _route.apply(this, arguments);}return route;}()
  2924. // 执行路由跳转
  2925. }, { key: "openPage", value: function openPage(config) {
  2926. // 解构参数
  2927. var
  2928. url =
  2929. config.url,type = config.type,delta = config.delta,animationType = config.animationType,animationDuration = config.animationDuration;
  2930. if (config.type == 'navigateTo' || config.type == 'to') {
  2931. uni.navigateTo({
  2932. url: url,
  2933. animationType: animationType,
  2934. animationDuration: animationDuration });
  2935. }
  2936. if (config.type == 'redirectTo' || config.type == 'redirect') {
  2937. uni.redirectTo({
  2938. url: url });
  2939. }
  2940. if (config.type == 'switchTab' || config.type == 'tab') {
  2941. uni.switchTab({
  2942. url: url });
  2943. }
  2944. if (config.type == 'reLaunch' || config.type == 'launch') {
  2945. uni.reLaunch({
  2946. url: url });
  2947. }
  2948. if (config.type == 'navigateBack' || config.type == 'back') {
  2949. uni.navigateBack({
  2950. delta: delta });
  2951. }
  2952. } }]);return Router;}();var _default =
  2953. new Router().route;exports.default = _default;
  2954. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2955. /***/ }),
  2956. /***/ 2:
  2957. /*!***********************************!*\
  2958. !*** (webpack)/buildin/global.js ***!
  2959. \***********************************/
  2960. /*! no static exports found */
  2961. /***/ (function(module, exports) {
  2962. var g;
  2963. // This works in non-strict mode
  2964. g = (function() {
  2965. return this;
  2966. })();
  2967. try {
  2968. // This works if eval is allowed (see CSP)
  2969. g = g || new Function("return this")();
  2970. } catch (e) {
  2971. // This works if the window reference is available
  2972. if (typeof window === "object") g = window;
  2973. }
  2974. // g can still be undefined, but nothing to do about it...
  2975. // We return undefined, instead of nothing here, so it's
  2976. // easier to handle this case. if(!global) { ...}
  2977. module.exports = g;
  2978. /***/ }),
  2979. /***/ 20:
  2980. /*!**********************************************************!*\
  2981. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  2982. \**********************************************************/
  2983. /*! no static exports found */
  2984. /***/ (function(module, exports, __webpack_require__) {
  2985. module.exports = __webpack_require__(/*! regenerator-runtime */ 21);
  2986. /***/ }),
  2987. /***/ 205:
  2988. /*!**************************************************************************************!*\
  2989. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/MpHtmlParser.js ***!
  2990. \**************************************************************************************/
  2991. /*! no static exports found */
  2992. /***/ (function(module, exports, __webpack_require__) {
  2993. "use strict";
  2994. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  2995. var _config = _interopRequireDefault(__webpack_require__(/*! ./config.js */ 206));
  2996. var _CssHandler = _interopRequireDefault(__webpack_require__(/*! ./CssHandler.js */ 207));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} /**
  2997. * html 解析器
  2998. * @tutorial https://github.com/jin-yufeng/Parser
  2999. * @version 20201029
  3000. * @author JinYufeng
  3001. * @listens MIT
  3002. */var blankChar = _config.default.blankChar;var windowWidth = uni.getSystemInfoSync().windowWidth;var emoji;function MpHtmlParser(data) {var _this = this;var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3003. this.attrs = {};
  3004. this.CssHandler = new _CssHandler.default(options.tagStyle, windowWidth);
  3005. this.data = data;
  3006. this.domain = options.domain;
  3007. this.DOM = [];
  3008. this.i = this.start = this.audioNum = this.imgNum = this.videoNum = 0;
  3009. options.prot = (this.domain || '').includes('://') ? this.domain.split('://')[0] : 'http';
  3010. this.options = options;
  3011. this.state = this.Text;
  3012. this.STACK = [];
  3013. // 工具函数
  3014. this.bubble = function () {
  3015. for (var i = _this.STACK.length, item; item = _this.STACK[--i];) {
  3016. if (_config.default.richOnlyTags[item.name]) return false;
  3017. item.c = 1;
  3018. }
  3019. return true;
  3020. };
  3021. this.decode = function (val, amp) {
  3022. var i = -1,
  3023. j,en;
  3024. while (1) {
  3025. if ((i = val.indexOf('&', i + 1)) == -1) break;
  3026. if ((j = val.indexOf(';', i + 2)) == -1) break;
  3027. if (val[i + 1] == '#') {
  3028. en = parseInt((val[i + 2] == 'x' ? '0' : '') + val.substring(i + 2, j));
  3029. if (!isNaN(en)) val = val.substr(0, i) + String.fromCharCode(en) + val.substr(j + 1);
  3030. } else {
  3031. en = val.substring(i + 1, j);
  3032. if (_config.default.entities[en] || en == amp)
  3033. val = val.substr(0, i) + (_config.default.entities[en] || '&') + val.substr(j + 1);
  3034. }
  3035. }
  3036. return val;
  3037. };
  3038. this.getUrl = function (url) {
  3039. if (url[0] == '/') {
  3040. if (url[1] == '/') url = _this.options.prot + ':' + url;else
  3041. if (_this.domain) url = _this.domain + url;
  3042. } else if (_this.domain && url.indexOf('data:') != 0 && !url.includes('://'))
  3043. url = _this.domain + '/' + url;
  3044. return url;
  3045. };
  3046. this.isClose = function () {return _this.data[_this.i] == '>' || _this.data[_this.i] == '/' && _this.data[_this.i + 1] == '>';};
  3047. this.section = function () {return _this.data.substring(_this.start, _this.i);};
  3048. this.parent = function () {return _this.STACK[_this.STACK.length - 1];};
  3049. this.siblings = function () {return _this.STACK.length ? _this.parent().children : _this.DOM;};
  3050. }
  3051. MpHtmlParser.prototype.parse = function () {
  3052. if (emoji) this.data = emoji.parseEmoji(this.data);
  3053. for (var c; c = this.data[this.i]; this.i++) {
  3054. this.state(c);}
  3055. if (this.state == this.Text) this.setText();
  3056. while (this.STACK.length) {this.popNode(this.STACK.pop());}
  3057. return this.DOM;
  3058. };
  3059. // 设置属性
  3060. MpHtmlParser.prototype.setAttr = function () {
  3061. var name = this.attrName.toLowerCase(),
  3062. val = this.attrVal;
  3063. if (_config.default.boolAttrs[name]) this.attrs[name] = 'T';else
  3064. if (val) {
  3065. if (name == 'src' || name == 'data-src' && !this.attrs.src) this.attrs.src = this.getUrl(this.decode(val, 'amp'));else
  3066. if (name == 'href' || name == 'style') this.attrs[name] = this.decode(val, 'amp');else
  3067. if (name.substr(0, 5) != 'data-') this.attrs[name] = val;
  3068. }
  3069. this.attrVal = '';
  3070. while (blankChar[this.data[this.i]]) {this.i++;}
  3071. if (this.isClose()) this.setNode();else
  3072. {
  3073. this.start = this.i;
  3074. this.state = this.AttrName;
  3075. }
  3076. };
  3077. // 设置文本节点
  3078. MpHtmlParser.prototype.setText = function () {
  3079. var back,text = this.section();
  3080. if (!text) return;
  3081. text = _config.default.onText && _config.default.onText(text, function () {return back = true;}) || text;
  3082. if (back) {
  3083. this.data = this.data.substr(0, this.start) + text + this.data.substr(this.i);
  3084. var j = this.start + text.length;
  3085. for (this.i = this.start; this.i < j; this.i++) {this.state(this.data[this.i]);}
  3086. return;
  3087. }
  3088. if (!this.pre) {
  3089. // 合并空白符
  3090. var flag,tmp = [];
  3091. for (var i = text.length, c; c = text[--i];) {
  3092. if (!blankChar[c]) {
  3093. tmp.unshift(c);
  3094. if (!flag) flag = 1;
  3095. } else {
  3096. if (tmp[0] != ' ') tmp.unshift(' ');
  3097. if (c == '\n' && flag == void 0) flag = 0;
  3098. }}
  3099. if (flag == 0) return;
  3100. text = tmp.join('');
  3101. }
  3102. this.siblings().push({
  3103. type: 'text',
  3104. text: this.decode(text) });
  3105. };
  3106. // 设置元素节点
  3107. MpHtmlParser.prototype.setNode = function () {
  3108. var node = {
  3109. name: this.tagName.toLowerCase(),
  3110. attrs: this.attrs },
  3111. close = _config.default.selfClosingTags[node.name];
  3112. if (this.options.nodes.length) node.type = 'node';
  3113. this.attrs = {};
  3114. if (!_config.default.ignoreTags[node.name]) {
  3115. // 处理属性
  3116. var attrs = node.attrs,
  3117. style = this.CssHandler.match(node.name, attrs, node) + (attrs.style || ''),
  3118. styleObj = {};
  3119. if (attrs.id) {
  3120. if (this.options.compress & 1) attrs.id = void 0;else
  3121. if (this.options.useAnchor) this.bubble();
  3122. }
  3123. if (this.options.compress & 2 && attrs.class) attrs.class = void 0;
  3124. switch (node.name) {
  3125. case 'a':
  3126. case 'ad':
  3127. this.bubble();
  3128. break;
  3129. case 'font':
  3130. if (attrs.color) {
  3131. styleObj['color'] = attrs.color;
  3132. attrs.color = void 0;
  3133. }
  3134. if (attrs.face) {
  3135. styleObj['font-family'] = attrs.face;
  3136. attrs.face = void 0;
  3137. }
  3138. if (attrs.size) {
  3139. var size = parseInt(attrs.size);
  3140. if (size < 1) size = 1;else
  3141. if (size > 7) size = 7;
  3142. var map = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'];
  3143. styleObj['font-size'] = map[size - 1];
  3144. attrs.size = void 0;
  3145. }
  3146. break;
  3147. case 'embed':
  3148. var src = node.attrs.src || '',
  3149. type = node.attrs.type || '';
  3150. if (type.includes('video') || src.includes('.mp4') || src.includes('.3gp') || src.includes('.m3u8'))
  3151. node.name = 'video';else
  3152. if (type.includes('audio') || src.includes('.m4a') || src.includes('.wav') || src.includes('.mp3') || src.includes(
  3153. '.aac'))
  3154. node.name = 'audio';else
  3155. break;
  3156. if (node.attrs.autostart)
  3157. node.attrs.autoplay = 'T';
  3158. node.attrs.controls = 'T';
  3159. case 'video':
  3160. case 'audio':
  3161. if (!attrs.id) attrs.id = node.name + ++this["".concat(node.name, "Num")];else
  3162. this["".concat(node.name, "Num")]++;
  3163. if (node.name == 'video') {
  3164. if (this.videoNum > 3)
  3165. node.lazyLoad = 1;
  3166. if (attrs.width) {
  3167. styleObj.width = parseFloat(attrs.width) + (attrs.width.includes('%') ? '%' : 'px');
  3168. attrs.width = void 0;
  3169. }
  3170. if (attrs.height) {
  3171. styleObj.height = parseFloat(attrs.height) + (attrs.height.includes('%') ? '%' : 'px');
  3172. attrs.height = void 0;
  3173. }
  3174. }
  3175. if (!attrs.controls && !attrs.autoplay) attrs.controls = 'T';
  3176. attrs.source = [];
  3177. if (attrs.src) {
  3178. attrs.source.push(attrs.src);
  3179. attrs.src = void 0;
  3180. }
  3181. this.bubble();
  3182. break;
  3183. case 'td':
  3184. case 'th':
  3185. if (attrs.colspan || attrs.rowspan)
  3186. for (var k = this.STACK.length, item; item = this.STACK[--k];) {
  3187. if (item.name == 'table') {
  3188. item.flag = 1;
  3189. break;
  3190. }}}
  3191. if (attrs.align) {
  3192. if (node.name == 'table') {
  3193. if (attrs.align == 'center') styleObj['margin-inline-start'] = styleObj['margin-inline-end'] = 'auto';else
  3194. styleObj['float'] = attrs.align;
  3195. } else styleObj['text-align'] = attrs.align;
  3196. attrs.align = void 0;
  3197. }
  3198. // 压缩 style
  3199. var styles = style.split(';');
  3200. style = '';
  3201. for (var i = 0, len = styles.length; i < len; i++) {
  3202. var info = styles[i].split(':');
  3203. if (info.length < 2) continue;
  3204. var _key = info[0].trim().toLowerCase(),
  3205. _value = info.slice(1).join(':').trim();
  3206. if (_value[0] == '-' || _value.includes('safe'))
  3207. style += ";".concat(_key, ":").concat(_value);else
  3208. if (!styleObj[_key] || _value.includes('import') || !styleObj[_key].includes('import'))
  3209. styleObj[_key] = _value;
  3210. }
  3211. if (node.name == 'img') {
  3212. if (attrs.src && !attrs.ignore) {
  3213. if (this.bubble())
  3214. attrs.i = (this.imgNum++).toString();else
  3215. attrs.ignore = 'T';
  3216. }
  3217. if (attrs.ignore) {
  3218. style += ';-webkit-touch-callout:none';
  3219. styleObj['max-width'] = '100%';
  3220. }
  3221. var width;
  3222. if (styleObj.width) width = styleObj.width;else
  3223. if (attrs.width) width = attrs.width.includes('%') ? attrs.width : parseFloat(attrs.width) + 'px';
  3224. if (width) {
  3225. styleObj.width = width;
  3226. attrs.width = '100%';
  3227. if (parseInt(width) > windowWidth) {
  3228. styleObj.height = '';
  3229. if (attrs.height) attrs.height = void 0;
  3230. }
  3231. }
  3232. if (styleObj.height) {
  3233. attrs.height = styleObj.height;
  3234. styleObj.height = '';
  3235. } else if (attrs.height && !attrs.height.includes('%'))
  3236. attrs.height = parseFloat(attrs.height) + 'px';
  3237. }
  3238. for (var key in styleObj) {
  3239. var value = styleObj[key];
  3240. if (!value) continue;
  3241. if (key.includes('flex') || key == 'order' || key == 'self-align') node.c = 1;
  3242. // 填充链接
  3243. if (value.includes('url')) {
  3244. var j = value.indexOf('(');
  3245. if (j++ != -1) {
  3246. while (value[j] == '"' || value[j] == "'" || blankChar[value[j]]) {j++;}
  3247. value = value.substr(0, j) + this.getUrl(value.substr(j));
  3248. }
  3249. }
  3250. // 转换 rpx
  3251. else if (value.includes('rpx'))
  3252. value = value.replace(/[0-9.]+\s*rpx/g, function ($) {return parseFloat($) * windowWidth / 750 + 'px';});else
  3253. if (key == 'white-space' && value.includes('pre') && !close)
  3254. this.pre = node.pre = true;
  3255. style += ";".concat(key, ":").concat(value);
  3256. }
  3257. style = style.substr(1);
  3258. if (style) attrs.style = style;
  3259. if (!close) {
  3260. node.children = [];
  3261. if (node.name == 'pre' && _config.default.highlight) {
  3262. this.remove(node);
  3263. this.pre = node.pre = true;
  3264. }
  3265. this.siblings().push(node);
  3266. this.STACK.push(node);
  3267. } else if (!_config.default.filter || _config.default.filter(node, this) != false)
  3268. this.siblings().push(node);
  3269. } else {
  3270. if (!close) this.remove(node);else
  3271. if (node.name == 'source') {
  3272. var parent = this.parent();
  3273. if (parent && (parent.name == 'video' || parent.name == 'audio') && node.attrs.src)
  3274. parent.attrs.source.push(node.attrs.src);
  3275. } else if (node.name == 'base' && !this.domain) this.domain = node.attrs.href;
  3276. }
  3277. if (this.data[this.i] == '/') this.i++;
  3278. this.start = this.i + 1;
  3279. this.state = this.Text;
  3280. };
  3281. // 移除标签
  3282. MpHtmlParser.prototype.remove = function (node) {var _this2 = this;
  3283. var name = node.name,
  3284. j = this.i;
  3285. // 处理 svg
  3286. var handleSvg = function handleSvg() {
  3287. var src = _this2.data.substring(j, _this2.i + 1);
  3288. node.attrs.xmlns = 'http://www.w3.org/2000/svg';
  3289. for (var key in node.attrs) {
  3290. if (key == 'viewbox') src = " viewBox=\"".concat(node.attrs.viewbox, "\"") + src;else
  3291. if (key != 'style') src = " ".concat(key, "=\"").concat(node.attrs[key], "\"") + src;
  3292. }
  3293. src = '<svg' + src;
  3294. var parent = _this2.parent();
  3295. if (node.attrs.width == '100%' && parent && (parent.attrs.style || '').includes('inline'))
  3296. parent.attrs.style = 'width:300px;max-width:100%;' + parent.attrs.style;
  3297. _this2.siblings().push({
  3298. name: 'img',
  3299. attrs: {
  3300. src: 'data:image/svg+xml;utf8,' + src.replace(/#/g, '%23'),
  3301. style: node.attrs.style,
  3302. ignore: 'T' } });
  3303. };
  3304. if (node.name == 'svg' && this.data[j] == '/') return handleSvg(this.i++);
  3305. while (1) {
  3306. if ((this.i = this.data.indexOf('</', this.i + 1)) == -1) {
  3307. if (name == 'pre' || name == 'svg') this.i = j;else
  3308. this.i = this.data.length;
  3309. return;
  3310. }
  3311. this.start = this.i += 2;
  3312. while (!blankChar[this.data[this.i]] && !this.isClose()) {this.i++;}
  3313. if (this.section().toLowerCase() == name) {
  3314. // 代码块高亮
  3315. if (name == 'pre') {
  3316. this.data = this.data.substr(0, j + 1) + _config.default.highlight(this.data.substring(j + 1, this.i - 5), node.attrs) + this.data.
  3317. substr(this.i - 5);
  3318. return this.i = j;
  3319. } else if (name == 'style')
  3320. this.CssHandler.getStyle(this.data.substring(j + 1, this.i - 7));else
  3321. if (name == 'title')
  3322. this.DOM.title = this.data.substring(j + 1, this.i - 7);
  3323. if ((this.i = this.data.indexOf('>', this.i)) == -1) this.i = this.data.length;
  3324. if (name == 'svg') handleSvg();
  3325. return;
  3326. }
  3327. }
  3328. };
  3329. // 节点出栈处理
  3330. MpHtmlParser.prototype.popNode = function (node) {
  3331. // 空白符处理
  3332. if (node.pre) {
  3333. node.pre = this.pre = void 0;
  3334. for (var i = this.STACK.length; i--;) {
  3335. if (this.STACK[i].pre)
  3336. this.pre = true;}
  3337. }
  3338. var siblings = this.siblings(),
  3339. len = siblings.length,
  3340. childs = node.children;
  3341. if (node.name == 'head' || _config.default.filter && _config.default.filter(node, this) == false)
  3342. return siblings.pop();
  3343. var attrs = node.attrs;
  3344. // 替换一些标签名
  3345. if (_config.default.blockTags[node.name]) node.name = 'div';else
  3346. if (!_config.default.trustTags[node.name]) node.name = 'span';
  3347. // 处理列表
  3348. if (node.c && (node.name == 'ul' || node.name == 'ol')) {
  3349. if ((node.attrs.style || '').includes('list-style:none')) {
  3350. for (var _i = 0, child; child = childs[_i++];) {
  3351. if (child.name == 'li')
  3352. child.name = 'div';}
  3353. } else if (node.name == 'ul') {
  3354. var floor = 1;
  3355. for (var _i2 = this.STACK.length; _i2--;) {
  3356. if (this.STACK[_i2].name == 'ul') floor++;}
  3357. if (floor != 1)
  3358. for (var _i3 = childs.length; _i3--;) {
  3359. childs[_i3].floor = floor;}
  3360. } else {
  3361. for (var _i4 = 0, num = 1, _child; _child = childs[_i4++];) {
  3362. if (_child.name == 'li') {
  3363. _child.type = 'ol';
  3364. _child.num = function (num, type) {
  3365. if (type == 'a') return String.fromCharCode(97 + (num - 1) % 26);
  3366. if (type == 'A') return String.fromCharCode(65 + (num - 1) % 26);
  3367. if (type == 'i' || type == 'I') {
  3368. num = (num - 1) % 99 + 1;
  3369. var one = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'],
  3370. ten = ['X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'],
  3371. res = (ten[Math.floor(num / 10) - 1] || '') + (one[num % 10 - 1] || '');
  3372. if (type == 'i') return res.toLowerCase();
  3373. return res;
  3374. }
  3375. return num;
  3376. }(num++, attrs.type) + '.';
  3377. }}
  3378. }
  3379. }
  3380. // 处理表格
  3381. if (node.name == 'table') {
  3382. var padding = parseFloat(attrs.cellpadding),
  3383. spacing = parseFloat(attrs.cellspacing),
  3384. border = parseFloat(attrs.border);
  3385. if (node.c) {
  3386. if (isNaN(padding)) padding = 2;
  3387. if (isNaN(spacing)) spacing = 2;
  3388. }
  3389. if (border) attrs.style = "border:".concat(border, "px solid gray;").concat(attrs.style || '');
  3390. if (node.flag && node.c) {
  3391. // 有 colspan 或 rowspan 且含有链接的表格转为 grid 布局实现
  3392. attrs.style = "".concat(attrs.style || '', ";").concat(spacing ? ";grid-gap:".concat(spacing, "px") : ';border-left:0;border-top:0');
  3393. var row = 1,
  3394. col = 1,
  3395. colNum,
  3396. trs = [],
  3397. children = [],
  3398. map = {};
  3399. (function f(ns) {
  3400. for (var i = 0; i < ns.length; i++) {
  3401. if (ns[i].name == 'tr') trs.push(ns[i]);else
  3402. f(ns[i].children || []);
  3403. }
  3404. })(node.children);
  3405. for (var _i5 = 0; _i5 < trs.length; _i5++) {
  3406. for (var j = 0, td; td = trs[_i5].children[j]; j++) {
  3407. if (td.name == 'td' || td.name == 'th') {
  3408. while (map[row + '.' + col]) {col++;}
  3409. var cell = {
  3410. name: 'div',
  3411. c: 1,
  3412. attrs: {
  3413. style: (td.attrs.style || '') + (border ? ";border:".concat(border, "px solid gray") + (spacing ? '' :
  3414. ';border-right:0;border-bottom:0') : '') + (padding ? ";padding:".concat(padding, "px") : '') },
  3415. children: td.children };
  3416. if (td.attrs.colspan) {
  3417. cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + parseInt(td.attrs.colspan));
  3418. if (!td.attrs.rowspan) cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + 1);
  3419. col += parseInt(td.attrs.colspan) - 1;
  3420. }
  3421. if (td.attrs.rowspan) {
  3422. cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + parseInt(td.attrs.rowspan));
  3423. if (!td.attrs.colspan) cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + 1);
  3424. for (var k = 1; k < td.attrs.rowspan; k++) {map[row + k + '.' + col] = 1;}
  3425. }
  3426. children.push(cell);
  3427. col++;
  3428. }
  3429. }
  3430. if (!colNum) {
  3431. colNum = col - 1;
  3432. attrs.style += ";grid-template-columns:repeat(".concat(colNum, ",auto)");
  3433. }
  3434. col = 1;
  3435. row++;
  3436. }
  3437. node.children = children;
  3438. } else {
  3439. attrs.style = "border-spacing:".concat(spacing, "px;").concat(attrs.style || '');
  3440. if (border || padding)
  3441. (function f(ns) {
  3442. for (var i = 0, n; n = ns[i]; i++) {
  3443. if (n.name == 'th' || n.name == 'td') {
  3444. if (border) n.attrs.style = "border:".concat(border, "px solid gray;").concat(n.attrs.style || '');
  3445. if (padding) n.attrs.style = "padding:".concat(padding, "px;").concat(n.attrs.style || '');
  3446. } else f(n.children || []);
  3447. }
  3448. })(childs);
  3449. }
  3450. if (this.options.autoscroll) {
  3451. var table = Object.assign({}, node);
  3452. node.name = 'div';
  3453. node.attrs = {
  3454. style: 'overflow:scroll' };
  3455. node.children = [table];
  3456. }
  3457. }
  3458. this.CssHandler.pop && this.CssHandler.pop(node);
  3459. // 自动压缩
  3460. if (node.name == 'div' && !Object.keys(attrs).length && childs.length == 1 && childs[0].name == 'div')
  3461. siblings[len - 1] = childs[0];
  3462. };
  3463. // 状态机
  3464. MpHtmlParser.prototype.Text = function (c) {
  3465. if (c == '<') {
  3466. var next = this.data[this.i + 1],
  3467. isLetter = function isLetter(c) {return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';};
  3468. if (isLetter(next)) {
  3469. this.setText();
  3470. this.start = this.i + 1;
  3471. this.state = this.TagName;
  3472. } else if (next == '/') {
  3473. this.setText();
  3474. if (isLetter(this.data[++this.i + 1])) {
  3475. this.start = this.i + 1;
  3476. this.state = this.EndTag;
  3477. } else this.Comment();
  3478. } else if (next == '!' || next == '?') {
  3479. this.setText();
  3480. this.Comment();
  3481. }
  3482. }
  3483. };
  3484. MpHtmlParser.prototype.Comment = function () {
  3485. var key;
  3486. if (this.data.substring(this.i + 2, this.i + 4) == '--') key = '-->';else
  3487. if (this.data.substring(this.i + 2, this.i + 9) == '[CDATA[') key = ']]>';else
  3488. key = '>';
  3489. if ((this.i = this.data.indexOf(key, this.i + 2)) == -1) this.i = this.data.length;else
  3490. this.i += key.length - 1;
  3491. this.start = this.i + 1;
  3492. this.state = this.Text;
  3493. };
  3494. MpHtmlParser.prototype.TagName = function (c) {
  3495. if (blankChar[c]) {
  3496. this.tagName = this.section();
  3497. while (blankChar[this.data[this.i]]) {this.i++;}
  3498. if (this.isClose()) this.setNode();else
  3499. {
  3500. this.start = this.i;
  3501. this.state = this.AttrName;
  3502. }
  3503. } else if (this.isClose()) {
  3504. this.tagName = this.section();
  3505. this.setNode();
  3506. }
  3507. };
  3508. MpHtmlParser.prototype.AttrName = function (c) {
  3509. if (c == '=' || blankChar[c] || this.isClose()) {
  3510. this.attrName = this.section();
  3511. if (blankChar[c])
  3512. while (blankChar[this.data[++this.i]]) {;}
  3513. if (this.data[this.i] == '=') {
  3514. while (blankChar[this.data[++this.i]]) {;}
  3515. this.start = this.i--;
  3516. this.state = this.AttrValue;
  3517. } else this.setAttr();
  3518. }
  3519. };
  3520. MpHtmlParser.prototype.AttrValue = function (c) {
  3521. if (c == '"' || c == "'") {
  3522. this.start++;
  3523. if ((this.i = this.data.indexOf(c, this.i + 1)) == -1) return this.i = this.data.length;
  3524. this.attrVal = this.section();
  3525. this.i++;
  3526. } else {
  3527. for (; !blankChar[this.data[this.i]] && !this.isClose(); this.i++) {;}
  3528. this.attrVal = this.section();
  3529. }
  3530. this.setAttr();
  3531. };
  3532. MpHtmlParser.prototype.EndTag = function (c) {
  3533. if (blankChar[c] || c == '>' || c == '/') {
  3534. var name = this.section().toLowerCase();
  3535. for (var i = this.STACK.length; i--;) {
  3536. if (this.STACK[i].name == name) break;}
  3537. if (i != -1) {
  3538. var node;
  3539. while ((node = this.STACK.pop()).name != name) {this.popNode(node);}
  3540. this.popNode(node);
  3541. } else if (name == 'p' || name == 'br')
  3542. this.siblings().push({
  3543. name: name,
  3544. attrs: {} });
  3545. this.i = this.data.indexOf('>', this.i);
  3546. this.start = this.i + 1;
  3547. if (this.i == -1) this.i = this.data.length;else
  3548. this.state = this.Text;
  3549. }
  3550. };var _default =
  3551. MpHtmlParser;exports.default = _default;
  3552. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3553. /***/ }),
  3554. /***/ 206:
  3555. /*!********************************************************************************!*\
  3556. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/config.js ***!
  3557. \********************************************************************************/
  3558. /*! no static exports found */
  3559. /***/ (function(module, exports, __webpack_require__) {
  3560. "use strict";
  3561. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /* 配置文件 */
  3562. var cfg = {
  3563. // 出错占位图
  3564. errorImg: null,
  3565. // 过滤器函数
  3566. filter: null,
  3567. // 代码高亮函数
  3568. highlight: null,
  3569. // 文本处理函数
  3570. onText: null,
  3571. // 实体编码列表
  3572. entities: {
  3573. quot: '"',
  3574. apos: "'",
  3575. semi: ';',
  3576. nbsp: '\xA0',
  3577. ensp: "\u2002",
  3578. emsp: "\u2003",
  3579. ndash: '–',
  3580. mdash: '—',
  3581. middot: '·',
  3582. lsquo: '‘',
  3583. rsquo: '’',
  3584. ldquo: '“',
  3585. rdquo: '”',
  3586. bull: '•',
  3587. hellip: '…' },
  3588. blankChar: makeMap(' ,\xA0,\t,\r,\n,\f'),
  3589. boolAttrs: makeMap('allowfullscreen,autoplay,autostart,controls,ignore,loop,muted'),
  3590. // 块级标签,将被转为 div
  3591. blockTags: makeMap('address,article,aside,body,caption,center,cite,footer,header,html,nav,pre,section'),
  3592. // 将被移除的标签
  3593. ignoreTags: makeMap('area,base,canvas,frame,iframe,input,link,map,meta,param,script,source,style,svg,textarea,title,track,wbr'),
  3594. // 只能被 rich-text 显示的标签
  3595. richOnlyTags: makeMap('a,colgroup,fieldset,legend'),
  3596. // 自闭合的标签
  3597. selfClosingTags: makeMap('area,base,br,col,circle,ellipse,embed,frame,hr,img,input,line,link,meta,param,path,polygon,rect,source,track,use,wbr'),
  3598. // 信任的标签
  3599. 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'),
  3600. // 默认的标签样式
  3601. userAgentStyles: {
  3602. address: 'font-style:italic',
  3603. big: 'display:inline;font-size:1.2em',
  3604. blockquote: 'background-color:#f6f6f6;border-left:3px solid #dbdbdb;color:#6c6c6c;padding:5px 0 5px 10px',
  3605. caption: 'display:table-caption;text-align:center',
  3606. center: 'text-align:center',
  3607. cite: 'font-style:italic',
  3608. dd: 'margin-left:40px',
  3609. mark: 'background-color:yellow',
  3610. pre: 'font-family:monospace;white-space:pre;overflow:scroll',
  3611. s: 'text-decoration:line-through',
  3612. small: 'display:inline;font-size:0.8em',
  3613. u: 'text-decoration:underline' } };
  3614. function makeMap(str) {
  3615. var map = Object.create(null),
  3616. list = str.split(',');
  3617. for (var i = list.length; i--;) {
  3618. map[list[i]] = true;}
  3619. return map;
  3620. }
  3621. if (wx.canIUse('editor')) {
  3622. cfg.blockTags.pre = void 0;
  3623. cfg.ignoreTags.rp = true;
  3624. Object.assign(cfg.richOnlyTags, makeMap('bdi,bdo,caption,rt,ruby'));
  3625. Object.assign(cfg.trustTags, makeMap('bdi,bdo,caption,pre,rt,ruby'));
  3626. }var _default =
  3627. cfg;exports.default = _default;
  3628. /***/ }),
  3629. /***/ 207:
  3630. /*!************************************************************************************!*\
  3631. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/CssHandler.js ***!
  3632. \************************************************************************************/
  3633. /*! no static exports found */
  3634. /***/ (function(module, exports, __webpack_require__) {
  3635. "use strict";
  3636. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _config = _interopRequireDefault(__webpack_require__(/*! ./config.js */ 206));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  3637. var isLetter = function isLetter(c) {return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';};
  3638. function CssHandler(tagStyle) {
  3639. var styles = Object.assign(Object.create(null), _config.default.userAgentStyles);
  3640. for (var item in tagStyle) {
  3641. styles[item] = (styles[item] ? styles[item] + ';' : '') + tagStyle[item];}
  3642. this.styles = styles;
  3643. }
  3644. CssHandler.prototype.getStyle = function (data) {
  3645. this.styles = new parser(data, this.styles).parse();
  3646. };
  3647. CssHandler.prototype.match = function (name, attrs) {
  3648. var tmp,matched = (tmp = this.styles[name]) ? tmp + ';' : '';
  3649. if (attrs.class) {
  3650. var items = attrs.class.split(' ');
  3651. for (var i = 0, item; item = items[i]; i++) {
  3652. if (tmp = this.styles['.' + item])
  3653. matched += tmp + ';';}
  3654. }
  3655. if (tmp = this.styles['#' + attrs.id])
  3656. matched += tmp + ';';
  3657. return matched;
  3658. };var _default =
  3659. CssHandler;exports.default = _default;
  3660. function parser(data, init) {
  3661. this.data = data;
  3662. this.floor = 0;
  3663. this.i = 0;
  3664. this.list = [];
  3665. this.res = init;
  3666. this.state = this.Space;
  3667. }
  3668. parser.prototype.parse = function () {
  3669. for (var c; c = this.data[this.i]; this.i++) {
  3670. this.state(c);}
  3671. return this.res;
  3672. };
  3673. parser.prototype.section = function () {
  3674. return this.data.substring(this.start, this.i);
  3675. };
  3676. // 状态机
  3677. parser.prototype.Space = function (c) {
  3678. if (c == '.' || c == '#' || isLetter(c)) {
  3679. this.start = this.i;
  3680. this.state = this.Name;
  3681. } else if (c == '/' && this.data[this.i + 1] == '*')
  3682. this.Comment();else
  3683. if (!_config.default.blankChar[c] && c != ';')
  3684. this.state = this.Ignore;
  3685. };
  3686. parser.prototype.Comment = function () {
  3687. this.i = this.data.indexOf('*/', this.i) + 1;
  3688. if (!this.i) this.i = this.data.length;
  3689. this.state = this.Space;
  3690. };
  3691. parser.prototype.Ignore = function (c) {
  3692. if (c == '{') this.floor++;else
  3693. if (c == '}' && ! --this.floor) {
  3694. this.list = [];
  3695. this.state = this.Space;
  3696. }
  3697. };
  3698. parser.prototype.Name = function (c) {
  3699. if (_config.default.blankChar[c]) {
  3700. this.list.push(this.section());
  3701. this.state = this.NameSpace;
  3702. } else if (c == '{') {
  3703. this.list.push(this.section());
  3704. this.Content();
  3705. } else if (c == ',') {
  3706. this.list.push(this.section());
  3707. this.Comma();
  3708. } else if (!isLetter(c) && (c < '0' || c > '9') && c != '-' && c != '_')
  3709. this.state = this.Ignore;
  3710. };
  3711. parser.prototype.NameSpace = function (c) {
  3712. if (c == '{') this.Content();else
  3713. if (c == ',') this.Comma();else
  3714. if (!_config.default.blankChar[c]) this.state = this.Ignore;
  3715. };
  3716. parser.prototype.Comma = function () {
  3717. while (_config.default.blankChar[this.data[++this.i]]) {;}
  3718. if (this.data[this.i] == '{') this.Content();else
  3719. {
  3720. this.start = this.i--;
  3721. this.state = this.Name;
  3722. }
  3723. };
  3724. parser.prototype.Content = function () {
  3725. this.start = ++this.i;
  3726. if ((this.i = this.data.indexOf('}', this.i)) == -1) this.i = this.data.length;
  3727. var content = this.section();
  3728. for (var i = 0, item; item = this.list[i++];) {
  3729. if (this.res[item]) this.res[item] += ';' + content;else
  3730. this.res[item] = content;}
  3731. this.list = [];
  3732. this.state = this.Space;
  3733. };
  3734. /***/ }),
  3735. /***/ 21:
  3736. /*!************************************************************!*\
  3737. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  3738. \************************************************************/
  3739. /*! no static exports found */
  3740. /***/ (function(module, exports, __webpack_require__) {
  3741. /**
  3742. * Copyright (c) 2014-present, Facebook, Inc.
  3743. *
  3744. * This source code is licensed under the MIT license found in the
  3745. * LICENSE file in the root directory of this source tree.
  3746. */
  3747. // This method of obtaining a reference to the global object needs to be
  3748. // kept identical to the way it is obtained in runtime.js
  3749. var g = (function() {
  3750. return this || (typeof self === "object" && self);
  3751. })() || Function("return this")();
  3752. // Use `getOwnPropertyNames` because not all browsers support calling
  3753. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  3754. var hadRuntime = g.regeneratorRuntime &&
  3755. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  3756. // Save the old regeneratorRuntime in case it needs to be restored later.
  3757. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  3758. // Force reevalutation of runtime.js.
  3759. g.regeneratorRuntime = undefined;
  3760. module.exports = __webpack_require__(/*! ./runtime */ 22);
  3761. if (hadRuntime) {
  3762. // Restore the original runtime.
  3763. g.regeneratorRuntime = oldRuntime;
  3764. } else {
  3765. // Remove the global property added by runtime.js.
  3766. try {
  3767. delete g.regeneratorRuntime;
  3768. } catch(e) {
  3769. g.regeneratorRuntime = undefined;
  3770. }
  3771. }
  3772. /***/ }),
  3773. /***/ 22:
  3774. /*!*****************************************************!*\
  3775. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  3776. \*****************************************************/
  3777. /*! no static exports found */
  3778. /***/ (function(module, exports) {
  3779. /**
  3780. * Copyright (c) 2014-present, Facebook, Inc.
  3781. *
  3782. * This source code is licensed under the MIT license found in the
  3783. * LICENSE file in the root directory of this source tree.
  3784. */
  3785. !(function(global) {
  3786. "use strict";
  3787. var Op = Object.prototype;
  3788. var hasOwn = Op.hasOwnProperty;
  3789. var undefined; // More compressible than void 0.
  3790. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  3791. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  3792. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  3793. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  3794. var inModule = typeof module === "object";
  3795. var runtime = global.regeneratorRuntime;
  3796. if (runtime) {
  3797. if (inModule) {
  3798. // If regeneratorRuntime is defined globally and we're in a module,
  3799. // make the exports object identical to regeneratorRuntime.
  3800. module.exports = runtime;
  3801. }
  3802. // Don't bother evaluating the rest of this file if the runtime was
  3803. // already defined globally.
  3804. return;
  3805. }
  3806. // Define the runtime globally (as expected by generated code) as either
  3807. // module.exports (if we're in a module) or a new, empty object.
  3808. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  3809. function wrap(innerFn, outerFn, self, tryLocsList) {
  3810. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  3811. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  3812. var generator = Object.create(protoGenerator.prototype);
  3813. var context = new Context(tryLocsList || []);
  3814. // The ._invoke method unifies the implementations of the .next,
  3815. // .throw, and .return methods.
  3816. generator._invoke = makeInvokeMethod(innerFn, self, context);
  3817. return generator;
  3818. }
  3819. runtime.wrap = wrap;
  3820. // Try/catch helper to minimize deoptimizations. Returns a completion
  3821. // record like context.tryEntries[i].completion. This interface could
  3822. // have been (and was previously) designed to take a closure to be
  3823. // invoked without arguments, but in all the cases we care about we
  3824. // already have an existing method we want to call, so there's no need
  3825. // to create a new function object. We can even get away with assuming
  3826. // the method takes exactly one argument, since that happens to be true
  3827. // in every case, so we don't have to touch the arguments object. The
  3828. // only additional allocation required is the completion record, which
  3829. // has a stable shape and so hopefully should be cheap to allocate.
  3830. function tryCatch(fn, obj, arg) {
  3831. try {
  3832. return { type: "normal", arg: fn.call(obj, arg) };
  3833. } catch (err) {
  3834. return { type: "throw", arg: err };
  3835. }
  3836. }
  3837. var GenStateSuspendedStart = "suspendedStart";
  3838. var GenStateSuspendedYield = "suspendedYield";
  3839. var GenStateExecuting = "executing";
  3840. var GenStateCompleted = "completed";
  3841. // Returning this object from the innerFn has the same effect as
  3842. // breaking out of the dispatch switch statement.
  3843. var ContinueSentinel = {};
  3844. // Dummy constructor functions that we use as the .constructor and
  3845. // .constructor.prototype properties for functions that return Generator
  3846. // objects. For full spec compliance, you may wish to configure your
  3847. // minifier not to mangle the names of these two functions.
  3848. function Generator() {}
  3849. function GeneratorFunction() {}
  3850. function GeneratorFunctionPrototype() {}
  3851. // This is a polyfill for %IteratorPrototype% for environments that
  3852. // don't natively support it.
  3853. var IteratorPrototype = {};
  3854. IteratorPrototype[iteratorSymbol] = function () {
  3855. return this;
  3856. };
  3857. var getProto = Object.getPrototypeOf;
  3858. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  3859. if (NativeIteratorPrototype &&
  3860. NativeIteratorPrototype !== Op &&
  3861. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  3862. // This environment has a native %IteratorPrototype%; use it instead
  3863. // of the polyfill.
  3864. IteratorPrototype = NativeIteratorPrototype;
  3865. }
  3866. var Gp = GeneratorFunctionPrototype.prototype =
  3867. Generator.prototype = Object.create(IteratorPrototype);
  3868. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  3869. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  3870. GeneratorFunctionPrototype[toStringTagSymbol] =
  3871. GeneratorFunction.displayName = "GeneratorFunction";
  3872. // Helper for defining the .next, .throw, and .return methods of the
  3873. // Iterator interface in terms of a single ._invoke method.
  3874. function defineIteratorMethods(prototype) {
  3875. ["next", "throw", "return"].forEach(function(method) {
  3876. prototype[method] = function(arg) {
  3877. return this._invoke(method, arg);
  3878. };
  3879. });
  3880. }
  3881. runtime.isGeneratorFunction = function(genFun) {
  3882. var ctor = typeof genFun === "function" && genFun.constructor;
  3883. return ctor
  3884. ? ctor === GeneratorFunction ||
  3885. // For the native GeneratorFunction constructor, the best we can
  3886. // do is to check its .name property.
  3887. (ctor.displayName || ctor.name) === "GeneratorFunction"
  3888. : false;
  3889. };
  3890. runtime.mark = function(genFun) {
  3891. if (Object.setPrototypeOf) {
  3892. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  3893. } else {
  3894. genFun.__proto__ = GeneratorFunctionPrototype;
  3895. if (!(toStringTagSymbol in genFun)) {
  3896. genFun[toStringTagSymbol] = "GeneratorFunction";
  3897. }
  3898. }
  3899. genFun.prototype = Object.create(Gp);
  3900. return genFun;
  3901. };
  3902. // Within the body of any async function, `await x` is transformed to
  3903. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  3904. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  3905. // meant to be awaited.
  3906. runtime.awrap = function(arg) {
  3907. return { __await: arg };
  3908. };
  3909. function AsyncIterator(generator) {
  3910. function invoke(method, arg, resolve, reject) {
  3911. var record = tryCatch(generator[method], generator, arg);
  3912. if (record.type === "throw") {
  3913. reject(record.arg);
  3914. } else {
  3915. var result = record.arg;
  3916. var value = result.value;
  3917. if (value &&
  3918. typeof value === "object" &&
  3919. hasOwn.call(value, "__await")) {
  3920. return Promise.resolve(value.__await).then(function(value) {
  3921. invoke("next", value, resolve, reject);
  3922. }, function(err) {
  3923. invoke("throw", err, resolve, reject);
  3924. });
  3925. }
  3926. return Promise.resolve(value).then(function(unwrapped) {
  3927. // When a yielded Promise is resolved, its final value becomes
  3928. // the .value of the Promise<{value,done}> result for the
  3929. // current iteration.
  3930. result.value = unwrapped;
  3931. resolve(result);
  3932. }, function(error) {
  3933. // If a rejected Promise was yielded, throw the rejection back
  3934. // into the async generator function so it can be handled there.
  3935. return invoke("throw", error, resolve, reject);
  3936. });
  3937. }
  3938. }
  3939. var previousPromise;
  3940. function enqueue(method, arg) {
  3941. function callInvokeWithMethodAndArg() {
  3942. return new Promise(function(resolve, reject) {
  3943. invoke(method, arg, resolve, reject);
  3944. });
  3945. }
  3946. return previousPromise =
  3947. // If enqueue has been called before, then we want to wait until
  3948. // all previous Promises have been resolved before calling invoke,
  3949. // so that results are always delivered in the correct order. If
  3950. // enqueue has not been called before, then it is important to
  3951. // call invoke immediately, without waiting on a callback to fire,
  3952. // so that the async generator function has the opportunity to do
  3953. // any necessary setup in a predictable way. This predictability
  3954. // is why the Promise constructor synchronously invokes its
  3955. // executor callback, and why async functions synchronously
  3956. // execute code before the first await. Since we implement simple
  3957. // async functions in terms of async generators, it is especially
  3958. // important to get this right, even though it requires care.
  3959. previousPromise ? previousPromise.then(
  3960. callInvokeWithMethodAndArg,
  3961. // Avoid propagating failures to Promises returned by later
  3962. // invocations of the iterator.
  3963. callInvokeWithMethodAndArg
  3964. ) : callInvokeWithMethodAndArg();
  3965. }
  3966. // Define the unified helper method that is used to implement .next,
  3967. // .throw, and .return (see defineIteratorMethods).
  3968. this._invoke = enqueue;
  3969. }
  3970. defineIteratorMethods(AsyncIterator.prototype);
  3971. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  3972. return this;
  3973. };
  3974. runtime.AsyncIterator = AsyncIterator;
  3975. // Note that simple async functions are implemented on top of
  3976. // AsyncIterator objects; they just return a Promise for the value of
  3977. // the final result produced by the iterator.
  3978. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  3979. var iter = new AsyncIterator(
  3980. wrap(innerFn, outerFn, self, tryLocsList)
  3981. );
  3982. return runtime.isGeneratorFunction(outerFn)
  3983. ? iter // If outerFn is a generator, return the full iterator.
  3984. : iter.next().then(function(result) {
  3985. return result.done ? result.value : iter.next();
  3986. });
  3987. };
  3988. function makeInvokeMethod(innerFn, self, context) {
  3989. var state = GenStateSuspendedStart;
  3990. return function invoke(method, arg) {
  3991. if (state === GenStateExecuting) {
  3992. throw new Error("Generator is already running");
  3993. }
  3994. if (state === GenStateCompleted) {
  3995. if (method === "throw") {
  3996. throw arg;
  3997. }
  3998. // Be forgiving, per 25.3.3.3.3 of the spec:
  3999. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  4000. return doneResult();
  4001. }
  4002. context.method = method;
  4003. context.arg = arg;
  4004. while (true) {
  4005. var delegate = context.delegate;
  4006. if (delegate) {
  4007. var delegateResult = maybeInvokeDelegate(delegate, context);
  4008. if (delegateResult) {
  4009. if (delegateResult === ContinueSentinel) continue;
  4010. return delegateResult;
  4011. }
  4012. }
  4013. if (context.method === "next") {
  4014. // Setting context._sent for legacy support of Babel's
  4015. // function.sent implementation.
  4016. context.sent = context._sent = context.arg;
  4017. } else if (context.method === "throw") {
  4018. if (state === GenStateSuspendedStart) {
  4019. state = GenStateCompleted;
  4020. throw context.arg;
  4021. }
  4022. context.dispatchException(context.arg);
  4023. } else if (context.method === "return") {
  4024. context.abrupt("return", context.arg);
  4025. }
  4026. state = GenStateExecuting;
  4027. var record = tryCatch(innerFn, self, context);
  4028. if (record.type === "normal") {
  4029. // If an exception is thrown from innerFn, we leave state ===
  4030. // GenStateExecuting and loop back for another invocation.
  4031. state = context.done
  4032. ? GenStateCompleted
  4033. : GenStateSuspendedYield;
  4034. if (record.arg === ContinueSentinel) {
  4035. continue;
  4036. }
  4037. return {
  4038. value: record.arg,
  4039. done: context.done
  4040. };
  4041. } else if (record.type === "throw") {
  4042. state = GenStateCompleted;
  4043. // Dispatch the exception by looping back around to the
  4044. // context.dispatchException(context.arg) call above.
  4045. context.method = "throw";
  4046. context.arg = record.arg;
  4047. }
  4048. }
  4049. };
  4050. }
  4051. // Call delegate.iterator[context.method](context.arg) and handle the
  4052. // result, either by returning a { value, done } result from the
  4053. // delegate iterator, or by modifying context.method and context.arg,
  4054. // setting context.delegate to null, and returning the ContinueSentinel.
  4055. function maybeInvokeDelegate(delegate, context) {
  4056. var method = delegate.iterator[context.method];
  4057. if (method === undefined) {
  4058. // A .throw or .return when the delegate iterator has no .throw
  4059. // method always terminates the yield* loop.
  4060. context.delegate = null;
  4061. if (context.method === "throw") {
  4062. if (delegate.iterator.return) {
  4063. // If the delegate iterator has a return method, give it a
  4064. // chance to clean up.
  4065. context.method = "return";
  4066. context.arg = undefined;
  4067. maybeInvokeDelegate(delegate, context);
  4068. if (context.method === "throw") {
  4069. // If maybeInvokeDelegate(context) changed context.method from
  4070. // "return" to "throw", let that override the TypeError below.
  4071. return ContinueSentinel;
  4072. }
  4073. }
  4074. context.method = "throw";
  4075. context.arg = new TypeError(
  4076. "The iterator does not provide a 'throw' method");
  4077. }
  4078. return ContinueSentinel;
  4079. }
  4080. var record = tryCatch(method, delegate.iterator, context.arg);
  4081. if (record.type === "throw") {
  4082. context.method = "throw";
  4083. context.arg = record.arg;
  4084. context.delegate = null;
  4085. return ContinueSentinel;
  4086. }
  4087. var info = record.arg;
  4088. if (! info) {
  4089. context.method = "throw";
  4090. context.arg = new TypeError("iterator result is not an object");
  4091. context.delegate = null;
  4092. return ContinueSentinel;
  4093. }
  4094. if (info.done) {
  4095. // Assign the result of the finished delegate to the temporary
  4096. // variable specified by delegate.resultName (see delegateYield).
  4097. context[delegate.resultName] = info.value;
  4098. // Resume execution at the desired location (see delegateYield).
  4099. context.next = delegate.nextLoc;
  4100. // If context.method was "throw" but the delegate handled the
  4101. // exception, let the outer generator proceed normally. If
  4102. // context.method was "next", forget context.arg since it has been
  4103. // "consumed" by the delegate iterator. If context.method was
  4104. // "return", allow the original .return call to continue in the
  4105. // outer generator.
  4106. if (context.method !== "return") {
  4107. context.method = "next";
  4108. context.arg = undefined;
  4109. }
  4110. } else {
  4111. // Re-yield the result returned by the delegate method.
  4112. return info;
  4113. }
  4114. // The delegate iterator is finished, so forget it and continue with
  4115. // the outer generator.
  4116. context.delegate = null;
  4117. return ContinueSentinel;
  4118. }
  4119. // Define Generator.prototype.{next,throw,return} in terms of the
  4120. // unified ._invoke helper method.
  4121. defineIteratorMethods(Gp);
  4122. Gp[toStringTagSymbol] = "Generator";
  4123. // A Generator should always return itself as the iterator object when the
  4124. // @@iterator function is called on it. Some browsers' implementations of the
  4125. // iterator prototype chain incorrectly implement this, causing the Generator
  4126. // object to not be returned from this call. This ensures that doesn't happen.
  4127. // See https://github.com/facebook/regenerator/issues/274 for more details.
  4128. Gp[iteratorSymbol] = function() {
  4129. return this;
  4130. };
  4131. Gp.toString = function() {
  4132. return "[object Generator]";
  4133. };
  4134. function pushTryEntry(locs) {
  4135. var entry = { tryLoc: locs[0] };
  4136. if (1 in locs) {
  4137. entry.catchLoc = locs[1];
  4138. }
  4139. if (2 in locs) {
  4140. entry.finallyLoc = locs[2];
  4141. entry.afterLoc = locs[3];
  4142. }
  4143. this.tryEntries.push(entry);
  4144. }
  4145. function resetTryEntry(entry) {
  4146. var record = entry.completion || {};
  4147. record.type = "normal";
  4148. delete record.arg;
  4149. entry.completion = record;
  4150. }
  4151. function Context(tryLocsList) {
  4152. // The root entry object (effectively a try statement without a catch
  4153. // or a finally block) gives us a place to store values thrown from
  4154. // locations where there is no enclosing try statement.
  4155. this.tryEntries = [{ tryLoc: "root" }];
  4156. tryLocsList.forEach(pushTryEntry, this);
  4157. this.reset(true);
  4158. }
  4159. runtime.keys = function(object) {
  4160. var keys = [];
  4161. for (var key in object) {
  4162. keys.push(key);
  4163. }
  4164. keys.reverse();
  4165. // Rather than returning an object with a next method, we keep
  4166. // things simple and return the next function itself.
  4167. return function next() {
  4168. while (keys.length) {
  4169. var key = keys.pop();
  4170. if (key in object) {
  4171. next.value = key;
  4172. next.done = false;
  4173. return next;
  4174. }
  4175. }
  4176. // To avoid creating an additional object, we just hang the .value
  4177. // and .done properties off the next function object itself. This
  4178. // also ensures that the minifier will not anonymize the function.
  4179. next.done = true;
  4180. return next;
  4181. };
  4182. };
  4183. function values(iterable) {
  4184. if (iterable) {
  4185. var iteratorMethod = iterable[iteratorSymbol];
  4186. if (iteratorMethod) {
  4187. return iteratorMethod.call(iterable);
  4188. }
  4189. if (typeof iterable.next === "function") {
  4190. return iterable;
  4191. }
  4192. if (!isNaN(iterable.length)) {
  4193. var i = -1, next = function next() {
  4194. while (++i < iterable.length) {
  4195. if (hasOwn.call(iterable, i)) {
  4196. next.value = iterable[i];
  4197. next.done = false;
  4198. return next;
  4199. }
  4200. }
  4201. next.value = undefined;
  4202. next.done = true;
  4203. return next;
  4204. };
  4205. return next.next = next;
  4206. }
  4207. }
  4208. // Return an iterator with no values.
  4209. return { next: doneResult };
  4210. }
  4211. runtime.values = values;
  4212. function doneResult() {
  4213. return { value: undefined, done: true };
  4214. }
  4215. Context.prototype = {
  4216. constructor: Context,
  4217. reset: function(skipTempReset) {
  4218. this.prev = 0;
  4219. this.next = 0;
  4220. // Resetting context._sent for legacy support of Babel's
  4221. // function.sent implementation.
  4222. this.sent = this._sent = undefined;
  4223. this.done = false;
  4224. this.delegate = null;
  4225. this.method = "next";
  4226. this.arg = undefined;
  4227. this.tryEntries.forEach(resetTryEntry);
  4228. if (!skipTempReset) {
  4229. for (var name in this) {
  4230. // Not sure about the optimal order of these conditions:
  4231. if (name.charAt(0) === "t" &&
  4232. hasOwn.call(this, name) &&
  4233. !isNaN(+name.slice(1))) {
  4234. this[name] = undefined;
  4235. }
  4236. }
  4237. }
  4238. },
  4239. stop: function() {
  4240. this.done = true;
  4241. var rootEntry = this.tryEntries[0];
  4242. var rootRecord = rootEntry.completion;
  4243. if (rootRecord.type === "throw") {
  4244. throw rootRecord.arg;
  4245. }
  4246. return this.rval;
  4247. },
  4248. dispatchException: function(exception) {
  4249. if (this.done) {
  4250. throw exception;
  4251. }
  4252. var context = this;
  4253. function handle(loc, caught) {
  4254. record.type = "throw";
  4255. record.arg = exception;
  4256. context.next = loc;
  4257. if (caught) {
  4258. // If the dispatched exception was caught by a catch block,
  4259. // then let that catch block handle the exception normally.
  4260. context.method = "next";
  4261. context.arg = undefined;
  4262. }
  4263. return !! caught;
  4264. }
  4265. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  4266. var entry = this.tryEntries[i];
  4267. var record = entry.completion;
  4268. if (entry.tryLoc === "root") {
  4269. // Exception thrown outside of any try block that could handle
  4270. // it, so set the completion value of the entire function to
  4271. // throw the exception.
  4272. return handle("end");
  4273. }
  4274. if (entry.tryLoc <= this.prev) {
  4275. var hasCatch = hasOwn.call(entry, "catchLoc");
  4276. var hasFinally = hasOwn.call(entry, "finallyLoc");
  4277. if (hasCatch && hasFinally) {
  4278. if (this.prev < entry.catchLoc) {
  4279. return handle(entry.catchLoc, true);
  4280. } else if (this.prev < entry.finallyLoc) {
  4281. return handle(entry.finallyLoc);
  4282. }
  4283. } else if (hasCatch) {
  4284. if (this.prev < entry.catchLoc) {
  4285. return handle(entry.catchLoc, true);
  4286. }
  4287. } else if (hasFinally) {
  4288. if (this.prev < entry.finallyLoc) {
  4289. return handle(entry.finallyLoc);
  4290. }
  4291. } else {
  4292. throw new Error("try statement without catch or finally");
  4293. }
  4294. }
  4295. }
  4296. },
  4297. abrupt: function(type, arg) {
  4298. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  4299. var entry = this.tryEntries[i];
  4300. if (entry.tryLoc <= this.prev &&
  4301. hasOwn.call(entry, "finallyLoc") &&
  4302. this.prev < entry.finallyLoc) {
  4303. var finallyEntry = entry;
  4304. break;
  4305. }
  4306. }
  4307. if (finallyEntry &&
  4308. (type === "break" ||
  4309. type === "continue") &&
  4310. finallyEntry.tryLoc <= arg &&
  4311. arg <= finallyEntry.finallyLoc) {
  4312. // Ignore the finally entry if control is not jumping to a
  4313. // location outside the try/catch block.
  4314. finallyEntry = null;
  4315. }
  4316. var record = finallyEntry ? finallyEntry.completion : {};
  4317. record.type = type;
  4318. record.arg = arg;
  4319. if (finallyEntry) {
  4320. this.method = "next";
  4321. this.next = finallyEntry.finallyLoc;
  4322. return ContinueSentinel;
  4323. }
  4324. return this.complete(record);
  4325. },
  4326. complete: function(record, afterLoc) {
  4327. if (record.type === "throw") {
  4328. throw record.arg;
  4329. }
  4330. if (record.type === "break" ||
  4331. record.type === "continue") {
  4332. this.next = record.arg;
  4333. } else if (record.type === "return") {
  4334. this.rval = this.arg = record.arg;
  4335. this.method = "return";
  4336. this.next = "end";
  4337. } else if (record.type === "normal" && afterLoc) {
  4338. this.next = afterLoc;
  4339. }
  4340. return ContinueSentinel;
  4341. },
  4342. finish: function(finallyLoc) {
  4343. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  4344. var entry = this.tryEntries[i];
  4345. if (entry.finallyLoc === finallyLoc) {
  4346. this.complete(entry.completion, entry.afterLoc);
  4347. resetTryEntry(entry);
  4348. return ContinueSentinel;
  4349. }
  4350. }
  4351. },
  4352. "catch": function(tryLoc) {
  4353. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  4354. var entry = this.tryEntries[i];
  4355. if (entry.tryLoc === tryLoc) {
  4356. var record = entry.completion;
  4357. if (record.type === "throw") {
  4358. var thrown = record.arg;
  4359. resetTryEntry(entry);
  4360. }
  4361. return thrown;
  4362. }
  4363. }
  4364. // The context.catch method must only be called with a location
  4365. // argument that corresponds to a known catch block.
  4366. throw new Error("illegal catch attempt");
  4367. },
  4368. delegateYield: function(iterable, resultName, nextLoc) {
  4369. this.delegate = {
  4370. iterator: values(iterable),
  4371. resultName: resultName,
  4372. nextLoc: nextLoc
  4373. };
  4374. if (this.method === "next") {
  4375. // Deliberately forget the last sent value so that we don't
  4376. // accidentally pass it on to the delegate.
  4377. this.arg = undefined;
  4378. }
  4379. return ContinueSentinel;
  4380. }
  4381. };
  4382. })(
  4383. // In sloppy mode, unbound `this` refers to the global object, fallback to
  4384. // Function constructor if we're in global strict mode. That is sadly a form
  4385. // of indirect eval which violates Content Security Policy.
  4386. (function() {
  4387. return this || (typeof self === "object" && self);
  4388. })() || Function("return this")()
  4389. );
  4390. /***/ }),
  4391. /***/ 23:
  4392. /*!**************************************************************************!*\
  4393. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/timeFormat.js ***!
  4394. \**************************************************************************/
  4395. /*! no static exports found */
  4396. /***/ (function(module, exports, __webpack_require__) {
  4397. "use strict";
  4398. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
  4399. // 所以这里做一个兼容polyfill的兼容处理
  4400. if (!String.prototype.padStart) {
  4401. // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
  4402. String.prototype.padStart = function (maxLength) {var fillString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
  4403. if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError(
  4404. 'fillString must be String');
  4405. var str = this;
  4406. // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
  4407. if (str.length >= maxLength) return String(str);
  4408. var fillLength = maxLength - str.length,
  4409. times = Math.ceil(fillLength / fillString.length);
  4410. while (times >>= 1) {
  4411. fillString += fillString;
  4412. if (times === 1) {
  4413. fillString += fillString;
  4414. }
  4415. }
  4416. return fillString.slice(0, fillLength) + str;
  4417. };
  4418. }
  4419. // 其他更多是格式化有如下:
  4420. // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
  4421. function timeFormat() {var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;var fmt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  4422. // 如果为null,则格式化当前时间
  4423. if (!dateTime) dateTime = Number(new Date());
  4424. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  4425. if (dateTime.toString().length == 10) dateTime *= 1000;
  4426. var date = new Date(dateTime);
  4427. var ret;
  4428. var opt = {
  4429. "y+": date.getFullYear().toString(), // 年
  4430. "m+": (date.getMonth() + 1).toString(), // 月
  4431. "d+": date.getDate().toString(), // 日
  4432. "h+": date.getHours().toString(), // 时
  4433. "M+": date.getMinutes().toString(), // 分
  4434. "s+": date.getSeconds().toString() // 秒
  4435. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  4436. };
  4437. for (var k in opt) {
  4438. ret = new RegExp("(" + k + ")").exec(fmt);
  4439. if (ret) {
  4440. fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
  4441. };
  4442. };
  4443. return fmt;
  4444. }var _default =
  4445. timeFormat;exports.default = _default;
  4446. /***/ }),
  4447. /***/ 236:
  4448. /*!*******************************************************************!*\
  4449. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/util/emitter.js ***!
  4450. \*******************************************************************/
  4451. /*! no static exports found */
  4452. /***/ (function(module, exports, __webpack_require__) {
  4453. "use strict";
  4454. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  4455. * 递归使用 call 方式this指向
  4456. * @param componentName // 需要找的组件的名称
  4457. * @param eventName // 事件名称
  4458. * @param params // 需要传递的参数
  4459. */
  4460. function _broadcast(componentName, eventName, params) {
  4461. // 循环子节点找到名称一样的子节点 否则 递归 当前子节点
  4462. var $children;
  4463. $children = this.$children;
  4464. $children.map(function (child) {
  4465. if (componentName === child.$options.name) {
  4466. child.$emit.apply(child, [eventName].concat(params));
  4467. } else {
  4468. _broadcast.apply(child, [componentName, eventName].concat(params));
  4469. }
  4470. });
  4471. }var _default =
  4472. {
  4473. methods: {
  4474. /**
  4475. * 派发 (向上查找) (一个)
  4476. * @param componentName // 需要找的组件的名称
  4477. * @param eventName // 事件名称
  4478. * @param params // 需要传递的参数
  4479. */
  4480. dispatch: function dispatch(componentName, eventName, params) {
  4481. var parent = this.$parent || this.$root; //$parent 找到最近的父节点 $root 根节点
  4482. var name = parent.$options.name; // 获取当前组件实例的name
  4483. // 如果当前有节点 && 当前没名称 且 当前名称等于需要传进来的名称的时候就去查找当前的节点
  4484. // 循环出当前名称的一样的组件实例
  4485. while (parent && (!name || name !== componentName)) {
  4486. parent = parent.$parent;
  4487. if (parent) {
  4488. name = parent.$options.name;
  4489. }
  4490. }
  4491. // 有节点表示当前找到了name一样的实例
  4492. if (parent) {
  4493. parent.$emit.apply(parent, [eventName].concat(params));
  4494. }
  4495. },
  4496. /**
  4497. * 广播 (向下查找) (广播多个)
  4498. * @param componentName // 需要找的组件的名称
  4499. * @param eventName // 事件名称
  4500. * @param params // 需要传递的参数
  4501. */
  4502. broadcast: function broadcast(componentName, eventName, params) {
  4503. _broadcast.call(this, componentName, eventName, params);
  4504. } } };exports.default = _default;
  4505. /***/ }),
  4506. /***/ 237:
  4507. /*!***************************************************************************!*\
  4508. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/util/async-validator.js ***!
  4509. \***************************************************************************/
  4510. /*! no static exports found */
  4511. /***/ (function(module, exports, __webpack_require__) {
  4512. "use strict";
  4513. /* WEBPACK VAR INJECTION */(function(process) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function _extends() {
  4514. _extends = Object.assign || function (target) {
  4515. for (var i = 1; i < arguments.length; i++) {
  4516. var source = arguments[i];
  4517. for (var key in source) {
  4518. if (Object.prototype.hasOwnProperty.call(source, key)) {
  4519. target[key] = source[key];
  4520. }
  4521. }
  4522. }
  4523. return target;
  4524. };
  4525. return _extends.apply(this, arguments);
  4526. }
  4527. /* eslint no-console:0 */
  4528. var formatRegExp = /%[sdj%]/g;
  4529. var warning = function warning() {}; // don't print warning message when in production env or node runtime
  4530. if (typeof process !== 'undefined' && Object({"VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}) && "development" !== 'production' && typeof window !==
  4531. 'undefined' && typeof document !== 'undefined') {
  4532. warning = function warning(type, errors) {
  4533. if (typeof console !== 'undefined' && console.warn) {
  4534. if (errors.every(function (e) {
  4535. return typeof e === 'string';
  4536. })) {
  4537. console.warn(type, errors);
  4538. }
  4539. }
  4540. };
  4541. }
  4542. function convertFieldsError(errors) {
  4543. if (!errors || !errors.length) return null;
  4544. var fields = {};
  4545. errors.forEach(function (error) {
  4546. var field = error.field;
  4547. fields[field] = fields[field] || [];
  4548. fields[field].push(error);
  4549. });
  4550. return fields;
  4551. }
  4552. function format() {
  4553. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  4554. args[_key] = arguments[_key];
  4555. }
  4556. var i = 1;
  4557. var f = args[0];
  4558. var len = args.length;
  4559. if (typeof f === 'function') {
  4560. return f.apply(null, args.slice(1));
  4561. }
  4562. if (typeof f === 'string') {
  4563. var str = String(f).replace(formatRegExp, function (x) {
  4564. if (x === '%%') {
  4565. return '%';
  4566. }
  4567. if (i >= len) {
  4568. return x;
  4569. }
  4570. switch (x) {
  4571. case '%s':
  4572. return String(args[i++]);
  4573. case '%d':
  4574. return Number(args[i++]);
  4575. case '%j':
  4576. try {
  4577. return JSON.stringify(args[i++]);
  4578. } catch (_) {
  4579. return '[Circular]';
  4580. }
  4581. break;
  4582. default:
  4583. return x;}
  4584. });
  4585. for (var arg = args[i]; i < len; arg = args[++i]) {
  4586. str += " " + arg;
  4587. }
  4588. return str;
  4589. }
  4590. return f;
  4591. }
  4592. function isNativeStringType(type) {
  4593. return type === 'string' || type === 'url' || type === 'hex' || type === 'email' || type === 'pattern';
  4594. }
  4595. function isEmptyValue(value, type) {
  4596. if (value === undefined || value === null) {
  4597. return true;
  4598. }
  4599. if (type === 'array' && Array.isArray(value) && !value.length) {
  4600. return true;
  4601. }
  4602. if (isNativeStringType(type) && typeof value === 'string' && !value) {
  4603. return true;
  4604. }
  4605. return false;
  4606. }
  4607. function asyncParallelArray(arr, func, callback) {
  4608. var results = [];
  4609. var total = 0;
  4610. var arrLength = arr.length;
  4611. function count(errors) {
  4612. results.push.apply(results, errors);
  4613. total++;
  4614. if (total === arrLength) {
  4615. callback(results);
  4616. }
  4617. }
  4618. arr.forEach(function (a) {
  4619. func(a, count);
  4620. });
  4621. }
  4622. function asyncSerialArray(arr, func, callback) {
  4623. var index = 0;
  4624. var arrLength = arr.length;
  4625. function next(errors) {
  4626. if (errors && errors.length) {
  4627. callback(errors);
  4628. return;
  4629. }
  4630. var original = index;
  4631. index = index + 1;
  4632. if (original < arrLength) {
  4633. func(arr[original], next);
  4634. } else {
  4635. callback([]);
  4636. }
  4637. }
  4638. next([]);
  4639. }
  4640. function flattenObjArr(objArr) {
  4641. var ret = [];
  4642. Object.keys(objArr).forEach(function (k) {
  4643. ret.push.apply(ret, objArr[k]);
  4644. });
  4645. return ret;
  4646. }
  4647. function asyncMap(objArr, option, func, callback) {
  4648. if (option.first) {
  4649. var _pending = new Promise(function (resolve, reject) {
  4650. var next = function next(errors) {
  4651. callback(errors);
  4652. return errors.length ? reject({
  4653. errors: errors,
  4654. fields: convertFieldsError(errors) }) :
  4655. resolve();
  4656. };
  4657. var flattenArr = flattenObjArr(objArr);
  4658. asyncSerialArray(flattenArr, func, next);
  4659. });
  4660. _pending["catch"](function (e) {
  4661. return e;
  4662. });
  4663. return _pending;
  4664. }
  4665. var firstFields = option.firstFields || [];
  4666. if (firstFields === true) {
  4667. firstFields = Object.keys(objArr);
  4668. }
  4669. var objArrKeys = Object.keys(objArr);
  4670. var objArrLength = objArrKeys.length;
  4671. var total = 0;
  4672. var results = [];
  4673. var pending = new Promise(function (resolve, reject) {
  4674. var next = function next(errors) {
  4675. results.push.apply(results, errors);
  4676. total++;
  4677. if (total === objArrLength) {
  4678. callback(results);
  4679. return results.length ? reject({
  4680. errors: results,
  4681. fields: convertFieldsError(results) }) :
  4682. resolve();
  4683. }
  4684. };
  4685. if (!objArrKeys.length) {
  4686. callback(results);
  4687. resolve();
  4688. }
  4689. objArrKeys.forEach(function (key) {
  4690. var arr = objArr[key];
  4691. if (firstFields.indexOf(key) !== -1) {
  4692. asyncSerialArray(arr, func, next);
  4693. } else {
  4694. asyncParallelArray(arr, func, next);
  4695. }
  4696. });
  4697. });
  4698. pending["catch"](function (e) {
  4699. return e;
  4700. });
  4701. return pending;
  4702. }
  4703. function complementError(rule) {
  4704. return function (oe) {
  4705. if (oe && oe.message) {
  4706. oe.field = oe.field || rule.fullField;
  4707. return oe;
  4708. }
  4709. return {
  4710. message: typeof oe === 'function' ? oe() : oe,
  4711. field: oe.field || rule.fullField };
  4712. };
  4713. }
  4714. function deepMerge(target, source) {
  4715. if (source) {
  4716. for (var s in source) {
  4717. if (source.hasOwnProperty(s)) {
  4718. var value = source[s];
  4719. if (typeof value === 'object' && typeof target[s] === 'object') {
  4720. target[s] = _extends({}, target[s], {}, value);
  4721. } else {
  4722. target[s] = value;
  4723. }
  4724. }
  4725. }
  4726. }
  4727. return target;
  4728. }
  4729. /**
  4730. * Rule for validating required fields.
  4731. *
  4732. * @param rule The validation rule.
  4733. * @param value The value of the field on the source object.
  4734. * @param source The source object being validated.
  4735. * @param errors An array of errors that this rule may add
  4736. * validation errors to.
  4737. * @param options The validation options.
  4738. * @param options.messages The validation messages.
  4739. */
  4740. function required(rule, value, source, errors, options, type) {
  4741. if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) {
  4742. errors.push(format(options.messages.required, rule.fullField));
  4743. }
  4744. }
  4745. /**
  4746. * Rule for validating whitespace.
  4747. *
  4748. * @param rule The validation rule.
  4749. * @param value The value of the field on the source object.
  4750. * @param source The source object being validated.
  4751. * @param errors An array of errors that this rule may add
  4752. * validation errors to.
  4753. * @param options The validation options.
  4754. * @param options.messages The validation messages.
  4755. */
  4756. function whitespace(rule, value, source, errors, options) {
  4757. if (/^\s+$/.test(value) || value === '') {
  4758. errors.push(format(options.messages.whitespace, rule.fullField));
  4759. }
  4760. }
  4761. /* eslint max-len:0 */
  4762. var pattern = {
  4763. // http://emailregex.com/
  4764. 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,}))$/,
  4765. url: new RegExp(
  4766. "^(?!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]*)?$",
  4767. 'i'),
  4768. hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i };
  4769. var types = {
  4770. integer: function integer(value) {
  4771. return types.number(value) && parseInt(value, 10) === value;
  4772. },
  4773. "float": function float(value) {
  4774. return types.number(value) && !types.integer(value);
  4775. },
  4776. array: function array(value) {
  4777. return Array.isArray(value);
  4778. },
  4779. regexp: function regexp(value) {
  4780. if (value instanceof RegExp) {
  4781. return true;
  4782. }
  4783. try {
  4784. return !!new RegExp(value);
  4785. } catch (e) {
  4786. return false;
  4787. }
  4788. },
  4789. date: function date(value) {
  4790. return typeof value.getTime === 'function' && typeof value.getMonth === 'function' && typeof value.getYear ===
  4791. 'function';
  4792. },
  4793. number: function number(value) {
  4794. if (isNaN(value)) {
  4795. return false;
  4796. }
  4797. // 修改源码,将字符串数值先转为数值
  4798. return typeof +value === 'number';
  4799. },
  4800. object: function object(value) {
  4801. return typeof value === 'object' && !types.array(value);
  4802. },
  4803. method: function method(value) {
  4804. return typeof value === 'function';
  4805. },
  4806. email: function email(value) {
  4807. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  4808. },
  4809. url: function url(value) {
  4810. return typeof value === 'string' && !!value.match(pattern.url);
  4811. },
  4812. hex: function hex(value) {
  4813. return typeof value === 'string' && !!value.match(pattern.hex);
  4814. } };
  4815. /**
  4816. * Rule for validating the type of a value.
  4817. *
  4818. * @param rule The validation rule.
  4819. * @param value The value of the field on the source object.
  4820. * @param source The source object being validated.
  4821. * @param errors An array of errors that this rule may add
  4822. * validation errors to.
  4823. * @param options The validation options.
  4824. * @param options.messages The validation messages.
  4825. */
  4826. function type(rule, value, source, errors, options) {
  4827. if (rule.required && value === undefined) {
  4828. required(rule, value, source, errors, options);
  4829. return;
  4830. }
  4831. var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];
  4832. var ruleType = rule.type;
  4833. if (custom.indexOf(ruleType) > -1) {
  4834. if (!types[ruleType](value)) {
  4835. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  4836. } // straight typeof check
  4837. } else if (ruleType && typeof value !== rule.type) {
  4838. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  4839. }
  4840. }
  4841. /**
  4842. * Rule for validating minimum and maximum allowed values.
  4843. *
  4844. * @param rule The validation rule.
  4845. * @param value The value of the field on the source object.
  4846. * @param source The source object being validated.
  4847. * @param errors An array of errors that this rule may add
  4848. * validation errors to.
  4849. * @param options The validation options.
  4850. * @param options.messages The validation messages.
  4851. */
  4852. function range(rule, value, source, errors, options) {
  4853. var len = typeof rule.len === 'number';
  4854. var min = typeof rule.min === 'number';
  4855. var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)
  4856. var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
  4857. var val = value;
  4858. var key = null;
  4859. var num = typeof value === 'number';
  4860. var str = typeof value === 'string';
  4861. var arr = Array.isArray(value);
  4862. if (num) {
  4863. key = 'number';
  4864. } else if (str) {
  4865. key = 'string';
  4866. } else if (arr) {
  4867. key = 'array';
  4868. } // if the value is not of a supported type for range validation
  4869. // the validation rule rule should use the
  4870. // type property to also test for a particular type
  4871. if (!key) {
  4872. return false;
  4873. }
  4874. if (arr) {
  4875. val = value.length;
  4876. }
  4877. if (str) {
  4878. // 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3
  4879. val = value.replace(spRegexp, '_').length;
  4880. }
  4881. if (len) {
  4882. if (val !== rule.len) {
  4883. errors.push(format(options.messages[key].len, rule.fullField, rule.len));
  4884. }
  4885. } else if (min && !max && val < rule.min) {
  4886. errors.push(format(options.messages[key].min, rule.fullField, rule.min));
  4887. } else if (max && !min && val > rule.max) {
  4888. errors.push(format(options.messages[key].max, rule.fullField, rule.max));
  4889. } else if (min && max && (val < rule.min || val > rule.max)) {
  4890. errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
  4891. }
  4892. }
  4893. var ENUM = 'enum';
  4894. /**
  4895. * Rule for validating a value exists in an enumerable list.
  4896. *
  4897. * @param rule The validation rule.
  4898. * @param value The value of the field on the source object.
  4899. * @param source The source object being validated.
  4900. * @param errors An array of errors that this rule may add
  4901. * validation errors to.
  4902. * @param options The validation options.
  4903. * @param options.messages The validation messages.
  4904. */
  4905. function enumerable(rule, value, source, errors, options) {
  4906. rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
  4907. if (rule[ENUM].indexOf(value) === -1) {
  4908. errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));
  4909. }
  4910. }
  4911. /**
  4912. * Rule for validating a regular expression pattern.
  4913. *
  4914. * @param rule The validation rule.
  4915. * @param value The value of the field on the source object.
  4916. * @param source The source object being validated.
  4917. * @param errors An array of errors that this rule may add
  4918. * validation errors to.
  4919. * @param options The validation options.
  4920. * @param options.messages The validation messages.
  4921. */
  4922. function pattern$1(rule, value, source, errors, options) {
  4923. if (rule.pattern) {
  4924. if (rule.pattern instanceof RegExp) {
  4925. // if a RegExp instance is passed, reset `lastIndex` in case its `global`
  4926. // flag is accidentally set to `true`, which in a validation scenario
  4927. // is not necessary and the result might be misleading
  4928. rule.pattern.lastIndex = 0;
  4929. if (!rule.pattern.test(value)) {
  4930. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  4931. }
  4932. } else if (typeof rule.pattern === 'string') {
  4933. var _pattern = new RegExp(rule.pattern);
  4934. if (!_pattern.test(value)) {
  4935. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  4936. }
  4937. }
  4938. }
  4939. }
  4940. var rules = {
  4941. required: required,
  4942. whitespace: whitespace,
  4943. type: type,
  4944. range: range,
  4945. "enum": enumerable,
  4946. pattern: pattern$1 };
  4947. /**
  4948. * Performs validation for string types.
  4949. *
  4950. * @param rule The validation rule.
  4951. * @param value The value of the field on the source object.
  4952. * @param callback The callback function.
  4953. * @param source The source object being validated.
  4954. * @param options The validation options.
  4955. * @param options.messages The validation messages.
  4956. */
  4957. function string(rule, value, callback, source, options) {
  4958. var errors = [];
  4959. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  4960. if (validate) {
  4961. if (isEmptyValue(value, 'string') && !rule.required) {
  4962. return callback();
  4963. }
  4964. rules.required(rule, value, source, errors, options, 'string');
  4965. if (!isEmptyValue(value, 'string')) {
  4966. rules.type(rule, value, source, errors, options);
  4967. rules.range(rule, value, source, errors, options);
  4968. rules.pattern(rule, value, source, errors, options);
  4969. if (rule.whitespace === true) {
  4970. rules.whitespace(rule, value, source, errors, options);
  4971. }
  4972. }
  4973. }
  4974. callback(errors);
  4975. }
  4976. /**
  4977. * Validates a function.
  4978. *
  4979. * @param rule The validation rule.
  4980. * @param value The value of the field on the source object.
  4981. * @param callback The callback function.
  4982. * @param source The source object being validated.
  4983. * @param options The validation options.
  4984. * @param options.messages The validation messages.
  4985. */
  4986. function method(rule, value, callback, source, options) {
  4987. var errors = [];
  4988. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  4989. if (validate) {
  4990. if (isEmptyValue(value) && !rule.required) {
  4991. return callback();
  4992. }
  4993. rules.required(rule, value, source, errors, options);
  4994. if (value !== undefined) {
  4995. rules.type(rule, value, source, errors, options);
  4996. }
  4997. }
  4998. callback(errors);
  4999. }
  5000. /**
  5001. * Validates a number.
  5002. *
  5003. * @param rule The validation rule.
  5004. * @param value The value of the field on the source object.
  5005. * @param callback The callback function.
  5006. * @param source The source object being validated.
  5007. * @param options The validation options.
  5008. * @param options.messages The validation messages.
  5009. */
  5010. function number(rule, value, callback, source, options) {
  5011. var errors = [];
  5012. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5013. if (validate) {
  5014. if (value === '') {
  5015. value = undefined;
  5016. }
  5017. if (isEmptyValue(value) && !rule.required) {
  5018. return callback();
  5019. }
  5020. rules.required(rule, value, source, errors, options);
  5021. if (value !== undefined) {
  5022. rules.type(rule, value, source, errors, options);
  5023. rules.range(rule, value, source, errors, options);
  5024. }
  5025. }
  5026. callback(errors);
  5027. }
  5028. /**
  5029. * Validates a boolean.
  5030. *
  5031. * @param rule The validation rule.
  5032. * @param value The value of the field on the source object.
  5033. * @param callback The callback function.
  5034. * @param source The source object being validated.
  5035. * @param options The validation options.
  5036. * @param options.messages The validation messages.
  5037. */
  5038. function _boolean(rule, value, callback, source, options) {
  5039. var errors = [];
  5040. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5041. if (validate) {
  5042. if (isEmptyValue(value) && !rule.required) {
  5043. return callback();
  5044. }
  5045. rules.required(rule, value, source, errors, options);
  5046. if (value !== undefined) {
  5047. rules.type(rule, value, source, errors, options);
  5048. }
  5049. }
  5050. callback(errors);
  5051. }
  5052. /**
  5053. * Validates the regular expression type.
  5054. *
  5055. * @param rule The validation rule.
  5056. * @param value The value of the field on the source object.
  5057. * @param callback The callback function.
  5058. * @param source The source object being validated.
  5059. * @param options The validation options.
  5060. * @param options.messages The validation messages.
  5061. */
  5062. function regexp(rule, value, callback, source, options) {
  5063. var errors = [];
  5064. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5065. if (validate) {
  5066. if (isEmptyValue(value) && !rule.required) {
  5067. return callback();
  5068. }
  5069. rules.required(rule, value, source, errors, options);
  5070. if (!isEmptyValue(value)) {
  5071. rules.type(rule, value, source, errors, options);
  5072. }
  5073. }
  5074. callback(errors);
  5075. }
  5076. /**
  5077. * Validates a number is an integer.
  5078. *
  5079. * @param rule The validation rule.
  5080. * @param value The value of the field on the source object.
  5081. * @param callback The callback function.
  5082. * @param source The source object being validated.
  5083. * @param options The validation options.
  5084. * @param options.messages The validation messages.
  5085. */
  5086. function integer(rule, value, callback, source, options) {
  5087. var errors = [];
  5088. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5089. if (validate) {
  5090. if (isEmptyValue(value) && !rule.required) {
  5091. return callback();
  5092. }
  5093. rules.required(rule, value, source, errors, options);
  5094. if (value !== undefined) {
  5095. rules.type(rule, value, source, errors, options);
  5096. rules.range(rule, value, source, errors, options);
  5097. }
  5098. }
  5099. callback(errors);
  5100. }
  5101. /**
  5102. * Validates a number is a floating point number.
  5103. *
  5104. * @param rule The validation rule.
  5105. * @param value The value of the field on the source object.
  5106. * @param callback The callback function.
  5107. * @param source The source object being validated.
  5108. * @param options The validation options.
  5109. * @param options.messages The validation messages.
  5110. */
  5111. function floatFn(rule, value, callback, source, options) {
  5112. var errors = [];
  5113. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5114. if (validate) {
  5115. if (isEmptyValue(value) && !rule.required) {
  5116. return callback();
  5117. }
  5118. rules.required(rule, value, source, errors, options);
  5119. if (value !== undefined) {
  5120. rules.type(rule, value, source, errors, options);
  5121. rules.range(rule, value, source, errors, options);
  5122. }
  5123. }
  5124. callback(errors);
  5125. }
  5126. /**
  5127. * Validates an array.
  5128. *
  5129. * @param rule The validation rule.
  5130. * @param value The value of the field on the source object.
  5131. * @param callback The callback function.
  5132. * @param source The source object being validated.
  5133. * @param options The validation options.
  5134. * @param options.messages The validation messages.
  5135. */
  5136. function array(rule, value, callback, source, options) {
  5137. var errors = [];
  5138. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5139. if (validate) {
  5140. if (isEmptyValue(value, 'array') && !rule.required) {
  5141. return callback();
  5142. }
  5143. rules.required(rule, value, source, errors, options, 'array');
  5144. if (!isEmptyValue(value, 'array')) {
  5145. rules.type(rule, value, source, errors, options);
  5146. rules.range(rule, value, source, errors, options);
  5147. }
  5148. }
  5149. callback(errors);
  5150. }
  5151. /**
  5152. * Validates an object.
  5153. *
  5154. * @param rule The validation rule.
  5155. * @param value The value of the field on the source object.
  5156. * @param callback The callback function.
  5157. * @param source The source object being validated.
  5158. * @param options The validation options.
  5159. * @param options.messages The validation messages.
  5160. */
  5161. function object(rule, value, callback, source, options) {
  5162. var errors = [];
  5163. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5164. if (validate) {
  5165. if (isEmptyValue(value) && !rule.required) {
  5166. return callback();
  5167. }
  5168. rules.required(rule, value, source, errors, options);
  5169. if (value !== undefined) {
  5170. rules.type(rule, value, source, errors, options);
  5171. }
  5172. }
  5173. callback(errors);
  5174. }
  5175. var ENUM$1 = 'enum';
  5176. /**
  5177. * Validates an enumerable list.
  5178. *
  5179. * @param rule The validation rule.
  5180. * @param value The value of the field on the source object.
  5181. * @param callback The callback function.
  5182. * @param source The source object being validated.
  5183. * @param options The validation options.
  5184. * @param options.messages The validation messages.
  5185. */
  5186. function enumerable$1(rule, value, callback, source, options) {
  5187. var errors = [];
  5188. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5189. if (validate) {
  5190. if (isEmptyValue(value) && !rule.required) {
  5191. return callback();
  5192. }
  5193. rules.required(rule, value, source, errors, options);
  5194. if (value !== undefined) {
  5195. rules[ENUM$1](rule, value, source, errors, options);
  5196. }
  5197. }
  5198. callback(errors);
  5199. }
  5200. /**
  5201. * Validates a regular expression pattern.
  5202. *
  5203. * Performs validation when a rule only contains
  5204. * a pattern property but is not declared as a string type.
  5205. *
  5206. * @param rule The validation rule.
  5207. * @param value The value of the field on the source object.
  5208. * @param callback The callback function.
  5209. * @param source The source object being validated.
  5210. * @param options The validation options.
  5211. * @param options.messages The validation messages.
  5212. */
  5213. function pattern$2(rule, value, callback, source, options) {
  5214. var errors = [];
  5215. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5216. if (validate) {
  5217. if (isEmptyValue(value, 'string') && !rule.required) {
  5218. return callback();
  5219. }
  5220. rules.required(rule, value, source, errors, options);
  5221. if (!isEmptyValue(value, 'string')) {
  5222. rules.pattern(rule, value, source, errors, options);
  5223. }
  5224. }
  5225. callback(errors);
  5226. }
  5227. function date(rule, value, callback, source, options) {
  5228. var errors = [];
  5229. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5230. if (validate) {
  5231. if (isEmptyValue(value) && !rule.required) {
  5232. return callback();
  5233. }
  5234. rules.required(rule, value, source, errors, options);
  5235. if (!isEmptyValue(value)) {
  5236. var dateObject;
  5237. if (typeof value === 'number') {
  5238. dateObject = new Date(value);
  5239. } else {
  5240. dateObject = value;
  5241. }
  5242. rules.type(rule, dateObject, source, errors, options);
  5243. if (dateObject) {
  5244. rules.range(rule, dateObject.getTime(), source, errors, options);
  5245. }
  5246. }
  5247. }
  5248. callback(errors);
  5249. }
  5250. function required$1(rule, value, callback, source, options) {
  5251. var errors = [];
  5252. var type = Array.isArray(value) ? 'array' : typeof value;
  5253. rules.required(rule, value, source, errors, options, type);
  5254. callback(errors);
  5255. }
  5256. function type$1(rule, value, callback, source, options) {
  5257. var ruleType = rule.type;
  5258. var errors = [];
  5259. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5260. if (validate) {
  5261. if (isEmptyValue(value, ruleType) && !rule.required) {
  5262. return callback();
  5263. }
  5264. rules.required(rule, value, source, errors, options, ruleType);
  5265. if (!isEmptyValue(value, ruleType)) {
  5266. rules.type(rule, value, source, errors, options);
  5267. }
  5268. }
  5269. callback(errors);
  5270. }
  5271. /**
  5272. * Performs validation for any type.
  5273. *
  5274. * @param rule The validation rule.
  5275. * @param value The value of the field on the source object.
  5276. * @param callback The callback function.
  5277. * @param source The source object being validated.
  5278. * @param options The validation options.
  5279. * @param options.messages The validation messages.
  5280. */
  5281. function any(rule, value, callback, source, options) {
  5282. var errors = [];
  5283. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5284. if (validate) {
  5285. if (isEmptyValue(value) && !rule.required) {
  5286. return callback();
  5287. }
  5288. rules.required(rule, value, source, errors, options);
  5289. }
  5290. callback(errors);
  5291. }
  5292. var validators = {
  5293. string: string,
  5294. method: method,
  5295. number: number,
  5296. "boolean": _boolean,
  5297. regexp: regexp,
  5298. integer: integer,
  5299. "float": floatFn,
  5300. array: array,
  5301. object: object,
  5302. "enum": enumerable$1,
  5303. pattern: pattern$2,
  5304. date: date,
  5305. url: type$1,
  5306. hex: type$1,
  5307. email: type$1,
  5308. required: required$1,
  5309. any: any };
  5310. function newMessages() {
  5311. return {
  5312. "default": 'Validation error on field %s',
  5313. required: '%s is required',
  5314. "enum": '%s must be one of %s',
  5315. whitespace: '%s cannot be empty',
  5316. date: {
  5317. format: '%s date %s is invalid for format %s',
  5318. parse: '%s date could not be parsed, %s is invalid ',
  5319. invalid: '%s date %s is invalid' },
  5320. types: {
  5321. string: '%s is not a %s',
  5322. method: '%s is not a %s (function)',
  5323. array: '%s is not an %s',
  5324. object: '%s is not an %s',
  5325. number: '%s is not a %s',
  5326. date: '%s is not a %s',
  5327. "boolean": '%s is not a %s',
  5328. integer: '%s is not an %s',
  5329. "float": '%s is not a %s',
  5330. regexp: '%s is not a valid %s',
  5331. email: '%s is not a valid %s',
  5332. url: '%s is not a valid %s',
  5333. hex: '%s is not a valid %s' },
  5334. string: {
  5335. len: '%s must be exactly %s characters',
  5336. min: '%s must be at least %s characters',
  5337. max: '%s cannot be longer than %s characters',
  5338. range: '%s must be between %s and %s characters' },
  5339. number: {
  5340. len: '%s must equal %s',
  5341. min: '%s cannot be less than %s',
  5342. max: '%s cannot be greater than %s',
  5343. range: '%s must be between %s and %s' },
  5344. array: {
  5345. len: '%s must be exactly %s in length',
  5346. min: '%s cannot be less than %s in length',
  5347. max: '%s cannot be greater than %s in length',
  5348. range: '%s must be between %s and %s in length' },
  5349. pattern: {
  5350. mismatch: '%s value %s does not match pattern %s' },
  5351. clone: function clone() {
  5352. var cloned = JSON.parse(JSON.stringify(this));
  5353. cloned.clone = this.clone;
  5354. return cloned;
  5355. } };
  5356. }
  5357. var messages = newMessages();
  5358. /**
  5359. * Encapsulates a validation schema.
  5360. *
  5361. * @param descriptor An object declaring validation rules
  5362. * for this schema.
  5363. */
  5364. function Schema(descriptor) {
  5365. this.rules = null;
  5366. this._messages = messages;
  5367. this.define(descriptor);
  5368. }
  5369. Schema.prototype = {
  5370. messages: function messages(_messages) {
  5371. if (_messages) {
  5372. this._messages = deepMerge(newMessages(), _messages);
  5373. }
  5374. return this._messages;
  5375. },
  5376. define: function define(rules) {
  5377. if (!rules) {
  5378. throw new Error('Cannot configure a schema with no rules');
  5379. }
  5380. if (typeof rules !== 'object' || Array.isArray(rules)) {
  5381. throw new Error('Rules must be an object');
  5382. }
  5383. this.rules = {};
  5384. var z;
  5385. var item;
  5386. for (z in rules) {
  5387. if (rules.hasOwnProperty(z)) {
  5388. item = rules[z];
  5389. this.rules[z] = Array.isArray(item) ? item : [item];
  5390. }
  5391. }
  5392. },
  5393. validate: function validate(source_, o, oc) {
  5394. var _this = this;
  5395. if (o === void 0) {
  5396. o = {};
  5397. }
  5398. if (oc === void 0) {
  5399. oc = function oc() {};
  5400. }
  5401. var source = source_;
  5402. var options = o;
  5403. var callback = oc;
  5404. if (typeof options === 'function') {
  5405. callback = options;
  5406. options = {};
  5407. }
  5408. if (!this.rules || Object.keys(this.rules).length === 0) {
  5409. if (callback) {
  5410. callback();
  5411. }
  5412. return Promise.resolve();
  5413. }
  5414. function complete(results) {
  5415. var i;
  5416. var errors = [];
  5417. var fields = {};
  5418. function add(e) {
  5419. if (Array.isArray(e)) {
  5420. var _errors;
  5421. errors = (_errors = errors).concat.apply(_errors, e);
  5422. } else {
  5423. errors.push(e);
  5424. }
  5425. }
  5426. for (i = 0; i < results.length; i++) {
  5427. add(results[i]);
  5428. }
  5429. if (!errors.length) {
  5430. errors = null;
  5431. fields = null;
  5432. } else {
  5433. fields = convertFieldsError(errors);
  5434. }
  5435. callback(errors, fields);
  5436. }
  5437. if (options.messages) {
  5438. var messages$1 = this.messages();
  5439. if (messages$1 === messages) {
  5440. messages$1 = newMessages();
  5441. }
  5442. deepMerge(messages$1, options.messages);
  5443. options.messages = messages$1;
  5444. } else {
  5445. options.messages = this.messages();
  5446. }
  5447. var arr;
  5448. var value;
  5449. var series = {};
  5450. var keys = options.keys || Object.keys(this.rules);
  5451. keys.forEach(function (z) {
  5452. arr = _this.rules[z];
  5453. value = source[z];
  5454. arr.forEach(function (r) {
  5455. var rule = r;
  5456. if (typeof rule.transform === 'function') {
  5457. if (source === source_) {
  5458. source = _extends({}, source);
  5459. }
  5460. value = source[z] = rule.transform(value);
  5461. }
  5462. if (typeof rule === 'function') {
  5463. rule = {
  5464. validator: rule };
  5465. } else {
  5466. rule = _extends({}, rule);
  5467. }
  5468. rule.validator = _this.getValidationMethod(rule);
  5469. rule.field = z;
  5470. rule.fullField = rule.fullField || z;
  5471. rule.type = _this.getType(rule);
  5472. if (!rule.validator) {
  5473. return;
  5474. }
  5475. series[z] = series[z] || [];
  5476. series[z].push({
  5477. rule: rule,
  5478. value: value,
  5479. source: source,
  5480. field: z });
  5481. });
  5482. });
  5483. var errorFields = {};
  5484. return asyncMap(series, options, function (data, doIt) {
  5485. var rule = data.rule;
  5486. var deep = (rule.type === 'object' || rule.type === 'array') && (typeof rule.fields === 'object' || typeof rule.defaultField ===
  5487. 'object');
  5488. deep = deep && (rule.required || !rule.required && data.value);
  5489. rule.field = data.field;
  5490. function addFullfield(key, schema) {
  5491. return _extends({}, schema, {
  5492. fullField: rule.fullField + "." + key });
  5493. }
  5494. function cb(e) {
  5495. if (e === void 0) {
  5496. e = [];
  5497. }
  5498. var errors = e;
  5499. if (!Array.isArray(errors)) {
  5500. errors = [errors];
  5501. }
  5502. if (!options.suppressWarning && errors.length) {
  5503. Schema.warning('async-validator:', errors);
  5504. }
  5505. if (errors.length && rule.message) {
  5506. errors = [].concat(rule.message);
  5507. }
  5508. errors = errors.map(complementError(rule));
  5509. if (options.first && errors.length) {
  5510. errorFields[rule.field] = 1;
  5511. return doIt(errors);
  5512. }
  5513. if (!deep) {
  5514. doIt(errors);
  5515. } else {
  5516. // if rule is required but the target object
  5517. // does not exist fail at the rule level and don't
  5518. // go deeper
  5519. if (rule.required && !data.value) {
  5520. if (rule.message) {
  5521. errors = [].concat(rule.message).map(complementError(rule));
  5522. } else if (options.error) {
  5523. errors = [options.error(rule, format(options.messages.required, rule.field))];
  5524. } else {
  5525. errors = [];
  5526. }
  5527. return doIt(errors);
  5528. }
  5529. var fieldsSchema = {};
  5530. if (rule.defaultField) {
  5531. for (var k in data.value) {
  5532. if (data.value.hasOwnProperty(k)) {
  5533. fieldsSchema[k] = rule.defaultField;
  5534. }
  5535. }
  5536. }
  5537. fieldsSchema = _extends({}, fieldsSchema, {}, data.rule.fields);
  5538. for (var f in fieldsSchema) {
  5539. if (fieldsSchema.hasOwnProperty(f)) {
  5540. var fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]];
  5541. fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f));
  5542. }
  5543. }
  5544. var schema = new Schema(fieldsSchema);
  5545. schema.messages(options.messages);
  5546. if (data.rule.options) {
  5547. data.rule.options.messages = options.messages;
  5548. data.rule.options.error = options.error;
  5549. }
  5550. schema.validate(data.value, data.rule.options || options, function (errs) {
  5551. var finalErrors = [];
  5552. if (errors && errors.length) {
  5553. finalErrors.push.apply(finalErrors, errors);
  5554. }
  5555. if (errs && errs.length) {
  5556. finalErrors.push.apply(finalErrors, errs);
  5557. }
  5558. doIt(finalErrors.length ? finalErrors : null);
  5559. });
  5560. }
  5561. }
  5562. var res;
  5563. if (rule.asyncValidator) {
  5564. res = rule.asyncValidator(rule, data.value, cb, data.source, options);
  5565. } else if (rule.validator) {
  5566. res = rule.validator(rule, data.value, cb, data.source, options);
  5567. if (res === true) {
  5568. cb();
  5569. } else if (res === false) {
  5570. cb(rule.message || rule.field + " fails");
  5571. } else if (res instanceof Array) {
  5572. cb(res);
  5573. } else if (res instanceof Error) {
  5574. cb(res.message);
  5575. }
  5576. }
  5577. if (res && res.then) {
  5578. res.then(function () {
  5579. return cb();
  5580. }, function (e) {
  5581. return cb(e);
  5582. });
  5583. }
  5584. }, function (results) {
  5585. complete(results);
  5586. });
  5587. },
  5588. getType: function getType(rule) {
  5589. if (rule.type === undefined && rule.pattern instanceof RegExp) {
  5590. rule.type = 'pattern';
  5591. }
  5592. if (typeof rule.validator !== 'function' && rule.type && !validators.hasOwnProperty(rule.type)) {
  5593. throw new Error(format('Unknown rule type %s', rule.type));
  5594. }
  5595. return rule.type || 'string';
  5596. },
  5597. getValidationMethod: function getValidationMethod(rule) {
  5598. if (typeof rule.validator === 'function') {
  5599. return rule.validator;
  5600. }
  5601. var keys = Object.keys(rule);
  5602. var messageIndex = keys.indexOf('message');
  5603. if (messageIndex !== -1) {
  5604. keys.splice(messageIndex, 1);
  5605. }
  5606. if (keys.length === 1 && keys[0] === 'required') {
  5607. return validators.required;
  5608. }
  5609. return validators[this.getType(rule)] || false;
  5610. } };
  5611. Schema.register = function register(type, validator) {
  5612. if (typeof validator !== 'function') {
  5613. throw new Error('Cannot register a validator by type, validator is not a function');
  5614. }
  5615. validators[type] = validator;
  5616. };
  5617. Schema.warning = warning;
  5618. Schema.messages = messages;var _default =
  5619. Schema;exports.default = _default;
  5620. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/node-libs-browser/mock/process.js */ 238)))
  5621. /***/ }),
  5622. /***/ 238:
  5623. /*!********************************************************!*\
  5624. !*** ./node_modules/node-libs-browser/mock/process.js ***!
  5625. \********************************************************/
  5626. /*! no static exports found */
  5627. /***/ (function(module, exports, __webpack_require__) {
  5628. exports.nextTick = function nextTick(fn) {
  5629. var args = Array.prototype.slice.call(arguments);
  5630. args.shift();
  5631. setTimeout(function () {
  5632. fn.apply(null, args);
  5633. }, 0);
  5634. };
  5635. exports.platform = exports.arch =
  5636. exports.execPath = exports.title = 'browser';
  5637. exports.pid = 1;
  5638. exports.browser = true;
  5639. exports.env = {};
  5640. exports.argv = [];
  5641. exports.binding = function (name) {
  5642. throw new Error('No such module. (Possibly not yet loaded)')
  5643. };
  5644. (function () {
  5645. var cwd = '/';
  5646. var path;
  5647. exports.cwd = function () { return cwd };
  5648. exports.chdir = function (dir) {
  5649. if (!path) path = __webpack_require__(/*! path */ 239);
  5650. cwd = path.resolve(dir, cwd);
  5651. };
  5652. })();
  5653. exports.exit = exports.kill =
  5654. exports.umask = exports.dlopen =
  5655. exports.uptime = exports.memoryUsage =
  5656. exports.uvCounters = function() {};
  5657. exports.features = {};
  5658. /***/ }),
  5659. /***/ 239:
  5660. /*!***********************************************!*\
  5661. !*** ./node_modules/path-browserify/index.js ***!
  5662. \***********************************************/
  5663. /*! no static exports found */
  5664. /***/ (function(module, exports, __webpack_require__) {
  5665. /* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
  5666. // backported and transplited with Babel, with backwards-compat fixes
  5667. // Copyright Joyent, Inc. and other Node contributors.
  5668. //
  5669. // Permission is hereby granted, free of charge, to any person obtaining a
  5670. // copy of this software and associated documentation files (the
  5671. // "Software"), to deal in the Software without restriction, including
  5672. // without limitation the rights to use, copy, modify, merge, publish,
  5673. // distribute, sublicense, and/or sell copies of the Software, and to permit
  5674. // persons to whom the Software is furnished to do so, subject to the
  5675. // following conditions:
  5676. //
  5677. // The above copyright notice and this permission notice shall be included
  5678. // in all copies or substantial portions of the Software.
  5679. //
  5680. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  5681. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  5682. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  5683. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  5684. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  5685. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  5686. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  5687. // resolves . and .. elements in a path array with directory names there
  5688. // must be no slashes, empty elements, or device names (c:\) in the array
  5689. // (so also no leading and trailing slashes - it does not distinguish
  5690. // relative and absolute paths)
  5691. function normalizeArray(parts, allowAboveRoot) {
  5692. // if the path tries to go above the root, `up` ends up > 0
  5693. var up = 0;
  5694. for (var i = parts.length - 1; i >= 0; i--) {
  5695. var last = parts[i];
  5696. if (last === '.') {
  5697. parts.splice(i, 1);
  5698. } else if (last === '..') {
  5699. parts.splice(i, 1);
  5700. up++;
  5701. } else if (up) {
  5702. parts.splice(i, 1);
  5703. up--;
  5704. }
  5705. }
  5706. // if the path is allowed to go above the root, restore leading ..s
  5707. if (allowAboveRoot) {
  5708. for (; up--; up) {
  5709. parts.unshift('..');
  5710. }
  5711. }
  5712. return parts;
  5713. }
  5714. // path.resolve([from ...], to)
  5715. // posix version
  5716. exports.resolve = function() {
  5717. var resolvedPath = '',
  5718. resolvedAbsolute = false;
  5719. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  5720. var path = (i >= 0) ? arguments[i] : process.cwd();
  5721. // Skip empty and invalid entries
  5722. if (typeof path !== 'string') {
  5723. throw new TypeError('Arguments to path.resolve must be strings');
  5724. } else if (!path) {
  5725. continue;
  5726. }
  5727. resolvedPath = path + '/' + resolvedPath;
  5728. resolvedAbsolute = path.charAt(0) === '/';
  5729. }
  5730. // At this point the path should be resolved to a full absolute path, but
  5731. // handle relative paths to be safe (might happen when process.cwd() fails)
  5732. // Normalize the path
  5733. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  5734. return !!p;
  5735. }), !resolvedAbsolute).join('/');
  5736. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  5737. };
  5738. // path.normalize(path)
  5739. // posix version
  5740. exports.normalize = function(path) {
  5741. var isAbsolute = exports.isAbsolute(path),
  5742. trailingSlash = substr(path, -1) === '/';
  5743. // Normalize the path
  5744. path = normalizeArray(filter(path.split('/'), function(p) {
  5745. return !!p;
  5746. }), !isAbsolute).join('/');
  5747. if (!path && !isAbsolute) {
  5748. path = '.';
  5749. }
  5750. if (path && trailingSlash) {
  5751. path += '/';
  5752. }
  5753. return (isAbsolute ? '/' : '') + path;
  5754. };
  5755. // posix version
  5756. exports.isAbsolute = function(path) {
  5757. return path.charAt(0) === '/';
  5758. };
  5759. // posix version
  5760. exports.join = function() {
  5761. var paths = Array.prototype.slice.call(arguments, 0);
  5762. return exports.normalize(filter(paths, function(p, index) {
  5763. if (typeof p !== 'string') {
  5764. throw new TypeError('Arguments to path.join must be strings');
  5765. }
  5766. return p;
  5767. }).join('/'));
  5768. };
  5769. // path.relative(from, to)
  5770. // posix version
  5771. exports.relative = function(from, to) {
  5772. from = exports.resolve(from).substr(1);
  5773. to = exports.resolve(to).substr(1);
  5774. function trim(arr) {
  5775. var start = 0;
  5776. for (; start < arr.length; start++) {
  5777. if (arr[start] !== '') break;
  5778. }
  5779. var end = arr.length - 1;
  5780. for (; end >= 0; end--) {
  5781. if (arr[end] !== '') break;
  5782. }
  5783. if (start > end) return [];
  5784. return arr.slice(start, end - start + 1);
  5785. }
  5786. var fromParts = trim(from.split('/'));
  5787. var toParts = trim(to.split('/'));
  5788. var length = Math.min(fromParts.length, toParts.length);
  5789. var samePartsLength = length;
  5790. for (var i = 0; i < length; i++) {
  5791. if (fromParts[i] !== toParts[i]) {
  5792. samePartsLength = i;
  5793. break;
  5794. }
  5795. }
  5796. var outputParts = [];
  5797. for (var i = samePartsLength; i < fromParts.length; i++) {
  5798. outputParts.push('..');
  5799. }
  5800. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  5801. return outputParts.join('/');
  5802. };
  5803. exports.sep = '/';
  5804. exports.delimiter = ':';
  5805. exports.dirname = function (path) {
  5806. if (typeof path !== 'string') path = path + '';
  5807. if (path.length === 0) return '.';
  5808. var code = path.charCodeAt(0);
  5809. var hasRoot = code === 47 /*/*/;
  5810. var end = -1;
  5811. var matchedSlash = true;
  5812. for (var i = path.length - 1; i >= 1; --i) {
  5813. code = path.charCodeAt(i);
  5814. if (code === 47 /*/*/) {
  5815. if (!matchedSlash) {
  5816. end = i;
  5817. break;
  5818. }
  5819. } else {
  5820. // We saw the first non-path separator
  5821. matchedSlash = false;
  5822. }
  5823. }
  5824. if (end === -1) return hasRoot ? '/' : '.';
  5825. if (hasRoot && end === 1) {
  5826. // return '//';
  5827. // Backwards-compat fix:
  5828. return '/';
  5829. }
  5830. return path.slice(0, end);
  5831. };
  5832. function basename(path) {
  5833. if (typeof path !== 'string') path = path + '';
  5834. var start = 0;
  5835. var end = -1;
  5836. var matchedSlash = true;
  5837. var i;
  5838. for (i = path.length - 1; i >= 0; --i) {
  5839. if (path.charCodeAt(i) === 47 /*/*/) {
  5840. // If we reached a path separator that was not part of a set of path
  5841. // separators at the end of the string, stop now
  5842. if (!matchedSlash) {
  5843. start = i + 1;
  5844. break;
  5845. }
  5846. } else if (end === -1) {
  5847. // We saw the first non-path separator, mark this as the end of our
  5848. // path component
  5849. matchedSlash = false;
  5850. end = i + 1;
  5851. }
  5852. }
  5853. if (end === -1) return '';
  5854. return path.slice(start, end);
  5855. }
  5856. // Uses a mixed approach for backwards-compatibility, as ext behavior changed
  5857. // in new Node.js versions, so only basename() above is backported here
  5858. exports.basename = function (path, ext) {
  5859. var f = basename(path);
  5860. if (ext && f.substr(-1 * ext.length) === ext) {
  5861. f = f.substr(0, f.length - ext.length);
  5862. }
  5863. return f;
  5864. };
  5865. exports.extname = function (path) {
  5866. if (typeof path !== 'string') path = path + '';
  5867. var startDot = -1;
  5868. var startPart = 0;
  5869. var end = -1;
  5870. var matchedSlash = true;
  5871. // Track the state of characters (if any) we see before our first dot and
  5872. // after any path separator we find
  5873. var preDotState = 0;
  5874. for (var i = path.length - 1; i >= 0; --i) {
  5875. var code = path.charCodeAt(i);
  5876. if (code === 47 /*/*/) {
  5877. // If we reached a path separator that was not part of a set of path
  5878. // separators at the end of the string, stop now
  5879. if (!matchedSlash) {
  5880. startPart = i + 1;
  5881. break;
  5882. }
  5883. continue;
  5884. }
  5885. if (end === -1) {
  5886. // We saw the first non-path separator, mark this as the end of our
  5887. // extension
  5888. matchedSlash = false;
  5889. end = i + 1;
  5890. }
  5891. if (code === 46 /*.*/) {
  5892. // If this is our first dot, mark it as the start of our extension
  5893. if (startDot === -1)
  5894. startDot = i;
  5895. else if (preDotState !== 1)
  5896. preDotState = 1;
  5897. } else if (startDot !== -1) {
  5898. // We saw a non-dot and non-path separator before our dot, so we should
  5899. // have a good chance at having a non-empty extension
  5900. preDotState = -1;
  5901. }
  5902. }
  5903. if (startDot === -1 || end === -1 ||
  5904. // We saw a non-dot character immediately before the dot
  5905. preDotState === 0 ||
  5906. // The (right-most) trimmed path component is exactly '..'
  5907. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  5908. return '';
  5909. }
  5910. return path.slice(startDot, end);
  5911. };
  5912. function filter (xs, f) {
  5913. if (xs.filter) return xs.filter(f);
  5914. var res = [];
  5915. for (var i = 0; i < xs.length; i++) {
  5916. if (f(xs[i], i, xs)) res.push(xs[i]);
  5917. }
  5918. return res;
  5919. }
  5920. // String.prototype.substr - negative index don't work in IE8
  5921. var substr = 'ab'.substr(-1) === 'b'
  5922. ? function (str, start, len) { return str.substr(start, len) }
  5923. : function (str, start, len) {
  5924. if (start < 0) start = str.length + start;
  5925. return str.substr(start, len);
  5926. }
  5927. ;
  5928. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 238)))
  5929. /***/ }),
  5930. /***/ 24:
  5931. /*!************************************************************************!*\
  5932. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/timeFrom.js ***!
  5933. \************************************************************************/
  5934. /*! no static exports found */
  5935. /***/ (function(module, exports, __webpack_require__) {
  5936. "use strict";
  5937. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ../../libs/function/timeFormat.js */ 23));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  5938. /**
  5939. * 时间戳转为多久之前
  5940. * @param String timestamp 时间戳
  5941. * @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
  5942. * 如果为布尔值false,无论什么时间,都返回多久以前的格式
  5943. */
  5944. function timeFrom() {var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  5945. // 如果为null,则格式化当前时间
  5946. if (!dateTime) dateTime = Number(new Date());
  5947. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  5948. if (dateTime.toString().length == 10) dateTime *= 1000;
  5949. var timestamp = +new Date(Number(dateTime));
  5950. var timer = (Number(new Date()) - timestamp) / 1000;
  5951. // 如果小于5分钟,则返回"刚刚",其他以此类推
  5952. var tips = '';
  5953. switch (true) {
  5954. case timer < 300:
  5955. tips = '刚刚';
  5956. break;
  5957. case timer >= 300 && timer < 3600:
  5958. tips = parseInt(timer / 60) + '分钟前';
  5959. break;
  5960. case timer >= 3600 && timer < 86400:
  5961. tips = parseInt(timer / 3600) + '小时前';
  5962. break;
  5963. case timer >= 86400 && timer < 2592000:
  5964. tips = parseInt(timer / 86400) + '天前';
  5965. break;
  5966. default:
  5967. // 如果format为false,则无论什么时间戳,都显示xx之前
  5968. if (format === false) {
  5969. if (timer >= 2592000 && timer < 365 * 86400) {
  5970. tips = parseInt(timer / (86400 * 30)) + '个月前';
  5971. } else {
  5972. tips = parseInt(timer / (86400 * 365)) + '年前';
  5973. }
  5974. } else {
  5975. tips = (0, _timeFormat.default)(timestamp, format);
  5976. }}
  5977. return tips;
  5978. }var _default =
  5979. timeFrom;exports.default = _default;
  5980. /***/ }),
  5981. /***/ 25:
  5982. /*!*****************************************************************************!*\
  5983. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/colorGradient.js ***!
  5984. \*****************************************************************************/
  5985. /*! no static exports found */
  5986. /***/ (function(module, exports, __webpack_require__) {
  5987. "use strict";
  5988. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  5989. * 求两个颜色之间的渐变值
  5990. * @param {string} startColor 开始的颜色
  5991. * @param {string} endColor 结束的颜色
  5992. * @param {number} step 颜色等分的份额
  5993. * */
  5994. function colorGradient() {var startColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rgb(0, 0, 0)';var endColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rgb(255, 255, 255)';var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
  5995. var startRGB = hexToRgb(startColor, false); //转换为rgb数组模式
  5996. var startR = startRGB[0];
  5997. var startG = startRGB[1];
  5998. var startB = startRGB[2];
  5999. var endRGB = hexToRgb(endColor, false);
  6000. var endR = endRGB[0];
  6001. var endG = endRGB[1];
  6002. var endB = endRGB[2];
  6003. var sR = (endR - startR) / step; //总差值
  6004. var sG = (endG - startG) / step;
  6005. var sB = (endB - startB) / step;
  6006. var colorArr = [];
  6007. for (var i = 0; i < step; i++) {
  6008. //计算每一步的hex值
  6009. var hex = rgbToHex('rgb(' + Math.round(sR * i + startR) + ',' + Math.round(sG * i + startG) + ',' + Math.round(sB *
  6010. i + startB) + ')');
  6011. colorArr.push(hex);
  6012. }
  6013. return colorArr;
  6014. }
  6015. // 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式)
  6016. function hexToRgb(sColor) {var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  6017. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  6018. sColor = sColor.toLowerCase();
  6019. if (sColor && reg.test(sColor)) {
  6020. if (sColor.length === 4) {
  6021. var sColorNew = "#";
  6022. for (var i = 1; i < 4; i += 1) {
  6023. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  6024. }
  6025. sColor = sColorNew;
  6026. }
  6027. //处理六位的颜色值
  6028. var sColorChange = [];
  6029. for (var _i = 1; _i < 7; _i += 2) {
  6030. sColorChange.push(parseInt("0x" + sColor.slice(_i, _i + 2)));
  6031. }
  6032. if (!str) {
  6033. return sColorChange;
  6034. } else {
  6035. return "rgb(".concat(sColorChange[0], ",").concat(sColorChange[1], ",").concat(sColorChange[2], ")");
  6036. }
  6037. } else if (/^(rgb|RGB)/.test(sColor)) {
  6038. var arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  6039. return arr.map(function (val) {return Number(val);});
  6040. } else {
  6041. return sColor;
  6042. }
  6043. };
  6044. // 将rgb表示方式转换为hex表示方式
  6045. function rgbToHex(rgb) {
  6046. var _this = rgb;
  6047. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  6048. if (/^(rgb|RGB)/.test(_this)) {
  6049. var aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  6050. var strHex = "#";
  6051. for (var i = 0; i < aColor.length; i++) {
  6052. var hex = Number(aColor[i]).toString(16);
  6053. hex = String(hex).length == 1 ? 0 + '' + hex : hex; // 保证每个rgb的值为2位
  6054. if (hex === "0") {
  6055. hex += hex;
  6056. }
  6057. strHex += hex;
  6058. }
  6059. if (strHex.length !== 7) {
  6060. strHex = _this;
  6061. }
  6062. return strHex;
  6063. } else if (reg.test(_this)) {
  6064. var aNum = _this.replace(/#/, "").split("");
  6065. if (aNum.length === 6) {
  6066. return _this;
  6067. } else if (aNum.length === 3) {
  6068. var numHex = "#";
  6069. for (var _i2 = 0; _i2 < aNum.length; _i2 += 1) {
  6070. numHex += aNum[_i2] + aNum[_i2];
  6071. }
  6072. return numHex;
  6073. }
  6074. } else {
  6075. return _this;
  6076. }
  6077. }
  6078. /**
  6079. * JS颜色十六进制转换为rgb或rgba,返回的格式为 rgba(255,255,255,0.5)字符串
  6080. * sHex为传入的十六进制的色值
  6081. * alpha为rgba的透明度
  6082. */
  6083. function colorToRgba(color) {var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.3;
  6084. color = rgbToHex(color);
  6085. // 十六进制颜色值的正则表达式
  6086. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  6087. /* 16进制颜色转为RGB格式 */
  6088. var sColor = color.toLowerCase();
  6089. if (sColor && reg.test(sColor)) {
  6090. if (sColor.length === 4) {
  6091. var sColorNew = '#';
  6092. for (var i = 1; i < 4; i += 1) {
  6093. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  6094. }
  6095. sColor = sColorNew;
  6096. }
  6097. // 处理六位的颜色值
  6098. var sColorChange = [];
  6099. for (var _i3 = 1; _i3 < 7; _i3 += 2) {
  6100. sColorChange.push(parseInt('0x' + sColor.slice(_i3, _i3 + 2)));
  6101. }
  6102. // return sColorChange.join(',')
  6103. return 'rgba(' + sColorChange.join(',') + ',' + alpha + ')';
  6104. } else
  6105. {
  6106. return sColor;
  6107. }
  6108. }var _default =
  6109. {
  6110. colorGradient: colorGradient,
  6111. hexToRgb: hexToRgb,
  6112. rgbToHex: rgbToHex,
  6113. colorToRgba: colorToRgba };exports.default = _default;
  6114. /***/ }),
  6115. /***/ 26:
  6116. /*!********************************************************************!*\
  6117. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/guid.js ***!
  6118. \********************************************************************/
  6119. /*! no static exports found */
  6120. /***/ (function(module, exports, __webpack_require__) {
  6121. "use strict";
  6122. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  6123. * 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85
  6124. * 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier)
  6125. * 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题
  6126. * 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱
  6127. * v-for的时候,推荐使用后端返回的id而不是循环的index
  6128. * @param {Number} len uuid的长度
  6129. * @param {Boolean} firstU 将返回的首字母置为"u"
  6130. * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
  6131. */
  6132. function guid() {var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;var firstU = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var radix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  6133. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  6134. var uuid = [];
  6135. radix = radix || chars.length;
  6136. if (len) {
  6137. // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
  6138. for (var i = 0; i < len; i++) {uuid[i] = chars[0 | Math.random() * radix];}
  6139. } else {
  6140. var r;
  6141. // rfc4122标准要求返回的uuid中,某些位为固定的字符
  6142. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  6143. uuid[14] = '4';
  6144. for (var _i = 0; _i < 36; _i++) {
  6145. if (!uuid[_i]) {
  6146. r = 0 | Math.random() * 16;
  6147. uuid[_i] = chars[_i == 19 ? r & 0x3 | 0x8 : r];
  6148. }
  6149. }
  6150. }
  6151. // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
  6152. if (firstU) {
  6153. uuid.shift();
  6154. return 'u' + uuid.join('');
  6155. } else {
  6156. return uuid.join('');
  6157. }
  6158. }var _default =
  6159. guid;exports.default = _default;
  6160. /***/ }),
  6161. /***/ 27:
  6162. /*!*********************************************************************!*\
  6163. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/color.js ***!
  6164. \*********************************************************************/
  6165. /*! no static exports found */
  6166. /***/ (function(module, exports, __webpack_require__) {
  6167. "use strict";
  6168. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
  6169. // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
  6170. var color = {
  6171. primary: "#2979ff",
  6172. primaryDark: "#2b85e4",
  6173. primaryDisabled: "#a0cfff",
  6174. primaryLight: "#ecf5ff",
  6175. bgColor: "#f3f4f6",
  6176. info: "#909399",
  6177. infoDark: "#82848a",
  6178. infoDisabled: "#c8c9cc",
  6179. infoLight: "#f4f4f5",
  6180. warning: "#ff9900",
  6181. warningDark: "#f29100",
  6182. warningDisabled: "#fcbd71",
  6183. warningLight: "#fdf6ec",
  6184. error: "#fa3534",
  6185. errorDark: "#dd6161",
  6186. errorDisabled: "#fab6b6",
  6187. errorLight: "#fef0f0",
  6188. success: "#19be6b",
  6189. successDark: "#18b566",
  6190. successDisabled: "#71d5a1",
  6191. successLight: "#dbf1e1",
  6192. mainColor: "#303133",
  6193. contentColor: "#606266",
  6194. tipsColor: "#909399",
  6195. lightColor: "#c0c4cc",
  6196. borderColor: "#e4e7ed" };var _default =
  6197. color;exports.default = _default;
  6198. /***/ }),
  6199. /***/ 28:
  6200. /*!*************************************************************************!*\
  6201. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/type2icon.js ***!
  6202. \*************************************************************************/
  6203. /*! no static exports found */
  6204. /***/ (function(module, exports, __webpack_require__) {
  6205. "use strict";
  6206. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  6207. * 根据主题type值,获取对应的图标
  6208. * @param String type 主题名称,primary|info|error|warning|success
  6209. * @param String fill 是否使用fill填充实体的图标
  6210. */
  6211. function type2icon() {var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'success';var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  6212. // 如果非预置值,默认为success
  6213. if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success';
  6214. var iconName = '';
  6215. // 目前(2019-12-12),info和primary使用同一个图标
  6216. switch (type) {
  6217. case 'primary':
  6218. iconName = 'info-circle';
  6219. break;
  6220. case 'info':
  6221. iconName = 'info-circle';
  6222. break;
  6223. case 'error':
  6224. iconName = 'close-circle';
  6225. break;
  6226. case 'warning':
  6227. iconName = 'error-circle';
  6228. break;
  6229. case 'success':
  6230. iconName = 'checkmark-circle';
  6231. break;
  6232. default:
  6233. iconName = 'checkmark-circle';}
  6234. // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
  6235. if (fill) iconName += '-fill';
  6236. return iconName;
  6237. }var _default =
  6238. type2icon;exports.default = _default;
  6239. /***/ }),
  6240. /***/ 29:
  6241. /*!***************************************************************************!*\
  6242. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/randomArray.js ***!
  6243. \***************************************************************************/
  6244. /*! no static exports found */
  6245. /***/ (function(module, exports, __webpack_require__) {
  6246. "use strict";
  6247. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 打乱数组
  6248. function randomArray() {var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  6249. // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
  6250. return array.sort(function () {return Math.random() - 0.5;});
  6251. }var _default =
  6252. randomArray;exports.default = _default;
  6253. /***/ }),
  6254. /***/ 3:
  6255. /*!*************************************************************!*\
  6256. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  6257. \*************************************************************/
  6258. /*! no static exports found */
  6259. /***/ (function(module, exports, __webpack_require__) {
  6260. "use strict";
  6261. /* WEBPACK VAR INJECTION */(function(uni, global) {Object.defineProperty(exports, "__esModule", { value: true });exports.compileI18nJsonStr = compileI18nJsonStr;exports.hasI18nJson = hasI18nJson;exports.initVueI18n = initVueI18n;exports.isI18nStr = isI18nStr;exports.normalizeLocale = normalizeLocale;exports.parseI18nJson = parseI18nJson;exports.resolveLocale = resolveLocale;exports.isString = exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var isArray = Array.isArray;
  6262. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  6263. var defaultDelimiters = ['{', '}'];var
  6264. BaseFormatter = /*#__PURE__*/function () {
  6265. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  6266. this._caches = Object.create(null);
  6267. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  6268. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  6269. if (!values) {
  6270. return [message];
  6271. }
  6272. var tokens = this._caches[message];
  6273. if (!tokens) {
  6274. tokens = parse(message, delimiters);
  6275. this._caches[message] = tokens;
  6276. }
  6277. return compile(tokens, values);
  6278. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  6279. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  6280. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  6281. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  6282. var tokens = [];
  6283. var position = 0;
  6284. var text = '';
  6285. while (position < format.length) {
  6286. var char = format[position++];
  6287. if (char === startDelimiter) {
  6288. if (text) {
  6289. tokens.push({ type: 'text', value: text });
  6290. }
  6291. text = '';
  6292. var sub = '';
  6293. char = format[position++];
  6294. while (char !== undefined && char !== endDelimiter) {
  6295. sub += char;
  6296. char = format[position++];
  6297. }
  6298. var isClosed = char === endDelimiter;
  6299. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  6300. 'list' :
  6301. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  6302. 'named' :
  6303. 'unknown';
  6304. tokens.push({ value: sub, type: type });
  6305. }
  6306. // else if (char === '%') {
  6307. // // when found rails i18n syntax, skip text capture
  6308. // if (format[position] !== '{') {
  6309. // text += char
  6310. // }
  6311. // }
  6312. else {
  6313. text += char;
  6314. }
  6315. }
  6316. text && tokens.push({ type: 'text', value: text });
  6317. return tokens;
  6318. }
  6319. function compile(tokens, values) {
  6320. var compiled = [];
  6321. var index = 0;
  6322. var mode = isArray(values) ?
  6323. 'list' :
  6324. isObject(values) ?
  6325. 'named' :
  6326. 'unknown';
  6327. if (mode === 'unknown') {
  6328. return compiled;
  6329. }
  6330. while (index < tokens.length) {
  6331. var token = tokens[index];
  6332. switch (token.type) {
  6333. case 'text':
  6334. compiled.push(token.value);
  6335. break;
  6336. case 'list':
  6337. compiled.push(values[parseInt(token.value, 10)]);
  6338. break;
  6339. case 'named':
  6340. if (mode === 'named') {
  6341. compiled.push(values[token.value]);
  6342. } else
  6343. {
  6344. if (true) {
  6345. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  6346. }
  6347. }
  6348. break;
  6349. case 'unknown':
  6350. if (true) {
  6351. console.warn("Detect 'unknown' type of token!");
  6352. }
  6353. break;}
  6354. index++;
  6355. }
  6356. return compiled;
  6357. }
  6358. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  6359. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  6360. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  6361. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  6362. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  6363. var hasOwnProperty = Object.prototype.hasOwnProperty;
  6364. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  6365. var defaultFormatter = new BaseFormatter();
  6366. function include(str, parts) {
  6367. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  6368. }
  6369. function startsWith(str, parts) {
  6370. return parts.find(function (part) {return str.indexOf(part) === 0;});
  6371. }
  6372. function normalizeLocale(locale, messages) {
  6373. if (!locale) {
  6374. return;
  6375. }
  6376. locale = locale.trim().replace(/_/g, '-');
  6377. if (messages && messages[locale]) {
  6378. return locale;
  6379. }
  6380. locale = locale.toLowerCase();
  6381. if (locale.indexOf('zh') === 0) {
  6382. if (locale.indexOf('-hans') > -1) {
  6383. return LOCALE_ZH_HANS;
  6384. }
  6385. if (locale.indexOf('-hant') > -1) {
  6386. return LOCALE_ZH_HANT;
  6387. }
  6388. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  6389. return LOCALE_ZH_HANT;
  6390. }
  6391. return LOCALE_ZH_HANS;
  6392. }
  6393. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  6394. if (lang) {
  6395. return lang;
  6396. }
  6397. }var
  6398. I18n = /*#__PURE__*/function () {
  6399. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  6400. this.locale = LOCALE_EN;
  6401. this.fallbackLocale = LOCALE_EN;
  6402. this.message = {};
  6403. this.messages = {};
  6404. this.watchers = [];
  6405. if (fallbackLocale) {
  6406. this.fallbackLocale = fallbackLocale;
  6407. }
  6408. this.formater = formater || defaultFormatter;
  6409. this.messages = messages || {};
  6410. this.setLocale(locale || LOCALE_EN);
  6411. if (watcher) {
  6412. this.watchLocale(watcher);
  6413. }
  6414. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  6415. locale) {var _this = this;
  6416. var oldLocale = this.locale;
  6417. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  6418. if (!this.messages[this.locale]) {
  6419. // 可能初始化时不存在
  6420. this.messages[this.locale] = {};
  6421. }
  6422. this.message = this.messages[this.locale];
  6423. // 仅发生变化时,通知
  6424. if (oldLocale !== this.locale) {
  6425. this.watchers.forEach(function (watcher) {
  6426. watcher(_this.locale, oldLocale);
  6427. });
  6428. }
  6429. } }, { key: "getLocale", value: function getLocale()
  6430. {
  6431. return this.locale;
  6432. } }, { key: "watchLocale", value: function watchLocale(
  6433. fn) {var _this2 = this;
  6434. var index = this.watchers.push(fn) - 1;
  6435. return function () {
  6436. _this2.watchers.splice(index, 1);
  6437. };
  6438. } }, { key: "add", value: function add(
  6439. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  6440. var curMessages = this.messages[locale];
  6441. if (curMessages) {
  6442. if (override) {
  6443. Object.assign(curMessages, message);
  6444. } else
  6445. {
  6446. Object.keys(message).forEach(function (key) {
  6447. if (!hasOwn(curMessages, key)) {
  6448. curMessages[key] = message[key];
  6449. }
  6450. });
  6451. }
  6452. } else
  6453. {
  6454. this.messages[locale] = message;
  6455. }
  6456. } }, { key: "f", value: function f(
  6457. message, values, delimiters) {
  6458. return this.formater.interpolate(message, values, delimiters).join('');
  6459. } }, { key: "t", value: function t(
  6460. key, locale, values) {
  6461. var message = this.message;
  6462. if (typeof locale === 'string') {
  6463. locale = normalizeLocale(locale, this.messages);
  6464. locale && (message = this.messages[locale]);
  6465. } else
  6466. {
  6467. values = locale;
  6468. }
  6469. if (!hasOwn(message, key)) {
  6470. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  6471. return key;
  6472. }
  6473. return this.formater.interpolate(message[key], values).join('');
  6474. } }]);return I18n;}();exports.I18n = I18n;
  6475. function watchAppLocale(appVm, i18n) {
  6476. // 需要保证 watch 的触发在组件渲染之前
  6477. if (appVm.$watchLocale) {
  6478. // vue2
  6479. appVm.$watchLocale(function (newLocale) {
  6480. i18n.setLocale(newLocale);
  6481. });
  6482. } else
  6483. {
  6484. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  6485. i18n.setLocale(newLocale);
  6486. });
  6487. }
  6488. }
  6489. function getDefaultLocale() {
  6490. if (typeof uni !== 'undefined' && uni.getLocale) {
  6491. return uni.getLocale();
  6492. }
  6493. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  6494. if (typeof global !== 'undefined' && global.getLocale) {
  6495. return global.getLocale();
  6496. }
  6497. return LOCALE_EN;
  6498. }
  6499. function initVueI18n(locale) {var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;var watcher = arguments.length > 3 ? arguments[3] : undefined;
  6500. // 兼容旧版本入参
  6501. if (typeof locale !== 'string') {var _ref4 =
  6502. [
  6503. messages,
  6504. locale];locale = _ref4[0];messages = _ref4[1];
  6505. }
  6506. if (typeof locale !== 'string') {
  6507. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  6508. locale = getDefaultLocale();
  6509. }
  6510. if (typeof fallbackLocale !== 'string') {
  6511. fallbackLocale =
  6512. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  6513. LOCALE_EN;
  6514. }
  6515. var i18n = new I18n({
  6516. locale: locale,
  6517. fallbackLocale: fallbackLocale,
  6518. messages: messages,
  6519. watcher: watcher });
  6520. var _t = function t(key, values) {
  6521. if (typeof getApp !== 'function') {
  6522. // app view
  6523. /* eslint-disable no-func-assign */
  6524. _t = function t(key, values) {
  6525. return i18n.t(key, values);
  6526. };
  6527. } else
  6528. {
  6529. var isWatchedAppLocale = false;
  6530. _t = function t(key, values) {
  6531. var appVm = getApp().$vm;
  6532. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  6533. // options: {
  6534. // type: Array,
  6535. // default () {
  6536. // return [{
  6537. // icon: 'shop',
  6538. // text: t("uni-goods-nav.options.shop"),
  6539. // }, {
  6540. // icon: 'cart',
  6541. // text: t("uni-goods-nav.options.cart")
  6542. // }]
  6543. // }
  6544. // },
  6545. if (appVm) {
  6546. // 触发响应式
  6547. appVm.$locale;
  6548. if (!isWatchedAppLocale) {
  6549. isWatchedAppLocale = true;
  6550. watchAppLocale(appVm, i18n);
  6551. }
  6552. }
  6553. return i18n.t(key, values);
  6554. };
  6555. }
  6556. return _t(key, values);
  6557. };
  6558. return {
  6559. i18n: i18n,
  6560. f: function f(message, values, delimiters) {
  6561. return i18n.f(message, values, delimiters);
  6562. },
  6563. t: function t(key, values) {
  6564. return _t(key, values);
  6565. },
  6566. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  6567. return i18n.add(locale, message, override);
  6568. },
  6569. watch: function watch(fn) {
  6570. return i18n.watchLocale(fn);
  6571. },
  6572. getLocale: function getLocale() {
  6573. return i18n.getLocale();
  6574. },
  6575. setLocale: function setLocale(newLocale) {
  6576. return i18n.setLocale(newLocale);
  6577. } };
  6578. }
  6579. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  6580. var formater;
  6581. function hasI18nJson(jsonObj, delimiters) {
  6582. if (!formater) {
  6583. formater = new BaseFormatter();
  6584. }
  6585. return walkJsonObj(jsonObj, function (jsonObj, key) {
  6586. var value = jsonObj[key];
  6587. if (isString(value)) {
  6588. if (isI18nStr(value, delimiters)) {
  6589. return true;
  6590. }
  6591. } else
  6592. {
  6593. return hasI18nJson(value, delimiters);
  6594. }
  6595. });
  6596. }
  6597. function parseI18nJson(jsonObj, values, delimiters) {
  6598. if (!formater) {
  6599. formater = new BaseFormatter();
  6600. }
  6601. walkJsonObj(jsonObj, function (jsonObj, key) {
  6602. var value = jsonObj[key];
  6603. if (isString(value)) {
  6604. if (isI18nStr(value, delimiters)) {
  6605. jsonObj[key] = compileStr(value, values, delimiters);
  6606. }
  6607. } else
  6608. {
  6609. parseI18nJson(value, values, delimiters);
  6610. }
  6611. });
  6612. return jsonObj;
  6613. }
  6614. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  6615. if (!isI18nStr(jsonStr, delimiters)) {
  6616. return jsonStr;
  6617. }
  6618. if (!formater) {
  6619. formater = new BaseFormatter();
  6620. }
  6621. var localeValues = [];
  6622. Object.keys(locales).forEach(function (name) {
  6623. if (name !== locale) {
  6624. localeValues.push({
  6625. locale: name,
  6626. values: locales[name] });
  6627. }
  6628. });
  6629. localeValues.unshift({ locale: locale, values: locales[locale] });
  6630. try {
  6631. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  6632. }
  6633. catch (e) {}
  6634. return jsonStr;
  6635. }
  6636. function isI18nStr(value, delimiters) {
  6637. return value.indexOf(delimiters[0]) > -1;
  6638. }
  6639. function compileStr(value, values, delimiters) {
  6640. return formater.interpolate(value, values, delimiters).join('');
  6641. }
  6642. function compileValue(jsonObj, key, localeValues, delimiters) {
  6643. var value = jsonObj[key];
  6644. if (isString(value)) {
  6645. // 存在国际化
  6646. if (isI18nStr(value, delimiters)) {
  6647. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  6648. if (localeValues.length > 1) {
  6649. // 格式化国际化语言
  6650. var valueLocales = jsonObj[key + 'Locales'] = {};
  6651. localeValues.forEach(function (localValue) {
  6652. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  6653. });
  6654. }
  6655. }
  6656. } else
  6657. {
  6658. compileJsonObj(value, localeValues, delimiters);
  6659. }
  6660. }
  6661. function compileJsonObj(jsonObj, localeValues, delimiters) {
  6662. walkJsonObj(jsonObj, function (jsonObj, key) {
  6663. compileValue(jsonObj, key, localeValues, delimiters);
  6664. });
  6665. return jsonObj;
  6666. }
  6667. function walkJsonObj(jsonObj, walk) {
  6668. if (isArray(jsonObj)) {
  6669. for (var i = 0; i < jsonObj.length; i++) {
  6670. if (walk(jsonObj, i)) {
  6671. return true;
  6672. }
  6673. }
  6674. } else
  6675. if (isObject(jsonObj)) {
  6676. for (var key in jsonObj) {
  6677. if (walk(jsonObj, key)) {
  6678. return true;
  6679. }
  6680. }
  6681. }
  6682. return false;
  6683. }
  6684. function resolveLocale(locales) {
  6685. return function (locale) {
  6686. if (!locale) {
  6687. return locale;
  6688. }
  6689. locale = normalizeLocale(locale) || locale;
  6690. return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;});
  6691. };
  6692. }
  6693. function resolveLocaleChain(locale) {
  6694. var chain = [];
  6695. var tokens = locale.split('-');
  6696. while (tokens.length) {
  6697. chain.push(tokens.join('-'));
  6698. tokens.pop();
  6699. }
  6700. return chain;
  6701. }
  6702. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  6703. /***/ }),
  6704. /***/ 30:
  6705. /*!***********************************************************************!*\
  6706. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/addUnit.js ***!
  6707. \***********************************************************************/
  6708. /*! no static exports found */
  6709. /***/ (function(module, exports, __webpack_require__) {
  6710. "use strict";
  6711. Object.defineProperty(exports, "__esModule", { value: true });exports.default = addUnit;var _test = _interopRequireDefault(__webpack_require__(/*! ./test.js */ 17));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  6712. // 添加单位,如果有rpx,%,px等单位结尾或者值为auto,直接返回,否则加上rpx单位结尾
  6713. function addUnit() {var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'auto';var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rpx';
  6714. value = String(value);
  6715. // 用uView内置验证规则中的number判断是否为数值
  6716. return _test.default.number(value) ? "".concat(value).concat(unit) : value;
  6717. }
  6718. /***/ }),
  6719. /***/ 31:
  6720. /*!**********************************************************************!*\
  6721. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/random.js ***!
  6722. \**********************************************************************/
  6723. /*! no static exports found */
  6724. /***/ (function(module, exports, __webpack_require__) {
  6725. "use strict";
  6726. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function random(min, max) {
  6727. if (min >= 0 && max > 0 && max >= min) {
  6728. var gab = max - min + 1;
  6729. return Math.floor(Math.random() * gab + min);
  6730. } else {
  6731. return 0;
  6732. }
  6733. }var _default =
  6734. random;exports.default = _default;
  6735. /***/ }),
  6736. /***/ 32:
  6737. /*!********************************************************************!*\
  6738. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/trim.js ***!
  6739. \********************************************************************/
  6740. /*! no static exports found */
  6741. /***/ (function(module, exports, __webpack_require__) {
  6742. "use strict";
  6743. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function trim(str) {var pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'both';
  6744. if (pos == 'both') {
  6745. return str.replace(/^\s+|\s+$/g, "");
  6746. } else if (pos == "left") {
  6747. return str.replace(/^\s*/, '');
  6748. } else if (pos == 'right') {
  6749. return str.replace(/(\s*$)/g, "");
  6750. } else if (pos == 'all') {
  6751. return str.replace(/\s+/g, "");
  6752. } else {
  6753. return str;
  6754. }
  6755. }var _default =
  6756. trim;exports.default = _default;
  6757. /***/ }),
  6758. /***/ 33:
  6759. /*!*********************************************************************!*\
  6760. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/toast.js ***!
  6761. \*********************************************************************/
  6762. /*! no static exports found */
  6763. /***/ (function(module, exports, __webpack_require__) {
  6764. "use strict";
  6765. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function toast(title) {var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1500;
  6766. uni.showToast({
  6767. title: title,
  6768. icon: 'none',
  6769. duration: duration });
  6770. }var _default =
  6771. toast;exports.default = _default;
  6772. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  6773. /***/ }),
  6774. /***/ 34:
  6775. /*!*************************************************************************!*\
  6776. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/getParent.js ***!
  6777. \*************************************************************************/
  6778. /*! no static exports found */
  6779. /***/ (function(module, exports, __webpack_require__) {
  6780. "use strict";
  6781. Object.defineProperty(exports, "__esModule", { value: true });exports.default = getParent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  6782. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  6783. function getParent(name, keys) {
  6784. var parent = this.$parent;
  6785. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  6786. while (parent) {
  6787. // 父组件
  6788. if (parent.$options.name !== name) {
  6789. // 如果组件的name不相等,继续上一级寻找
  6790. parent = parent.$parent;
  6791. } else {var _ret = function () {
  6792. var data = {};
  6793. // 判断keys是否数组,如果传过来的是一个数组,那么直接使用数组元素值当做键值去父组件寻找
  6794. if (Array.isArray(keys)) {
  6795. keys.map(function (val) {
  6796. data[val] = parent[val] ? parent[val] : '';
  6797. });
  6798. } else {
  6799. // 历遍传过来的对象参数
  6800. for (var i in keys) {
  6801. // 如果子组件有此值则用,无此值则用父组件的值
  6802. // 判断是否空数组,如果是,则用父组件的值,否则用子组件的值
  6803. if (Array.isArray(keys[i])) {
  6804. if (keys[i].length) {
  6805. data[i] = keys[i];
  6806. } else {
  6807. data[i] = parent[i];
  6808. }
  6809. } else if (keys[i].constructor === Object) {
  6810. // 判断是否对象,如果是对象,且有属性,那么使用子组件的值,否则使用父组件的值
  6811. if (Object.keys(keys[i]).length) {
  6812. data[i] = keys[i];
  6813. } else {
  6814. data[i] = parent[i];
  6815. }
  6816. } else {
  6817. // 只要子组件有传值,即使是false值,也是“传值”了,也需要覆盖父组件的同名参数
  6818. data[i] = keys[i] || keys[i] === false ? keys[i] : parent[i];
  6819. }
  6820. }
  6821. }
  6822. return { v: data };}();if (typeof _ret === "object") return _ret.v;
  6823. }
  6824. }
  6825. return {};
  6826. }
  6827. /***/ }),
  6828. /***/ 35:
  6829. /*!***********************************************************************!*\
  6830. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/$parent.js ***!
  6831. \***********************************************************************/
  6832. /*! no static exports found */
  6833. /***/ (function(module, exports, __webpack_require__) {
  6834. "use strict";
  6835. Object.defineProperty(exports, "__esModule", { value: true });exports.default = $parent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  6836. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  6837. // 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
  6838. // 值(默认为undefined),就是查找最顶层的$parent
  6839. function $parent() {var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  6840. var parent = this.$parent;
  6841. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  6842. while (parent) {
  6843. // 父组件
  6844. if (parent.$options && parent.$options.name !== name) {
  6845. // 如果组件的name不相等,继续上一级寻找
  6846. parent = parent.$parent;
  6847. } else {
  6848. return parent;
  6849. }
  6850. }
  6851. return false;
  6852. }
  6853. /***/ }),
  6854. /***/ 36:
  6855. /*!*******************************************************************!*\
  6856. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/sys.js ***!
  6857. \*******************************************************************/
  6858. /*! no static exports found */
  6859. /***/ (function(module, exports, __webpack_require__) {
  6860. "use strict";
  6861. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.os = os;exports.sys = sys;function os() {
  6862. return uni.getSystemInfoSync().platform;
  6863. };
  6864. function sys() {
  6865. return uni.getSystemInfoSync();
  6866. }
  6867. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  6868. /***/ }),
  6869. /***/ 37:
  6870. /*!************************************************************************!*\
  6871. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/debounce.js ***!
  6872. \************************************************************************/
  6873. /*! no static exports found */
  6874. /***/ (function(module, exports, __webpack_require__) {
  6875. "use strict";
  6876. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timeout = null;
  6877. /**
  6878. * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
  6879. *
  6880. * @param {Function} func 要执行的回调函数
  6881. * @param {Number} wait 延时的时间
  6882. * @param {Boolean} immediate 是否立即执行
  6883. * @return null
  6884. */
  6885. function debounce(func) {var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  6886. // 清除定时器
  6887. if (timeout !== null) clearTimeout(timeout);
  6888. // 立即执行,此类情况一般用不到
  6889. if (immediate) {
  6890. var callNow = !timeout;
  6891. timeout = setTimeout(function () {
  6892. timeout = null;
  6893. }, wait);
  6894. if (callNow) typeof func === 'function' && func();
  6895. } else {
  6896. // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
  6897. timeout = setTimeout(function () {
  6898. typeof func === 'function' && func();
  6899. }, wait);
  6900. }
  6901. }var _default =
  6902. debounce;exports.default = _default;
  6903. /***/ }),
  6904. /***/ 38:
  6905. /*!************************************************************************!*\
  6906. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/throttle.js ***!
  6907. \************************************************************************/
  6908. /*! no static exports found */
  6909. /***/ (function(module, exports, __webpack_require__) {
  6910. "use strict";
  6911. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timeoutArr = [];
  6912. var flagArr = [];
  6913. /**
  6914. * 节流函数
  6915. * 节流原理:在一定时间内,只能触发一次
  6916. * @param {Function} fn 要执行的回调函数
  6917. * @param {Number} time 延时的时间
  6918. * @param {Boolean} isImmediate 是否立即执行
  6919. * @param {String} timeoutName 定时器ID
  6920. * @return null
  6921. */
  6922. function throttle(fn) {var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;var isImmediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;var timeoutName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "default";
  6923. if (!timeoutArr[timeoutName]) timeoutArr[timeoutName] = null;
  6924. if (isImmediate) {
  6925. if (!flagArr[timeoutName]) {
  6926. flagArr[timeoutName] = true;
  6927. // 如果是立即执行,则在time毫秒内开始时执行
  6928. if (typeof fn === 'function') fn();
  6929. timeoutArr[timeoutName] = setTimeout(function () {
  6930. flagArr[timeoutName] = false;
  6931. }, time);
  6932. }
  6933. } else {
  6934. if (!flagArr[timeoutName]) {
  6935. flagArr[timeoutName] = true;
  6936. // 如果是非立即执行,则在time毫秒内的结束处执行
  6937. timeoutArr[timeoutName] = setTimeout(function () {
  6938. flagArr[timeoutName] = false;
  6939. if (typeof fn === 'function') fn();
  6940. }, time);
  6941. }
  6942. }
  6943. };var _default =
  6944. throttle;exports.default = _default;
  6945. /***/ }),
  6946. /***/ 39:
  6947. /*!********************************************************************!*\
  6948. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/config/config.js ***!
  6949. \********************************************************************/
  6950. /*! no static exports found */
  6951. /***/ (function(module, exports, __webpack_require__) {
  6952. "use strict";
  6953. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 第一版 1.10.1 版本发布于2021-11-18
  6954. var version = '1.10.1';var _default =
  6955. {
  6956. v: version,
  6957. version: version,
  6958. // 主题名称
  6959. type: [
  6960. 'primary',
  6961. 'success',
  6962. 'info',
  6963. 'error',
  6964. 'warning'] };exports.default = _default;
  6965. /***/ }),
  6966. /***/ 4:
  6967. /*!******************************************************************************************!*\
  6968. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  6969. \******************************************************************************************/
  6970. /*! exports provided: default */
  6971. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6972. "use strict";
  6973. __webpack_require__.r(__webpack_exports__);
  6974. /* WEBPACK VAR INJECTION */(function(global) {/*!
  6975. * Vue.js v2.6.11
  6976. * (c) 2014-2022 Evan You
  6977. * Released under the MIT License.
  6978. */
  6979. /* */
  6980. var emptyObject = Object.freeze({});
  6981. // These helpers produce better VM code in JS engines due to their
  6982. // explicitness and function inlining.
  6983. function isUndef (v) {
  6984. return v === undefined || v === null
  6985. }
  6986. function isDef (v) {
  6987. return v !== undefined && v !== null
  6988. }
  6989. function isTrue (v) {
  6990. return v === true
  6991. }
  6992. function isFalse (v) {
  6993. return v === false
  6994. }
  6995. /**
  6996. * Check if value is primitive.
  6997. */
  6998. function isPrimitive (value) {
  6999. return (
  7000. typeof value === 'string' ||
  7001. typeof value === 'number' ||
  7002. // $flow-disable-line
  7003. typeof value === 'symbol' ||
  7004. typeof value === 'boolean'
  7005. )
  7006. }
  7007. /**
  7008. * Quick object check - this is primarily used to tell
  7009. * Objects from primitive values when we know the value
  7010. * is a JSON-compliant type.
  7011. */
  7012. function isObject (obj) {
  7013. return obj !== null && typeof obj === 'object'
  7014. }
  7015. /**
  7016. * Get the raw type string of a value, e.g., [object Object].
  7017. */
  7018. var _toString = Object.prototype.toString;
  7019. function toRawType (value) {
  7020. return _toString.call(value).slice(8, -1)
  7021. }
  7022. /**
  7023. * Strict object type check. Only returns true
  7024. * for plain JavaScript objects.
  7025. */
  7026. function isPlainObject (obj) {
  7027. return _toString.call(obj) === '[object Object]'
  7028. }
  7029. function isRegExp (v) {
  7030. return _toString.call(v) === '[object RegExp]'
  7031. }
  7032. /**
  7033. * Check if val is a valid array index.
  7034. */
  7035. function isValidArrayIndex (val) {
  7036. var n = parseFloat(String(val));
  7037. return n >= 0 && Math.floor(n) === n && isFinite(val)
  7038. }
  7039. function isPromise (val) {
  7040. return (
  7041. isDef(val) &&
  7042. typeof val.then === 'function' &&
  7043. typeof val.catch === 'function'
  7044. )
  7045. }
  7046. /**
  7047. * Convert a value to a string that is actually rendered.
  7048. */
  7049. function toString (val) {
  7050. return val == null
  7051. ? ''
  7052. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  7053. ? JSON.stringify(val, null, 2)
  7054. : String(val)
  7055. }
  7056. /**
  7057. * Convert an input value to a number for persistence.
  7058. * If the conversion fails, return original string.
  7059. */
  7060. function toNumber (val) {
  7061. var n = parseFloat(val);
  7062. return isNaN(n) ? val : n
  7063. }
  7064. /**
  7065. * Make a map and return a function for checking if a key
  7066. * is in that map.
  7067. */
  7068. function makeMap (
  7069. str,
  7070. expectsLowerCase
  7071. ) {
  7072. var map = Object.create(null);
  7073. var list = str.split(',');
  7074. for (var i = 0; i < list.length; i++) {
  7075. map[list[i]] = true;
  7076. }
  7077. return expectsLowerCase
  7078. ? function (val) { return map[val.toLowerCase()]; }
  7079. : function (val) { return map[val]; }
  7080. }
  7081. /**
  7082. * Check if a tag is a built-in tag.
  7083. */
  7084. var isBuiltInTag = makeMap('slot,component', true);
  7085. /**
  7086. * Check if an attribute is a reserved attribute.
  7087. */
  7088. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  7089. /**
  7090. * Remove an item from an array.
  7091. */
  7092. function remove (arr, item) {
  7093. if (arr.length) {
  7094. var index = arr.indexOf(item);
  7095. if (index > -1) {
  7096. return arr.splice(index, 1)
  7097. }
  7098. }
  7099. }
  7100. /**
  7101. * Check whether an object has the property.
  7102. */
  7103. var hasOwnProperty = Object.prototype.hasOwnProperty;
  7104. function hasOwn (obj, key) {
  7105. return hasOwnProperty.call(obj, key)
  7106. }
  7107. /**
  7108. * Create a cached version of a pure function.
  7109. */
  7110. function cached (fn) {
  7111. var cache = Object.create(null);
  7112. return (function cachedFn (str) {
  7113. var hit = cache[str];
  7114. return hit || (cache[str] = fn(str))
  7115. })
  7116. }
  7117. /**
  7118. * Camelize a hyphen-delimited string.
  7119. */
  7120. var camelizeRE = /-(\w)/g;
  7121. var camelize = cached(function (str) {
  7122. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  7123. });
  7124. /**
  7125. * Capitalize a string.
  7126. */
  7127. var capitalize = cached(function (str) {
  7128. return str.charAt(0).toUpperCase() + str.slice(1)
  7129. });
  7130. /**
  7131. * Hyphenate a camelCase string.
  7132. */
  7133. var hyphenateRE = /\B([A-Z])/g;
  7134. var hyphenate = cached(function (str) {
  7135. return str.replace(hyphenateRE, '-$1').toLowerCase()
  7136. });
  7137. /**
  7138. * Simple bind polyfill for environments that do not support it,
  7139. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  7140. * since native bind is now performant enough in most browsers.
  7141. * But removing it would mean breaking code that was able to run in
  7142. * PhantomJS 1.x, so this must be kept for backward compatibility.
  7143. */
  7144. /* istanbul ignore next */
  7145. function polyfillBind (fn, ctx) {
  7146. function boundFn (a) {
  7147. var l = arguments.length;
  7148. return l
  7149. ? l > 1
  7150. ? fn.apply(ctx, arguments)
  7151. : fn.call(ctx, a)
  7152. : fn.call(ctx)
  7153. }
  7154. boundFn._length = fn.length;
  7155. return boundFn
  7156. }
  7157. function nativeBind (fn, ctx) {
  7158. return fn.bind(ctx)
  7159. }
  7160. var bind = Function.prototype.bind
  7161. ? nativeBind
  7162. : polyfillBind;
  7163. /**
  7164. * Convert an Array-like object to a real Array.
  7165. */
  7166. function toArray (list, start) {
  7167. start = start || 0;
  7168. var i = list.length - start;
  7169. var ret = new Array(i);
  7170. while (i--) {
  7171. ret[i] = list[i + start];
  7172. }
  7173. return ret
  7174. }
  7175. /**
  7176. * Mix properties into target object.
  7177. */
  7178. function extend (to, _from) {
  7179. for (var key in _from) {
  7180. to[key] = _from[key];
  7181. }
  7182. return to
  7183. }
  7184. /**
  7185. * Merge an Array of Objects into a single Object.
  7186. */
  7187. function toObject (arr) {
  7188. var res = {};
  7189. for (var i = 0; i < arr.length; i++) {
  7190. if (arr[i]) {
  7191. extend(res, arr[i]);
  7192. }
  7193. }
  7194. return res
  7195. }
  7196. /* eslint-disable no-unused-vars */
  7197. /**
  7198. * Perform no operation.
  7199. * Stubbing args to make Flow happy without leaving useless transpiled code
  7200. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  7201. */
  7202. function noop (a, b, c) {}
  7203. /**
  7204. * Always return false.
  7205. */
  7206. var no = function (a, b, c) { return false; };
  7207. /* eslint-enable no-unused-vars */
  7208. /**
  7209. * Return the same value.
  7210. */
  7211. var identity = function (_) { return _; };
  7212. /**
  7213. * Check if two values are loosely equal - that is,
  7214. * if they are plain objects, do they have the same shape?
  7215. */
  7216. function looseEqual (a, b) {
  7217. if (a === b) { return true }
  7218. var isObjectA = isObject(a);
  7219. var isObjectB = isObject(b);
  7220. if (isObjectA && isObjectB) {
  7221. try {
  7222. var isArrayA = Array.isArray(a);
  7223. var isArrayB = Array.isArray(b);
  7224. if (isArrayA && isArrayB) {
  7225. return a.length === b.length && a.every(function (e, i) {
  7226. return looseEqual(e, b[i])
  7227. })
  7228. } else if (a instanceof Date && b instanceof Date) {
  7229. return a.getTime() === b.getTime()
  7230. } else if (!isArrayA && !isArrayB) {
  7231. var keysA = Object.keys(a);
  7232. var keysB = Object.keys(b);
  7233. return keysA.length === keysB.length && keysA.every(function (key) {
  7234. return looseEqual(a[key], b[key])
  7235. })
  7236. } else {
  7237. /* istanbul ignore next */
  7238. return false
  7239. }
  7240. } catch (e) {
  7241. /* istanbul ignore next */
  7242. return false
  7243. }
  7244. } else if (!isObjectA && !isObjectB) {
  7245. return String(a) === String(b)
  7246. } else {
  7247. return false
  7248. }
  7249. }
  7250. /**
  7251. * Return the first index at which a loosely equal value can be
  7252. * found in the array (if value is a plain object, the array must
  7253. * contain an object of the same shape), or -1 if it is not present.
  7254. */
  7255. function looseIndexOf (arr, val) {
  7256. for (var i = 0; i < arr.length; i++) {
  7257. if (looseEqual(arr[i], val)) { return i }
  7258. }
  7259. return -1
  7260. }
  7261. /**
  7262. * Ensure a function is called only once.
  7263. */
  7264. function once (fn) {
  7265. var called = false;
  7266. return function () {
  7267. if (!called) {
  7268. called = true;
  7269. fn.apply(this, arguments);
  7270. }
  7271. }
  7272. }
  7273. var ASSET_TYPES = [
  7274. 'component',
  7275. 'directive',
  7276. 'filter'
  7277. ];
  7278. var LIFECYCLE_HOOKS = [
  7279. 'beforeCreate',
  7280. 'created',
  7281. 'beforeMount',
  7282. 'mounted',
  7283. 'beforeUpdate',
  7284. 'updated',
  7285. 'beforeDestroy',
  7286. 'destroyed',
  7287. 'activated',
  7288. 'deactivated',
  7289. 'errorCaptured',
  7290. 'serverPrefetch'
  7291. ];
  7292. /* */
  7293. var config = ({
  7294. /**
  7295. * Option merge strategies (used in core/util/options)
  7296. */
  7297. // $flow-disable-line
  7298. optionMergeStrategies: Object.create(null),
  7299. /**
  7300. * Whether to suppress warnings.
  7301. */
  7302. silent: false,
  7303. /**
  7304. * Show production mode tip message on boot?
  7305. */
  7306. productionTip: "development" !== 'production',
  7307. /**
  7308. * Whether to enable devtools
  7309. */
  7310. devtools: "development" !== 'production',
  7311. /**
  7312. * Whether to record perf
  7313. */
  7314. performance: false,
  7315. /**
  7316. * Error handler for watcher errors
  7317. */
  7318. errorHandler: null,
  7319. /**
  7320. * Warn handler for watcher warns
  7321. */
  7322. warnHandler: null,
  7323. /**
  7324. * Ignore certain custom elements
  7325. */
  7326. ignoredElements: [],
  7327. /**
  7328. * Custom user key aliases for v-on
  7329. */
  7330. // $flow-disable-line
  7331. keyCodes: Object.create(null),
  7332. /**
  7333. * Check if a tag is reserved so that it cannot be registered as a
  7334. * component. This is platform-dependent and may be overwritten.
  7335. */
  7336. isReservedTag: no,
  7337. /**
  7338. * Check if an attribute is reserved so that it cannot be used as a component
  7339. * prop. This is platform-dependent and may be overwritten.
  7340. */
  7341. isReservedAttr: no,
  7342. /**
  7343. * Check if a tag is an unknown element.
  7344. * Platform-dependent.
  7345. */
  7346. isUnknownElement: no,
  7347. /**
  7348. * Get the namespace of an element
  7349. */
  7350. getTagNamespace: noop,
  7351. /**
  7352. * Parse the real tag name for the specific platform.
  7353. */
  7354. parsePlatformTagName: identity,
  7355. /**
  7356. * Check if an attribute must be bound using property, e.g. value
  7357. * Platform-dependent.
  7358. */
  7359. mustUseProp: no,
  7360. /**
  7361. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  7362. * This will significantly reduce performance if set to false.
  7363. */
  7364. async: true,
  7365. /**
  7366. * Exposed for legacy reasons
  7367. */
  7368. _lifecycleHooks: LIFECYCLE_HOOKS
  7369. });
  7370. /* */
  7371. /**
  7372. * unicode letters used for parsing html tags, component names and property paths.
  7373. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  7374. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  7375. */
  7376. 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/;
  7377. /**
  7378. * Check if a string starts with $ or _
  7379. */
  7380. function isReserved (str) {
  7381. var c = (str + '').charCodeAt(0);
  7382. return c === 0x24 || c === 0x5F
  7383. }
  7384. /**
  7385. * Define a property.
  7386. */
  7387. function def (obj, key, val, enumerable) {
  7388. Object.defineProperty(obj, key, {
  7389. value: val,
  7390. enumerable: !!enumerable,
  7391. writable: true,
  7392. configurable: true
  7393. });
  7394. }
  7395. /**
  7396. * Parse simple path.
  7397. */
  7398. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  7399. function parsePath (path) {
  7400. if (bailRE.test(path)) {
  7401. return
  7402. }
  7403. var segments = path.split('.');
  7404. return function (obj) {
  7405. for (var i = 0; i < segments.length; i++) {
  7406. if (!obj) { return }
  7407. obj = obj[segments[i]];
  7408. }
  7409. return obj
  7410. }
  7411. }
  7412. /* */
  7413. // can we use __proto__?
  7414. var hasProto = '__proto__' in {};
  7415. // Browser environment sniffing
  7416. var inBrowser = typeof window !== 'undefined';
  7417. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  7418. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  7419. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  7420. var isIE = UA && /msie|trident/.test(UA);
  7421. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  7422. var isEdge = UA && UA.indexOf('edge/') > 0;
  7423. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  7424. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  7425. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  7426. var isPhantomJS = UA && /phantomjs/.test(UA);
  7427. var isFF = UA && UA.match(/firefox\/(\d+)/);
  7428. // Firefox has a "watch" function on Object.prototype...
  7429. var nativeWatch = ({}).watch;
  7430. if (inBrowser) {
  7431. try {
  7432. var opts = {};
  7433. Object.defineProperty(opts, 'passive', ({
  7434. get: function get () {
  7435. }
  7436. })); // https://github.com/facebook/flow/issues/285
  7437. window.addEventListener('test-passive', null, opts);
  7438. } catch (e) {}
  7439. }
  7440. // this needs to be lazy-evaled because vue may be required before
  7441. // vue-server-renderer can set VUE_ENV
  7442. var _isServer;
  7443. var isServerRendering = function () {
  7444. if (_isServer === undefined) {
  7445. /* istanbul ignore if */
  7446. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  7447. // detect presence of vue-server-renderer and avoid
  7448. // Webpack shimming the process
  7449. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  7450. } else {
  7451. _isServer = false;
  7452. }
  7453. }
  7454. return _isServer
  7455. };
  7456. // detect devtools
  7457. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  7458. /* istanbul ignore next */
  7459. function isNative (Ctor) {
  7460. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  7461. }
  7462. var hasSymbol =
  7463. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  7464. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  7465. var _Set;
  7466. /* istanbul ignore if */ // $flow-disable-line
  7467. if (typeof Set !== 'undefined' && isNative(Set)) {
  7468. // use native Set when available.
  7469. _Set = Set;
  7470. } else {
  7471. // a non-standard Set polyfill that only works with primitive keys.
  7472. _Set = /*@__PURE__*/(function () {
  7473. function Set () {
  7474. this.set = Object.create(null);
  7475. }
  7476. Set.prototype.has = function has (key) {
  7477. return this.set[key] === true
  7478. };
  7479. Set.prototype.add = function add (key) {
  7480. this.set[key] = true;
  7481. };
  7482. Set.prototype.clear = function clear () {
  7483. this.set = Object.create(null);
  7484. };
  7485. return Set;
  7486. }());
  7487. }
  7488. /* */
  7489. var warn = noop;
  7490. var tip = noop;
  7491. var generateComponentTrace = (noop); // work around flow check
  7492. var formatComponentName = (noop);
  7493. if (true) {
  7494. var hasConsole = typeof console !== 'undefined';
  7495. var classifyRE = /(?:^|[-_])(\w)/g;
  7496. var classify = function (str) { return str
  7497. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  7498. .replace(/[-_]/g, ''); };
  7499. warn = function (msg, vm) {
  7500. var trace = vm ? generateComponentTrace(vm) : '';
  7501. if (config.warnHandler) {
  7502. config.warnHandler.call(null, msg, vm, trace);
  7503. } else if (hasConsole && (!config.silent)) {
  7504. console.error(("[Vue warn]: " + msg + trace));
  7505. }
  7506. };
  7507. tip = function (msg, vm) {
  7508. if (hasConsole && (!config.silent)) {
  7509. console.warn("[Vue tip]: " + msg + (
  7510. vm ? generateComponentTrace(vm) : ''
  7511. ));
  7512. }
  7513. };
  7514. formatComponentName = function (vm, includeFile) {
  7515. if (vm.$root === vm) {
  7516. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  7517. return ('') + vm.$options.__file
  7518. }
  7519. return '<Root>'
  7520. }
  7521. var options = typeof vm === 'function' && vm.cid != null
  7522. ? vm.options
  7523. : vm._isVue
  7524. ? vm.$options || vm.constructor.options
  7525. : vm;
  7526. var name = options.name || options._componentTag;
  7527. var file = options.__file;
  7528. if (!name && file) {
  7529. var match = file.match(/([^/\\]+)\.vue$/);
  7530. name = match && match[1];
  7531. }
  7532. return (
  7533. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  7534. (file && includeFile !== false ? (" at " + file) : '')
  7535. )
  7536. };
  7537. var repeat = function (str, n) {
  7538. var res = '';
  7539. while (n) {
  7540. if (n % 2 === 1) { res += str; }
  7541. if (n > 1) { str += str; }
  7542. n >>= 1;
  7543. }
  7544. return res
  7545. };
  7546. generateComponentTrace = function (vm) {
  7547. if (vm._isVue && vm.$parent) {
  7548. var tree = [];
  7549. var currentRecursiveSequence = 0;
  7550. while (vm && vm.$options.name !== 'PageBody') {
  7551. if (tree.length > 0) {
  7552. var last = tree[tree.length - 1];
  7553. if (last.constructor === vm.constructor) {
  7554. currentRecursiveSequence++;
  7555. vm = vm.$parent;
  7556. continue
  7557. } else if (currentRecursiveSequence > 0) {
  7558. tree[tree.length - 1] = [last, currentRecursiveSequence];
  7559. currentRecursiveSequence = 0;
  7560. }
  7561. }
  7562. !vm.$options.isReserved && tree.push(vm);
  7563. vm = vm.$parent;
  7564. }
  7565. return '\n\nfound in\n\n' + tree
  7566. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  7567. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  7568. : formatComponentName(vm))); })
  7569. .join('\n')
  7570. } else {
  7571. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  7572. }
  7573. };
  7574. }
  7575. /* */
  7576. var uid = 0;
  7577. /**
  7578. * A dep is an observable that can have multiple
  7579. * directives subscribing to it.
  7580. */
  7581. var Dep = function Dep () {
  7582. this.id = uid++;
  7583. this.subs = [];
  7584. };
  7585. Dep.prototype.addSub = function addSub (sub) {
  7586. this.subs.push(sub);
  7587. };
  7588. Dep.prototype.removeSub = function removeSub (sub) {
  7589. remove(this.subs, sub);
  7590. };
  7591. Dep.prototype.depend = function depend () {
  7592. if (Dep.SharedObject.target) {
  7593. Dep.SharedObject.target.addDep(this);
  7594. }
  7595. };
  7596. Dep.prototype.notify = function notify () {
  7597. // stabilize the subscriber list first
  7598. var subs = this.subs.slice();
  7599. if ( true && !config.async) {
  7600. // subs aren't sorted in scheduler if not running async
  7601. // we need to sort them now to make sure they fire in correct
  7602. // order
  7603. subs.sort(function (a, b) { return a.id - b.id; });
  7604. }
  7605. for (var i = 0, l = subs.length; i < l; i++) {
  7606. subs[i].update();
  7607. }
  7608. };
  7609. // The current target watcher being evaluated.
  7610. // This is globally unique because only one watcher
  7611. // can be evaluated at a time.
  7612. // fixed by xxxxxx (nvue shared vuex)
  7613. /* eslint-disable no-undef */
  7614. Dep.SharedObject = {};
  7615. Dep.SharedObject.target = null;
  7616. Dep.SharedObject.targetStack = [];
  7617. function pushTarget (target) {
  7618. Dep.SharedObject.targetStack.push(target);
  7619. Dep.SharedObject.target = target;
  7620. Dep.target = target;
  7621. }
  7622. function popTarget () {
  7623. Dep.SharedObject.targetStack.pop();
  7624. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  7625. Dep.target = Dep.SharedObject.target;
  7626. }
  7627. /* */
  7628. var VNode = function VNode (
  7629. tag,
  7630. data,
  7631. children,
  7632. text,
  7633. elm,
  7634. context,
  7635. componentOptions,
  7636. asyncFactory
  7637. ) {
  7638. this.tag = tag;
  7639. this.data = data;
  7640. this.children = children;
  7641. this.text = text;
  7642. this.elm = elm;
  7643. this.ns = undefined;
  7644. this.context = context;
  7645. this.fnContext = undefined;
  7646. this.fnOptions = undefined;
  7647. this.fnScopeId = undefined;
  7648. this.key = data && data.key;
  7649. this.componentOptions = componentOptions;
  7650. this.componentInstance = undefined;
  7651. this.parent = undefined;
  7652. this.raw = false;
  7653. this.isStatic = false;
  7654. this.isRootInsert = true;
  7655. this.isComment = false;
  7656. this.isCloned = false;
  7657. this.isOnce = false;
  7658. this.asyncFactory = asyncFactory;
  7659. this.asyncMeta = undefined;
  7660. this.isAsyncPlaceholder = false;
  7661. };
  7662. var prototypeAccessors = { child: { configurable: true } };
  7663. // DEPRECATED: alias for componentInstance for backwards compat.
  7664. /* istanbul ignore next */
  7665. prototypeAccessors.child.get = function () {
  7666. return this.componentInstance
  7667. };
  7668. Object.defineProperties( VNode.prototype, prototypeAccessors );
  7669. var createEmptyVNode = function (text) {
  7670. if ( text === void 0 ) text = '';
  7671. var node = new VNode();
  7672. node.text = text;
  7673. node.isComment = true;
  7674. return node
  7675. };
  7676. function createTextVNode (val) {
  7677. return new VNode(undefined, undefined, undefined, String(val))
  7678. }
  7679. // optimized shallow clone
  7680. // used for static nodes and slot nodes because they may be reused across
  7681. // multiple renders, cloning them avoids errors when DOM manipulations rely
  7682. // on their elm reference.
  7683. function cloneVNode (vnode) {
  7684. var cloned = new VNode(
  7685. vnode.tag,
  7686. vnode.data,
  7687. // #7975
  7688. // clone children array to avoid mutating original in case of cloning
  7689. // a child.
  7690. vnode.children && vnode.children.slice(),
  7691. vnode.text,
  7692. vnode.elm,
  7693. vnode.context,
  7694. vnode.componentOptions,
  7695. vnode.asyncFactory
  7696. );
  7697. cloned.ns = vnode.ns;
  7698. cloned.isStatic = vnode.isStatic;
  7699. cloned.key = vnode.key;
  7700. cloned.isComment = vnode.isComment;
  7701. cloned.fnContext = vnode.fnContext;
  7702. cloned.fnOptions = vnode.fnOptions;
  7703. cloned.fnScopeId = vnode.fnScopeId;
  7704. cloned.asyncMeta = vnode.asyncMeta;
  7705. cloned.isCloned = true;
  7706. return cloned
  7707. }
  7708. /*
  7709. * not type checking this file because flow doesn't play well with
  7710. * dynamically accessing methods on Array prototype
  7711. */
  7712. var arrayProto = Array.prototype;
  7713. var arrayMethods = Object.create(arrayProto);
  7714. var methodsToPatch = [
  7715. 'push',
  7716. 'pop',
  7717. 'shift',
  7718. 'unshift',
  7719. 'splice',
  7720. 'sort',
  7721. 'reverse'
  7722. ];
  7723. /**
  7724. * Intercept mutating methods and emit events
  7725. */
  7726. methodsToPatch.forEach(function (method) {
  7727. // cache original method
  7728. var original = arrayProto[method];
  7729. def(arrayMethods, method, function mutator () {
  7730. var args = [], len = arguments.length;
  7731. while ( len-- ) args[ len ] = arguments[ len ];
  7732. var result = original.apply(this, args);
  7733. var ob = this.__ob__;
  7734. var inserted;
  7735. switch (method) {
  7736. case 'push':
  7737. case 'unshift':
  7738. inserted = args;
  7739. break
  7740. case 'splice':
  7741. inserted = args.slice(2);
  7742. break
  7743. }
  7744. if (inserted) { ob.observeArray(inserted); }
  7745. // notify change
  7746. ob.dep.notify();
  7747. return result
  7748. });
  7749. });
  7750. /* */
  7751. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  7752. /**
  7753. * In some cases we may want to disable observation inside a component's
  7754. * update computation.
  7755. */
  7756. var shouldObserve = true;
  7757. function toggleObserving (value) {
  7758. shouldObserve = value;
  7759. }
  7760. /**
  7761. * Observer class that is attached to each observed
  7762. * object. Once attached, the observer converts the target
  7763. * object's property keys into getter/setters that
  7764. * collect dependencies and dispatch updates.
  7765. */
  7766. var Observer = function Observer (value) {
  7767. this.value = value;
  7768. this.dep = new Dep();
  7769. this.vmCount = 0;
  7770. def(value, '__ob__', this);
  7771. if (Array.isArray(value)) {
  7772. if (hasProto) {
  7773. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  7774. if(value.push !== value.__proto__.push){
  7775. copyAugment(value, arrayMethods, arrayKeys);
  7776. } else {
  7777. protoAugment(value, arrayMethods);
  7778. }
  7779. }
  7780. } else {
  7781. copyAugment(value, arrayMethods, arrayKeys);
  7782. }
  7783. this.observeArray(value);
  7784. } else {
  7785. this.walk(value);
  7786. }
  7787. };
  7788. /**
  7789. * Walk through all properties and convert them into
  7790. * getter/setters. This method should only be called when
  7791. * value type is Object.
  7792. */
  7793. Observer.prototype.walk = function walk (obj) {
  7794. var keys = Object.keys(obj);
  7795. for (var i = 0; i < keys.length; i++) {
  7796. defineReactive$$1(obj, keys[i]);
  7797. }
  7798. };
  7799. /**
  7800. * Observe a list of Array items.
  7801. */
  7802. Observer.prototype.observeArray = function observeArray (items) {
  7803. for (var i = 0, l = items.length; i < l; i++) {
  7804. observe(items[i]);
  7805. }
  7806. };
  7807. // helpers
  7808. /**
  7809. * Augment a target Object or Array by intercepting
  7810. * the prototype chain using __proto__
  7811. */
  7812. function protoAugment (target, src) {
  7813. /* eslint-disable no-proto */
  7814. target.__proto__ = src;
  7815. /* eslint-enable no-proto */
  7816. }
  7817. /**
  7818. * Augment a target Object or Array by defining
  7819. * hidden properties.
  7820. */
  7821. /* istanbul ignore next */
  7822. function copyAugment (target, src, keys) {
  7823. for (var i = 0, l = keys.length; i < l; i++) {
  7824. var key = keys[i];
  7825. def(target, key, src[key]);
  7826. }
  7827. }
  7828. /**
  7829. * Attempt to create an observer instance for a value,
  7830. * returns the new observer if successfully observed,
  7831. * or the existing observer if the value already has one.
  7832. */
  7833. function observe (value, asRootData) {
  7834. if (!isObject(value) || value instanceof VNode) {
  7835. return
  7836. }
  7837. var ob;
  7838. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  7839. ob = value.__ob__;
  7840. } else if (
  7841. shouldObserve &&
  7842. !isServerRendering() &&
  7843. (Array.isArray(value) || isPlainObject(value)) &&
  7844. Object.isExtensible(value) &&
  7845. !value._isVue
  7846. ) {
  7847. ob = new Observer(value);
  7848. }
  7849. if (asRootData && ob) {
  7850. ob.vmCount++;
  7851. }
  7852. return ob
  7853. }
  7854. /**
  7855. * Define a reactive property on an Object.
  7856. */
  7857. function defineReactive$$1 (
  7858. obj,
  7859. key,
  7860. val,
  7861. customSetter,
  7862. shallow
  7863. ) {
  7864. var dep = new Dep();
  7865. var property = Object.getOwnPropertyDescriptor(obj, key);
  7866. if (property && property.configurable === false) {
  7867. return
  7868. }
  7869. // cater for pre-defined getter/setters
  7870. var getter = property && property.get;
  7871. var setter = property && property.set;
  7872. if ((!getter || setter) && arguments.length === 2) {
  7873. val = obj[key];
  7874. }
  7875. var childOb = !shallow && observe(val);
  7876. Object.defineProperty(obj, key, {
  7877. enumerable: true,
  7878. configurable: true,
  7879. get: function reactiveGetter () {
  7880. var value = getter ? getter.call(obj) : val;
  7881. if (Dep.SharedObject.target) { // fixed by xxxxxx
  7882. dep.depend();
  7883. if (childOb) {
  7884. childOb.dep.depend();
  7885. if (Array.isArray(value)) {
  7886. dependArray(value);
  7887. }
  7888. }
  7889. }
  7890. return value
  7891. },
  7892. set: function reactiveSetter (newVal) {
  7893. var value = getter ? getter.call(obj) : val;
  7894. /* eslint-disable no-self-compare */
  7895. if (newVal === value || (newVal !== newVal && value !== value)) {
  7896. return
  7897. }
  7898. /* eslint-enable no-self-compare */
  7899. if ( true && customSetter) {
  7900. customSetter();
  7901. }
  7902. // #7981: for accessor properties without setter
  7903. if (getter && !setter) { return }
  7904. if (setter) {
  7905. setter.call(obj, newVal);
  7906. } else {
  7907. val = newVal;
  7908. }
  7909. childOb = !shallow && observe(newVal);
  7910. dep.notify();
  7911. }
  7912. });
  7913. }
  7914. /**
  7915. * Set a property on an object. Adds the new property and
  7916. * triggers change notification if the property doesn't
  7917. * already exist.
  7918. */
  7919. function set (target, key, val) {
  7920. if ( true &&
  7921. (isUndef(target) || isPrimitive(target))
  7922. ) {
  7923. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  7924. }
  7925. if (Array.isArray(target) && isValidArrayIndex(key)) {
  7926. target.length = Math.max(target.length, key);
  7927. target.splice(key, 1, val);
  7928. return val
  7929. }
  7930. if (key in target && !(key in Object.prototype)) {
  7931. target[key] = val;
  7932. return val
  7933. }
  7934. var ob = (target).__ob__;
  7935. if (target._isVue || (ob && ob.vmCount)) {
  7936. true && warn(
  7937. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  7938. 'at runtime - declare it upfront in the data option.'
  7939. );
  7940. return val
  7941. }
  7942. if (!ob) {
  7943. target[key] = val;
  7944. return val
  7945. }
  7946. defineReactive$$1(ob.value, key, val);
  7947. ob.dep.notify();
  7948. return val
  7949. }
  7950. /**
  7951. * Delete a property and trigger change if necessary.
  7952. */
  7953. function del (target, key) {
  7954. if ( true &&
  7955. (isUndef(target) || isPrimitive(target))
  7956. ) {
  7957. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  7958. }
  7959. if (Array.isArray(target) && isValidArrayIndex(key)) {
  7960. target.splice(key, 1);
  7961. return
  7962. }
  7963. var ob = (target).__ob__;
  7964. if (target._isVue || (ob && ob.vmCount)) {
  7965. true && warn(
  7966. 'Avoid deleting properties on a Vue instance or its root $data ' +
  7967. '- just set it to null.'
  7968. );
  7969. return
  7970. }
  7971. if (!hasOwn(target, key)) {
  7972. return
  7973. }
  7974. delete target[key];
  7975. if (!ob) {
  7976. return
  7977. }
  7978. ob.dep.notify();
  7979. }
  7980. /**
  7981. * Collect dependencies on array elements when the array is touched, since
  7982. * we cannot intercept array element access like property getters.
  7983. */
  7984. function dependArray (value) {
  7985. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  7986. e = value[i];
  7987. e && e.__ob__ && e.__ob__.dep.depend();
  7988. if (Array.isArray(e)) {
  7989. dependArray(e);
  7990. }
  7991. }
  7992. }
  7993. /* */
  7994. /**
  7995. * Option overwriting strategies are functions that handle
  7996. * how to merge a parent option value and a child option
  7997. * value into the final value.
  7998. */
  7999. var strats = config.optionMergeStrategies;
  8000. /**
  8001. * Options with restrictions
  8002. */
  8003. if (true) {
  8004. strats.el = strats.propsData = function (parent, child, vm, key) {
  8005. if (!vm) {
  8006. warn(
  8007. "option \"" + key + "\" can only be used during instance " +
  8008. 'creation with the `new` keyword.'
  8009. );
  8010. }
  8011. return defaultStrat(parent, child)
  8012. };
  8013. }
  8014. /**
  8015. * Helper that recursively merges two data objects together.
  8016. */
  8017. function mergeData (to, from) {
  8018. if (!from) { return to }
  8019. var key, toVal, fromVal;
  8020. var keys = hasSymbol
  8021. ? Reflect.ownKeys(from)
  8022. : Object.keys(from);
  8023. for (var i = 0; i < keys.length; i++) {
  8024. key = keys[i];
  8025. // in case the object is already observed...
  8026. if (key === '__ob__') { continue }
  8027. toVal = to[key];
  8028. fromVal = from[key];
  8029. if (!hasOwn(to, key)) {
  8030. set(to, key, fromVal);
  8031. } else if (
  8032. toVal !== fromVal &&
  8033. isPlainObject(toVal) &&
  8034. isPlainObject(fromVal)
  8035. ) {
  8036. mergeData(toVal, fromVal);
  8037. }
  8038. }
  8039. return to
  8040. }
  8041. /**
  8042. * Data
  8043. */
  8044. function mergeDataOrFn (
  8045. parentVal,
  8046. childVal,
  8047. vm
  8048. ) {
  8049. if (!vm) {
  8050. // in a Vue.extend merge, both should be functions
  8051. if (!childVal) {
  8052. return parentVal
  8053. }
  8054. if (!parentVal) {
  8055. return childVal
  8056. }
  8057. // when parentVal & childVal are both present,
  8058. // we need to return a function that returns the
  8059. // merged result of both functions... no need to
  8060. // check if parentVal is a function here because
  8061. // it has to be a function to pass previous merges.
  8062. return function mergedDataFn () {
  8063. return mergeData(
  8064. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  8065. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  8066. )
  8067. }
  8068. } else {
  8069. return function mergedInstanceDataFn () {
  8070. // instance merge
  8071. var instanceData = typeof childVal === 'function'
  8072. ? childVal.call(vm, vm)
  8073. : childVal;
  8074. var defaultData = typeof parentVal === 'function'
  8075. ? parentVal.call(vm, vm)
  8076. : parentVal;
  8077. if (instanceData) {
  8078. return mergeData(instanceData, defaultData)
  8079. } else {
  8080. return defaultData
  8081. }
  8082. }
  8083. }
  8084. }
  8085. strats.data = function (
  8086. parentVal,
  8087. childVal,
  8088. vm
  8089. ) {
  8090. if (!vm) {
  8091. if (childVal && typeof childVal !== 'function') {
  8092. true && warn(
  8093. 'The "data" option should be a function ' +
  8094. 'that returns a per-instance value in component ' +
  8095. 'definitions.',
  8096. vm
  8097. );
  8098. return parentVal
  8099. }
  8100. return mergeDataOrFn(parentVal, childVal)
  8101. }
  8102. return mergeDataOrFn(parentVal, childVal, vm)
  8103. };
  8104. /**
  8105. * Hooks and props are merged as arrays.
  8106. */
  8107. function mergeHook (
  8108. parentVal,
  8109. childVal
  8110. ) {
  8111. var res = childVal
  8112. ? parentVal
  8113. ? parentVal.concat(childVal)
  8114. : Array.isArray(childVal)
  8115. ? childVal
  8116. : [childVal]
  8117. : parentVal;
  8118. return res
  8119. ? dedupeHooks(res)
  8120. : res
  8121. }
  8122. function dedupeHooks (hooks) {
  8123. var res = [];
  8124. for (var i = 0; i < hooks.length; i++) {
  8125. if (res.indexOf(hooks[i]) === -1) {
  8126. res.push(hooks[i]);
  8127. }
  8128. }
  8129. return res
  8130. }
  8131. LIFECYCLE_HOOKS.forEach(function (hook) {
  8132. strats[hook] = mergeHook;
  8133. });
  8134. /**
  8135. * Assets
  8136. *
  8137. * When a vm is present (instance creation), we need to do
  8138. * a three-way merge between constructor options, instance
  8139. * options and parent options.
  8140. */
  8141. function mergeAssets (
  8142. parentVal,
  8143. childVal,
  8144. vm,
  8145. key
  8146. ) {
  8147. var res = Object.create(parentVal || null);
  8148. if (childVal) {
  8149. true && assertObjectType(key, childVal, vm);
  8150. return extend(res, childVal)
  8151. } else {
  8152. return res
  8153. }
  8154. }
  8155. ASSET_TYPES.forEach(function (type) {
  8156. strats[type + 's'] = mergeAssets;
  8157. });
  8158. /**
  8159. * Watchers.
  8160. *
  8161. * Watchers hashes should not overwrite one
  8162. * another, so we merge them as arrays.
  8163. */
  8164. strats.watch = function (
  8165. parentVal,
  8166. childVal,
  8167. vm,
  8168. key
  8169. ) {
  8170. // work around Firefox's Object.prototype.watch...
  8171. if (parentVal === nativeWatch) { parentVal = undefined; }
  8172. if (childVal === nativeWatch) { childVal = undefined; }
  8173. /* istanbul ignore if */
  8174. if (!childVal) { return Object.create(parentVal || null) }
  8175. if (true) {
  8176. assertObjectType(key, childVal, vm);
  8177. }
  8178. if (!parentVal) { return childVal }
  8179. var ret = {};
  8180. extend(ret, parentVal);
  8181. for (var key$1 in childVal) {
  8182. var parent = ret[key$1];
  8183. var child = childVal[key$1];
  8184. if (parent && !Array.isArray(parent)) {
  8185. parent = [parent];
  8186. }
  8187. ret[key$1] = parent
  8188. ? parent.concat(child)
  8189. : Array.isArray(child) ? child : [child];
  8190. }
  8191. return ret
  8192. };
  8193. /**
  8194. * Other object hashes.
  8195. */
  8196. strats.props =
  8197. strats.methods =
  8198. strats.inject =
  8199. strats.computed = function (
  8200. parentVal,
  8201. childVal,
  8202. vm,
  8203. key
  8204. ) {
  8205. if (childVal && "development" !== 'production') {
  8206. assertObjectType(key, childVal, vm);
  8207. }
  8208. if (!parentVal) { return childVal }
  8209. var ret = Object.create(null);
  8210. extend(ret, parentVal);
  8211. if (childVal) { extend(ret, childVal); }
  8212. return ret
  8213. };
  8214. strats.provide = mergeDataOrFn;
  8215. /**
  8216. * Default strategy.
  8217. */
  8218. var defaultStrat = function (parentVal, childVal) {
  8219. return childVal === undefined
  8220. ? parentVal
  8221. : childVal
  8222. };
  8223. /**
  8224. * Validate component names
  8225. */
  8226. function checkComponents (options) {
  8227. for (var key in options.components) {
  8228. validateComponentName(key);
  8229. }
  8230. }
  8231. function validateComponentName (name) {
  8232. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  8233. warn(
  8234. 'Invalid component name: "' + name + '". Component names ' +
  8235. 'should conform to valid custom element name in html5 specification.'
  8236. );
  8237. }
  8238. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  8239. warn(
  8240. 'Do not use built-in or reserved HTML elements as component ' +
  8241. 'id: ' + name
  8242. );
  8243. }
  8244. }
  8245. /**
  8246. * Ensure all props option syntax are normalized into the
  8247. * Object-based format.
  8248. */
  8249. function normalizeProps (options, vm) {
  8250. var props = options.props;
  8251. if (!props) { return }
  8252. var res = {};
  8253. var i, val, name;
  8254. if (Array.isArray(props)) {
  8255. i = props.length;
  8256. while (i--) {
  8257. val = props[i];
  8258. if (typeof val === 'string') {
  8259. name = camelize(val);
  8260. res[name] = { type: null };
  8261. } else if (true) {
  8262. warn('props must be strings when using array syntax.');
  8263. }
  8264. }
  8265. } else if (isPlainObject(props)) {
  8266. for (var key in props) {
  8267. val = props[key];
  8268. name = camelize(key);
  8269. res[name] = isPlainObject(val)
  8270. ? val
  8271. : { type: val };
  8272. }
  8273. } else if (true) {
  8274. warn(
  8275. "Invalid value for option \"props\": expected an Array or an Object, " +
  8276. "but got " + (toRawType(props)) + ".",
  8277. vm
  8278. );
  8279. }
  8280. options.props = res;
  8281. }
  8282. /**
  8283. * Normalize all injections into Object-based format
  8284. */
  8285. function normalizeInject (options, vm) {
  8286. var inject = options.inject;
  8287. if (!inject) { return }
  8288. var normalized = options.inject = {};
  8289. if (Array.isArray(inject)) {
  8290. for (var i = 0; i < inject.length; i++) {
  8291. normalized[inject[i]] = { from: inject[i] };
  8292. }
  8293. } else if (isPlainObject(inject)) {
  8294. for (var key in inject) {
  8295. var val = inject[key];
  8296. normalized[key] = isPlainObject(val)
  8297. ? extend({ from: key }, val)
  8298. : { from: val };
  8299. }
  8300. } else if (true) {
  8301. warn(
  8302. "Invalid value for option \"inject\": expected an Array or an Object, " +
  8303. "but got " + (toRawType(inject)) + ".",
  8304. vm
  8305. );
  8306. }
  8307. }
  8308. /**
  8309. * Normalize raw function directives into object format.
  8310. */
  8311. function normalizeDirectives (options) {
  8312. var dirs = options.directives;
  8313. if (dirs) {
  8314. for (var key in dirs) {
  8315. var def$$1 = dirs[key];
  8316. if (typeof def$$1 === 'function') {
  8317. dirs[key] = { bind: def$$1, update: def$$1 };
  8318. }
  8319. }
  8320. }
  8321. }
  8322. function assertObjectType (name, value, vm) {
  8323. if (!isPlainObject(value)) {
  8324. warn(
  8325. "Invalid value for option \"" + name + "\": expected an Object, " +
  8326. "but got " + (toRawType(value)) + ".",
  8327. vm
  8328. );
  8329. }
  8330. }
  8331. /**
  8332. * Merge two option objects into a new one.
  8333. * Core utility used in both instantiation and inheritance.
  8334. */
  8335. function mergeOptions (
  8336. parent,
  8337. child,
  8338. vm
  8339. ) {
  8340. if (true) {
  8341. checkComponents(child);
  8342. }
  8343. if (typeof child === 'function') {
  8344. child = child.options;
  8345. }
  8346. normalizeProps(child, vm);
  8347. normalizeInject(child, vm);
  8348. normalizeDirectives(child);
  8349. // Apply extends and mixins on the child options,
  8350. // but only if it is a raw options object that isn't
  8351. // the result of another mergeOptions call.
  8352. // Only merged options has the _base property.
  8353. if (!child._base) {
  8354. if (child.extends) {
  8355. parent = mergeOptions(parent, child.extends, vm);
  8356. }
  8357. if (child.mixins) {
  8358. for (var i = 0, l = child.mixins.length; i < l; i++) {
  8359. parent = mergeOptions(parent, child.mixins[i], vm);
  8360. }
  8361. }
  8362. }
  8363. var options = {};
  8364. var key;
  8365. for (key in parent) {
  8366. mergeField(key);
  8367. }
  8368. for (key in child) {
  8369. if (!hasOwn(parent, key)) {
  8370. mergeField(key);
  8371. }
  8372. }
  8373. function mergeField (key) {
  8374. var strat = strats[key] || defaultStrat;
  8375. options[key] = strat(parent[key], child[key], vm, key);
  8376. }
  8377. return options
  8378. }
  8379. /**
  8380. * Resolve an asset.
  8381. * This function is used because child instances need access
  8382. * to assets defined in its ancestor chain.
  8383. */
  8384. function resolveAsset (
  8385. options,
  8386. type,
  8387. id,
  8388. warnMissing
  8389. ) {
  8390. /* istanbul ignore if */
  8391. if (typeof id !== 'string') {
  8392. return
  8393. }
  8394. var assets = options[type];
  8395. // check local registration variations first
  8396. if (hasOwn(assets, id)) { return assets[id] }
  8397. var camelizedId = camelize(id);
  8398. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  8399. var PascalCaseId = capitalize(camelizedId);
  8400. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  8401. // fallback to prototype chain
  8402. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  8403. if ( true && warnMissing && !res) {
  8404. warn(
  8405. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  8406. options
  8407. );
  8408. }
  8409. return res
  8410. }
  8411. /* */
  8412. function validateProp (
  8413. key,
  8414. propOptions,
  8415. propsData,
  8416. vm
  8417. ) {
  8418. var prop = propOptions[key];
  8419. var absent = !hasOwn(propsData, key);
  8420. var value = propsData[key];
  8421. // boolean casting
  8422. var booleanIndex = getTypeIndex(Boolean, prop.type);
  8423. if (booleanIndex > -1) {
  8424. if (absent && !hasOwn(prop, 'default')) {
  8425. value = false;
  8426. } else if (value === '' || value === hyphenate(key)) {
  8427. // only cast empty string / same name to boolean if
  8428. // boolean has higher priority
  8429. var stringIndex = getTypeIndex(String, prop.type);
  8430. if (stringIndex < 0 || booleanIndex < stringIndex) {
  8431. value = true;
  8432. }
  8433. }
  8434. }
  8435. // check default value
  8436. if (value === undefined) {
  8437. value = getPropDefaultValue(vm, prop, key);
  8438. // since the default value is a fresh copy,
  8439. // make sure to observe it.
  8440. var prevShouldObserve = shouldObserve;
  8441. toggleObserving(true);
  8442. observe(value);
  8443. toggleObserving(prevShouldObserve);
  8444. }
  8445. if (
  8446. true
  8447. ) {
  8448. assertProp(prop, key, value, vm, absent);
  8449. }
  8450. return value
  8451. }
  8452. /**
  8453. * Get the default value of a prop.
  8454. */
  8455. function getPropDefaultValue (vm, prop, key) {
  8456. // no default, return undefined
  8457. if (!hasOwn(prop, 'default')) {
  8458. return undefined
  8459. }
  8460. var def = prop.default;
  8461. // warn against non-factory defaults for Object & Array
  8462. if ( true && isObject(def)) {
  8463. warn(
  8464. 'Invalid default value for prop "' + key + '": ' +
  8465. 'Props with type Object/Array must use a factory function ' +
  8466. 'to return the default value.',
  8467. vm
  8468. );
  8469. }
  8470. // the raw prop value was also undefined from previous render,
  8471. // return previous default value to avoid unnecessary watcher trigger
  8472. if (vm && vm.$options.propsData &&
  8473. vm.$options.propsData[key] === undefined &&
  8474. vm._props[key] !== undefined
  8475. ) {
  8476. return vm._props[key]
  8477. }
  8478. // call factory function for non-Function types
  8479. // a value is Function if its prototype is function even across different execution context
  8480. return typeof def === 'function' && getType(prop.type) !== 'Function'
  8481. ? def.call(vm)
  8482. : def
  8483. }
  8484. /**
  8485. * Assert whether a prop is valid.
  8486. */
  8487. function assertProp (
  8488. prop,
  8489. name,
  8490. value,
  8491. vm,
  8492. absent
  8493. ) {
  8494. if (prop.required && absent) {
  8495. warn(
  8496. 'Missing required prop: "' + name + '"',
  8497. vm
  8498. );
  8499. return
  8500. }
  8501. if (value == null && !prop.required) {
  8502. return
  8503. }
  8504. var type = prop.type;
  8505. var valid = !type || type === true;
  8506. var expectedTypes = [];
  8507. if (type) {
  8508. if (!Array.isArray(type)) {
  8509. type = [type];
  8510. }
  8511. for (var i = 0; i < type.length && !valid; i++) {
  8512. var assertedType = assertType(value, type[i]);
  8513. expectedTypes.push(assertedType.expectedType || '');
  8514. valid = assertedType.valid;
  8515. }
  8516. }
  8517. if (!valid) {
  8518. warn(
  8519. getInvalidTypeMessage(name, value, expectedTypes),
  8520. vm
  8521. );
  8522. return
  8523. }
  8524. var validator = prop.validator;
  8525. if (validator) {
  8526. if (!validator(value)) {
  8527. warn(
  8528. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  8529. vm
  8530. );
  8531. }
  8532. }
  8533. }
  8534. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  8535. function assertType (value, type) {
  8536. var valid;
  8537. var expectedType = getType(type);
  8538. if (simpleCheckRE.test(expectedType)) {
  8539. var t = typeof value;
  8540. valid = t === expectedType.toLowerCase();
  8541. // for primitive wrapper objects
  8542. if (!valid && t === 'object') {
  8543. valid = value instanceof type;
  8544. }
  8545. } else if (expectedType === 'Object') {
  8546. valid = isPlainObject(value);
  8547. } else if (expectedType === 'Array') {
  8548. valid = Array.isArray(value);
  8549. } else {
  8550. valid = value instanceof type;
  8551. }
  8552. return {
  8553. valid: valid,
  8554. expectedType: expectedType
  8555. }
  8556. }
  8557. /**
  8558. * Use function string name to check built-in types,
  8559. * because a simple equality check will fail when running
  8560. * across different vms / iframes.
  8561. */
  8562. function getType (fn) {
  8563. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  8564. return match ? match[1] : ''
  8565. }
  8566. function isSameType (a, b) {
  8567. return getType(a) === getType(b)
  8568. }
  8569. function getTypeIndex (type, expectedTypes) {
  8570. if (!Array.isArray(expectedTypes)) {
  8571. return isSameType(expectedTypes, type) ? 0 : -1
  8572. }
  8573. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  8574. if (isSameType(expectedTypes[i], type)) {
  8575. return i
  8576. }
  8577. }
  8578. return -1
  8579. }
  8580. function getInvalidTypeMessage (name, value, expectedTypes) {
  8581. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  8582. " Expected " + (expectedTypes.map(capitalize).join(', '));
  8583. var expectedType = expectedTypes[0];
  8584. var receivedType = toRawType(value);
  8585. var expectedValue = styleValue(value, expectedType);
  8586. var receivedValue = styleValue(value, receivedType);
  8587. // check if we need to specify expected value
  8588. if (expectedTypes.length === 1 &&
  8589. isExplicable(expectedType) &&
  8590. !isBoolean(expectedType, receivedType)) {
  8591. message += " with value " + expectedValue;
  8592. }
  8593. message += ", got " + receivedType + " ";
  8594. // check if we need to specify received value
  8595. if (isExplicable(receivedType)) {
  8596. message += "with value " + receivedValue + ".";
  8597. }
  8598. return message
  8599. }
  8600. function styleValue (value, type) {
  8601. if (type === 'String') {
  8602. return ("\"" + value + "\"")
  8603. } else if (type === 'Number') {
  8604. return ("" + (Number(value)))
  8605. } else {
  8606. return ("" + value)
  8607. }
  8608. }
  8609. function isExplicable (value) {
  8610. var explicitTypes = ['string', 'number', 'boolean'];
  8611. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  8612. }
  8613. function isBoolean () {
  8614. var args = [], len = arguments.length;
  8615. while ( len-- ) args[ len ] = arguments[ len ];
  8616. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  8617. }
  8618. /* */
  8619. function handleError (err, vm, info) {
  8620. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  8621. // See: https://github.com/vuejs/vuex/issues/1505
  8622. pushTarget();
  8623. try {
  8624. if (vm) {
  8625. var cur = vm;
  8626. while ((cur = cur.$parent)) {
  8627. var hooks = cur.$options.errorCaptured;
  8628. if (hooks) {
  8629. for (var i = 0; i < hooks.length; i++) {
  8630. try {
  8631. var capture = hooks[i].call(cur, err, vm, info) === false;
  8632. if (capture) { return }
  8633. } catch (e) {
  8634. globalHandleError(e, cur, 'errorCaptured hook');
  8635. }
  8636. }
  8637. }
  8638. }
  8639. }
  8640. globalHandleError(err, vm, info);
  8641. } finally {
  8642. popTarget();
  8643. }
  8644. }
  8645. function invokeWithErrorHandling (
  8646. handler,
  8647. context,
  8648. args,
  8649. vm,
  8650. info
  8651. ) {
  8652. var res;
  8653. try {
  8654. res = args ? handler.apply(context, args) : handler.call(context);
  8655. if (res && !res._isVue && isPromise(res) && !res._handled) {
  8656. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  8657. // issue #9511
  8658. // avoid catch triggering multiple times when nested calls
  8659. res._handled = true;
  8660. }
  8661. } catch (e) {
  8662. handleError(e, vm, info);
  8663. }
  8664. return res
  8665. }
  8666. function globalHandleError (err, vm, info) {
  8667. if (config.errorHandler) {
  8668. try {
  8669. return config.errorHandler.call(null, err, vm, info)
  8670. } catch (e) {
  8671. // if the user intentionally throws the original error in the handler,
  8672. // do not log it twice
  8673. if (e !== err) {
  8674. logError(e, null, 'config.errorHandler');
  8675. }
  8676. }
  8677. }
  8678. logError(err, vm, info);
  8679. }
  8680. function logError (err, vm, info) {
  8681. if (true) {
  8682. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8683. }
  8684. /* istanbul ignore else */
  8685. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  8686. console.error(err);
  8687. } else {
  8688. throw err
  8689. }
  8690. }
  8691. /* */
  8692. var callbacks = [];
  8693. var pending = false;
  8694. function flushCallbacks () {
  8695. pending = false;
  8696. var copies = callbacks.slice(0);
  8697. callbacks.length = 0;
  8698. for (var i = 0; i < copies.length; i++) {
  8699. copies[i]();
  8700. }
  8701. }
  8702. // Here we have async deferring wrappers using microtasks.
  8703. // In 2.5 we used (macro) tasks (in combination with microtasks).
  8704. // However, it has subtle problems when state is changed right before repaint
  8705. // (e.g. #6813, out-in transitions).
  8706. // Also, using (macro) tasks in event handler would cause some weird behaviors
  8707. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  8708. // So we now use microtasks everywhere, again.
  8709. // A major drawback of this tradeoff is that there are some scenarios
  8710. // where microtasks have too high a priority and fire in between supposedly
  8711. // sequential events (e.g. #4521, #6690, which have workarounds)
  8712. // or even between bubbling of the same event (#6566).
  8713. var timerFunc;
  8714. // The nextTick behavior leverages the microtask queue, which can be accessed
  8715. // via either native Promise.then or MutationObserver.
  8716. // MutationObserver has wider support, however it is seriously bugged in
  8717. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  8718. // completely stops working after triggering a few times... so, if native
  8719. // Promise is available, we will use it:
  8720. /* istanbul ignore next, $flow-disable-line */
  8721. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  8722. var p = Promise.resolve();
  8723. timerFunc = function () {
  8724. p.then(flushCallbacks);
  8725. // In problematic UIWebViews, Promise.then doesn't completely break, but
  8726. // it can get stuck in a weird state where callbacks are pushed into the
  8727. // microtask queue but the queue isn't being flushed, until the browser
  8728. // needs to do some other work, e.g. handle a timer. Therefore we can
  8729. // "force" the microtask queue to be flushed by adding an empty timer.
  8730. if (isIOS) { setTimeout(noop); }
  8731. };
  8732. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  8733. isNative(MutationObserver) ||
  8734. // PhantomJS and iOS 7.x
  8735. MutationObserver.toString() === '[object MutationObserverConstructor]'
  8736. )) {
  8737. // Use MutationObserver where native Promise is not available,
  8738. // e.g. PhantomJS, iOS7, Android 4.4
  8739. // (#6466 MutationObserver is unreliable in IE11)
  8740. var counter = 1;
  8741. var observer = new MutationObserver(flushCallbacks);
  8742. var textNode = document.createTextNode(String(counter));
  8743. observer.observe(textNode, {
  8744. characterData: true
  8745. });
  8746. timerFunc = function () {
  8747. counter = (counter + 1) % 2;
  8748. textNode.data = String(counter);
  8749. };
  8750. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  8751. // Fallback to setImmediate.
  8752. // Technically it leverages the (macro) task queue,
  8753. // but it is still a better choice than setTimeout.
  8754. timerFunc = function () {
  8755. setImmediate(flushCallbacks);
  8756. };
  8757. } else {
  8758. // Fallback to setTimeout.
  8759. timerFunc = function () {
  8760. setTimeout(flushCallbacks, 0);
  8761. };
  8762. }
  8763. function nextTick (cb, ctx) {
  8764. var _resolve;
  8765. callbacks.push(function () {
  8766. if (cb) {
  8767. try {
  8768. cb.call(ctx);
  8769. } catch (e) {
  8770. handleError(e, ctx, 'nextTick');
  8771. }
  8772. } else if (_resolve) {
  8773. _resolve(ctx);
  8774. }
  8775. });
  8776. if (!pending) {
  8777. pending = true;
  8778. timerFunc();
  8779. }
  8780. // $flow-disable-line
  8781. if (!cb && typeof Promise !== 'undefined') {
  8782. return new Promise(function (resolve) {
  8783. _resolve = resolve;
  8784. })
  8785. }
  8786. }
  8787. /* */
  8788. /* not type checking this file because flow doesn't play well with Proxy */
  8789. var initProxy;
  8790. if (true) {
  8791. var allowedGlobals = makeMap(
  8792. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  8793. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  8794. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  8795. 'require' // for Webpack/Browserify
  8796. );
  8797. var warnNonPresent = function (target, key) {
  8798. warn(
  8799. "Property or method \"" + key + "\" is not defined on the instance but " +
  8800. 'referenced during render. Make sure that this property is reactive, ' +
  8801. 'either in the data option, or for class-based components, by ' +
  8802. 'initializing the property. ' +
  8803. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  8804. target
  8805. );
  8806. };
  8807. var warnReservedPrefix = function (target, key) {
  8808. warn(
  8809. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  8810. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  8811. 'prevent conflicts with Vue internals. ' +
  8812. 'See: https://vuejs.org/v2/api/#data',
  8813. target
  8814. );
  8815. };
  8816. var hasProxy =
  8817. typeof Proxy !== 'undefined' && isNative(Proxy);
  8818. if (hasProxy) {
  8819. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  8820. config.keyCodes = new Proxy(config.keyCodes, {
  8821. set: function set (target, key, value) {
  8822. if (isBuiltInModifier(key)) {
  8823. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  8824. return false
  8825. } else {
  8826. target[key] = value;
  8827. return true
  8828. }
  8829. }
  8830. });
  8831. }
  8832. var hasHandler = {
  8833. has: function has (target, key) {
  8834. var has = key in target;
  8835. var isAllowed = allowedGlobals(key) ||
  8836. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  8837. if (!has && !isAllowed) {
  8838. if (key in target.$data) { warnReservedPrefix(target, key); }
  8839. else { warnNonPresent(target, key); }
  8840. }
  8841. return has || !isAllowed
  8842. }
  8843. };
  8844. var getHandler = {
  8845. get: function get (target, key) {
  8846. if (typeof key === 'string' && !(key in target)) {
  8847. if (key in target.$data) { warnReservedPrefix(target, key); }
  8848. else { warnNonPresent(target, key); }
  8849. }
  8850. return target[key]
  8851. }
  8852. };
  8853. initProxy = function initProxy (vm) {
  8854. if (hasProxy) {
  8855. // determine which proxy handler to use
  8856. var options = vm.$options;
  8857. var handlers = options.render && options.render._withStripped
  8858. ? getHandler
  8859. : hasHandler;
  8860. vm._renderProxy = new Proxy(vm, handlers);
  8861. } else {
  8862. vm._renderProxy = vm;
  8863. }
  8864. };
  8865. }
  8866. /* */
  8867. var seenObjects = new _Set();
  8868. /**
  8869. * Recursively traverse an object to evoke all converted
  8870. * getters, so that every nested property inside the object
  8871. * is collected as a "deep" dependency.
  8872. */
  8873. function traverse (val) {
  8874. _traverse(val, seenObjects);
  8875. seenObjects.clear();
  8876. }
  8877. function _traverse (val, seen) {
  8878. var i, keys;
  8879. var isA = Array.isArray(val);
  8880. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  8881. return
  8882. }
  8883. if (val.__ob__) {
  8884. var depId = val.__ob__.dep.id;
  8885. if (seen.has(depId)) {
  8886. return
  8887. }
  8888. seen.add(depId);
  8889. }
  8890. if (isA) {
  8891. i = val.length;
  8892. while (i--) { _traverse(val[i], seen); }
  8893. } else {
  8894. keys = Object.keys(val);
  8895. i = keys.length;
  8896. while (i--) { _traverse(val[keys[i]], seen); }
  8897. }
  8898. }
  8899. var mark;
  8900. var measure;
  8901. if (true) {
  8902. var perf = inBrowser && window.performance;
  8903. /* istanbul ignore if */
  8904. if (
  8905. perf &&
  8906. perf.mark &&
  8907. perf.measure &&
  8908. perf.clearMarks &&
  8909. perf.clearMeasures
  8910. ) {
  8911. mark = function (tag) { return perf.mark(tag); };
  8912. measure = function (name, startTag, endTag) {
  8913. perf.measure(name, startTag, endTag);
  8914. perf.clearMarks(startTag);
  8915. perf.clearMarks(endTag);
  8916. // perf.clearMeasures(name)
  8917. };
  8918. }
  8919. }
  8920. /* */
  8921. var normalizeEvent = cached(function (name) {
  8922. var passive = name.charAt(0) === '&';
  8923. name = passive ? name.slice(1) : name;
  8924. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  8925. name = once$$1 ? name.slice(1) : name;
  8926. var capture = name.charAt(0) === '!';
  8927. name = capture ? name.slice(1) : name;
  8928. return {
  8929. name: name,
  8930. once: once$$1,
  8931. capture: capture,
  8932. passive: passive
  8933. }
  8934. });
  8935. function createFnInvoker (fns, vm) {
  8936. function invoker () {
  8937. var arguments$1 = arguments;
  8938. var fns = invoker.fns;
  8939. if (Array.isArray(fns)) {
  8940. var cloned = fns.slice();
  8941. for (var i = 0; i < cloned.length; i++) {
  8942. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  8943. }
  8944. } else {
  8945. // return handler return value for single handlers
  8946. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  8947. }
  8948. }
  8949. invoker.fns = fns;
  8950. return invoker
  8951. }
  8952. function updateListeners (
  8953. on,
  8954. oldOn,
  8955. add,
  8956. remove$$1,
  8957. createOnceHandler,
  8958. vm
  8959. ) {
  8960. var name, def$$1, cur, old, event;
  8961. for (name in on) {
  8962. def$$1 = cur = on[name];
  8963. old = oldOn[name];
  8964. event = normalizeEvent(name);
  8965. if (isUndef(cur)) {
  8966. true && warn(
  8967. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  8968. vm
  8969. );
  8970. } else if (isUndef(old)) {
  8971. if (isUndef(cur.fns)) {
  8972. cur = on[name] = createFnInvoker(cur, vm);
  8973. }
  8974. if (isTrue(event.once)) {
  8975. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  8976. }
  8977. add(event.name, cur, event.capture, event.passive, event.params);
  8978. } else if (cur !== old) {
  8979. old.fns = cur;
  8980. on[name] = old;
  8981. }
  8982. }
  8983. for (name in oldOn) {
  8984. if (isUndef(on[name])) {
  8985. event = normalizeEvent(name);
  8986. remove$$1(event.name, oldOn[name], event.capture);
  8987. }
  8988. }
  8989. }
  8990. /* */
  8991. /* */
  8992. // fixed by xxxxxx (mp properties)
  8993. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  8994. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  8995. if (isUndef(propOptions)) {
  8996. return res
  8997. }
  8998. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  8999. var attrs = data.attrs;
  9000. var props = data.props;
  9001. if (isDef(attrs) || isDef(props)) {
  9002. for (var key in propOptions) {
  9003. var altKey = hyphenate(key);
  9004. var result = checkProp(res, props, key, altKey, true) ||
  9005. checkProp(res, attrs, key, altKey, false);
  9006. // externalClass
  9007. if (
  9008. result &&
  9009. res[key] &&
  9010. externalClasses.indexOf(altKey) !== -1 &&
  9011. context[camelize(res[key])]
  9012. ) {
  9013. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  9014. res[key] = context[camelize(res[key])];
  9015. }
  9016. }
  9017. }
  9018. return res
  9019. }
  9020. function extractPropsFromVNodeData (
  9021. data,
  9022. Ctor,
  9023. tag,
  9024. context// fixed by xxxxxx
  9025. ) {
  9026. // we are only extracting raw values here.
  9027. // validation and default values are handled in the child
  9028. // component itself.
  9029. var propOptions = Ctor.options.props;
  9030. if (isUndef(propOptions)) {
  9031. // fixed by xxxxxx
  9032. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  9033. }
  9034. var res = {};
  9035. var attrs = data.attrs;
  9036. var props = data.props;
  9037. if (isDef(attrs) || isDef(props)) {
  9038. for (var key in propOptions) {
  9039. var altKey = hyphenate(key);
  9040. if (true) {
  9041. var keyInLowerCase = key.toLowerCase();
  9042. if (
  9043. key !== keyInLowerCase &&
  9044. attrs && hasOwn(attrs, keyInLowerCase)
  9045. ) {
  9046. tip(
  9047. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  9048. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  9049. " \"" + key + "\". " +
  9050. "Note that HTML attributes are case-insensitive and camelCased " +
  9051. "props need to use their kebab-case equivalents when using in-DOM " +
  9052. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  9053. );
  9054. }
  9055. }
  9056. checkProp(res, props, key, altKey, true) ||
  9057. checkProp(res, attrs, key, altKey, false);
  9058. }
  9059. }
  9060. // fixed by xxxxxx
  9061. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  9062. }
  9063. function checkProp (
  9064. res,
  9065. hash,
  9066. key,
  9067. altKey,
  9068. preserve
  9069. ) {
  9070. if (isDef(hash)) {
  9071. if (hasOwn(hash, key)) {
  9072. res[key] = hash[key];
  9073. if (!preserve) {
  9074. delete hash[key];
  9075. }
  9076. return true
  9077. } else if (hasOwn(hash, altKey)) {
  9078. res[key] = hash[altKey];
  9079. if (!preserve) {
  9080. delete hash[altKey];
  9081. }
  9082. return true
  9083. }
  9084. }
  9085. return false
  9086. }
  9087. /* */
  9088. // The template compiler attempts to minimize the need for normalization by
  9089. // statically analyzing the template at compile time.
  9090. //
  9091. // For plain HTML markup, normalization can be completely skipped because the
  9092. // generated render function is guaranteed to return Array<VNode>. There are
  9093. // two cases where extra normalization is needed:
  9094. // 1. When the children contains components - because a functional component
  9095. // may return an Array instead of a single root. In this case, just a simple
  9096. // normalization is needed - if any child is an Array, we flatten the whole
  9097. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  9098. // because functional components already normalize their own children.
  9099. function simpleNormalizeChildren (children) {
  9100. for (var i = 0; i < children.length; i++) {
  9101. if (Array.isArray(children[i])) {
  9102. return Array.prototype.concat.apply([], children)
  9103. }
  9104. }
  9105. return children
  9106. }
  9107. // 2. When the children contains constructs that always generated nested Arrays,
  9108. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  9109. // with hand-written render functions / JSX. In such cases a full normalization
  9110. // is needed to cater to all possible types of children values.
  9111. function normalizeChildren (children) {
  9112. return isPrimitive(children)
  9113. ? [createTextVNode(children)]
  9114. : Array.isArray(children)
  9115. ? normalizeArrayChildren(children)
  9116. : undefined
  9117. }
  9118. function isTextNode (node) {
  9119. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  9120. }
  9121. function normalizeArrayChildren (children, nestedIndex) {
  9122. var res = [];
  9123. var i, c, lastIndex, last;
  9124. for (i = 0; i < children.length; i++) {
  9125. c = children[i];
  9126. if (isUndef(c) || typeof c === 'boolean') { continue }
  9127. lastIndex = res.length - 1;
  9128. last = res[lastIndex];
  9129. // nested
  9130. if (Array.isArray(c)) {
  9131. if (c.length > 0) {
  9132. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  9133. // merge adjacent text nodes
  9134. if (isTextNode(c[0]) && isTextNode(last)) {
  9135. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  9136. c.shift();
  9137. }
  9138. res.push.apply(res, c);
  9139. }
  9140. } else if (isPrimitive(c)) {
  9141. if (isTextNode(last)) {
  9142. // merge adjacent text nodes
  9143. // this is necessary for SSR hydration because text nodes are
  9144. // essentially merged when rendered to HTML strings
  9145. res[lastIndex] = createTextVNode(last.text + c);
  9146. } else if (c !== '') {
  9147. // convert primitive to vnode
  9148. res.push(createTextVNode(c));
  9149. }
  9150. } else {
  9151. if (isTextNode(c) && isTextNode(last)) {
  9152. // merge adjacent text nodes
  9153. res[lastIndex] = createTextVNode(last.text + c.text);
  9154. } else {
  9155. // default key for nested array children (likely generated by v-for)
  9156. if (isTrue(children._isVList) &&
  9157. isDef(c.tag) &&
  9158. isUndef(c.key) &&
  9159. isDef(nestedIndex)) {
  9160. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  9161. }
  9162. res.push(c);
  9163. }
  9164. }
  9165. }
  9166. return res
  9167. }
  9168. /* */
  9169. function initProvide (vm) {
  9170. var provide = vm.$options.provide;
  9171. if (provide) {
  9172. vm._provided = typeof provide === 'function'
  9173. ? provide.call(vm)
  9174. : provide;
  9175. }
  9176. }
  9177. function initInjections (vm) {
  9178. var result = resolveInject(vm.$options.inject, vm);
  9179. if (result) {
  9180. toggleObserving(false);
  9181. Object.keys(result).forEach(function (key) {
  9182. /* istanbul ignore else */
  9183. if (true) {
  9184. defineReactive$$1(vm, key, result[key], function () {
  9185. warn(
  9186. "Avoid mutating an injected value directly since the changes will be " +
  9187. "overwritten whenever the provided component re-renders. " +
  9188. "injection being mutated: \"" + key + "\"",
  9189. vm
  9190. );
  9191. });
  9192. } else {}
  9193. });
  9194. toggleObserving(true);
  9195. }
  9196. }
  9197. function resolveInject (inject, vm) {
  9198. if (inject) {
  9199. // inject is :any because flow is not smart enough to figure out cached
  9200. var result = Object.create(null);
  9201. var keys = hasSymbol
  9202. ? Reflect.ownKeys(inject)
  9203. : Object.keys(inject);
  9204. for (var i = 0; i < keys.length; i++) {
  9205. var key = keys[i];
  9206. // #6574 in case the inject object is observed...
  9207. if (key === '__ob__') { continue }
  9208. var provideKey = inject[key].from;
  9209. var source = vm;
  9210. while (source) {
  9211. if (source._provided && hasOwn(source._provided, provideKey)) {
  9212. result[key] = source._provided[provideKey];
  9213. break
  9214. }
  9215. source = source.$parent;
  9216. }
  9217. if (!source) {
  9218. if ('default' in inject[key]) {
  9219. var provideDefault = inject[key].default;
  9220. result[key] = typeof provideDefault === 'function'
  9221. ? provideDefault.call(vm)
  9222. : provideDefault;
  9223. } else if (true) {
  9224. warn(("Injection \"" + key + "\" not found"), vm);
  9225. }
  9226. }
  9227. }
  9228. return result
  9229. }
  9230. }
  9231. /* */
  9232. /**
  9233. * Runtime helper for resolving raw children VNodes into a slot object.
  9234. */
  9235. function resolveSlots (
  9236. children,
  9237. context
  9238. ) {
  9239. if (!children || !children.length) {
  9240. return {}
  9241. }
  9242. var slots = {};
  9243. for (var i = 0, l = children.length; i < l; i++) {
  9244. var child = children[i];
  9245. var data = child.data;
  9246. // remove slot attribute if the node is resolved as a Vue slot node
  9247. if (data && data.attrs && data.attrs.slot) {
  9248. delete data.attrs.slot;
  9249. }
  9250. // named slots should only be respected if the vnode was rendered in the
  9251. // same context.
  9252. if ((child.context === context || child.fnContext === context) &&
  9253. data && data.slot != null
  9254. ) {
  9255. var name = data.slot;
  9256. var slot = (slots[name] || (slots[name] = []));
  9257. if (child.tag === 'template') {
  9258. slot.push.apply(slot, child.children || []);
  9259. } else {
  9260. slot.push(child);
  9261. }
  9262. } else {
  9263. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  9264. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  9265. (slots['page'] || (slots['page'] = [])).push(child);
  9266. }else{
  9267. (slots.default || (slots.default = [])).push(child);
  9268. }
  9269. }
  9270. }
  9271. // ignore slots that contains only whitespace
  9272. for (var name$1 in slots) {
  9273. if (slots[name$1].every(isWhitespace)) {
  9274. delete slots[name$1];
  9275. }
  9276. }
  9277. return slots
  9278. }
  9279. function isWhitespace (node) {
  9280. return (node.isComment && !node.asyncFactory) || node.text === ' '
  9281. }
  9282. /* */
  9283. function normalizeScopedSlots (
  9284. slots,
  9285. normalSlots,
  9286. prevSlots
  9287. ) {
  9288. var res;
  9289. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  9290. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  9291. var key = slots && slots.$key;
  9292. if (!slots) {
  9293. res = {};
  9294. } else if (slots._normalized) {
  9295. // fast path 1: child component re-render only, parent did not change
  9296. return slots._normalized
  9297. } else if (
  9298. isStable &&
  9299. prevSlots &&
  9300. prevSlots !== emptyObject &&
  9301. key === prevSlots.$key &&
  9302. !hasNormalSlots &&
  9303. !prevSlots.$hasNormal
  9304. ) {
  9305. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  9306. // only need to normalize once
  9307. return prevSlots
  9308. } else {
  9309. res = {};
  9310. for (var key$1 in slots) {
  9311. if (slots[key$1] && key$1[0] !== '$') {
  9312. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  9313. }
  9314. }
  9315. }
  9316. // expose normal slots on scopedSlots
  9317. for (var key$2 in normalSlots) {
  9318. if (!(key$2 in res)) {
  9319. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  9320. }
  9321. }
  9322. // avoriaz seems to mock a non-extensible $scopedSlots object
  9323. // and when that is passed down this would cause an error
  9324. if (slots && Object.isExtensible(slots)) {
  9325. (slots)._normalized = res;
  9326. }
  9327. def(res, '$stable', isStable);
  9328. def(res, '$key', key);
  9329. def(res, '$hasNormal', hasNormalSlots);
  9330. return res
  9331. }
  9332. function normalizeScopedSlot(normalSlots, key, fn) {
  9333. var normalized = function () {
  9334. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  9335. res = res && typeof res === 'object' && !Array.isArray(res)
  9336. ? [res] // single vnode
  9337. : normalizeChildren(res);
  9338. return res && (
  9339. res.length === 0 ||
  9340. (res.length === 1 && res[0].isComment) // #9658
  9341. ) ? undefined
  9342. : res
  9343. };
  9344. // this is a slot using the new v-slot syntax without scope. although it is
  9345. // compiled as a scoped slot, render fn users would expect it to be present
  9346. // on this.$slots because the usage is semantically a normal slot.
  9347. if (fn.proxy) {
  9348. Object.defineProperty(normalSlots, key, {
  9349. get: normalized,
  9350. enumerable: true,
  9351. configurable: true
  9352. });
  9353. }
  9354. return normalized
  9355. }
  9356. function proxyNormalSlot(slots, key) {
  9357. return function () { return slots[key]; }
  9358. }
  9359. /* */
  9360. /**
  9361. * Runtime helper for rendering v-for lists.
  9362. */
  9363. function renderList (
  9364. val,
  9365. render
  9366. ) {
  9367. var ret, i, l, keys, key;
  9368. if (Array.isArray(val) || typeof val === 'string') {
  9369. ret = new Array(val.length);
  9370. for (i = 0, l = val.length; i < l; i++) {
  9371. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  9372. }
  9373. } else if (typeof val === 'number') {
  9374. ret = new Array(val);
  9375. for (i = 0; i < val; i++) {
  9376. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  9377. }
  9378. } else if (isObject(val)) {
  9379. if (hasSymbol && val[Symbol.iterator]) {
  9380. ret = [];
  9381. var iterator = val[Symbol.iterator]();
  9382. var result = iterator.next();
  9383. while (!result.done) {
  9384. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  9385. result = iterator.next();
  9386. }
  9387. } else {
  9388. keys = Object.keys(val);
  9389. ret = new Array(keys.length);
  9390. for (i = 0, l = keys.length; i < l; i++) {
  9391. key = keys[i];
  9392. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  9393. }
  9394. }
  9395. }
  9396. if (!isDef(ret)) {
  9397. ret = [];
  9398. }
  9399. (ret)._isVList = true;
  9400. return ret
  9401. }
  9402. /* */
  9403. /**
  9404. * Runtime helper for rendering <slot>
  9405. */
  9406. function renderSlot (
  9407. name,
  9408. fallback,
  9409. props,
  9410. bindObject
  9411. ) {
  9412. var scopedSlotFn = this.$scopedSlots[name];
  9413. var nodes;
  9414. if (scopedSlotFn) { // scoped slot
  9415. props = props || {};
  9416. if (bindObject) {
  9417. if ( true && !isObject(bindObject)) {
  9418. warn(
  9419. 'slot v-bind without argument expects an Object',
  9420. this
  9421. );
  9422. }
  9423. props = extend(extend({}, bindObject), props);
  9424. }
  9425. // fixed by xxxxxx app-plus scopedSlot
  9426. nodes = scopedSlotFn(props, this, props._i) || fallback;
  9427. } else {
  9428. nodes = this.$slots[name] || fallback;
  9429. }
  9430. var target = props && props.slot;
  9431. if (target) {
  9432. return this.$createElement('template', { slot: target }, nodes)
  9433. } else {
  9434. return nodes
  9435. }
  9436. }
  9437. /* */
  9438. /**
  9439. * Runtime helper for resolving filters
  9440. */
  9441. function resolveFilter (id) {
  9442. return resolveAsset(this.$options, 'filters', id, true) || identity
  9443. }
  9444. /* */
  9445. function isKeyNotMatch (expect, actual) {
  9446. if (Array.isArray(expect)) {
  9447. return expect.indexOf(actual) === -1
  9448. } else {
  9449. return expect !== actual
  9450. }
  9451. }
  9452. /**
  9453. * Runtime helper for checking keyCodes from config.
  9454. * exposed as Vue.prototype._k
  9455. * passing in eventKeyName as last argument separately for backwards compat
  9456. */
  9457. function checkKeyCodes (
  9458. eventKeyCode,
  9459. key,
  9460. builtInKeyCode,
  9461. eventKeyName,
  9462. builtInKeyName
  9463. ) {
  9464. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  9465. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  9466. return isKeyNotMatch(builtInKeyName, eventKeyName)
  9467. } else if (mappedKeyCode) {
  9468. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  9469. } else if (eventKeyName) {
  9470. return hyphenate(eventKeyName) !== key
  9471. }
  9472. }
  9473. /* */
  9474. /**
  9475. * Runtime helper for merging v-bind="object" into a VNode's data.
  9476. */
  9477. function bindObjectProps (
  9478. data,
  9479. tag,
  9480. value,
  9481. asProp,
  9482. isSync
  9483. ) {
  9484. if (value) {
  9485. if (!isObject(value)) {
  9486. true && warn(
  9487. 'v-bind without argument expects an Object or Array value',
  9488. this
  9489. );
  9490. } else {
  9491. if (Array.isArray(value)) {
  9492. value = toObject(value);
  9493. }
  9494. var hash;
  9495. var loop = function ( key ) {
  9496. if (
  9497. key === 'class' ||
  9498. key === 'style' ||
  9499. isReservedAttribute(key)
  9500. ) {
  9501. hash = data;
  9502. } else {
  9503. var type = data.attrs && data.attrs.type;
  9504. hash = asProp || config.mustUseProp(tag, type, key)
  9505. ? data.domProps || (data.domProps = {})
  9506. : data.attrs || (data.attrs = {});
  9507. }
  9508. var camelizedKey = camelize(key);
  9509. var hyphenatedKey = hyphenate(key);
  9510. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  9511. hash[key] = value[key];
  9512. if (isSync) {
  9513. var on = data.on || (data.on = {});
  9514. on[("update:" + key)] = function ($event) {
  9515. value[key] = $event;
  9516. };
  9517. }
  9518. }
  9519. };
  9520. for (var key in value) loop( key );
  9521. }
  9522. }
  9523. return data
  9524. }
  9525. /* */
  9526. /**
  9527. * Runtime helper for rendering static trees.
  9528. */
  9529. function renderStatic (
  9530. index,
  9531. isInFor
  9532. ) {
  9533. var cached = this._staticTrees || (this._staticTrees = []);
  9534. var tree = cached[index];
  9535. // if has already-rendered static tree and not inside v-for,
  9536. // we can reuse the same tree.
  9537. if (tree && !isInFor) {
  9538. return tree
  9539. }
  9540. // otherwise, render a fresh tree.
  9541. tree = cached[index] = this.$options.staticRenderFns[index].call(
  9542. this._renderProxy,
  9543. null,
  9544. this // for render fns generated for functional component templates
  9545. );
  9546. markStatic(tree, ("__static__" + index), false);
  9547. return tree
  9548. }
  9549. /**
  9550. * Runtime helper for v-once.
  9551. * Effectively it means marking the node as static with a unique key.
  9552. */
  9553. function markOnce (
  9554. tree,
  9555. index,
  9556. key
  9557. ) {
  9558. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  9559. return tree
  9560. }
  9561. function markStatic (
  9562. tree,
  9563. key,
  9564. isOnce
  9565. ) {
  9566. if (Array.isArray(tree)) {
  9567. for (var i = 0; i < tree.length; i++) {
  9568. if (tree[i] && typeof tree[i] !== 'string') {
  9569. markStaticNode(tree[i], (key + "_" + i), isOnce);
  9570. }
  9571. }
  9572. } else {
  9573. markStaticNode(tree, key, isOnce);
  9574. }
  9575. }
  9576. function markStaticNode (node, key, isOnce) {
  9577. node.isStatic = true;
  9578. node.key = key;
  9579. node.isOnce = isOnce;
  9580. }
  9581. /* */
  9582. function bindObjectListeners (data, value) {
  9583. if (value) {
  9584. if (!isPlainObject(value)) {
  9585. true && warn(
  9586. 'v-on without argument expects an Object value',
  9587. this
  9588. );
  9589. } else {
  9590. var on = data.on = data.on ? extend({}, data.on) : {};
  9591. for (var key in value) {
  9592. var existing = on[key];
  9593. var ours = value[key];
  9594. on[key] = existing ? [].concat(existing, ours) : ours;
  9595. }
  9596. }
  9597. }
  9598. return data
  9599. }
  9600. /* */
  9601. function resolveScopedSlots (
  9602. fns, // see flow/vnode
  9603. res,
  9604. // the following are added in 2.6
  9605. hasDynamicKeys,
  9606. contentHashKey
  9607. ) {
  9608. res = res || { $stable: !hasDynamicKeys };
  9609. for (var i = 0; i < fns.length; i++) {
  9610. var slot = fns[i];
  9611. if (Array.isArray(slot)) {
  9612. resolveScopedSlots(slot, res, hasDynamicKeys);
  9613. } else if (slot) {
  9614. // marker for reverse proxying v-slot without scope on this.$slots
  9615. if (slot.proxy) {
  9616. slot.fn.proxy = true;
  9617. }
  9618. res[slot.key] = slot.fn;
  9619. }
  9620. }
  9621. if (contentHashKey) {
  9622. (res).$key = contentHashKey;
  9623. }
  9624. return res
  9625. }
  9626. /* */
  9627. function bindDynamicKeys (baseObj, values) {
  9628. for (var i = 0; i < values.length; i += 2) {
  9629. var key = values[i];
  9630. if (typeof key === 'string' && key) {
  9631. baseObj[values[i]] = values[i + 1];
  9632. } else if ( true && key !== '' && key !== null) {
  9633. // null is a special value for explicitly removing a binding
  9634. warn(
  9635. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  9636. this
  9637. );
  9638. }
  9639. }
  9640. return baseObj
  9641. }
  9642. // helper to dynamically append modifier runtime markers to event names.
  9643. // ensure only append when value is already string, otherwise it will be cast
  9644. // to string and cause the type check to miss.
  9645. function prependModifier (value, symbol) {
  9646. return typeof value === 'string' ? symbol + value : value
  9647. }
  9648. /* */
  9649. function installRenderHelpers (target) {
  9650. target._o = markOnce;
  9651. target._n = toNumber;
  9652. target._s = toString;
  9653. target._l = renderList;
  9654. target._t = renderSlot;
  9655. target._q = looseEqual;
  9656. target._i = looseIndexOf;
  9657. target._m = renderStatic;
  9658. target._f = resolveFilter;
  9659. target._k = checkKeyCodes;
  9660. target._b = bindObjectProps;
  9661. target._v = createTextVNode;
  9662. target._e = createEmptyVNode;
  9663. target._u = resolveScopedSlots;
  9664. target._g = bindObjectListeners;
  9665. target._d = bindDynamicKeys;
  9666. target._p = prependModifier;
  9667. }
  9668. /* */
  9669. function FunctionalRenderContext (
  9670. data,
  9671. props,
  9672. children,
  9673. parent,
  9674. Ctor
  9675. ) {
  9676. var this$1 = this;
  9677. var options = Ctor.options;
  9678. // ensure the createElement function in functional components
  9679. // gets a unique context - this is necessary for correct named slot check
  9680. var contextVm;
  9681. if (hasOwn(parent, '_uid')) {
  9682. contextVm = Object.create(parent);
  9683. // $flow-disable-line
  9684. contextVm._original = parent;
  9685. } else {
  9686. // the context vm passed in is a functional context as well.
  9687. // in this case we want to make sure we are able to get a hold to the
  9688. // real context instance.
  9689. contextVm = parent;
  9690. // $flow-disable-line
  9691. parent = parent._original;
  9692. }
  9693. var isCompiled = isTrue(options._compiled);
  9694. var needNormalization = !isCompiled;
  9695. this.data = data;
  9696. this.props = props;
  9697. this.children = children;
  9698. this.parent = parent;
  9699. this.listeners = data.on || emptyObject;
  9700. this.injections = resolveInject(options.inject, parent);
  9701. this.slots = function () {
  9702. if (!this$1.$slots) {
  9703. normalizeScopedSlots(
  9704. data.scopedSlots,
  9705. this$1.$slots = resolveSlots(children, parent)
  9706. );
  9707. }
  9708. return this$1.$slots
  9709. };
  9710. Object.defineProperty(this, 'scopedSlots', ({
  9711. enumerable: true,
  9712. get: function get () {
  9713. return normalizeScopedSlots(data.scopedSlots, this.slots())
  9714. }
  9715. }));
  9716. // support for compiled functional template
  9717. if (isCompiled) {
  9718. // exposing $options for renderStatic()
  9719. this.$options = options;
  9720. // pre-resolve slots for renderSlot()
  9721. this.$slots = this.slots();
  9722. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  9723. }
  9724. if (options._scopeId) {
  9725. this._c = function (a, b, c, d) {
  9726. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  9727. if (vnode && !Array.isArray(vnode)) {
  9728. vnode.fnScopeId = options._scopeId;
  9729. vnode.fnContext = parent;
  9730. }
  9731. return vnode
  9732. };
  9733. } else {
  9734. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  9735. }
  9736. }
  9737. installRenderHelpers(FunctionalRenderContext.prototype);
  9738. function createFunctionalComponent (
  9739. Ctor,
  9740. propsData,
  9741. data,
  9742. contextVm,
  9743. children
  9744. ) {
  9745. var options = Ctor.options;
  9746. var props = {};
  9747. var propOptions = options.props;
  9748. if (isDef(propOptions)) {
  9749. for (var key in propOptions) {
  9750. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  9751. }
  9752. } else {
  9753. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  9754. if (isDef(data.props)) { mergeProps(props, data.props); }
  9755. }
  9756. var renderContext = new FunctionalRenderContext(
  9757. data,
  9758. props,
  9759. children,
  9760. contextVm,
  9761. Ctor
  9762. );
  9763. var vnode = options.render.call(null, renderContext._c, renderContext);
  9764. if (vnode instanceof VNode) {
  9765. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  9766. } else if (Array.isArray(vnode)) {
  9767. var vnodes = normalizeChildren(vnode) || [];
  9768. var res = new Array(vnodes.length);
  9769. for (var i = 0; i < vnodes.length; i++) {
  9770. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  9771. }
  9772. return res
  9773. }
  9774. }
  9775. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  9776. // #7817 clone node before setting fnContext, otherwise if the node is reused
  9777. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  9778. // that should not be matched to match.
  9779. var clone = cloneVNode(vnode);
  9780. clone.fnContext = contextVm;
  9781. clone.fnOptions = options;
  9782. if (true) {
  9783. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  9784. }
  9785. if (data.slot) {
  9786. (clone.data || (clone.data = {})).slot = data.slot;
  9787. }
  9788. return clone
  9789. }
  9790. function mergeProps (to, from) {
  9791. for (var key in from) {
  9792. to[camelize(key)] = from[key];
  9793. }
  9794. }
  9795. /* */
  9796. /* */
  9797. /* */
  9798. /* */
  9799. // inline hooks to be invoked on component VNodes during patch
  9800. var componentVNodeHooks = {
  9801. init: function init (vnode, hydrating) {
  9802. if (
  9803. vnode.componentInstance &&
  9804. !vnode.componentInstance._isDestroyed &&
  9805. vnode.data.keepAlive
  9806. ) {
  9807. // kept-alive components, treat as a patch
  9808. var mountedNode = vnode; // work around flow
  9809. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  9810. } else {
  9811. var child = vnode.componentInstance = createComponentInstanceForVnode(
  9812. vnode,
  9813. activeInstance
  9814. );
  9815. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  9816. }
  9817. },
  9818. prepatch: function prepatch (oldVnode, vnode) {
  9819. var options = vnode.componentOptions;
  9820. var child = vnode.componentInstance = oldVnode.componentInstance;
  9821. updateChildComponent(
  9822. child,
  9823. options.propsData, // updated props
  9824. options.listeners, // updated listeners
  9825. vnode, // new parent vnode
  9826. options.children // new children
  9827. );
  9828. },
  9829. insert: function insert (vnode) {
  9830. var context = vnode.context;
  9831. var componentInstance = vnode.componentInstance;
  9832. if (!componentInstance._isMounted) {
  9833. callHook(componentInstance, 'onServiceCreated');
  9834. callHook(componentInstance, 'onServiceAttached');
  9835. componentInstance._isMounted = true;
  9836. callHook(componentInstance, 'mounted');
  9837. }
  9838. if (vnode.data.keepAlive) {
  9839. if (context._isMounted) {
  9840. // vue-router#1212
  9841. // During updates, a kept-alive component's child components may
  9842. // change, so directly walking the tree here may call activated hooks
  9843. // on incorrect children. Instead we push them into a queue which will
  9844. // be processed after the whole patch process ended.
  9845. queueActivatedComponent(componentInstance);
  9846. } else {
  9847. activateChildComponent(componentInstance, true /* direct */);
  9848. }
  9849. }
  9850. },
  9851. destroy: function destroy (vnode) {
  9852. var componentInstance = vnode.componentInstance;
  9853. if (!componentInstance._isDestroyed) {
  9854. if (!vnode.data.keepAlive) {
  9855. componentInstance.$destroy();
  9856. } else {
  9857. deactivateChildComponent(componentInstance, true /* direct */);
  9858. }
  9859. }
  9860. }
  9861. };
  9862. var hooksToMerge = Object.keys(componentVNodeHooks);
  9863. function createComponent (
  9864. Ctor,
  9865. data,
  9866. context,
  9867. children,
  9868. tag
  9869. ) {
  9870. if (isUndef(Ctor)) {
  9871. return
  9872. }
  9873. var baseCtor = context.$options._base;
  9874. // plain options object: turn it into a constructor
  9875. if (isObject(Ctor)) {
  9876. Ctor = baseCtor.extend(Ctor);
  9877. }
  9878. // if at this stage it's not a constructor or an async component factory,
  9879. // reject.
  9880. if (typeof Ctor !== 'function') {
  9881. if (true) {
  9882. warn(("Invalid Component definition: " + (String(Ctor))), context);
  9883. }
  9884. return
  9885. }
  9886. // async component
  9887. var asyncFactory;
  9888. if (isUndef(Ctor.cid)) {
  9889. asyncFactory = Ctor;
  9890. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  9891. if (Ctor === undefined) {
  9892. // return a placeholder node for async component, which is rendered
  9893. // as a comment node but preserves all the raw information for the node.
  9894. // the information will be used for async server-rendering and hydration.
  9895. return createAsyncPlaceholder(
  9896. asyncFactory,
  9897. data,
  9898. context,
  9899. children,
  9900. tag
  9901. )
  9902. }
  9903. }
  9904. data = data || {};
  9905. // resolve constructor options in case global mixins are applied after
  9906. // component constructor creation
  9907. resolveConstructorOptions(Ctor);
  9908. // transform component v-model data into props & events
  9909. if (isDef(data.model)) {
  9910. transformModel(Ctor.options, data);
  9911. }
  9912. // extract props
  9913. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  9914. // functional component
  9915. if (isTrue(Ctor.options.functional)) {
  9916. return createFunctionalComponent(Ctor, propsData, data, context, children)
  9917. }
  9918. // extract listeners, since these needs to be treated as
  9919. // child component listeners instead of DOM listeners
  9920. var listeners = data.on;
  9921. // replace with listeners with .native modifier
  9922. // so it gets processed during parent component patch.
  9923. data.on = data.nativeOn;
  9924. if (isTrue(Ctor.options.abstract)) {
  9925. // abstract components do not keep anything
  9926. // other than props & listeners & slot
  9927. // work around flow
  9928. var slot = data.slot;
  9929. data = {};
  9930. if (slot) {
  9931. data.slot = slot;
  9932. }
  9933. }
  9934. // install component management hooks onto the placeholder node
  9935. installComponentHooks(data);
  9936. // return a placeholder vnode
  9937. var name = Ctor.options.name || tag;
  9938. var vnode = new VNode(
  9939. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  9940. data, undefined, undefined, undefined, context,
  9941. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  9942. asyncFactory
  9943. );
  9944. return vnode
  9945. }
  9946. function createComponentInstanceForVnode (
  9947. vnode, // we know it's MountedComponentVNode but flow doesn't
  9948. parent // activeInstance in lifecycle state
  9949. ) {
  9950. var options = {
  9951. _isComponent: true,
  9952. _parentVnode: vnode,
  9953. parent: parent
  9954. };
  9955. // check inline-template render functions
  9956. var inlineTemplate = vnode.data.inlineTemplate;
  9957. if (isDef(inlineTemplate)) {
  9958. options.render = inlineTemplate.render;
  9959. options.staticRenderFns = inlineTemplate.staticRenderFns;
  9960. }
  9961. return new vnode.componentOptions.Ctor(options)
  9962. }
  9963. function installComponentHooks (data) {
  9964. var hooks = data.hook || (data.hook = {});
  9965. for (var i = 0; i < hooksToMerge.length; i++) {
  9966. var key = hooksToMerge[i];
  9967. var existing = hooks[key];
  9968. var toMerge = componentVNodeHooks[key];
  9969. if (existing !== toMerge && !(existing && existing._merged)) {
  9970. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  9971. }
  9972. }
  9973. }
  9974. function mergeHook$1 (f1, f2) {
  9975. var merged = function (a, b) {
  9976. // flow complains about extra args which is why we use any
  9977. f1(a, b);
  9978. f2(a, b);
  9979. };
  9980. merged._merged = true;
  9981. return merged
  9982. }
  9983. // transform component v-model info (value and callback) into
  9984. // prop and event handler respectively.
  9985. function transformModel (options, data) {
  9986. var prop = (options.model && options.model.prop) || 'value';
  9987. var event = (options.model && options.model.event) || 'input'
  9988. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  9989. var on = data.on || (data.on = {});
  9990. var existing = on[event];
  9991. var callback = data.model.callback;
  9992. if (isDef(existing)) {
  9993. if (
  9994. Array.isArray(existing)
  9995. ? existing.indexOf(callback) === -1
  9996. : existing !== callback
  9997. ) {
  9998. on[event] = [callback].concat(existing);
  9999. }
  10000. } else {
  10001. on[event] = callback;
  10002. }
  10003. }
  10004. /* */
  10005. var SIMPLE_NORMALIZE = 1;
  10006. var ALWAYS_NORMALIZE = 2;
  10007. // wrapper function for providing a more flexible interface
  10008. // without getting yelled at by flow
  10009. function createElement (
  10010. context,
  10011. tag,
  10012. data,
  10013. children,
  10014. normalizationType,
  10015. alwaysNormalize
  10016. ) {
  10017. if (Array.isArray(data) || isPrimitive(data)) {
  10018. normalizationType = children;
  10019. children = data;
  10020. data = undefined;
  10021. }
  10022. if (isTrue(alwaysNormalize)) {
  10023. normalizationType = ALWAYS_NORMALIZE;
  10024. }
  10025. return _createElement(context, tag, data, children, normalizationType)
  10026. }
  10027. function _createElement (
  10028. context,
  10029. tag,
  10030. data,
  10031. children,
  10032. normalizationType
  10033. ) {
  10034. if (isDef(data) && isDef((data).__ob__)) {
  10035. true && warn(
  10036. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  10037. 'Always create fresh vnode data objects in each render!',
  10038. context
  10039. );
  10040. return createEmptyVNode()
  10041. }
  10042. // object syntax in v-bind
  10043. if (isDef(data) && isDef(data.is)) {
  10044. tag = data.is;
  10045. }
  10046. if (!tag) {
  10047. // in case of component :is set to falsy value
  10048. return createEmptyVNode()
  10049. }
  10050. // warn against non-primitive key
  10051. if ( true &&
  10052. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  10053. ) {
  10054. {
  10055. warn(
  10056. 'Avoid using non-primitive value as key, ' +
  10057. 'use string/number value instead.',
  10058. context
  10059. );
  10060. }
  10061. }
  10062. // support single function children as default scoped slot
  10063. if (Array.isArray(children) &&
  10064. typeof children[0] === 'function'
  10065. ) {
  10066. data = data || {};
  10067. data.scopedSlots = { default: children[0] };
  10068. children.length = 0;
  10069. }
  10070. if (normalizationType === ALWAYS_NORMALIZE) {
  10071. children = normalizeChildren(children);
  10072. } else if (normalizationType === SIMPLE_NORMALIZE) {
  10073. children = simpleNormalizeChildren(children);
  10074. }
  10075. var vnode, ns;
  10076. if (typeof tag === 'string') {
  10077. var Ctor;
  10078. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  10079. if (config.isReservedTag(tag)) {
  10080. // platform built-in elements
  10081. if ( true && isDef(data) && isDef(data.nativeOn)) {
  10082. warn(
  10083. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  10084. context
  10085. );
  10086. }
  10087. vnode = new VNode(
  10088. config.parsePlatformTagName(tag), data, children,
  10089. undefined, undefined, context
  10090. );
  10091. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  10092. // component
  10093. vnode = createComponent(Ctor, data, context, children, tag);
  10094. } else {
  10095. // unknown or unlisted namespaced elements
  10096. // check at runtime because it may get assigned a namespace when its
  10097. // parent normalizes children
  10098. vnode = new VNode(
  10099. tag, data, children,
  10100. undefined, undefined, context
  10101. );
  10102. }
  10103. } else {
  10104. // direct component options / constructor
  10105. vnode = createComponent(tag, data, context, children);
  10106. }
  10107. if (Array.isArray(vnode)) {
  10108. return vnode
  10109. } else if (isDef(vnode)) {
  10110. if (isDef(ns)) { applyNS(vnode, ns); }
  10111. if (isDef(data)) { registerDeepBindings(data); }
  10112. return vnode
  10113. } else {
  10114. return createEmptyVNode()
  10115. }
  10116. }
  10117. function applyNS (vnode, ns, force) {
  10118. vnode.ns = ns;
  10119. if (vnode.tag === 'foreignObject') {
  10120. // use default namespace inside foreignObject
  10121. ns = undefined;
  10122. force = true;
  10123. }
  10124. if (isDef(vnode.children)) {
  10125. for (var i = 0, l = vnode.children.length; i < l; i++) {
  10126. var child = vnode.children[i];
  10127. if (isDef(child.tag) && (
  10128. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  10129. applyNS(child, ns, force);
  10130. }
  10131. }
  10132. }
  10133. }
  10134. // ref #5318
  10135. // necessary to ensure parent re-render when deep bindings like :style and
  10136. // :class are used on slot nodes
  10137. function registerDeepBindings (data) {
  10138. if (isObject(data.style)) {
  10139. traverse(data.style);
  10140. }
  10141. if (isObject(data.class)) {
  10142. traverse(data.class);
  10143. }
  10144. }
  10145. /* */
  10146. function initRender (vm) {
  10147. vm._vnode = null; // the root of the child tree
  10148. vm._staticTrees = null; // v-once cached trees
  10149. var options = vm.$options;
  10150. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  10151. var renderContext = parentVnode && parentVnode.context;
  10152. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  10153. vm.$scopedSlots = emptyObject;
  10154. // bind the createElement fn to this instance
  10155. // so that we get proper render context inside it.
  10156. // args order: tag, data, children, normalizationType, alwaysNormalize
  10157. // internal version is used by render functions compiled from templates
  10158. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  10159. // normalization is always applied for the public version, used in
  10160. // user-written render functions.
  10161. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  10162. // $attrs & $listeners are exposed for easier HOC creation.
  10163. // they need to be reactive so that HOCs using them are always updated
  10164. var parentData = parentVnode && parentVnode.data;
  10165. /* istanbul ignore else */
  10166. if (true) {
  10167. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  10168. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  10169. }, true);
  10170. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  10171. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  10172. }, true);
  10173. } else {}
  10174. }
  10175. var currentRenderingInstance = null;
  10176. function renderMixin (Vue) {
  10177. // install runtime convenience helpers
  10178. installRenderHelpers(Vue.prototype);
  10179. Vue.prototype.$nextTick = function (fn) {
  10180. return nextTick(fn, this)
  10181. };
  10182. Vue.prototype._render = function () {
  10183. var vm = this;
  10184. var ref = vm.$options;
  10185. var render = ref.render;
  10186. var _parentVnode = ref._parentVnode;
  10187. if (_parentVnode) {
  10188. vm.$scopedSlots = normalizeScopedSlots(
  10189. _parentVnode.data.scopedSlots,
  10190. vm.$slots,
  10191. vm.$scopedSlots
  10192. );
  10193. }
  10194. // set parent vnode. this allows render functions to have access
  10195. // to the data on the placeholder node.
  10196. vm.$vnode = _parentVnode;
  10197. // render self
  10198. var vnode;
  10199. try {
  10200. // There's no need to maintain a stack because all render fns are called
  10201. // separately from one another. Nested component's render fns are called
  10202. // when parent component is patched.
  10203. currentRenderingInstance = vm;
  10204. vnode = render.call(vm._renderProxy, vm.$createElement);
  10205. } catch (e) {
  10206. handleError(e, vm, "render");
  10207. // return error render result,
  10208. // or previous vnode to prevent render error causing blank component
  10209. /* istanbul ignore else */
  10210. if ( true && vm.$options.renderError) {
  10211. try {
  10212. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  10213. } catch (e) {
  10214. handleError(e, vm, "renderError");
  10215. vnode = vm._vnode;
  10216. }
  10217. } else {
  10218. vnode = vm._vnode;
  10219. }
  10220. } finally {
  10221. currentRenderingInstance = null;
  10222. }
  10223. // if the returned array contains only a single node, allow it
  10224. if (Array.isArray(vnode) && vnode.length === 1) {
  10225. vnode = vnode[0];
  10226. }
  10227. // return empty vnode in case the render function errored out
  10228. if (!(vnode instanceof VNode)) {
  10229. if ( true && Array.isArray(vnode)) {
  10230. warn(
  10231. 'Multiple root nodes returned from render function. Render function ' +
  10232. 'should return a single root node.',
  10233. vm
  10234. );
  10235. }
  10236. vnode = createEmptyVNode();
  10237. }
  10238. // set parent
  10239. vnode.parent = _parentVnode;
  10240. return vnode
  10241. };
  10242. }
  10243. /* */
  10244. function ensureCtor (comp, base) {
  10245. if (
  10246. comp.__esModule ||
  10247. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  10248. ) {
  10249. comp = comp.default;
  10250. }
  10251. return isObject(comp)
  10252. ? base.extend(comp)
  10253. : comp
  10254. }
  10255. function createAsyncPlaceholder (
  10256. factory,
  10257. data,
  10258. context,
  10259. children,
  10260. tag
  10261. ) {
  10262. var node = createEmptyVNode();
  10263. node.asyncFactory = factory;
  10264. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  10265. return node
  10266. }
  10267. function resolveAsyncComponent (
  10268. factory,
  10269. baseCtor
  10270. ) {
  10271. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  10272. return factory.errorComp
  10273. }
  10274. if (isDef(factory.resolved)) {
  10275. return factory.resolved
  10276. }
  10277. var owner = currentRenderingInstance;
  10278. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  10279. // already pending
  10280. factory.owners.push(owner);
  10281. }
  10282. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  10283. return factory.loadingComp
  10284. }
  10285. if (owner && !isDef(factory.owners)) {
  10286. var owners = factory.owners = [owner];
  10287. var sync = true;
  10288. var timerLoading = null;
  10289. var timerTimeout = null
  10290. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  10291. var forceRender = function (renderCompleted) {
  10292. for (var i = 0, l = owners.length; i < l; i++) {
  10293. (owners[i]).$forceUpdate();
  10294. }
  10295. if (renderCompleted) {
  10296. owners.length = 0;
  10297. if (timerLoading !== null) {
  10298. clearTimeout(timerLoading);
  10299. timerLoading = null;
  10300. }
  10301. if (timerTimeout !== null) {
  10302. clearTimeout(timerTimeout);
  10303. timerTimeout = null;
  10304. }
  10305. }
  10306. };
  10307. var resolve = once(function (res) {
  10308. // cache resolved
  10309. factory.resolved = ensureCtor(res, baseCtor);
  10310. // invoke callbacks only if this is not a synchronous resolve
  10311. // (async resolves are shimmed as synchronous during SSR)
  10312. if (!sync) {
  10313. forceRender(true);
  10314. } else {
  10315. owners.length = 0;
  10316. }
  10317. });
  10318. var reject = once(function (reason) {
  10319. true && warn(
  10320. "Failed to resolve async component: " + (String(factory)) +
  10321. (reason ? ("\nReason: " + reason) : '')
  10322. );
  10323. if (isDef(factory.errorComp)) {
  10324. factory.error = true;
  10325. forceRender(true);
  10326. }
  10327. });
  10328. var res = factory(resolve, reject);
  10329. if (isObject(res)) {
  10330. if (isPromise(res)) {
  10331. // () => Promise
  10332. if (isUndef(factory.resolved)) {
  10333. res.then(resolve, reject);
  10334. }
  10335. } else if (isPromise(res.component)) {
  10336. res.component.then(resolve, reject);
  10337. if (isDef(res.error)) {
  10338. factory.errorComp = ensureCtor(res.error, baseCtor);
  10339. }
  10340. if (isDef(res.loading)) {
  10341. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  10342. if (res.delay === 0) {
  10343. factory.loading = true;
  10344. } else {
  10345. timerLoading = setTimeout(function () {
  10346. timerLoading = null;
  10347. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  10348. factory.loading = true;
  10349. forceRender(false);
  10350. }
  10351. }, res.delay || 200);
  10352. }
  10353. }
  10354. if (isDef(res.timeout)) {
  10355. timerTimeout = setTimeout(function () {
  10356. timerTimeout = null;
  10357. if (isUndef(factory.resolved)) {
  10358. reject(
  10359. true
  10360. ? ("timeout (" + (res.timeout) + "ms)")
  10361. : undefined
  10362. );
  10363. }
  10364. }, res.timeout);
  10365. }
  10366. }
  10367. }
  10368. sync = false;
  10369. // return in case resolved synchronously
  10370. return factory.loading
  10371. ? factory.loadingComp
  10372. : factory.resolved
  10373. }
  10374. }
  10375. /* */
  10376. function isAsyncPlaceholder (node) {
  10377. return node.isComment && node.asyncFactory
  10378. }
  10379. /* */
  10380. function getFirstComponentChild (children) {
  10381. if (Array.isArray(children)) {
  10382. for (var i = 0; i < children.length; i++) {
  10383. var c = children[i];
  10384. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  10385. return c
  10386. }
  10387. }
  10388. }
  10389. }
  10390. /* */
  10391. /* */
  10392. function initEvents (vm) {
  10393. vm._events = Object.create(null);
  10394. vm._hasHookEvent = false;
  10395. // init parent attached events
  10396. var listeners = vm.$options._parentListeners;
  10397. if (listeners) {
  10398. updateComponentListeners(vm, listeners);
  10399. }
  10400. }
  10401. var target;
  10402. function add (event, fn) {
  10403. target.$on(event, fn);
  10404. }
  10405. function remove$1 (event, fn) {
  10406. target.$off(event, fn);
  10407. }
  10408. function createOnceHandler (event, fn) {
  10409. var _target = target;
  10410. return function onceHandler () {
  10411. var res = fn.apply(null, arguments);
  10412. if (res !== null) {
  10413. _target.$off(event, onceHandler);
  10414. }
  10415. }
  10416. }
  10417. function updateComponentListeners (
  10418. vm,
  10419. listeners,
  10420. oldListeners
  10421. ) {
  10422. target = vm;
  10423. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  10424. target = undefined;
  10425. }
  10426. function eventsMixin (Vue) {
  10427. var hookRE = /^hook:/;
  10428. Vue.prototype.$on = function (event, fn) {
  10429. var vm = this;
  10430. if (Array.isArray(event)) {
  10431. for (var i = 0, l = event.length; i < l; i++) {
  10432. vm.$on(event[i], fn);
  10433. }
  10434. } else {
  10435. (vm._events[event] || (vm._events[event] = [])).push(fn);
  10436. // optimize hook:event cost by using a boolean flag marked at registration
  10437. // instead of a hash lookup
  10438. if (hookRE.test(event)) {
  10439. vm._hasHookEvent = true;
  10440. }
  10441. }
  10442. return vm
  10443. };
  10444. Vue.prototype.$once = function (event, fn) {
  10445. var vm = this;
  10446. function on () {
  10447. vm.$off(event, on);
  10448. fn.apply(vm, arguments);
  10449. }
  10450. on.fn = fn;
  10451. vm.$on(event, on);
  10452. return vm
  10453. };
  10454. Vue.prototype.$off = function (event, fn) {
  10455. var vm = this;
  10456. // all
  10457. if (!arguments.length) {
  10458. vm._events = Object.create(null);
  10459. return vm
  10460. }
  10461. // array of events
  10462. if (Array.isArray(event)) {
  10463. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  10464. vm.$off(event[i$1], fn);
  10465. }
  10466. return vm
  10467. }
  10468. // specific event
  10469. var cbs = vm._events[event];
  10470. if (!cbs) {
  10471. return vm
  10472. }
  10473. if (!fn) {
  10474. vm._events[event] = null;
  10475. return vm
  10476. }
  10477. // specific handler
  10478. var cb;
  10479. var i = cbs.length;
  10480. while (i--) {
  10481. cb = cbs[i];
  10482. if (cb === fn || cb.fn === fn) {
  10483. cbs.splice(i, 1);
  10484. break
  10485. }
  10486. }
  10487. return vm
  10488. };
  10489. Vue.prototype.$emit = function (event) {
  10490. var vm = this;
  10491. if (true) {
  10492. var lowerCaseEvent = event.toLowerCase();
  10493. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  10494. tip(
  10495. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  10496. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  10497. "Note that HTML attributes are case-insensitive and you cannot use " +
  10498. "v-on to listen to camelCase events when using in-DOM templates. " +
  10499. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  10500. );
  10501. }
  10502. }
  10503. var cbs = vm._events[event];
  10504. if (cbs) {
  10505. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  10506. var args = toArray(arguments, 1);
  10507. var info = "event handler for \"" + event + "\"";
  10508. for (var i = 0, l = cbs.length; i < l; i++) {
  10509. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  10510. }
  10511. }
  10512. return vm
  10513. };
  10514. }
  10515. /* */
  10516. var activeInstance = null;
  10517. var isUpdatingChildComponent = false;
  10518. function setActiveInstance(vm) {
  10519. var prevActiveInstance = activeInstance;
  10520. activeInstance = vm;
  10521. return function () {
  10522. activeInstance = prevActiveInstance;
  10523. }
  10524. }
  10525. function initLifecycle (vm) {
  10526. var options = vm.$options;
  10527. // locate first non-abstract parent
  10528. var parent = options.parent;
  10529. if (parent && !options.abstract) {
  10530. while (parent.$options.abstract && parent.$parent) {
  10531. parent = parent.$parent;
  10532. }
  10533. parent.$children.push(vm);
  10534. }
  10535. vm.$parent = parent;
  10536. vm.$root = parent ? parent.$root : vm;
  10537. vm.$children = [];
  10538. vm.$refs = {};
  10539. vm._watcher = null;
  10540. vm._inactive = null;
  10541. vm._directInactive = false;
  10542. vm._isMounted = false;
  10543. vm._isDestroyed = false;
  10544. vm._isBeingDestroyed = false;
  10545. }
  10546. function lifecycleMixin (Vue) {
  10547. Vue.prototype._update = function (vnode, hydrating) {
  10548. var vm = this;
  10549. var prevEl = vm.$el;
  10550. var prevVnode = vm._vnode;
  10551. var restoreActiveInstance = setActiveInstance(vm);
  10552. vm._vnode = vnode;
  10553. // Vue.prototype.__patch__ is injected in entry points
  10554. // based on the rendering backend used.
  10555. if (!prevVnode) {
  10556. // initial render
  10557. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  10558. } else {
  10559. // updates
  10560. vm.$el = vm.__patch__(prevVnode, vnode);
  10561. }
  10562. restoreActiveInstance();
  10563. // update __vue__ reference
  10564. if (prevEl) {
  10565. prevEl.__vue__ = null;
  10566. }
  10567. if (vm.$el) {
  10568. vm.$el.__vue__ = vm;
  10569. }
  10570. // if parent is an HOC, update its $el as well
  10571. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  10572. vm.$parent.$el = vm.$el;
  10573. }
  10574. // updated hook is called by the scheduler to ensure that children are
  10575. // updated in a parent's updated hook.
  10576. };
  10577. Vue.prototype.$forceUpdate = function () {
  10578. var vm = this;
  10579. if (vm._watcher) {
  10580. vm._watcher.update();
  10581. }
  10582. };
  10583. Vue.prototype.$destroy = function () {
  10584. var vm = this;
  10585. if (vm._isBeingDestroyed) {
  10586. return
  10587. }
  10588. callHook(vm, 'beforeDestroy');
  10589. vm._isBeingDestroyed = true;
  10590. // remove self from parent
  10591. var parent = vm.$parent;
  10592. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  10593. remove(parent.$children, vm);
  10594. }
  10595. // teardown watchers
  10596. if (vm._watcher) {
  10597. vm._watcher.teardown();
  10598. }
  10599. var i = vm._watchers.length;
  10600. while (i--) {
  10601. vm._watchers[i].teardown();
  10602. }
  10603. // remove reference from data ob
  10604. // frozen object may not have observer.
  10605. if (vm._data.__ob__) {
  10606. vm._data.__ob__.vmCount--;
  10607. }
  10608. // call the last hook...
  10609. vm._isDestroyed = true;
  10610. // invoke destroy hooks on current rendered tree
  10611. vm.__patch__(vm._vnode, null);
  10612. // fire destroyed hook
  10613. callHook(vm, 'destroyed');
  10614. // turn off all instance listeners.
  10615. vm.$off();
  10616. // remove __vue__ reference
  10617. if (vm.$el) {
  10618. vm.$el.__vue__ = null;
  10619. }
  10620. // release circular reference (#6759)
  10621. if (vm.$vnode) {
  10622. vm.$vnode.parent = null;
  10623. }
  10624. };
  10625. }
  10626. function updateChildComponent (
  10627. vm,
  10628. propsData,
  10629. listeners,
  10630. parentVnode,
  10631. renderChildren
  10632. ) {
  10633. if (true) {
  10634. isUpdatingChildComponent = true;
  10635. }
  10636. // determine whether component has slot children
  10637. // we need to do this before overwriting $options._renderChildren.
  10638. // check if there are dynamic scopedSlots (hand-written or compiled but with
  10639. // dynamic slot names). Static scoped slots compiled from template has the
  10640. // "$stable" marker.
  10641. var newScopedSlots = parentVnode.data.scopedSlots;
  10642. var oldScopedSlots = vm.$scopedSlots;
  10643. var hasDynamicScopedSlot = !!(
  10644. (newScopedSlots && !newScopedSlots.$stable) ||
  10645. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  10646. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  10647. );
  10648. // Any static slot children from the parent may have changed during parent's
  10649. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  10650. // update is necessary to ensure correctness.
  10651. var needsForceUpdate = !!(
  10652. renderChildren || // has new static slots
  10653. vm.$options._renderChildren || // has old static slots
  10654. hasDynamicScopedSlot
  10655. );
  10656. vm.$options._parentVnode = parentVnode;
  10657. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  10658. if (vm._vnode) { // update child tree's parent
  10659. vm._vnode.parent = parentVnode;
  10660. }
  10661. vm.$options._renderChildren = renderChildren;
  10662. // update $attrs and $listeners hash
  10663. // these are also reactive so they may trigger child update if the child
  10664. // used them during render
  10665. vm.$attrs = parentVnode.data.attrs || emptyObject;
  10666. vm.$listeners = listeners || emptyObject;
  10667. // update props
  10668. if (propsData && vm.$options.props) {
  10669. toggleObserving(false);
  10670. var props = vm._props;
  10671. var propKeys = vm.$options._propKeys || [];
  10672. for (var i = 0; i < propKeys.length; i++) {
  10673. var key = propKeys[i];
  10674. var propOptions = vm.$options.props; // wtf flow?
  10675. props[key] = validateProp(key, propOptions, propsData, vm);
  10676. }
  10677. toggleObserving(true);
  10678. // keep a copy of raw propsData
  10679. vm.$options.propsData = propsData;
  10680. }
  10681. // fixed by xxxxxx update properties(mp runtime)
  10682. vm._$updateProperties && vm._$updateProperties(vm);
  10683. // update listeners
  10684. listeners = listeners || emptyObject;
  10685. var oldListeners = vm.$options._parentListeners;
  10686. vm.$options._parentListeners = listeners;
  10687. updateComponentListeners(vm, listeners, oldListeners);
  10688. // resolve slots + force update if has children
  10689. if (needsForceUpdate) {
  10690. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  10691. vm.$forceUpdate();
  10692. }
  10693. if (true) {
  10694. isUpdatingChildComponent = false;
  10695. }
  10696. }
  10697. function isInInactiveTree (vm) {
  10698. while (vm && (vm = vm.$parent)) {
  10699. if (vm._inactive) { return true }
  10700. }
  10701. return false
  10702. }
  10703. function activateChildComponent (vm, direct) {
  10704. if (direct) {
  10705. vm._directInactive = false;
  10706. if (isInInactiveTree(vm)) {
  10707. return
  10708. }
  10709. } else if (vm._directInactive) {
  10710. return
  10711. }
  10712. if (vm._inactive || vm._inactive === null) {
  10713. vm._inactive = false;
  10714. for (var i = 0; i < vm.$children.length; i++) {
  10715. activateChildComponent(vm.$children[i]);
  10716. }
  10717. callHook(vm, 'activated');
  10718. }
  10719. }
  10720. function deactivateChildComponent (vm, direct) {
  10721. if (direct) {
  10722. vm._directInactive = true;
  10723. if (isInInactiveTree(vm)) {
  10724. return
  10725. }
  10726. }
  10727. if (!vm._inactive) {
  10728. vm._inactive = true;
  10729. for (var i = 0; i < vm.$children.length; i++) {
  10730. deactivateChildComponent(vm.$children[i]);
  10731. }
  10732. callHook(vm, 'deactivated');
  10733. }
  10734. }
  10735. function callHook (vm, hook) {
  10736. // #7573 disable dep collection when invoking lifecycle hooks
  10737. pushTarget();
  10738. var handlers = vm.$options[hook];
  10739. var info = hook + " hook";
  10740. if (handlers) {
  10741. for (var i = 0, j = handlers.length; i < j; i++) {
  10742. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  10743. }
  10744. }
  10745. if (vm._hasHookEvent) {
  10746. vm.$emit('hook:' + hook);
  10747. }
  10748. popTarget();
  10749. }
  10750. /* */
  10751. var MAX_UPDATE_COUNT = 100;
  10752. var queue = [];
  10753. var activatedChildren = [];
  10754. var has = {};
  10755. var circular = {};
  10756. var waiting = false;
  10757. var flushing = false;
  10758. var index = 0;
  10759. /**
  10760. * Reset the scheduler's state.
  10761. */
  10762. function resetSchedulerState () {
  10763. index = queue.length = activatedChildren.length = 0;
  10764. has = {};
  10765. if (true) {
  10766. circular = {};
  10767. }
  10768. waiting = flushing = false;
  10769. }
  10770. // Async edge case #6566 requires saving the timestamp when event listeners are
  10771. // attached. However, calling performance.now() has a perf overhead especially
  10772. // if the page has thousands of event listeners. Instead, we take a timestamp
  10773. // every time the scheduler flushes and use that for all event listeners
  10774. // attached during that flush.
  10775. var currentFlushTimestamp = 0;
  10776. // Async edge case fix requires storing an event listener's attach timestamp.
  10777. var getNow = Date.now;
  10778. // Determine what event timestamp the browser is using. Annoyingly, the
  10779. // timestamp can either be hi-res (relative to page load) or low-res
  10780. // (relative to UNIX epoch), so in order to compare time we have to use the
  10781. // same timestamp type when saving the flush timestamp.
  10782. // All IE versions use low-res event timestamps, and have problematic clock
  10783. // implementations (#9632)
  10784. if (inBrowser && !isIE) {
  10785. var performance = window.performance;
  10786. if (
  10787. performance &&
  10788. typeof performance.now === 'function' &&
  10789. getNow() > document.createEvent('Event').timeStamp
  10790. ) {
  10791. // if the event timestamp, although evaluated AFTER the Date.now(), is
  10792. // smaller than it, it means the event is using a hi-res timestamp,
  10793. // and we need to use the hi-res version for event listener timestamps as
  10794. // well.
  10795. getNow = function () { return performance.now(); };
  10796. }
  10797. }
  10798. /**
  10799. * Flush both queues and run the watchers.
  10800. */
  10801. function flushSchedulerQueue () {
  10802. currentFlushTimestamp = getNow();
  10803. flushing = true;
  10804. var watcher, id;
  10805. // Sort queue before flush.
  10806. // This ensures that:
  10807. // 1. Components are updated from parent to child. (because parent is always
  10808. // created before the child)
  10809. // 2. A component's user watchers are run before its render watcher (because
  10810. // user watchers are created before the render watcher)
  10811. // 3. If a component is destroyed during a parent component's watcher run,
  10812. // its watchers can be skipped.
  10813. queue.sort(function (a, b) { return a.id - b.id; });
  10814. // do not cache length because more watchers might be pushed
  10815. // as we run existing watchers
  10816. for (index = 0; index < queue.length; index++) {
  10817. watcher = queue[index];
  10818. if (watcher.before) {
  10819. watcher.before();
  10820. }
  10821. id = watcher.id;
  10822. has[id] = null;
  10823. watcher.run();
  10824. // in dev build, check and stop circular updates.
  10825. if ( true && has[id] != null) {
  10826. circular[id] = (circular[id] || 0) + 1;
  10827. if (circular[id] > MAX_UPDATE_COUNT) {
  10828. warn(
  10829. 'You may have an infinite update loop ' + (
  10830. watcher.user
  10831. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  10832. : "in a component render function."
  10833. ),
  10834. watcher.vm
  10835. );
  10836. break
  10837. }
  10838. }
  10839. }
  10840. // keep copies of post queues before resetting state
  10841. var activatedQueue = activatedChildren.slice();
  10842. var updatedQueue = queue.slice();
  10843. resetSchedulerState();
  10844. // call component updated and activated hooks
  10845. callActivatedHooks(activatedQueue);
  10846. callUpdatedHooks(updatedQueue);
  10847. // devtool hook
  10848. /* istanbul ignore if */
  10849. if (devtools && config.devtools) {
  10850. devtools.emit('flush');
  10851. }
  10852. }
  10853. function callUpdatedHooks (queue) {
  10854. var i = queue.length;
  10855. while (i--) {
  10856. var watcher = queue[i];
  10857. var vm = watcher.vm;
  10858. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  10859. callHook(vm, 'updated');
  10860. }
  10861. }
  10862. }
  10863. /**
  10864. * Queue a kept-alive component that was activated during patch.
  10865. * The queue will be processed after the entire tree has been patched.
  10866. */
  10867. function queueActivatedComponent (vm) {
  10868. // setting _inactive to false here so that a render function can
  10869. // rely on checking whether it's in an inactive tree (e.g. router-view)
  10870. vm._inactive = false;
  10871. activatedChildren.push(vm);
  10872. }
  10873. function callActivatedHooks (queue) {
  10874. for (var i = 0; i < queue.length; i++) {
  10875. queue[i]._inactive = true;
  10876. activateChildComponent(queue[i], true /* true */);
  10877. }
  10878. }
  10879. /**
  10880. * Push a watcher into the watcher queue.
  10881. * Jobs with duplicate IDs will be skipped unless it's
  10882. * pushed when the queue is being flushed.
  10883. */
  10884. function queueWatcher (watcher) {
  10885. var id = watcher.id;
  10886. if (has[id] == null) {
  10887. has[id] = true;
  10888. if (!flushing) {
  10889. queue.push(watcher);
  10890. } else {
  10891. // if already flushing, splice the watcher based on its id
  10892. // if already past its id, it will be run next immediately.
  10893. var i = queue.length - 1;
  10894. while (i > index && queue[i].id > watcher.id) {
  10895. i--;
  10896. }
  10897. queue.splice(i + 1, 0, watcher);
  10898. }
  10899. // queue the flush
  10900. if (!waiting) {
  10901. waiting = true;
  10902. if ( true && !config.async) {
  10903. flushSchedulerQueue();
  10904. return
  10905. }
  10906. nextTick(flushSchedulerQueue);
  10907. }
  10908. }
  10909. }
  10910. /* */
  10911. var uid$2 = 0;
  10912. /**
  10913. * A watcher parses an expression, collects dependencies,
  10914. * and fires callback when the expression value changes.
  10915. * This is used for both the $watch() api and directives.
  10916. */
  10917. var Watcher = function Watcher (
  10918. vm,
  10919. expOrFn,
  10920. cb,
  10921. options,
  10922. isRenderWatcher
  10923. ) {
  10924. this.vm = vm;
  10925. if (isRenderWatcher) {
  10926. vm._watcher = this;
  10927. }
  10928. vm._watchers.push(this);
  10929. // options
  10930. if (options) {
  10931. this.deep = !!options.deep;
  10932. this.user = !!options.user;
  10933. this.lazy = !!options.lazy;
  10934. this.sync = !!options.sync;
  10935. this.before = options.before;
  10936. } else {
  10937. this.deep = this.user = this.lazy = this.sync = false;
  10938. }
  10939. this.cb = cb;
  10940. this.id = ++uid$2; // uid for batching
  10941. this.active = true;
  10942. this.dirty = this.lazy; // for lazy watchers
  10943. this.deps = [];
  10944. this.newDeps = [];
  10945. this.depIds = new _Set();
  10946. this.newDepIds = new _Set();
  10947. this.expression = true
  10948. ? expOrFn.toString()
  10949. : undefined;
  10950. // parse expression for getter
  10951. if (typeof expOrFn === 'function') {
  10952. this.getter = expOrFn;
  10953. } else {
  10954. this.getter = parsePath(expOrFn);
  10955. if (!this.getter) {
  10956. this.getter = noop;
  10957. true && warn(
  10958. "Failed watching path: \"" + expOrFn + "\" " +
  10959. 'Watcher only accepts simple dot-delimited paths. ' +
  10960. 'For full control, use a function instead.',
  10961. vm
  10962. );
  10963. }
  10964. }
  10965. this.value = this.lazy
  10966. ? undefined
  10967. : this.get();
  10968. };
  10969. /**
  10970. * Evaluate the getter, and re-collect dependencies.
  10971. */
  10972. Watcher.prototype.get = function get () {
  10973. pushTarget(this);
  10974. var value;
  10975. var vm = this.vm;
  10976. try {
  10977. value = this.getter.call(vm, vm);
  10978. } catch (e) {
  10979. if (this.user) {
  10980. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  10981. } else {
  10982. throw e
  10983. }
  10984. } finally {
  10985. // "touch" every property so they are all tracked as
  10986. // dependencies for deep watching
  10987. if (this.deep) {
  10988. traverse(value);
  10989. }
  10990. popTarget();
  10991. this.cleanupDeps();
  10992. }
  10993. return value
  10994. };
  10995. /**
  10996. * Add a dependency to this directive.
  10997. */
  10998. Watcher.prototype.addDep = function addDep (dep) {
  10999. var id = dep.id;
  11000. if (!this.newDepIds.has(id)) {
  11001. this.newDepIds.add(id);
  11002. this.newDeps.push(dep);
  11003. if (!this.depIds.has(id)) {
  11004. dep.addSub(this);
  11005. }
  11006. }
  11007. };
  11008. /**
  11009. * Clean up for dependency collection.
  11010. */
  11011. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  11012. var i = this.deps.length;
  11013. while (i--) {
  11014. var dep = this.deps[i];
  11015. if (!this.newDepIds.has(dep.id)) {
  11016. dep.removeSub(this);
  11017. }
  11018. }
  11019. var tmp = this.depIds;
  11020. this.depIds = this.newDepIds;
  11021. this.newDepIds = tmp;
  11022. this.newDepIds.clear();
  11023. tmp = this.deps;
  11024. this.deps = this.newDeps;
  11025. this.newDeps = tmp;
  11026. this.newDeps.length = 0;
  11027. };
  11028. /**
  11029. * Subscriber interface.
  11030. * Will be called when a dependency changes.
  11031. */
  11032. Watcher.prototype.update = function update () {
  11033. /* istanbul ignore else */
  11034. if (this.lazy) {
  11035. this.dirty = true;
  11036. } else if (this.sync) {
  11037. this.run();
  11038. } else {
  11039. queueWatcher(this);
  11040. }
  11041. };
  11042. /**
  11043. * Scheduler job interface.
  11044. * Will be called by the scheduler.
  11045. */
  11046. Watcher.prototype.run = function run () {
  11047. if (this.active) {
  11048. var value = this.get();
  11049. if (
  11050. value !== this.value ||
  11051. // Deep watchers and watchers on Object/Arrays should fire even
  11052. // when the value is the same, because the value may
  11053. // have mutated.
  11054. isObject(value) ||
  11055. this.deep
  11056. ) {
  11057. // set new value
  11058. var oldValue = this.value;
  11059. this.value = value;
  11060. if (this.user) {
  11061. try {
  11062. this.cb.call(this.vm, value, oldValue);
  11063. } catch (e) {
  11064. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  11065. }
  11066. } else {
  11067. this.cb.call(this.vm, value, oldValue);
  11068. }
  11069. }
  11070. }
  11071. };
  11072. /**
  11073. * Evaluate the value of the watcher.
  11074. * This only gets called for lazy watchers.
  11075. */
  11076. Watcher.prototype.evaluate = function evaluate () {
  11077. this.value = this.get();
  11078. this.dirty = false;
  11079. };
  11080. /**
  11081. * Depend on all deps collected by this watcher.
  11082. */
  11083. Watcher.prototype.depend = function depend () {
  11084. var i = this.deps.length;
  11085. while (i--) {
  11086. this.deps[i].depend();
  11087. }
  11088. };
  11089. /**
  11090. * Remove self from all dependencies' subscriber list.
  11091. */
  11092. Watcher.prototype.teardown = function teardown () {
  11093. if (this.active) {
  11094. // remove self from vm's watcher list
  11095. // this is a somewhat expensive operation so we skip it
  11096. // if the vm is being destroyed.
  11097. if (!this.vm._isBeingDestroyed) {
  11098. remove(this.vm._watchers, this);
  11099. }
  11100. var i = this.deps.length;
  11101. while (i--) {
  11102. this.deps[i].removeSub(this);
  11103. }
  11104. this.active = false;
  11105. }
  11106. };
  11107. /* */
  11108. var sharedPropertyDefinition = {
  11109. enumerable: true,
  11110. configurable: true,
  11111. get: noop,
  11112. set: noop
  11113. };
  11114. function proxy (target, sourceKey, key) {
  11115. sharedPropertyDefinition.get = function proxyGetter () {
  11116. return this[sourceKey][key]
  11117. };
  11118. sharedPropertyDefinition.set = function proxySetter (val) {
  11119. this[sourceKey][key] = val;
  11120. };
  11121. Object.defineProperty(target, key, sharedPropertyDefinition);
  11122. }
  11123. function initState (vm) {
  11124. vm._watchers = [];
  11125. var opts = vm.$options;
  11126. if (opts.props) { initProps(vm, opts.props); }
  11127. if (opts.methods) { initMethods(vm, opts.methods); }
  11128. if (opts.data) {
  11129. initData(vm);
  11130. } else {
  11131. observe(vm._data = {}, true /* asRootData */);
  11132. }
  11133. if (opts.computed) { initComputed(vm, opts.computed); }
  11134. if (opts.watch && opts.watch !== nativeWatch) {
  11135. initWatch(vm, opts.watch);
  11136. }
  11137. }
  11138. function initProps (vm, propsOptions) {
  11139. var propsData = vm.$options.propsData || {};
  11140. var props = vm._props = {};
  11141. // cache prop keys so that future props updates can iterate using Array
  11142. // instead of dynamic object key enumeration.
  11143. var keys = vm.$options._propKeys = [];
  11144. var isRoot = !vm.$parent;
  11145. // root instance props should be converted
  11146. if (!isRoot) {
  11147. toggleObserving(false);
  11148. }
  11149. var loop = function ( key ) {
  11150. keys.push(key);
  11151. var value = validateProp(key, propsOptions, propsData, vm);
  11152. /* istanbul ignore else */
  11153. if (true) {
  11154. var hyphenatedKey = hyphenate(key);
  11155. if (isReservedAttribute(hyphenatedKey) ||
  11156. config.isReservedAttr(hyphenatedKey)) {
  11157. warn(
  11158. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  11159. vm
  11160. );
  11161. }
  11162. defineReactive$$1(props, key, value, function () {
  11163. if (!isRoot && !isUpdatingChildComponent) {
  11164. {
  11165. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  11166. return
  11167. }
  11168. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  11169. if(
  11170. key === 'value' &&
  11171. Array.isArray(vm.$options.behaviors) &&
  11172. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  11173. ){
  11174. return
  11175. }
  11176. if(vm._getFormData){
  11177. return
  11178. }
  11179. var $parent = vm.$parent;
  11180. while($parent){
  11181. if($parent.__next_tick_pending){
  11182. return
  11183. }
  11184. $parent = $parent.$parent;
  11185. }
  11186. }
  11187. warn(
  11188. "Avoid mutating a prop directly since the value will be " +
  11189. "overwritten whenever the parent component re-renders. " +
  11190. "Instead, use a data or computed property based on the prop's " +
  11191. "value. Prop being mutated: \"" + key + "\"",
  11192. vm
  11193. );
  11194. }
  11195. });
  11196. } else {}
  11197. // static props are already proxied on the component's prototype
  11198. // during Vue.extend(). We only need to proxy props defined at
  11199. // instantiation here.
  11200. if (!(key in vm)) {
  11201. proxy(vm, "_props", key);
  11202. }
  11203. };
  11204. for (var key in propsOptions) loop( key );
  11205. toggleObserving(true);
  11206. }
  11207. function initData (vm) {
  11208. var data = vm.$options.data;
  11209. data = vm._data = typeof data === 'function'
  11210. ? getData(data, vm)
  11211. : data || {};
  11212. if (!isPlainObject(data)) {
  11213. data = {};
  11214. true && warn(
  11215. 'data functions should return an object:\n' +
  11216. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  11217. vm
  11218. );
  11219. }
  11220. // proxy data on instance
  11221. var keys = Object.keys(data);
  11222. var props = vm.$options.props;
  11223. var methods = vm.$options.methods;
  11224. var i = keys.length;
  11225. while (i--) {
  11226. var key = keys[i];
  11227. if (true) {
  11228. if (methods && hasOwn(methods, key)) {
  11229. warn(
  11230. ("Method \"" + key + "\" has already been defined as a data property."),
  11231. vm
  11232. );
  11233. }
  11234. }
  11235. if (props && hasOwn(props, key)) {
  11236. true && warn(
  11237. "The data property \"" + key + "\" is already declared as a prop. " +
  11238. "Use prop default value instead.",
  11239. vm
  11240. );
  11241. } else if (!isReserved(key)) {
  11242. proxy(vm, "_data", key);
  11243. }
  11244. }
  11245. // observe data
  11246. observe(data, true /* asRootData */);
  11247. }
  11248. function getData (data, vm) {
  11249. // #7573 disable dep collection when invoking data getters
  11250. pushTarget();
  11251. try {
  11252. return data.call(vm, vm)
  11253. } catch (e) {
  11254. handleError(e, vm, "data()");
  11255. return {}
  11256. } finally {
  11257. popTarget();
  11258. }
  11259. }
  11260. var computedWatcherOptions = { lazy: true };
  11261. function initComputed (vm, computed) {
  11262. // $flow-disable-line
  11263. var watchers = vm._computedWatchers = Object.create(null);
  11264. // computed properties are just getters during SSR
  11265. var isSSR = isServerRendering();
  11266. for (var key in computed) {
  11267. var userDef = computed[key];
  11268. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  11269. if ( true && getter == null) {
  11270. warn(
  11271. ("Getter is missing for computed property \"" + key + "\"."),
  11272. vm
  11273. );
  11274. }
  11275. if (!isSSR) {
  11276. // create internal watcher for the computed property.
  11277. watchers[key] = new Watcher(
  11278. vm,
  11279. getter || noop,
  11280. noop,
  11281. computedWatcherOptions
  11282. );
  11283. }
  11284. // component-defined computed properties are already defined on the
  11285. // component prototype. We only need to define computed properties defined
  11286. // at instantiation here.
  11287. if (!(key in vm)) {
  11288. defineComputed(vm, key, userDef);
  11289. } else if (true) {
  11290. if (key in vm.$data) {
  11291. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  11292. } else if (vm.$options.props && key in vm.$options.props) {
  11293. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  11294. }
  11295. }
  11296. }
  11297. }
  11298. function defineComputed (
  11299. target,
  11300. key,
  11301. userDef
  11302. ) {
  11303. var shouldCache = !isServerRendering();
  11304. if (typeof userDef === 'function') {
  11305. sharedPropertyDefinition.get = shouldCache
  11306. ? createComputedGetter(key)
  11307. : createGetterInvoker(userDef);
  11308. sharedPropertyDefinition.set = noop;
  11309. } else {
  11310. sharedPropertyDefinition.get = userDef.get
  11311. ? shouldCache && userDef.cache !== false
  11312. ? createComputedGetter(key)
  11313. : createGetterInvoker(userDef.get)
  11314. : noop;
  11315. sharedPropertyDefinition.set = userDef.set || noop;
  11316. }
  11317. if ( true &&
  11318. sharedPropertyDefinition.set === noop) {
  11319. sharedPropertyDefinition.set = function () {
  11320. warn(
  11321. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  11322. this
  11323. );
  11324. };
  11325. }
  11326. Object.defineProperty(target, key, sharedPropertyDefinition);
  11327. }
  11328. function createComputedGetter (key) {
  11329. return function computedGetter () {
  11330. var watcher = this._computedWatchers && this._computedWatchers[key];
  11331. if (watcher) {
  11332. if (watcher.dirty) {
  11333. watcher.evaluate();
  11334. }
  11335. if (Dep.SharedObject.target) {// fixed by xxxxxx
  11336. watcher.depend();
  11337. }
  11338. return watcher.value
  11339. }
  11340. }
  11341. }
  11342. function createGetterInvoker(fn) {
  11343. return function computedGetter () {
  11344. return fn.call(this, this)
  11345. }
  11346. }
  11347. function initMethods (vm, methods) {
  11348. var props = vm.$options.props;
  11349. for (var key in methods) {
  11350. if (true) {
  11351. if (typeof methods[key] !== 'function') {
  11352. warn(
  11353. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  11354. "Did you reference the function correctly?",
  11355. vm
  11356. );
  11357. }
  11358. if (props && hasOwn(props, key)) {
  11359. warn(
  11360. ("Method \"" + key + "\" has already been defined as a prop."),
  11361. vm
  11362. );
  11363. }
  11364. if ((key in vm) && isReserved(key)) {
  11365. warn(
  11366. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  11367. "Avoid defining component methods that start with _ or $."
  11368. );
  11369. }
  11370. }
  11371. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  11372. }
  11373. }
  11374. function initWatch (vm, watch) {
  11375. for (var key in watch) {
  11376. var handler = watch[key];
  11377. if (Array.isArray(handler)) {
  11378. for (var i = 0; i < handler.length; i++) {
  11379. createWatcher(vm, key, handler[i]);
  11380. }
  11381. } else {
  11382. createWatcher(vm, key, handler);
  11383. }
  11384. }
  11385. }
  11386. function createWatcher (
  11387. vm,
  11388. expOrFn,
  11389. handler,
  11390. options
  11391. ) {
  11392. if (isPlainObject(handler)) {
  11393. options = handler;
  11394. handler = handler.handler;
  11395. }
  11396. if (typeof handler === 'string') {
  11397. handler = vm[handler];
  11398. }
  11399. return vm.$watch(expOrFn, handler, options)
  11400. }
  11401. function stateMixin (Vue) {
  11402. // flow somehow has problems with directly declared definition object
  11403. // when using Object.defineProperty, so we have to procedurally build up
  11404. // the object here.
  11405. var dataDef = {};
  11406. dataDef.get = function () { return this._data };
  11407. var propsDef = {};
  11408. propsDef.get = function () { return this._props };
  11409. if (true) {
  11410. dataDef.set = function () {
  11411. warn(
  11412. 'Avoid replacing instance root $data. ' +
  11413. 'Use nested data properties instead.',
  11414. this
  11415. );
  11416. };
  11417. propsDef.set = function () {
  11418. warn("$props is readonly.", this);
  11419. };
  11420. }
  11421. Object.defineProperty(Vue.prototype, '$data', dataDef);
  11422. Object.defineProperty(Vue.prototype, '$props', propsDef);
  11423. Vue.prototype.$set = set;
  11424. Vue.prototype.$delete = del;
  11425. Vue.prototype.$watch = function (
  11426. expOrFn,
  11427. cb,
  11428. options
  11429. ) {
  11430. var vm = this;
  11431. if (isPlainObject(cb)) {
  11432. return createWatcher(vm, expOrFn, cb, options)
  11433. }
  11434. options = options || {};
  11435. options.user = true;
  11436. var watcher = new Watcher(vm, expOrFn, cb, options);
  11437. if (options.immediate) {
  11438. try {
  11439. cb.call(vm, watcher.value);
  11440. } catch (error) {
  11441. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  11442. }
  11443. }
  11444. return function unwatchFn () {
  11445. watcher.teardown();
  11446. }
  11447. };
  11448. }
  11449. /* */
  11450. var uid$3 = 0;
  11451. function initMixin (Vue) {
  11452. Vue.prototype._init = function (options) {
  11453. var vm = this;
  11454. // a uid
  11455. vm._uid = uid$3++;
  11456. var startTag, endTag;
  11457. /* istanbul ignore if */
  11458. if ( true && config.performance && mark) {
  11459. startTag = "vue-perf-start:" + (vm._uid);
  11460. endTag = "vue-perf-end:" + (vm._uid);
  11461. mark(startTag);
  11462. }
  11463. // a flag to avoid this being observed
  11464. vm._isVue = true;
  11465. // merge options
  11466. if (options && options._isComponent) {
  11467. // optimize internal component instantiation
  11468. // since dynamic options merging is pretty slow, and none of the
  11469. // internal component options needs special treatment.
  11470. initInternalComponent(vm, options);
  11471. } else {
  11472. vm.$options = mergeOptions(
  11473. resolveConstructorOptions(vm.constructor),
  11474. options || {},
  11475. vm
  11476. );
  11477. }
  11478. /* istanbul ignore else */
  11479. if (true) {
  11480. initProxy(vm);
  11481. } else {}
  11482. // expose real self
  11483. vm._self = vm;
  11484. initLifecycle(vm);
  11485. initEvents(vm);
  11486. initRender(vm);
  11487. callHook(vm, 'beforeCreate');
  11488. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  11489. initState(vm);
  11490. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  11491. !vm._$fallback && callHook(vm, 'created');
  11492. /* istanbul ignore if */
  11493. if ( true && config.performance && mark) {
  11494. vm._name = formatComponentName(vm, false);
  11495. mark(endTag);
  11496. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  11497. }
  11498. if (vm.$options.el) {
  11499. vm.$mount(vm.$options.el);
  11500. }
  11501. };
  11502. }
  11503. function initInternalComponent (vm, options) {
  11504. var opts = vm.$options = Object.create(vm.constructor.options);
  11505. // doing this because it's faster than dynamic enumeration.
  11506. var parentVnode = options._parentVnode;
  11507. opts.parent = options.parent;
  11508. opts._parentVnode = parentVnode;
  11509. var vnodeComponentOptions = parentVnode.componentOptions;
  11510. opts.propsData = vnodeComponentOptions.propsData;
  11511. opts._parentListeners = vnodeComponentOptions.listeners;
  11512. opts._renderChildren = vnodeComponentOptions.children;
  11513. opts._componentTag = vnodeComponentOptions.tag;
  11514. if (options.render) {
  11515. opts.render = options.render;
  11516. opts.staticRenderFns = options.staticRenderFns;
  11517. }
  11518. }
  11519. function resolveConstructorOptions (Ctor) {
  11520. var options = Ctor.options;
  11521. if (Ctor.super) {
  11522. var superOptions = resolveConstructorOptions(Ctor.super);
  11523. var cachedSuperOptions = Ctor.superOptions;
  11524. if (superOptions !== cachedSuperOptions) {
  11525. // super option changed,
  11526. // need to resolve new options.
  11527. Ctor.superOptions = superOptions;
  11528. // check if there are any late-modified/attached options (#4976)
  11529. var modifiedOptions = resolveModifiedOptions(Ctor);
  11530. // update base extend options
  11531. if (modifiedOptions) {
  11532. extend(Ctor.extendOptions, modifiedOptions);
  11533. }
  11534. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  11535. if (options.name) {
  11536. options.components[options.name] = Ctor;
  11537. }
  11538. }
  11539. }
  11540. return options
  11541. }
  11542. function resolveModifiedOptions (Ctor) {
  11543. var modified;
  11544. var latest = Ctor.options;
  11545. var sealed = Ctor.sealedOptions;
  11546. for (var key in latest) {
  11547. if (latest[key] !== sealed[key]) {
  11548. if (!modified) { modified = {}; }
  11549. modified[key] = latest[key];
  11550. }
  11551. }
  11552. return modified
  11553. }
  11554. function Vue (options) {
  11555. if ( true &&
  11556. !(this instanceof Vue)
  11557. ) {
  11558. warn('Vue is a constructor and should be called with the `new` keyword');
  11559. }
  11560. this._init(options);
  11561. }
  11562. initMixin(Vue);
  11563. stateMixin(Vue);
  11564. eventsMixin(Vue);
  11565. lifecycleMixin(Vue);
  11566. renderMixin(Vue);
  11567. /* */
  11568. function initUse (Vue) {
  11569. Vue.use = function (plugin) {
  11570. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  11571. if (installedPlugins.indexOf(plugin) > -1) {
  11572. return this
  11573. }
  11574. // additional parameters
  11575. var args = toArray(arguments, 1);
  11576. args.unshift(this);
  11577. if (typeof plugin.install === 'function') {
  11578. plugin.install.apply(plugin, args);
  11579. } else if (typeof plugin === 'function') {
  11580. plugin.apply(null, args);
  11581. }
  11582. installedPlugins.push(plugin);
  11583. return this
  11584. };
  11585. }
  11586. /* */
  11587. function initMixin$1 (Vue) {
  11588. Vue.mixin = function (mixin) {
  11589. this.options = mergeOptions(this.options, mixin);
  11590. return this
  11591. };
  11592. }
  11593. /* */
  11594. function initExtend (Vue) {
  11595. /**
  11596. * Each instance constructor, including Vue, has a unique
  11597. * cid. This enables us to create wrapped "child
  11598. * constructors" for prototypal inheritance and cache them.
  11599. */
  11600. Vue.cid = 0;
  11601. var cid = 1;
  11602. /**
  11603. * Class inheritance
  11604. */
  11605. Vue.extend = function (extendOptions) {
  11606. extendOptions = extendOptions || {};
  11607. var Super = this;
  11608. var SuperId = Super.cid;
  11609. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  11610. if (cachedCtors[SuperId]) {
  11611. return cachedCtors[SuperId]
  11612. }
  11613. var name = extendOptions.name || Super.options.name;
  11614. if ( true && name) {
  11615. validateComponentName(name);
  11616. }
  11617. var Sub = function VueComponent (options) {
  11618. this._init(options);
  11619. };
  11620. Sub.prototype = Object.create(Super.prototype);
  11621. Sub.prototype.constructor = Sub;
  11622. Sub.cid = cid++;
  11623. Sub.options = mergeOptions(
  11624. Super.options,
  11625. extendOptions
  11626. );
  11627. Sub['super'] = Super;
  11628. // For props and computed properties, we define the proxy getters on
  11629. // the Vue instances at extension time, on the extended prototype. This
  11630. // avoids Object.defineProperty calls for each instance created.
  11631. if (Sub.options.props) {
  11632. initProps$1(Sub);
  11633. }
  11634. if (Sub.options.computed) {
  11635. initComputed$1(Sub);
  11636. }
  11637. // allow further extension/mixin/plugin usage
  11638. Sub.extend = Super.extend;
  11639. Sub.mixin = Super.mixin;
  11640. Sub.use = Super.use;
  11641. // create asset registers, so extended classes
  11642. // can have their private assets too.
  11643. ASSET_TYPES.forEach(function (type) {
  11644. Sub[type] = Super[type];
  11645. });
  11646. // enable recursive self-lookup
  11647. if (name) {
  11648. Sub.options.components[name] = Sub;
  11649. }
  11650. // keep a reference to the super options at extension time.
  11651. // later at instantiation we can check if Super's options have
  11652. // been updated.
  11653. Sub.superOptions = Super.options;
  11654. Sub.extendOptions = extendOptions;
  11655. Sub.sealedOptions = extend({}, Sub.options);
  11656. // cache constructor
  11657. cachedCtors[SuperId] = Sub;
  11658. return Sub
  11659. };
  11660. }
  11661. function initProps$1 (Comp) {
  11662. var props = Comp.options.props;
  11663. for (var key in props) {
  11664. proxy(Comp.prototype, "_props", key);
  11665. }
  11666. }
  11667. function initComputed$1 (Comp) {
  11668. var computed = Comp.options.computed;
  11669. for (var key in computed) {
  11670. defineComputed(Comp.prototype, key, computed[key]);
  11671. }
  11672. }
  11673. /* */
  11674. function initAssetRegisters (Vue) {
  11675. /**
  11676. * Create asset registration methods.
  11677. */
  11678. ASSET_TYPES.forEach(function (type) {
  11679. Vue[type] = function (
  11680. id,
  11681. definition
  11682. ) {
  11683. if (!definition) {
  11684. return this.options[type + 's'][id]
  11685. } else {
  11686. /* istanbul ignore if */
  11687. if ( true && type === 'component') {
  11688. validateComponentName(id);
  11689. }
  11690. if (type === 'component' && isPlainObject(definition)) {
  11691. definition.name = definition.name || id;
  11692. definition = this.options._base.extend(definition);
  11693. }
  11694. if (type === 'directive' && typeof definition === 'function') {
  11695. definition = { bind: definition, update: definition };
  11696. }
  11697. this.options[type + 's'][id] = definition;
  11698. return definition
  11699. }
  11700. };
  11701. });
  11702. }
  11703. /* */
  11704. function getComponentName (opts) {
  11705. return opts && (opts.Ctor.options.name || opts.tag)
  11706. }
  11707. function matches (pattern, name) {
  11708. if (Array.isArray(pattern)) {
  11709. return pattern.indexOf(name) > -1
  11710. } else if (typeof pattern === 'string') {
  11711. return pattern.split(',').indexOf(name) > -1
  11712. } else if (isRegExp(pattern)) {
  11713. return pattern.test(name)
  11714. }
  11715. /* istanbul ignore next */
  11716. return false
  11717. }
  11718. function pruneCache (keepAliveInstance, filter) {
  11719. var cache = keepAliveInstance.cache;
  11720. var keys = keepAliveInstance.keys;
  11721. var _vnode = keepAliveInstance._vnode;
  11722. for (var key in cache) {
  11723. var cachedNode = cache[key];
  11724. if (cachedNode) {
  11725. var name = getComponentName(cachedNode.componentOptions);
  11726. if (name && !filter(name)) {
  11727. pruneCacheEntry(cache, key, keys, _vnode);
  11728. }
  11729. }
  11730. }
  11731. }
  11732. function pruneCacheEntry (
  11733. cache,
  11734. key,
  11735. keys,
  11736. current
  11737. ) {
  11738. var cached$$1 = cache[key];
  11739. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  11740. cached$$1.componentInstance.$destroy();
  11741. }
  11742. cache[key] = null;
  11743. remove(keys, key);
  11744. }
  11745. var patternTypes = [String, RegExp, Array];
  11746. var KeepAlive = {
  11747. name: 'keep-alive',
  11748. abstract: true,
  11749. props: {
  11750. include: patternTypes,
  11751. exclude: patternTypes,
  11752. max: [String, Number]
  11753. },
  11754. created: function created () {
  11755. this.cache = Object.create(null);
  11756. this.keys = [];
  11757. },
  11758. destroyed: function destroyed () {
  11759. for (var key in this.cache) {
  11760. pruneCacheEntry(this.cache, key, this.keys);
  11761. }
  11762. },
  11763. mounted: function mounted () {
  11764. var this$1 = this;
  11765. this.$watch('include', function (val) {
  11766. pruneCache(this$1, function (name) { return matches(val, name); });
  11767. });
  11768. this.$watch('exclude', function (val) {
  11769. pruneCache(this$1, function (name) { return !matches(val, name); });
  11770. });
  11771. },
  11772. render: function render () {
  11773. var slot = this.$slots.default;
  11774. var vnode = getFirstComponentChild(slot);
  11775. var componentOptions = vnode && vnode.componentOptions;
  11776. if (componentOptions) {
  11777. // check pattern
  11778. var name = getComponentName(componentOptions);
  11779. var ref = this;
  11780. var include = ref.include;
  11781. var exclude = ref.exclude;
  11782. if (
  11783. // not included
  11784. (include && (!name || !matches(include, name))) ||
  11785. // excluded
  11786. (exclude && name && matches(exclude, name))
  11787. ) {
  11788. return vnode
  11789. }
  11790. var ref$1 = this;
  11791. var cache = ref$1.cache;
  11792. var keys = ref$1.keys;
  11793. var key = vnode.key == null
  11794. // same constructor may get registered as different local components
  11795. // so cid alone is not enough (#3269)
  11796. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  11797. : vnode.key;
  11798. if (cache[key]) {
  11799. vnode.componentInstance = cache[key].componentInstance;
  11800. // make current key freshest
  11801. remove(keys, key);
  11802. keys.push(key);
  11803. } else {
  11804. cache[key] = vnode;
  11805. keys.push(key);
  11806. // prune oldest entry
  11807. if (this.max && keys.length > parseInt(this.max)) {
  11808. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  11809. }
  11810. }
  11811. vnode.data.keepAlive = true;
  11812. }
  11813. return vnode || (slot && slot[0])
  11814. }
  11815. };
  11816. var builtInComponents = {
  11817. KeepAlive: KeepAlive
  11818. };
  11819. /* */
  11820. function initGlobalAPI (Vue) {
  11821. // config
  11822. var configDef = {};
  11823. configDef.get = function () { return config; };
  11824. if (true) {
  11825. configDef.set = function () {
  11826. warn(
  11827. 'Do not replace the Vue.config object, set individual fields instead.'
  11828. );
  11829. };
  11830. }
  11831. Object.defineProperty(Vue, 'config', configDef);
  11832. // exposed util methods.
  11833. // NOTE: these are not considered part of the public API - avoid relying on
  11834. // them unless you are aware of the risk.
  11835. Vue.util = {
  11836. warn: warn,
  11837. extend: extend,
  11838. mergeOptions: mergeOptions,
  11839. defineReactive: defineReactive$$1
  11840. };
  11841. Vue.set = set;
  11842. Vue.delete = del;
  11843. Vue.nextTick = nextTick;
  11844. // 2.6 explicit observable API
  11845. Vue.observable = function (obj) {
  11846. observe(obj);
  11847. return obj
  11848. };
  11849. Vue.options = Object.create(null);
  11850. ASSET_TYPES.forEach(function (type) {
  11851. Vue.options[type + 's'] = Object.create(null);
  11852. });
  11853. // this is used to identify the "base" constructor to extend all plain-object
  11854. // components with in Weex's multi-instance scenarios.
  11855. Vue.options._base = Vue;
  11856. extend(Vue.options.components, builtInComponents);
  11857. initUse(Vue);
  11858. initMixin$1(Vue);
  11859. initExtend(Vue);
  11860. initAssetRegisters(Vue);
  11861. }
  11862. initGlobalAPI(Vue);
  11863. Object.defineProperty(Vue.prototype, '$isServer', {
  11864. get: isServerRendering
  11865. });
  11866. Object.defineProperty(Vue.prototype, '$ssrContext', {
  11867. get: function get () {
  11868. /* istanbul ignore next */
  11869. return this.$vnode && this.$vnode.ssrContext
  11870. }
  11871. });
  11872. // expose FunctionalRenderContext for ssr runtime helper installation
  11873. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  11874. value: FunctionalRenderContext
  11875. });
  11876. Vue.version = '2.6.11';
  11877. /**
  11878. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  11879. */
  11880. var ARRAYTYPE = '[object Array]';
  11881. var OBJECTTYPE = '[object Object]';
  11882. // const FUNCTIONTYPE = '[object Function]'
  11883. function diff(current, pre) {
  11884. var result = {};
  11885. syncKeys(current, pre);
  11886. _diff(current, pre, '', result);
  11887. return result
  11888. }
  11889. function syncKeys(current, pre) {
  11890. if (current === pre) { return }
  11891. var rootCurrentType = type(current);
  11892. var rootPreType = type(pre);
  11893. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  11894. if(Object.keys(current).length >= Object.keys(pre).length){
  11895. for (var key in pre) {
  11896. var currentValue = current[key];
  11897. if (currentValue === undefined) {
  11898. current[key] = null;
  11899. } else {
  11900. syncKeys(currentValue, pre[key]);
  11901. }
  11902. }
  11903. }
  11904. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  11905. if (current.length >= pre.length) {
  11906. pre.forEach(function (item, index) {
  11907. syncKeys(current[index], item);
  11908. });
  11909. }
  11910. }
  11911. }
  11912. function _diff(current, pre, path, result) {
  11913. if (current === pre) { return }
  11914. var rootCurrentType = type(current);
  11915. var rootPreType = type(pre);
  11916. if (rootCurrentType == OBJECTTYPE) {
  11917. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  11918. setResult(result, path, current);
  11919. } else {
  11920. var loop = function ( key ) {
  11921. var currentValue = current[key];
  11922. var preValue = pre[key];
  11923. var currentType = type(currentValue);
  11924. var preType = type(preValue);
  11925. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  11926. if (currentValue !== pre[key]) {
  11927. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  11928. }
  11929. } else if (currentType == ARRAYTYPE) {
  11930. if (preType != ARRAYTYPE) {
  11931. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  11932. } else {
  11933. if (currentValue.length < preValue.length) {
  11934. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  11935. } else {
  11936. currentValue.forEach(function (item, index) {
  11937. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  11938. });
  11939. }
  11940. }
  11941. } else if (currentType == OBJECTTYPE) {
  11942. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  11943. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  11944. } else {
  11945. for (var subKey in currentValue) {
  11946. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  11947. }
  11948. }
  11949. }
  11950. };
  11951. for (var key in current) loop( key );
  11952. }
  11953. } else if (rootCurrentType == ARRAYTYPE) {
  11954. if (rootPreType != ARRAYTYPE) {
  11955. setResult(result, path, current);
  11956. } else {
  11957. if (current.length < pre.length) {
  11958. setResult(result, path, current);
  11959. } else {
  11960. current.forEach(function (item, index) {
  11961. _diff(item, pre[index], path + '[' + index + ']', result);
  11962. });
  11963. }
  11964. }
  11965. } else {
  11966. setResult(result, path, current);
  11967. }
  11968. }
  11969. function setResult(result, k, v) {
  11970. // if (type(v) != FUNCTIONTYPE) {
  11971. result[k] = v;
  11972. // }
  11973. }
  11974. function type(obj) {
  11975. return Object.prototype.toString.call(obj)
  11976. }
  11977. /* */
  11978. function flushCallbacks$1(vm) {
  11979. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  11980. if (Object({"VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  11981. var mpInstance = vm.$scope;
  11982. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  11983. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  11984. }
  11985. var copies = vm.__next_tick_callbacks.slice(0);
  11986. vm.__next_tick_callbacks.length = 0;
  11987. for (var i = 0; i < copies.length; i++) {
  11988. copies[i]();
  11989. }
  11990. }
  11991. }
  11992. function hasRenderWatcher(vm) {
  11993. return queue.find(function (watcher) { return vm._watcher === watcher; })
  11994. }
  11995. function nextTick$1(vm, cb) {
  11996. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  11997. //2.nextTick 之前存在 render watcher
  11998. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  11999. if(Object({"VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  12000. var mpInstance = vm.$scope;
  12001. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  12002. ']:nextVueTick');
  12003. }
  12004. return nextTick(cb, vm)
  12005. }else{
  12006. if(Object({"VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  12007. var mpInstance$1 = vm.$scope;
  12008. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  12009. ']:nextMPTick');
  12010. }
  12011. }
  12012. var _resolve;
  12013. if (!vm.__next_tick_callbacks) {
  12014. vm.__next_tick_callbacks = [];
  12015. }
  12016. vm.__next_tick_callbacks.push(function () {
  12017. if (cb) {
  12018. try {
  12019. cb.call(vm);
  12020. } catch (e) {
  12021. handleError(e, vm, 'nextTick');
  12022. }
  12023. } else if (_resolve) {
  12024. _resolve(vm);
  12025. }
  12026. });
  12027. // $flow-disable-line
  12028. if (!cb && typeof Promise !== 'undefined') {
  12029. return new Promise(function (resolve) {
  12030. _resolve = resolve;
  12031. })
  12032. }
  12033. }
  12034. /* */
  12035. function cloneWithData(vm) {
  12036. // 确保当前 vm 所有数据被同步
  12037. var ret = Object.create(null);
  12038. var dataKeys = [].concat(
  12039. Object.keys(vm._data || {}),
  12040. Object.keys(vm._computedWatchers || {}));
  12041. dataKeys.reduce(function(ret, key) {
  12042. ret[key] = vm[key];
  12043. return ret
  12044. }, ret);
  12045. // vue-composition-api
  12046. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  12047. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  12048. if (rawBindings) {
  12049. Object.keys(rawBindings).forEach(function (key) {
  12050. ret[key] = vm[key];
  12051. });
  12052. }
  12053. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  12054. Object.assign(ret, vm.$mp.data || {});
  12055. if (
  12056. Array.isArray(vm.$options.behaviors) &&
  12057. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  12058. ) { //form-field
  12059. ret['name'] = vm.name;
  12060. ret['value'] = vm.value;
  12061. }
  12062. return JSON.parse(JSON.stringify(ret))
  12063. }
  12064. var patch = function(oldVnode, vnode) {
  12065. var this$1 = this;
  12066. if (vnode === null) { //destroy
  12067. return
  12068. }
  12069. if (this.mpType === 'page' || this.mpType === 'component') {
  12070. var mpInstance = this.$scope;
  12071. var data = Object.create(null);
  12072. try {
  12073. data = cloneWithData(this);
  12074. } catch (err) {
  12075. console.error(err);
  12076. }
  12077. data.__webviewId__ = mpInstance.data.__webviewId__;
  12078. var mpData = Object.create(null);
  12079. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  12080. mpData[key] = mpInstance.data[key];
  12081. });
  12082. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  12083. if (Object.keys(diffData).length) {
  12084. if (Object({"VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  12085. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  12086. ']差量更新',
  12087. JSON.stringify(diffData));
  12088. }
  12089. this.__next_tick_pending = true;
  12090. mpInstance.setData(diffData, function () {
  12091. this$1.__next_tick_pending = false;
  12092. flushCallbacks$1(this$1);
  12093. });
  12094. } else {
  12095. flushCallbacks$1(this);
  12096. }
  12097. }
  12098. };
  12099. /* */
  12100. function createEmptyRender() {
  12101. }
  12102. function mountComponent$1(
  12103. vm,
  12104. el,
  12105. hydrating
  12106. ) {
  12107. if (!vm.mpType) {//main.js 中的 new Vue
  12108. return vm
  12109. }
  12110. if (vm.mpType === 'app') {
  12111. vm.$options.render = createEmptyRender;
  12112. }
  12113. if (!vm.$options.render) {
  12114. vm.$options.render = createEmptyRender;
  12115. if (true) {
  12116. /* istanbul ignore if */
  12117. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  12118. vm.$options.el || el) {
  12119. warn(
  12120. 'You are using the runtime-only build of Vue where the template ' +
  12121. 'compiler is not available. Either pre-compile the templates into ' +
  12122. 'render functions, or use the compiler-included build.',
  12123. vm
  12124. );
  12125. } else {
  12126. warn(
  12127. 'Failed to mount component: template or render function not defined.',
  12128. vm
  12129. );
  12130. }
  12131. }
  12132. }
  12133. !vm._$fallback && callHook(vm, 'beforeMount');
  12134. var updateComponent = function () {
  12135. vm._update(vm._render(), hydrating);
  12136. };
  12137. // we set this to vm._watcher inside the watcher's constructor
  12138. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  12139. // component's mounted hook), which relies on vm._watcher being already defined
  12140. new Watcher(vm, updateComponent, noop, {
  12141. before: function before() {
  12142. if (vm._isMounted && !vm._isDestroyed) {
  12143. callHook(vm, 'beforeUpdate');
  12144. }
  12145. }
  12146. }, true /* isRenderWatcher */);
  12147. hydrating = false;
  12148. return vm
  12149. }
  12150. /* */
  12151. function renderClass (
  12152. staticClass,
  12153. dynamicClass
  12154. ) {
  12155. if (isDef(staticClass) || isDef(dynamicClass)) {
  12156. return concat(staticClass, stringifyClass(dynamicClass))
  12157. }
  12158. /* istanbul ignore next */
  12159. return ''
  12160. }
  12161. function concat (a, b) {
  12162. return a ? b ? (a + ' ' + b) : a : (b || '')
  12163. }
  12164. function stringifyClass (value) {
  12165. if (Array.isArray(value)) {
  12166. return stringifyArray(value)
  12167. }
  12168. if (isObject(value)) {
  12169. return stringifyObject(value)
  12170. }
  12171. if (typeof value === 'string') {
  12172. return value
  12173. }
  12174. /* istanbul ignore next */
  12175. return ''
  12176. }
  12177. function stringifyArray (value) {
  12178. var res = '';
  12179. var stringified;
  12180. for (var i = 0, l = value.length; i < l; i++) {
  12181. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  12182. if (res) { res += ' '; }
  12183. res += stringified;
  12184. }
  12185. }
  12186. return res
  12187. }
  12188. function stringifyObject (value) {
  12189. var res = '';
  12190. for (var key in value) {
  12191. if (value[key]) {
  12192. if (res) { res += ' '; }
  12193. res += key;
  12194. }
  12195. }
  12196. return res
  12197. }
  12198. /* */
  12199. var parseStyleText = cached(function (cssText) {
  12200. var res = {};
  12201. var listDelimiter = /;(?![^(]*\))/g;
  12202. var propertyDelimiter = /:(.+)/;
  12203. cssText.split(listDelimiter).forEach(function (item) {
  12204. if (item) {
  12205. var tmp = item.split(propertyDelimiter);
  12206. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  12207. }
  12208. });
  12209. return res
  12210. });
  12211. // normalize possible array / string values into Object
  12212. function normalizeStyleBinding (bindingStyle) {
  12213. if (Array.isArray(bindingStyle)) {
  12214. return toObject(bindingStyle)
  12215. }
  12216. if (typeof bindingStyle === 'string') {
  12217. return parseStyleText(bindingStyle)
  12218. }
  12219. return bindingStyle
  12220. }
  12221. /* */
  12222. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  12223. function getTarget(obj, path) {
  12224. var parts = path.split('.');
  12225. var key = parts[0];
  12226. if (key.indexOf('__$n') === 0) { //number index
  12227. key = parseInt(key.replace('__$n', ''));
  12228. }
  12229. if (parts.length === 1) {
  12230. return obj[key]
  12231. }
  12232. return getTarget(obj[key], parts.slice(1).join('.'))
  12233. }
  12234. function internalMixin(Vue) {
  12235. Vue.config.errorHandler = function(err, vm, info) {
  12236. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  12237. console.error(err);
  12238. /* eslint-disable no-undef */
  12239. var app = typeof getApp === 'function' && getApp();
  12240. if (app && app.onError) {
  12241. app.onError(err);
  12242. }
  12243. };
  12244. var oldEmit = Vue.prototype.$emit;
  12245. Vue.prototype.$emit = function(event) {
  12246. if (this.$scope && event) {
  12247. (this.$scope['_triggerEvent'] || this.$scope['triggerEvent']).call(this.$scope, event, {
  12248. __args__: toArray(arguments, 1)
  12249. });
  12250. }
  12251. return oldEmit.apply(this, arguments)
  12252. };
  12253. Vue.prototype.$nextTick = function(fn) {
  12254. return nextTick$1(this, fn)
  12255. };
  12256. MP_METHODS.forEach(function (method) {
  12257. Vue.prototype[method] = function(args) {
  12258. if (this.$scope && this.$scope[method]) {
  12259. return this.$scope[method](args)
  12260. }
  12261. // mp-alipay
  12262. if (typeof my === 'undefined') {
  12263. return
  12264. }
  12265. if (method === 'createSelectorQuery') {
  12266. /* eslint-disable no-undef */
  12267. return my.createSelectorQuery(args)
  12268. } else if (method === 'createIntersectionObserver') {
  12269. /* eslint-disable no-undef */
  12270. return my.createIntersectionObserver(args)
  12271. }
  12272. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  12273. };
  12274. });
  12275. Vue.prototype.__init_provide = initProvide;
  12276. Vue.prototype.__init_injections = initInjections;
  12277. Vue.prototype.__call_hook = function(hook, args) {
  12278. var vm = this;
  12279. // #7573 disable dep collection when invoking lifecycle hooks
  12280. pushTarget();
  12281. var handlers = vm.$options[hook];
  12282. var info = hook + " hook";
  12283. var ret;
  12284. if (handlers) {
  12285. for (var i = 0, j = handlers.length; i < j; i++) {
  12286. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  12287. }
  12288. }
  12289. if (vm._hasHookEvent) {
  12290. vm.$emit('hook:' + hook, args);
  12291. }
  12292. popTarget();
  12293. return ret
  12294. };
  12295. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  12296. if (Array.isArray(modifiers)) {
  12297. if (modifiers.indexOf('trim') !== -1) {
  12298. value = value.trim();
  12299. }
  12300. if (modifiers.indexOf('number') !== -1) {
  12301. value = this._n(value);
  12302. }
  12303. }
  12304. if (!target) {
  12305. target = this;
  12306. }
  12307. // 解决动态属性添加
  12308. Vue.set(target, key, value);
  12309. };
  12310. Vue.prototype.__set_sync = function(target, key, value) {
  12311. if (!target) {
  12312. target = this;
  12313. }
  12314. // 解决动态属性添加
  12315. Vue.set(target, key, value);
  12316. };
  12317. Vue.prototype.__get_orig = function(item) {
  12318. if (isPlainObject(item)) {
  12319. return item['$orig'] || item
  12320. }
  12321. return item
  12322. };
  12323. Vue.prototype.__get_value = function(dataPath, target) {
  12324. return getTarget(target || this, dataPath)
  12325. };
  12326. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  12327. return renderClass(staticClass, dynamicClass)
  12328. };
  12329. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  12330. if (!dynamicStyle && !staticStyle) {
  12331. return ''
  12332. }
  12333. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  12334. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  12335. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  12336. };
  12337. Vue.prototype.__map = function(val, iteratee) {
  12338. //TODO 暂不考虑 string
  12339. var ret, i, l, keys, key;
  12340. if (Array.isArray(val)) {
  12341. ret = new Array(val.length);
  12342. for (i = 0, l = val.length; i < l; i++) {
  12343. ret[i] = iteratee(val[i], i);
  12344. }
  12345. return ret
  12346. } else if (isObject(val)) {
  12347. keys = Object.keys(val);
  12348. ret = Object.create(null);
  12349. for (i = 0, l = keys.length; i < l; i++) {
  12350. key = keys[i];
  12351. ret[key] = iteratee(val[key], key, i);
  12352. }
  12353. return ret
  12354. } else if (typeof val === 'number') {
  12355. ret = new Array(val);
  12356. for (i = 0, l = val; i < l; i++) {
  12357. // 第一个参数暂时仍和小程序一致
  12358. ret[i] = iteratee(i, i);
  12359. }
  12360. return ret
  12361. }
  12362. return []
  12363. };
  12364. }
  12365. /* */
  12366. var LIFECYCLE_HOOKS$1 = [
  12367. //App
  12368. 'onLaunch',
  12369. 'onShow',
  12370. 'onHide',
  12371. 'onUniNViewMessage',
  12372. 'onPageNotFound',
  12373. 'onThemeChange',
  12374. 'onError',
  12375. 'onUnhandledRejection',
  12376. //Page
  12377. 'onInit',
  12378. 'onLoad',
  12379. // 'onShow',
  12380. 'onReady',
  12381. // 'onHide',
  12382. 'onUnload',
  12383. 'onPullDownRefresh',
  12384. 'onReachBottom',
  12385. 'onTabItemTap',
  12386. 'onAddToFavorites',
  12387. 'onShareTimeline',
  12388. 'onShareAppMessage',
  12389. 'onResize',
  12390. 'onPageScroll',
  12391. 'onNavigationBarButtonTap',
  12392. 'onBackPress',
  12393. 'onNavigationBarSearchInputChanged',
  12394. 'onNavigationBarSearchInputConfirmed',
  12395. 'onNavigationBarSearchInputClicked',
  12396. //Component
  12397. // 'onReady', // 兼容旧版本,应该移除该事件
  12398. 'onPageShow',
  12399. 'onPageHide',
  12400. 'onPageResize'
  12401. ];
  12402. function lifecycleMixin$1(Vue) {
  12403. //fixed vue-class-component
  12404. var oldExtend = Vue.extend;
  12405. Vue.extend = function(extendOptions) {
  12406. extendOptions = extendOptions || {};
  12407. var methods = extendOptions.methods;
  12408. if (methods) {
  12409. Object.keys(methods).forEach(function (methodName) {
  12410. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  12411. extendOptions[methodName] = methods[methodName];
  12412. delete methods[methodName];
  12413. }
  12414. });
  12415. }
  12416. return oldExtend.call(this, extendOptions)
  12417. };
  12418. var strategies = Vue.config.optionMergeStrategies;
  12419. var mergeHook = strategies.created;
  12420. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  12421. strategies[hook] = mergeHook;
  12422. });
  12423. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  12424. }
  12425. /* */
  12426. // install platform patch function
  12427. Vue.prototype.__patch__ = patch;
  12428. // public mount method
  12429. Vue.prototype.$mount = function(
  12430. el ,
  12431. hydrating
  12432. ) {
  12433. return mountComponent$1(this, el, hydrating)
  12434. };
  12435. lifecycleMixin$1(Vue);
  12436. internalMixin(Vue);
  12437. /* */
  12438. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  12439. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  12440. /***/ }),
  12441. /***/ 40:
  12442. /*!********************************************************************!*\
  12443. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/config/zIndex.js ***!
  12444. \********************************************************************/
  12445. /*! no static exports found */
  12446. /***/ (function(module, exports, __webpack_require__) {
  12447. "use strict";
  12448. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // uniapp在H5中各API的z-index值如下:
  12449. /**
  12450. * actionsheet: 999
  12451. * modal: 999
  12452. * navigate: 998
  12453. * tabbar: 998
  12454. * toast: 999
  12455. */var _default =
  12456. {
  12457. toast: 10090,
  12458. noNetwork: 10080,
  12459. // popup包含popup,actionsheet,keyboard,picker的值
  12460. popup: 10075,
  12461. mask: 10070,
  12462. navbar: 980,
  12463. topTips: 975,
  12464. sticky: 970,
  12465. indexListSticky: 965 };exports.default = _default;
  12466. /***/ }),
  12467. /***/ 41:
  12468. /*!***********************************!*\
  12469. !*** E:/fp/md/mdapp/api/index.js ***!
  12470. \***********************************/
  12471. /*! no static exports found */
  12472. /***/ (function(module, exports, __webpack_require__) {
  12473. "use strict";
  12474. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ 42));
  12475. var _estate = _interopRequireDefault(__webpack_require__(/*! ./estate */ 45));
  12476. var _cust = _interopRequireDefault(__webpack_require__(/*! ./cust */ 46));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _default =
  12477. {
  12478. base: _base.default,
  12479. estate: _estate.default,
  12480. cust: _cust.default };exports.default = _default;
  12481. /***/ }),
  12482. /***/ 42:
  12483. /*!**********************************!*\
  12484. !*** E:/fp/md/mdapp/api/base.js ***!
  12485. \**********************************/
  12486. /*! no static exports found */
  12487. /***/ (function(module, exports, __webpack_require__) {
  12488. "use strict";
  12489. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _http = __webpack_require__(/*! @/utils/http */ 43);var _default =
  12490. {
  12491. apilogin: function apilogin(params) {// 登录
  12492. return (0, _http.request)('api/login', params, 'loading');
  12493. },
  12494. apiregister: function apiregister(params) {// 注册
  12495. return (0, _http.request)('api/register', params, 'loading');
  12496. },
  12497. apisendsms: function apisendsms(params) {// 发送短信
  12498. return (0, _http.request)('api/send/sms', params, 'loading');
  12499. },
  12500. apicaptcha: function apicaptcha(params) {// 验证码图片
  12501. return (0, _http.request)('api/captcha', params, 'loading');
  12502. },
  12503. apicheckcaptcha: function apicheckcaptcha(params) {// 检查手机号
  12504. return (0, _http.request)('api/check/captcha', params);
  12505. },
  12506. apiwxlogin: function apiwxlogin(params) {// 微信登录
  12507. return (0, _http.request)('api/wx/login', params, 'loading');
  12508. },
  12509. apiwxautologin: function apiwxautologin(params) {// 微信登录 自动
  12510. return (0, _http.request)('api/wx/autologin', params, 'loading');
  12511. },
  12512. apiuserinfo: function apiuserinfo(params) {// 用户信息
  12513. return (0, _http.request)('api/user/info', params, 'loading');
  12514. },
  12515. apiuseredit: function apiuseredit(params) {// 用户编辑
  12516. return (0, _http.request)('api/user/edit', params, 'loading');
  12517. },
  12518. apiuserbindwechat: function apiuserbindwechat(params) {// 绑定微信
  12519. return (0, _http.request)('api/user/bind/wechat', params, 'loading');
  12520. },
  12521. apiuserauthadd: function apiuserauthadd(params) {// 用户认证 - 提交认证
  12522. return (0, _http.request)('api/user/auth/add', params, 'loading');
  12523. },
  12524. apiuserauthinfo: function apiuserauthinfo(params) {// 用户认证 - 认证详情
  12525. return (0, _http.request)('api/user/auth/info', params, 'loading');
  12526. },
  12527. apiuploadcloudpiv: function apiuploadcloudpiv(params) {// 图片上传云接口
  12528. return (0, _http.request)('api/upload/cloudpiv', params, 'loading');
  12529. } };exports.default = _default;
  12530. /***/ }),
  12531. /***/ 43:
  12532. /*!************************************!*\
  12533. !*** E:/fp/md/mdapp/utils/http.js ***!
  12534. \************************************/
  12535. /*! no static exports found */
  12536. /***/ (function(module, exports, __webpack_require__) {
  12537. "use strict";
  12538. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.request = request;var _utils = __webpack_require__(/*! @utils */ 44);function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}
  12539. var Http = function Http() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { data: {} };
  12540. return new Promise(function (resolve, reject) {
  12541. if (options.loadingStr === 'loading') {
  12542. uni.showLoading({
  12543. mask: true,
  12544. title: '加载中..' });
  12545. }
  12546. var token = uni.getStorageSync('MD_token') || '';
  12547. var header = {
  12548. 'Content-Type': 'application/json',
  12549. 'token': token
  12550. // 'Content-Type': 'application/x-www-form-urlencoded'
  12551. };
  12552. var params = _objectSpread({}, options.data);
  12553. if (uni.getStorageSync('APP_token')) params.token = uni.getStorageSync('APP_token');
  12554. for (var key in options.data) {
  12555. if (options.data[key] === undefined || options.data[key] === 'undefined') {
  12556. params[key] = '';
  12557. }
  12558. }
  12559. var url = uni.baseUrl + options.url;
  12560. // let url = options.url
  12561. if (options.queryData) {
  12562. var qStr = '';
  12563. for (var k in options.queryData) {
  12564. qStr += "".concat(k, "=").concat(options.queryData[k], "&");
  12565. }
  12566. qStr = qStr.substr(0, qStr.length - 1);
  12567. url += "?".concat(qStr);
  12568. }
  12569. uni.request({
  12570. url: url,
  12571. data: _objectSpread({},
  12572. params),
  12573. header: header,
  12574. method: options.method || 'POST',
  12575. complete: function complete(res) {
  12576. if (options.loadingStr === 'loading') {
  12577. uni.hideLoading();
  12578. }
  12579. },
  12580. success: function success(res) {var
  12581. cData = res.data;
  12582. var code = cData.errno;
  12583. switch (code) {
  12584. case 0:
  12585. return resolve((0, _utils.noEmpty)(cData.data) ? cData.data : cData);
  12586. break;
  12587. case 401:
  12588. case 404:
  12589. case 405:
  12590. uni.removeStorageSync('MD_userInfo');
  12591. var u2 = uni.getStorageSync('MD_userInfo2');
  12592. if (u2.bind_wechat === '1' && uni.getStorageSync('MD_token')) {
  12593. uni.login({
  12594. success: function success(res) {
  12595. if (res.code) {
  12596. uni.api.base.apiwxautologin({ code: res.code }).then(function (cData) {
  12597. if (cData.token === 'error') {
  12598. uni.removeStorageSync('MD_token');
  12599. } else {
  12600. uni.setStorageSync('MD_userInfo', cData);
  12601. uni.setStorageSync('MD_token', cData.token);
  12602. uni.api.base.apiuserinfo().then(function (res2) {
  12603. uni.setStorageSync('MD_userInfo2', res2);
  12604. uni.reLaunch({
  12605. url: '/pages/index/index' });
  12606. });
  12607. }
  12608. });
  12609. }
  12610. } });
  12611. } else {
  12612. uni.showToast({
  12613. title: "\u8BF7\u5148\u767B\u5F55~",
  12614. icon: 'none' });
  12615. uni.navigateTo({
  12616. url: '/pages/user/login/login' });
  12617. }
  12618. break;
  12619. default:
  12620. uni.showModal({
  12621. title: '提示',
  12622. content: "".concat(cData.errmsg, "(").concat(code, ")") });
  12623. return reject(cData);}
  12624. // resolve()
  12625. },
  12626. fail: function fail(err) {
  12627. console.log(err);
  12628. reject(err);
  12629. } });
  12630. });
  12631. };
  12632. // export default Http
  12633. function request(url, data, loadingStr, queryData) {
  12634. return Http({
  12635. url: url,
  12636. data: data,
  12637. loadingStr: loadingStr,
  12638. queryData: queryData });
  12639. }
  12640. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  12641. /***/ }),
  12642. /***/ 44:
  12643. /*!*************************************!*\
  12644. !*** E:/fp/md/mdapp/utils/index.js ***!
  12645. \*************************************/
  12646. /*! no static exports found */
  12647. /***/ (function(module, exports, __webpack_require__) {
  12648. "use strict";
  12649. Object.defineProperty(exports, "__esModule", { value: true });exports.strTrim = strTrim;exports.numFormat3 = numFormat3;exports.arrToObj = arrToObj;exports.noEmpty = noEmpty;exports.comGetTime = comGetTime; /**
  12650. * @param {string} str
  12651. * @returns {string}
  12652. */
  12653. function strTrim(str) {
  12654. return str.replace(/(^\s*)|(\s*$)/g, '');
  12655. }
  12656. /**
  12657. * @param {Number} num
  12658. * @returns {string}
  12659. */
  12660. function numFormat3(num) {var dotNum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  12661. var numArr = Number(num).toFixed(dotNum).toString().split('.');
  12662. var arr = numArr[0].split('').reverse();
  12663. var res = [];
  12664. for (var i = 0; i < arr.length; i++) {
  12665. if (i % 3 === 0 && i !== 0) {
  12666. res.push(',');
  12667. }
  12668. res.push(arr[i]);
  12669. }
  12670. res.reverse();
  12671. if (numArr[1]) {
  12672. res = res.join('').concat('.' + numArr[1]);
  12673. } else {
  12674. res = res.join('');
  12675. }
  12676. // let res = num.toString().replace(/\d+/, function(n){
  12677. // return n.replace(/(\d)(?=(\d{3})+$)/g,function($1){
  12678. // return $1 + ","
  12679. // })
  12680. // })
  12681. // toLocaleString()
  12682. return res;
  12683. }
  12684. /**
  12685. * @param {Array} arr
  12686. * @returns {Object}
  12687. */
  12688. function arrToObj(arr) {
  12689. var obj = {};
  12690. if (Object.prototype.toString.call(arr) === '[object Array]') {
  12691. if (arr.length > 0) {
  12692. arr.forEach(function (item) {
  12693. obj[item.val] = item.key;
  12694. });
  12695. }
  12696. }
  12697. return obj;
  12698. }
  12699. /**
  12700. * @param {any} val
  12701. * @returns {Boolean}
  12702. */
  12703. function noEmpty(val) {
  12704. if (val === null || val === undefined || val === '') {
  12705. return false;
  12706. } else {
  12707. return true;
  12708. }
  12709. }
  12710. /**
  12711. * @param {Number} date
  12712. * @param {Boolean} onlyDate
  12713. * @returns {String}
  12714. * function time(time = +new Date()) {
  12715. var date = new Date(time + 8 * 3600 * 1000); // 增加8小时
  12716. return date.toJSON().substr(0, 19).replace('T', ' ');
  12717. }
  12718. */
  12719. function comGetTime() {var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();var onlyDate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  12720. var year = date.getFullYear();
  12721. var month = date.getMonth() + 1;
  12722. month = month > 9 ? month : '0' + month;
  12723. var day = date.getDate();
  12724. day = day > 9 ? day : '0' + day;
  12725. var hour = date.getHours();
  12726. hour = hour > 9 ? hour : '0' + hour;
  12727. var minute = date.getMinutes();
  12728. minute = minute > 9 ? minute : '0' + minute;
  12729. var second = date.getSeconds();
  12730. second = second > 9 ? second : '0' + second;
  12731. var milli = date.getMilliseconds();
  12732. milli = milli > 100 ? milli : milli > 10 ? '0' + milli : '00' + milli;
  12733. return onlyDate ? "".concat(year, "-").concat(month, "-").concat(day) : "".concat(year).concat(month).concat(day).concat(hour).concat(minute).concat(second).concat(milli);
  12734. }
  12735. /***/ }),
  12736. /***/ 45:
  12737. /*!************************************!*\
  12738. !*** E:/fp/md/mdapp/api/estate.js ***!
  12739. \************************************/
  12740. /*! no static exports found */
  12741. /***/ (function(module, exports, __webpack_require__) {
  12742. "use strict";
  12743. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _http = __webpack_require__(/*! @/utils/http */ 43);var _default =
  12744. {
  12745. apiestatelist: function apiestatelist(params) {// 楼盘列表
  12746. return (0, _http.request)('api/estate/list', params, 'loading');
  12747. },
  12748. apireportadd: function apireportadd(params) {// 报备 - 添加报备
  12749. return (0, _http.request)('api/report/add', params, 'loading');
  12750. },
  12751. apireportlist: function apireportlist(params) {// 报备 - 报备列表
  12752. return (0, _http.request)('api/report/list', params, 'loading');
  12753. },
  12754. apireportdetail: function apireportdetail(params) {// 报备 - 报备详情
  12755. return (0, _http.request)('api/report/detail', params, 'loading');
  12756. },
  12757. apireportsite: function apireportsite(params) {// 案场 - 报备详情
  12758. return (0, _http.request)('api/report/site', params, 'loading');
  12759. },
  12760. apireportconfirm: function apireportconfirm(params) {// 报备 - 报备确认
  12761. return (0, _http.request)('api/report/confirm', params, 'loading');
  12762. },
  12763. apireportcount: function apireportcount(params) {// 报备 - 报备统计
  12764. return (0, _http.request)('api/report/count', params, 'loading');
  12765. } };exports.default = _default;
  12766. /***/ }),
  12767. /***/ 46:
  12768. /*!**********************************!*\
  12769. !*** E:/fp/md/mdapp/api/cust.js ***!
  12770. \**********************************/
  12771. /*! no static exports found */
  12772. /***/ (function(module, exports, __webpack_require__) {
  12773. "use strict";
  12774. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _http = __webpack_require__(/*! @/utils/http */ 43);var _default =
  12775. {
  12776. apicustomerlist: function apicustomerlist(params) {// 客户 列表
  12777. return (0, _http.request)('api/customer/list', params);
  12778. },
  12779. apicustomeradd: function apicustomeradd(params) {// 客户 添加
  12780. return (0, _http.request)('api/customer/add', params, 'loading');
  12781. },
  12782. apicustomeredit: function apicustomeredit(params) {// 客户 编辑
  12783. return (0, _http.request)('api/customer/edit', params, 'loading');
  12784. },
  12785. apicustomerdel: function apicustomerdel(params) {// 客户 删除
  12786. return (0, _http.request)('api/customer/del', params, 'loading');
  12787. },
  12788. apicustomerdetail: function apicustomerdetail(params) {// 客户 详情
  12789. return (0, _http.request)('api/customer/detail', params, 'loading');
  12790. },
  12791. apireportvisitchange: function apireportvisitchange(params) {// 到访材料添加
  12792. return (0, _http.request)('api/report/visit/change', params, 'loading');
  12793. },
  12794. apireportvisitdetail: function apireportvisitdetail(params) {// 到访材料详情
  12795. return (0, _http.request)('api/report/visit/detail', params, 'loading');
  12796. } };exports.default = _default;
  12797. /***/ }),
  12798. /***/ 47:
  12799. /*!************************************!*\
  12800. !*** E:/fp/md/mdapp/utils/tool.js ***!
  12801. \************************************/
  12802. /*! no static exports found */
  12803. /***/ (function(module, exports, __webpack_require__) {
  12804. "use strict";
  12805. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.getRandomNum = exports.confirmMsgFn = exports.msgBase = void 0;var getRandomNum = function getRandomNum(len, radix) {
  12806. // getRandomNum(24, 16)
  12807. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  12808. var uuid = [];
  12809. radix = radix || chars.length;
  12810. if (len) {
  12811. // Compact form
  12812. for (var i = 0; i < len; i++) {uuid[i] = chars[0 | Math.random() * radix];}
  12813. } else {
  12814. // rfc4122, version 4 form
  12815. var r;
  12816. // rfc4122 requires these characters
  12817. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  12818. uuid[14] = '4';
  12819. // Fill in random data.  At i==19 set the high bits of clock sequence as
  12820. // per rfc4122, sec. 4.1.5
  12821. for (var _i = 0; _i < 36; _i++) {
  12822. if (!uuid[_i]) {
  12823. r = 0 | Math.random() * 16;
  12824. uuid[_i] = chars[_i === 19 ? r & 0x3 | 0x8 : r];
  12825. }
  12826. }
  12827. }
  12828. return uuid.join('') + new Date().getTime();
  12829. };exports.getRandomNum = getRandomNum;
  12830. var msgBase = function msgBase(msgText, bc) {
  12831. uni.showToast({
  12832. title: msgText,
  12833. icon: 'none',
  12834. duration: 2000 }).
  12835. then(function () {
  12836. if (bc) bc();
  12837. });
  12838. };exports.msgBase = msgBase;
  12839. var confirmMsgFn = function confirmMsgFn(msgText, successBc, errorBc) {var title = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '提示';
  12840. uni.showModal({
  12841. title: title,
  12842. content: msgText,
  12843. success: function success(res) {
  12844. if (res.confirm) {
  12845. if (successBc) successBc();
  12846. } else if (res.cancel) {
  12847. if (errorBc) errorBc();
  12848. }
  12849. } });
  12850. };exports.confirmMsgFn = confirmMsgFn;
  12851. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  12852. /***/ }),
  12853. /***/ 5:
  12854. /*!*********************************!*\
  12855. !*** E:/fp/md/mdapp/pages.json ***!
  12856. \*********************************/
  12857. /*! no static exports found */
  12858. /***/ (function(module, exports) {
  12859. /***/ }),
  12860. /***/ 94:
  12861. /*!**************************************!*\
  12862. !*** E:/fp/md/mdapp/utils/qrcode.js ***!
  12863. \**************************************/
  12864. /*! no static exports found */
  12865. /***/ (function(module, exports, __webpack_require__) {
  12866. "use strict";
  12867. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;} /**
  12868. * qrcode-wx-miniprogram
  12869. */
  12870. var QRMode = {
  12871. MODE_NUMBER: 1 << 0,
  12872. MODE_ALPHA_NUM: 1 << 1,
  12873. MODE_8BIT_BYTE: 1 << 2,
  12874. MODE_KANJI: 1 << 3 },
  12875. QRErrorCorrectLevel = {
  12876. L: 1,
  12877. M: 0,
  12878. Q: 3,
  12879. H: 2 },
  12880. QRMaskPattern = {
  12881. PATTERN000: 0,
  12882. PATTERN001: 1,
  12883. PATTERN010: 2,
  12884. PATTERN011: 3,
  12885. PATTERN100: 4,
  12886. PATTERN101: 5,
  12887. PATTERN110: 6,
  12888. PATTERN111: 7 },
  12889. QRUtil = {
  12890. PATTERN_POSITION_TABLE: [
  12891. [],
  12892. [6, 18],
  12893. [6, 22],
  12894. [6, 26],
  12895. [6, 30],
  12896. [6, 34],
  12897. [6, 22, 38],
  12898. [6, 24, 42],
  12899. [6, 26, 46],
  12900. [6, 28, 50],
  12901. [6, 30, 54],
  12902. [6, 32, 58],
  12903. [6, 34, 62],
  12904. [6, 26, 46, 66],
  12905. [6, 26, 48, 70],
  12906. [6, 26, 50, 74],
  12907. [6, 30, 54, 78],
  12908. [6, 30, 56, 82],
  12909. [6, 30, 58, 86],
  12910. [6, 34, 62, 90],
  12911. [6, 28, 50, 72, 94],
  12912. [6, 26, 50, 74, 98],
  12913. [6, 30, 54, 78, 102],
  12914. [6, 28, 54, 80, 106],
  12915. [6, 32, 58, 84, 110],
  12916. [6, 30, 58, 86, 114],
  12917. [6, 34, 62, 90, 118],
  12918. [6, 26, 50, 74, 98, 122],
  12919. [6, 30, 54, 78, 102, 126],
  12920. [6, 26, 52, 78, 104, 130],
  12921. [6, 30, 56, 82, 108, 134],
  12922. [6, 34, 60, 86, 112, 138],
  12923. [6, 30, 58, 86, 114, 142],
  12924. [6, 34, 62, 90, 118, 146],
  12925. [6, 30, 54, 78, 102, 126, 150],
  12926. [6, 24, 50, 76, 102, 128, 154],
  12927. [6, 28, 54, 80, 106, 132, 158],
  12928. [6, 32, 58, 84, 110, 136, 162],
  12929. [6, 26, 54, 82, 110, 138, 166],
  12930. [6, 30, 58, 86, 114, 142, 170]],
  12931. G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,
  12932. G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,
  12933. G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,
  12934. getBCHTypeInfo: function getBCHTypeInfo(data) {
  12935. var d = data << 10;
  12936. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
  12937. d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15);
  12938. }
  12939. return (data << 10 | d) ^ QRUtil.G15_MASK;
  12940. },
  12941. getBCHTypeNumber: function getBCHTypeNumber(data) {
  12942. var d = data << 12;
  12943. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
  12944. d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18);
  12945. }
  12946. return data << 12 | d;
  12947. },
  12948. getBCHDigit: function getBCHDigit(data) {
  12949. var digit = 0;
  12950. while (data != 0) {
  12951. digit++;
  12952. data >>>= 1;
  12953. }
  12954. return digit;
  12955. },
  12956. getPatternPosition: function getPatternPosition(typeNumber) {
  12957. return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
  12958. },
  12959. getMask: function getMask(maskPattern, i, j) {
  12960. switch (maskPattern) {
  12961. case QRMaskPattern.PATTERN000:
  12962. return (i + j) % 2 == 0;
  12963. case QRMaskPattern.PATTERN001:
  12964. return i % 2 == 0;
  12965. case QRMaskPattern.PATTERN010:
  12966. return j % 3 == 0;
  12967. case QRMaskPattern.PATTERN011:
  12968. return (i + j) % 3 == 0;
  12969. case QRMaskPattern.PATTERN100:
  12970. return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
  12971. case QRMaskPattern.PATTERN101:
  12972. return i * j % 2 + i * j % 3 == 0;
  12973. case QRMaskPattern.PATTERN110:
  12974. return (i * j % 2 + i * j % 3) % 2 == 0;
  12975. case QRMaskPattern.PATTERN111:
  12976. return (i * j % 3 + (i + j) % 2) % 2 == 0;
  12977. default:
  12978. //throw new Error("bad maskPattern:" + maskPattern);
  12979. throwError("bad maskPattern:" + maskPattern);}
  12980. },
  12981. getErrorCorrectPolynomial: function getErrorCorrectPolynomial(errorCorrectLength) {
  12982. var a = new QRPolynomial([1], 0);
  12983. for (var i = 0; i < errorCorrectLength; i++) {
  12984. a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
  12985. }
  12986. return a;
  12987. },
  12988. getLengthInBits: function getLengthInBits(mode, type) {
  12989. if (1 <= type && type < 10) {
  12990. switch (mode) {
  12991. case QRMode.MODE_NUMBER:
  12992. return 10;
  12993. case QRMode.MODE_ALPHA_NUM:
  12994. return 9;
  12995. case QRMode.MODE_8BIT_BYTE:
  12996. return 8;
  12997. case QRMode.MODE_KANJI:
  12998. return 8;
  12999. default:
  13000. //throw new Error("mode:" + mode);
  13001. throwError("mode:" + mode);}
  13002. } else if (type < 27) {
  13003. switch (mode) {
  13004. case QRMode.MODE_NUMBER:
  13005. return 12;
  13006. case QRMode.MODE_ALPHA_NUM:
  13007. return 11;
  13008. case QRMode.MODE_8BIT_BYTE:
  13009. return 16;
  13010. case QRMode.MODE_KANJI:
  13011. return 10;
  13012. default:
  13013. //throw new Error("mode:" + mode);
  13014. throwError("mode:" + mode);}
  13015. } else if (type < 41) {
  13016. switch (mode) {
  13017. case QRMode.MODE_NUMBER:
  13018. return 14;
  13019. case QRMode.MODE_ALPHA_NUM:
  13020. return 13;
  13021. case QRMode.MODE_8BIT_BYTE:
  13022. return 16;
  13023. case QRMode.MODE_KANJI:
  13024. return 12;
  13025. default:
  13026. //throw new Error("mode:" + mode);
  13027. throwError("mode:" + mode);}
  13028. } else {
  13029. //throw new Error("type:" + type);
  13030. throwError("type:" + type);
  13031. }
  13032. },
  13033. getLostPoint: function getLostPoint(qrCode) {
  13034. var moduleCount = qrCode.getModuleCount();
  13035. var lostPoint = 0;
  13036. for (var row = 0; row < moduleCount; row++) {
  13037. for (var col = 0; col < moduleCount; col++) {
  13038. var sameCount = 0;
  13039. var dark = qrCode.isDark(row, col);
  13040. for (var r = -1; r <= 1; r++) {
  13041. if (row + r < 0 || moduleCount <= row + r) {
  13042. continue;
  13043. }
  13044. for (var c = -1; c <= 1; c++) {
  13045. if (col + c < 0 || moduleCount <= col + c) {
  13046. continue;
  13047. }
  13048. if (r == 0 && c == 0) {
  13049. continue;
  13050. }
  13051. if (dark == qrCode.isDark(row + r, col + c)) {
  13052. sameCount++;
  13053. }
  13054. }
  13055. }
  13056. if (sameCount > 5) {
  13057. lostPoint += 3 + sameCount - 5;
  13058. }
  13059. }
  13060. }
  13061. for (var row = 0; row < moduleCount - 1; row++) {
  13062. for (var col = 0; col < moduleCount - 1; col++) {
  13063. var count = 0;
  13064. if (qrCode.isDark(row, col)) count++;
  13065. if (qrCode.isDark(row + 1, col)) count++;
  13066. if (qrCode.isDark(row, col + 1)) count++;
  13067. if (qrCode.isDark(row + 1, col + 1)) count++;
  13068. if (count == 0 || count == 4) {
  13069. lostPoint += 3;
  13070. }
  13071. }
  13072. }
  13073. for (var row = 0; row < moduleCount; row++) {
  13074. for (var col = 0; col < moduleCount - 6; col++) {
  13075. if (qrCode.isDark(row, col) && !qrCode.isDark(row, col + 1) && qrCode.isDark(row, col + 2) &&
  13076. qrCode.isDark(row, col + 3) && qrCode.isDark(row, col + 4) && !qrCode.isDark(row, col +
  13077. 5) && qrCode.isDark(row, col + 6)) {
  13078. lostPoint += 40;
  13079. }
  13080. }
  13081. }
  13082. for (var col = 0; col < moduleCount; col++) {
  13083. for (var row = 0; row < moduleCount - 6; row++) {
  13084. if (qrCode.isDark(row, col) && !qrCode.isDark(row + 1, col) && qrCode.isDark(row + 2, col) &&
  13085. qrCode.isDark(row + 3, col) && qrCode.isDark(row + 4, col) && !qrCode.isDark(row + 5,
  13086. col) && qrCode.isDark(row + 6, col)) {
  13087. lostPoint += 40;
  13088. }
  13089. }
  13090. }
  13091. var darkCount = 0;
  13092. for (var col = 0; col < moduleCount; col++) {
  13093. for (var row = 0; row < moduleCount; row++) {
  13094. if (qrCode.isDark(row, col)) {
  13095. darkCount++;
  13096. }
  13097. }
  13098. }
  13099. var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
  13100. lostPoint += ratio * 10;
  13101. return lostPoint;
  13102. } },
  13103. QRMath = {
  13104. glog: function glog(n) {
  13105. if (n < 1) {
  13106. //throw new Error("glog(" + n + ")");
  13107. throwError("glog(" + n + ")");
  13108. }
  13109. return QRMath.LOG_TABLE[n];
  13110. },
  13111. gexp: function gexp(n) {
  13112. while (n < 0) {
  13113. n += 255;
  13114. }
  13115. while (n >= 256) {
  13116. n -= 255;
  13117. }
  13118. return QRMath.EXP_TABLE[n];
  13119. },
  13120. EXP_TABLE: new Array(256),
  13121. LOG_TABLE: new Array(256) };
  13122. for (var i = 0; i < 8; i++) {
  13123. QRMath.EXP_TABLE[i] = 1 << i;
  13124. }
  13125. for (var _i = 8; _i < 256; _i++) {
  13126. QRMath.EXP_TABLE[_i] = QRMath.EXP_TABLE[_i - 4] ^ QRMath.EXP_TABLE[_i - 5] ^ QRMath.EXP_TABLE[_i - 6] ^ QRMath.
  13127. EXP_TABLE[_i - 8];
  13128. }
  13129. for (var _i2 = 0; _i2 < 255; _i2++) {
  13130. QRMath.LOG_TABLE[QRMath.EXP_TABLE[_i2]] = _i2;
  13131. }
  13132. /*
  13133. * class QR8bitByte
  13134. * */var
  13135. QR8bitByte = /*#__PURE__*/function () {
  13136. function QR8bitByte(data) {_classCallCheck(this, QR8bitByte);
  13137. this.mode = QRMode.MODE_8BIT_BYTE;
  13138. this.data = data;
  13139. this.parsedData = [];
  13140. // Added to support UTF-8 Characters
  13141. for (var _i3 = 0, l = this.data.length; _i3 < l; _i3++) {
  13142. var byteArray = [],
  13143. code = this.data.charCodeAt(_i3);
  13144. if (code > 0x10000) {
  13145. byteArray[0] = 0xF0 | (code & 0x1C0000) >>> 18;
  13146. byteArray[1] = 0x80 | (code & 0x3F000) >>> 12;
  13147. byteArray[2] = 0x80 | (code & 0xFC0) >>> 6;
  13148. byteArray[3] = 0x80 | code & 0x3F;
  13149. } else if (code > 0x800) {
  13150. byteArray[0] = 0xE0 | (code & 0xF000) >>> 12;
  13151. byteArray[1] = 0x80 | (code & 0xFC0) >>> 6;
  13152. byteArray[2] = 0x80 | code & 0x3F;
  13153. } else if (code > 0x80) {
  13154. byteArray[0] = 0xC0 | (code & 0x7C0) >>> 6;
  13155. byteArray[1] = 0x80 | code & 0x3F;
  13156. } else {
  13157. byteArray[0] = code;
  13158. }
  13159. this.parsedData.push(byteArray);
  13160. }
  13161. this.parsedData = Array.prototype.concat.apply([], this.parsedData);
  13162. if (this.parsedData.length !== this.data.length) {
  13163. this.parsedData.unshift(191);
  13164. this.parsedData.unshift(187);
  13165. this.parsedData.unshift(239);
  13166. }
  13167. }_createClass(QR8bitByte, [{ key: "getLength", value: function getLength(
  13168. buffer) {
  13169. return this.parsedData.length;
  13170. } }, { key: "write", value: function write(
  13171. buffer) {
  13172. for (var _i4 = 0, l = this.parsedData.length; _i4 < l; _i4++) {
  13173. buffer.put(this.parsedData[_i4], 8);
  13174. }
  13175. } }]);return QR8bitByte;}();
  13176. /*
  13177. * class QRCodeModel
  13178. * */var
  13179. QRCodeModel = /*#__PURE__*/function () {
  13180. function QRCodeModel(typeNumber, errorCorrectLevel) {_classCallCheck(this, QRCodeModel);
  13181. this.typeNumber = typeNumber;
  13182. this.errorCorrectLevel = errorCorrectLevel;
  13183. this.modules = null;
  13184. this.moduleCount = 0;
  13185. this.dataCache = null;
  13186. this.dataList = [];
  13187. }_createClass(QRCodeModel, [{ key: "addData", value: function addData(
  13188. data) {
  13189. var newData = new QR8bitByte(data);
  13190. this.dataList.push(newData);
  13191. this.dataCache = null;
  13192. } }, { key: "isDark", value: function isDark(
  13193. row, col) {
  13194. if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {
  13195. //throw new Error(row + ',' + col);
  13196. throwError(row + ',' + col);
  13197. }
  13198. return this.modules[row][col];
  13199. } }, { key: "getModuleCount", value: function getModuleCount()
  13200. {
  13201. return this.moduleCount;
  13202. } }, { key: "make", value: function make()
  13203. {
  13204. this.makeImpl(false, this.getBestMaskPattern());
  13205. } }, { key: "makeImpl", value: function makeImpl(
  13206. test, maskPattern) {
  13207. this.moduleCount = this.typeNumber * 4 + 17;
  13208. this.modules = new Array(this.moduleCount);
  13209. for (var row = 0; row < this.moduleCount; row++) {
  13210. this.modules[row] = new Array(this.moduleCount);
  13211. for (var col = 0; col < this.moduleCount; col++) {
  13212. this.modules[row][col] = null;
  13213. }
  13214. }
  13215. this.setupPositionProbePattern(0, 0);
  13216. this.setupPositionProbePattern(this.moduleCount - 7, 0);
  13217. this.setupPositionProbePattern(0, this.moduleCount - 7);
  13218. this.setupPositionAdjustPattern();
  13219. this.setupTimingPattern();
  13220. this.setupTypeInfo(test, maskPattern);
  13221. if (this.typeNumber >= 7) {
  13222. this.setupTypeNumber(test);
  13223. }
  13224. if (this.dataCache == null) {
  13225. this.dataCache = QRCodeModel.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);
  13226. }
  13227. this.mapData(this.dataCache, maskPattern);
  13228. } }, { key: "setupPositionProbePattern", value: function setupPositionProbePattern(
  13229. row, col) {
  13230. for (var r = -1; r <= 7; r++) {
  13231. if (row + r <= -1 || this.moduleCount <= row + r) {
  13232. continue;
  13233. }
  13234. for (var c = -1; c <= 7; c++) {
  13235. if (col + c <= -1 || this.moduleCount <= col + c) {
  13236. continue;
  13237. }
  13238. this.modules[row + r][col + c] = 0 <= r && r <= 6 && (c == 0 || c == 6) ||
  13239. 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4;
  13240. }
  13241. }
  13242. } }, { key: "getBestMaskPattern", value: function getBestMaskPattern()
  13243. {
  13244. var minLostPoint = 0,
  13245. pattern = 0;
  13246. for (var _i5 = 0; _i5 < 8; _i5++) {
  13247. this.makeImpl(true, _i5);
  13248. var lostPoint = QRUtil.getLostPoint(this);
  13249. if (_i5 == 0 || minLostPoint > lostPoint) {
  13250. minLostPoint = lostPoint;
  13251. pattern = _i5;
  13252. }
  13253. }
  13254. return pattern;
  13255. } }, { key: "setupTimingPattern", value: function setupTimingPattern()
  13256. {
  13257. for (var r = 8; r < this.moduleCount - 8; r++) {
  13258. if (this.modules[r][6] != null) {
  13259. continue;
  13260. }
  13261. this.modules[r][6] = r % 2 == 0;
  13262. }
  13263. for (var c = 8; c < this.moduleCount - 8; c++) {
  13264. if (this.modules[6][c] != null) {
  13265. continue;
  13266. }
  13267. this.modules[6][c] = c % 2 == 0;
  13268. }
  13269. } }, { key: "setupPositionAdjustPattern", value: function setupPositionAdjustPattern()
  13270. {
  13271. var pos = QRUtil.getPatternPosition(this.typeNumber);
  13272. for (var _i6 = 0; _i6 < pos.length; _i6++) {
  13273. for (var j = 0; j < pos.length; j++) {
  13274. var row = pos[_i6],
  13275. col = pos[j];
  13276. if (this.modules[row][col] != null) {
  13277. continue;
  13278. }
  13279. for (var r = -2; r <= 2; r++) {
  13280. for (var c = -2; c <= 2; c++) {
  13281. this.modules[row + r][col + c] = r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c ==
  13282. 0;
  13283. }
  13284. }
  13285. }
  13286. }
  13287. } }, { key: "setupTypeNumber", value: function setupTypeNumber(
  13288. test) {
  13289. var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
  13290. for (var _i7 = 0; _i7 < 18; _i7++) {
  13291. this.modules[Math.floor(_i7 / 3)][_i7 % 3 + this.moduleCount - 8 - 3] = !test && (bits >> _i7 & 1) == 1;
  13292. }
  13293. for (var _i8 = 0; _i8 < 18; _i8++) {
  13294. this.modules[_i8 % 3 + this.moduleCount - 8 - 3][Math.floor(_i8 / 3)] = !test && (bits >> _i8 & 1) == 1;
  13295. }
  13296. } }, { key: "setupTypeInfo", value: function setupTypeInfo(
  13297. test, maskPattern) {
  13298. var data = this.errorCorrectLevel << 3 | maskPattern,
  13299. bits = QRUtil.getBCHTypeInfo(data);
  13300. for (var _i9 = 0; _i9 < 15; _i9++) {
  13301. var mod = !test && (bits >> _i9 & 1) == 1;
  13302. if (_i9 < 6) {
  13303. this.modules[_i9][8] = mod;
  13304. } else if (_i9 < 8) {
  13305. this.modules[_i9 + 1][8] = mod;
  13306. } else {
  13307. this.modules[this.moduleCount - 15 + _i9][8] = mod;
  13308. }
  13309. }
  13310. for (var _i10 = 0; _i10 < 15; _i10++) {
  13311. var _mod = !test && (bits >> _i10 & 1) == 1;
  13312. if (_i10 < 8) {
  13313. this.modules[8][this.moduleCount - _i10 - 1] = _mod;
  13314. } else if (_i10 < 9) {
  13315. this.modules[8][15 - _i10 - 1 + 1] = _mod;
  13316. } else {
  13317. this.modules[8][15 - _i10 - 1] = _mod;
  13318. }
  13319. }
  13320. this.modules[this.moduleCount - 8][8] = !test;
  13321. } }, { key: "mapData", value: function mapData(
  13322. data, maskPattern) {
  13323. var inc = -1,
  13324. row = this.moduleCount - 1,
  13325. bitIndex = 7,
  13326. byteIndex = 0;
  13327. for (var col = this.moduleCount - 1; col > 0; col -= 2) {
  13328. if (col == 6) col--;
  13329. while (true) {
  13330. for (var c = 0; c < 2; c++) {
  13331. if (this.modules[row][col - c] == null) {
  13332. var dark = false;
  13333. if (byteIndex < data.length) {
  13334. dark = (data[byteIndex] >>> bitIndex & 1) == 1;
  13335. }
  13336. var mask = QRUtil.getMask(maskPattern, row, col - c);
  13337. if (mask) {
  13338. dark = !dark;
  13339. }
  13340. this.modules[row][col - c] = dark;
  13341. bitIndex--;
  13342. if (bitIndex == -1) {
  13343. byteIndex++;
  13344. bitIndex = 7;
  13345. }
  13346. }
  13347. }
  13348. row += inc;
  13349. if (row < 0 || this.moduleCount <= row) {
  13350. row -= inc;
  13351. inc = -inc;
  13352. break;
  13353. }
  13354. }
  13355. }
  13356. } }]);return QRCodeModel;}();
  13357. QRCodeModel.PAD0 = 0xEC;
  13358. QRCodeModel.PAD1 = 0x11;
  13359. QRCodeModel.createData = function (typeNumber, errorCorrectLevel, dataList) {
  13360. var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel),
  13361. buffer = new QRBitBuffer();
  13362. for (var _i11 = 0; _i11 < dataList.length; _i11++) {
  13363. var data = dataList[_i11];
  13364. buffer.put(data.mode, 4);
  13365. buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber));
  13366. data.write(buffer);
  13367. }
  13368. var totalDataCount = 0;
  13369. for (var _i12 = 0; _i12 < rsBlocks.length; _i12++) {
  13370. totalDataCount += rsBlocks[_i12].dataCount;
  13371. }
  13372. if (buffer.getLengthInBits() > totalDataCount * 8) {
  13373. /*
  13374. throw new Error("code length overflow. (" +
  13375. buffer.getLengthInBits() +
  13376. ">" +
  13377. totalDataCount * 8 +
  13378. ")");
  13379. */
  13380. throwError("code length overflow. (" +
  13381. buffer.getLengthInBits() +
  13382. ">" +
  13383. totalDataCount * 8 +
  13384. ")");
  13385. }
  13386. if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
  13387. buffer.put(0, 4);
  13388. }
  13389. while (buffer.getLengthInBits() % 8 != 0) {
  13390. buffer.putBit(false);
  13391. }
  13392. while (true) {
  13393. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  13394. break;
  13395. }
  13396. buffer.put(QRCodeModel.PAD0, 8);
  13397. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  13398. break;
  13399. }
  13400. buffer.put(QRCodeModel.PAD1, 8);
  13401. }
  13402. return QRCodeModel.createBytes(buffer, rsBlocks);
  13403. };
  13404. QRCodeModel.createBytes = function (buffer, rsBlocks) {
  13405. var offset = 0,
  13406. maxDcCount = 0,
  13407. maxEcCount = 0,
  13408. dcData = new Array(rsBlocks.length),
  13409. ecData = new Array(rsBlocks.length);
  13410. for (var r = 0; r < rsBlocks.length; r++) {
  13411. var dcCount = rsBlocks[r].dataCount,
  13412. ecCount = rsBlocks[r].totalCount - dcCount;
  13413. maxDcCount = Math.max(maxDcCount, dcCount);
  13414. maxEcCount = Math.max(maxEcCount, ecCount);
  13415. dcData[r] = new Array(dcCount);
  13416. for (var _i13 = 0; _i13 < dcData[r].length; _i13++) {
  13417. dcData[r][_i13] = 0xff & buffer.buffer[_i13 + offset];
  13418. }
  13419. offset += dcCount;
  13420. var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount),
  13421. rawPoly = new QRPolynomial(dcData[r], rsPoly.getLength() - 1),
  13422. modPoly = rawPoly.mod(rsPoly);
  13423. ecData[r] = new Array(rsPoly.getLength() - 1);
  13424. for (var _i14 = 0; _i14 < ecData[r].length; _i14++) {
  13425. var modIndex = _i14 + modPoly.getLength() - ecData[r].length;
  13426. ecData[r][_i14] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
  13427. }
  13428. }
  13429. var totalCodeCount = 0;
  13430. for (var _i15 = 0; _i15 < rsBlocks.length; _i15++) {
  13431. totalCodeCount += rsBlocks[_i15].totalCount;
  13432. }
  13433. var data = new Array(totalCodeCount),
  13434. index = 0;
  13435. for (var _i16 = 0; _i16 < maxDcCount; _i16++) {
  13436. for (var _r = 0; _r < rsBlocks.length; _r++) {
  13437. if (_i16 < dcData[_r].length) {
  13438. data[index++] = dcData[_r][_i16];
  13439. }
  13440. }
  13441. }
  13442. for (var _i17 = 0; _i17 < maxEcCount; _i17++) {
  13443. for (var _r2 = 0; _r2 < rsBlocks.length; _r2++) {
  13444. if (_i17 < ecData[_r2].length) {
  13445. data[index++] = ecData[_r2][_i17];
  13446. }
  13447. }
  13448. }
  13449. return data;
  13450. };
  13451. /*
  13452. * class QRPolynomial
  13453. * */var
  13454. QRPolynomial = /*#__PURE__*/function () {
  13455. function QRPolynomial(num, shift) {_classCallCheck(this, QRPolynomial);
  13456. if (num.length == undefined) {
  13457. //throw new Error(num.length + '/' + shift);
  13458. throwError(num.length + '/' + shift);
  13459. }
  13460. var offset = 0;
  13461. while (offset < num.length && num[offset] == 0) {
  13462. offset++;
  13463. }
  13464. this.num = new Array(num.length - offset + shift);
  13465. for (var _i18 = 0; _i18 < num.length - offset; _i18++) {
  13466. this.num[_i18] = num[_i18 + offset];
  13467. }
  13468. }_createClass(QRPolynomial, [{ key: "get", value: function get(
  13469. index) {
  13470. return this.num[index];
  13471. } }, { key: "getLength", value: function getLength()
  13472. {
  13473. return this.num.length;
  13474. } }, { key: "multiply", value: function multiply(
  13475. e) {
  13476. var num = new Array(this.getLength() + e.getLength() - 1);
  13477. for (var _i19 = 0; _i19 < this.getLength(); _i19++) {
  13478. for (var j = 0; j < e.getLength(); j++) {
  13479. num[_i19 + j] ^= QRMath.gexp(QRMath.glog(this.get(_i19)) + QRMath.glog(e.get(j)));
  13480. }
  13481. }
  13482. return new QRPolynomial(num, 0);
  13483. } }, { key: "mod", value: function mod(
  13484. e) {
  13485. if (this.getLength() - e.getLength() < 0) {
  13486. return this;
  13487. }
  13488. var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0)),
  13489. num = new Array(this.getLength());
  13490. for (var _i20 = 0; _i20 < this.getLength(); _i20++) {
  13491. num[_i20] = this.get(_i20);
  13492. }
  13493. for (var _i21 = 0; _i21 < e.getLength(); _i21++) {
  13494. num[_i21] ^= QRMath.gexp(QRMath.glog(e.get(_i21)) + ratio);
  13495. }
  13496. return new QRPolynomial(num, 0).mod(e);
  13497. } }]);return QRPolynomial;}();
  13498. /*
  13499. * class QRRSBlock
  13500. * */var
  13501. QRRSBlock =
  13502. function QRRSBlock(totalCount, dataCount) {_classCallCheck(this, QRRSBlock);
  13503. this.totalCount = totalCount;
  13504. this.dataCount = dataCount;
  13505. };
  13506. QRRSBlock.RS_BLOCK_TABLE = [
  13507. [1, 26, 19],
  13508. [1, 26, 16],
  13509. [1, 26, 13],
  13510. [1, 26, 9],
  13511. [1, 44, 34],
  13512. [1, 44, 28],
  13513. [1, 44, 22],
  13514. [1, 44, 16],
  13515. [1, 70, 55],
  13516. [1, 70, 44],
  13517. [2, 35, 17],
  13518. [2, 35, 13],
  13519. [1, 100, 80],
  13520. [2, 50, 32],
  13521. [2, 50, 24],
  13522. [4, 25, 9],
  13523. [1, 134, 108],
  13524. [2, 67, 43],
  13525. [2, 33, 15, 2, 34, 16],
  13526. [2, 33, 11, 2, 34, 12],
  13527. [2, 86, 68],
  13528. [4, 43, 27],
  13529. [4, 43, 19],
  13530. [4, 43, 15],
  13531. [2, 98, 78],
  13532. [4, 49, 31],
  13533. [2, 32, 14, 4, 33, 15],
  13534. [4, 39, 13, 1, 40, 14],
  13535. [2, 121, 97],
  13536. [2, 60, 38, 2, 61, 39],
  13537. [4, 40, 18, 2, 41, 19],
  13538. [4, 40, 14, 2, 41, 15],
  13539. [2, 146, 116],
  13540. [3, 58, 36, 2, 59, 37],
  13541. [4, 36, 16, 4, 37, 17],
  13542. [4, 36, 12, 4, 37, 13],
  13543. [2, 86, 68, 2, 87, 69],
  13544. [4, 69, 43, 1, 70, 44],
  13545. [6, 43, 19, 2, 44, 20],
  13546. [6, 43, 15, 2, 44, 16],
  13547. [4, 101, 81],
  13548. [1, 80, 50, 4, 81, 51],
  13549. [4, 50, 22, 4, 51, 23],
  13550. [3, 36, 12, 8, 37, 13],
  13551. [2, 116, 92, 2, 117, 93],
  13552. [6, 58, 36, 2, 59, 37],
  13553. [4, 46, 20, 6, 47, 21],
  13554. [7, 42, 14, 4, 43, 15],
  13555. [4, 133, 107],
  13556. [8, 59, 37, 1, 60, 38],
  13557. [8, 44, 20, 4, 45, 21],
  13558. [12, 33, 11, 4, 34, 12],
  13559. [3, 145, 115, 1, 146, 116],
  13560. [4, 64, 40, 5, 65, 41],
  13561. [11, 36, 16, 5, 37, 17],
  13562. [11, 36, 12, 5, 37, 13],
  13563. [5, 109, 87, 1, 110, 88],
  13564. [5, 65, 41, 5, 66, 42],
  13565. [5, 54, 24, 7, 55, 25],
  13566. [11, 36, 12],
  13567. [5, 122, 98, 1, 123, 99],
  13568. [7, 73, 45, 3, 74, 46],
  13569. [15, 43, 19, 2, 44, 20],
  13570. [3, 45, 15, 13, 46, 16],
  13571. [1, 135, 107, 5, 136, 108],
  13572. [10, 74, 46, 1, 75, 47],
  13573. [1, 50, 22, 15, 51, 23],
  13574. [2, 42, 14, 17, 43, 15],
  13575. [5, 150, 120, 1, 151, 121],
  13576. [9, 69, 43, 4, 70, 44],
  13577. [17, 50, 22, 1, 51, 23],
  13578. [2, 42, 14, 19, 43, 15],
  13579. [3, 141, 113, 4, 142, 114],
  13580. [3, 70, 44, 11, 71, 45],
  13581. [17, 47, 21, 4, 48, 22],
  13582. [9, 39, 13, 16, 40, 14],
  13583. [3, 135, 107, 5, 136, 108],
  13584. [3, 67, 41, 13, 68, 42],
  13585. [15, 54, 24, 5, 55, 25],
  13586. [15, 43, 15, 10, 44, 16],
  13587. [4, 144, 116, 4, 145, 117],
  13588. [17, 68, 42],
  13589. [17, 50, 22, 6, 51, 23],
  13590. [19, 46, 16, 6, 47, 17],
  13591. [2, 139, 111, 7, 140, 112],
  13592. [17, 74, 46],
  13593. [7, 54, 24, 16, 55, 25],
  13594. [34, 37, 13],
  13595. [4, 151, 121, 5, 152, 122],
  13596. [4, 75, 47, 14, 76, 48],
  13597. [11, 54, 24, 14, 55, 25],
  13598. [16, 45, 15, 14, 46, 16],
  13599. [6, 147, 117, 4, 148, 118],
  13600. [6, 73, 45, 14, 74, 46],
  13601. [11, 54, 24, 16, 55, 25],
  13602. [30, 46, 16, 2, 47, 17],
  13603. [8, 132, 106, 4, 133, 107],
  13604. [8, 75, 47, 13, 76, 48],
  13605. [7, 54, 24, 22, 55, 25],
  13606. [22, 45, 15, 13, 46, 16],
  13607. [10, 142, 114, 2, 143, 115],
  13608. [19, 74, 46, 4, 75, 47],
  13609. [28, 50, 22, 6, 51, 23],
  13610. [33, 46, 16, 4, 47, 17],
  13611. [8, 152, 122, 4, 153, 123],
  13612. [22, 73, 45, 3, 74, 46],
  13613. [8, 53, 23, 26, 54, 24],
  13614. [12, 45, 15, 28, 46, 16],
  13615. [3, 147, 117, 10, 148, 118],
  13616. [3, 73, 45, 23, 74, 46],
  13617. [4, 54, 24, 31, 55, 25],
  13618. [11, 45, 15, 31, 46, 16],
  13619. [7, 146, 116, 7, 147, 117],
  13620. [21, 73, 45, 7, 74, 46],
  13621. [1, 53, 23, 37, 54, 24],
  13622. [19, 45, 15, 26, 46, 16],
  13623. [5, 145, 115, 10, 146, 116],
  13624. [19, 75, 47, 10, 76, 48],
  13625. [15, 54, 24, 25, 55, 25],
  13626. [23, 45, 15, 25, 46, 16],
  13627. [13, 145, 115, 3, 146, 116],
  13628. [2, 74, 46, 29, 75, 47],
  13629. [42, 54, 24, 1, 55, 25],
  13630. [23, 45, 15, 28, 46, 16],
  13631. [17, 145, 115],
  13632. [10, 74, 46, 23, 75, 47],
  13633. [10, 54, 24, 35, 55, 25],
  13634. [19, 45, 15, 35, 46, 16],
  13635. [17, 145, 115, 1, 146, 116],
  13636. [14, 74, 46, 21, 75, 47],
  13637. [29, 54, 24, 19, 55, 25],
  13638. [11, 45, 15, 46, 46, 16],
  13639. [13, 145, 115, 6, 146, 116],
  13640. [14, 74, 46, 23, 75, 47],
  13641. [44, 54, 24, 7, 55, 25],
  13642. [59, 46, 16, 1, 47, 17],
  13643. [12, 151, 121, 7, 152, 122],
  13644. [12, 75, 47, 26, 76, 48],
  13645. [39, 54, 24, 14, 55, 25],
  13646. [22, 45, 15, 41, 46, 16],
  13647. [6, 151, 121, 14, 152, 122],
  13648. [6, 75, 47, 34, 76, 48],
  13649. [46, 54, 24, 10, 55, 25],
  13650. [2, 45, 15, 64, 46, 16],
  13651. [17, 152, 122, 4, 153, 123],
  13652. [29, 74, 46, 14, 75, 47],
  13653. [49, 54, 24, 10, 55, 25],
  13654. [24, 45, 15, 46, 46, 16],
  13655. [4, 152, 122, 18, 153, 123],
  13656. [13, 74, 46, 32, 75, 47],
  13657. [48, 54, 24, 14, 55, 25],
  13658. [42, 45, 15, 32, 46, 16],
  13659. [20, 147, 117, 4, 148, 118],
  13660. [40, 75, 47, 7, 76, 48],
  13661. [43, 54, 24, 22, 55, 25],
  13662. [10, 45, 15, 67, 46, 16],
  13663. [19, 148, 118, 6, 149, 119],
  13664. [18, 75, 47, 31, 76, 48],
  13665. [34, 54, 24, 34, 55, 25],
  13666. [20, 45, 15, 61, 46, 16]];
  13667. QRRSBlock.getRSBlocks = function (typeNumber, errorCorrectLevel) {
  13668. var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel);
  13669. if (!rsBlock) {
  13670. //throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
  13671. throwError("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
  13672. }
  13673. var length = rsBlock.length / 3,
  13674. list = [];
  13675. for (var _i22 = 0; _i22 < length; _i22++) {
  13676. var count = rsBlock[_i22 * 3],
  13677. totalCount = rsBlock[_i22 * 3 + 1],
  13678. dataCount = rsBlock[_i22 * 3 + 2];
  13679. for (var j = 0; j < count; j++) {
  13680. list.push(new QRRSBlock(totalCount, dataCount));
  13681. }
  13682. }
  13683. return list;
  13684. };
  13685. QRRSBlock.getRsBlockTable = function (typeNumber, errorCorrectLevel) {
  13686. switch (errorCorrectLevel) {
  13687. case QRErrorCorrectLevel.L:
  13688. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4];
  13689. case QRErrorCorrectLevel.M:
  13690. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
  13691. case QRErrorCorrectLevel.Q:
  13692. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
  13693. case QRErrorCorrectLevel.H:
  13694. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
  13695. default:
  13696. return undefined;}
  13697. };
  13698. /*
  13699. * class QRBitBuffer
  13700. * */var
  13701. QRBitBuffer = /*#__PURE__*/function () {
  13702. function QRBitBuffer() {_classCallCheck(this, QRBitBuffer);
  13703. this.buffer = [];
  13704. this.length = 0;
  13705. }_createClass(QRBitBuffer, [{ key: "get", value: function get(
  13706. index) {
  13707. var bufIndex = Math.floor(index / 8);
  13708. return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) == 1;
  13709. } }, { key: "put", value: function put(
  13710. num, length) {
  13711. for (var _i23 = 0; _i23 < length; _i23++) {
  13712. this.putBit((num >>> length - _i23 - 1 & 1) == 1);
  13713. }
  13714. } }, { key: "getLengthInBits", value: function getLengthInBits()
  13715. {
  13716. return this.length;
  13717. } }, { key: "putBit", value: function putBit(
  13718. bit) {
  13719. var bufIndex = Math.floor(this.length / 8);
  13720. if (this.buffer.length <= bufIndex) {
  13721. this.buffer.push(0);
  13722. }
  13723. if (bit) {
  13724. this.buffer[bufIndex] |= 0x80 >>> this.length % 8;
  13725. }
  13726. this.length++;
  13727. } }]);return QRBitBuffer;}();
  13728. /*
  13729. * Class Drawing
  13730. * */var
  13731. Drawing = /*#__PURE__*/function () {
  13732. function Drawing(el, opts) {_classCallCheck(this, Drawing);
  13733. this._opts = opts;
  13734. this._el = el;
  13735. this._ctx = uni.createCanvasContext(el);
  13736. }_createClass(Drawing, [{ key: "draw", value: function draw(
  13737. QRCode) {
  13738. var ctx = this._ctx,
  13739. opts = this._opts;
  13740. var ctxPosFix = opts.width / 20;
  13741. //console.log(opts.width)
  13742. var count = QRCode.getModuleCount(),
  13743. width = (opts.width - 2 * ctxPosFix) / count,
  13744. height = (opts.height - 2 * ctxPosFix) / count,
  13745. roundedWidth = Math.round(width),
  13746. roundedHeight = Math.round(height);
  13747. this.clear();
  13748. ctx.setFillStyle('#fff');
  13749. ctx.fillRect(0, 0, this._opts.width + 4 * ctxPosFix, this._opts.width + 4 * ctxPosFix);
  13750. for (var row = 0; row < count; row++) {
  13751. for (var col = 0; col < count; col++) {
  13752. var isDark = QRCode.isDark(row, col),
  13753. left = col * width + ctxPosFix,
  13754. top = row * height + ctxPosFix;
  13755. ctx.setStrokeStyle(isDark ? opts.colorDark : opts.colorLight);
  13756. ctx.setLineWidth(1);
  13757. ctx.setFillStyle(isDark ? opts.colorDark : opts.colorLight);
  13758. ctx.fillRect(left, top, width, height);
  13759. ctx.strokeRect(
  13760. Math.floor(left) + 0.5,
  13761. Math.floor(top) + 0.5,
  13762. roundedWidth,
  13763. roundedHeight);
  13764. ctx.strokeRect(
  13765. Math.ceil(left) - 0.5,
  13766. Math.ceil(top) - 0.5,
  13767. roundedWidth,
  13768. roundedHeight);
  13769. }
  13770. }
  13771. this._opts.logo && this.drawImg(this._opts.logo, this._opts.width, ctx);
  13772. ctx.draw();
  13773. this._bIsPainted = true;
  13774. if (this._opts.successTips && drawingOptsSuccessTips) {
  13775. uni.hideLoading();
  13776. uni.showToast({
  13777. title: '生成成功',
  13778. icon: 'success',
  13779. duration: 1000 });
  13780. }
  13781. drawingOptsSuccessTips = true;
  13782. } }, { key: "clear", value: function clear()
  13783. {
  13784. this._ctx.clearRect(0, 0, this._opts.width, this._opts.height);
  13785. }
  13786. /** anlib **/
  13787. /**
  13788. * 二维码上添加图片
  13789. */ }, { key: "drawImg", value: function drawImg(
  13790. src, width, ctx) {
  13791. // logo相对二维码的比例
  13792. var scale = 5;
  13793. // logo相对二维码的大小
  13794. var imgSize = width / scale;
  13795. // 偏移位置起始点
  13796. var imgPos = width / scale * 2;
  13797. // 二维码边框尺寸,这里设置为原宽度的80分之一
  13798. var imgPosFix = width / 80;
  13799. //console.log('width', width);
  13800. //console.log('imgSize', imgSize);
  13801. //console.log('imgPos', imgPos);
  13802. //console.log('imgPosFix', imgPosFix);
  13803. //console.log('src', src);
  13804. ctx.setFillStyle('#fff');
  13805. ctx.fillRect(imgPos - imgPosFix, imgPos - imgPosFix, imgSize + imgPosFix * 2, imgSize + imgPosFix * 2);
  13806. ctx.beginPath();
  13807. ctx.moveTo(imgPos - imgPosFix, imgPos - imgPosFix);
  13808. ctx.stroke();
  13809. ctx.closePath();
  13810. ctx.drawImage(src, imgPos, imgPos, imgSize, imgSize);
  13811. ctx.beginPath();
  13812. } }]);return Drawing;}();
  13813. /*
  13814. * Class QRCode
  13815. * */
  13816. var QRCode = function () {
  13817. /**
  13818. * Get the type by string length
  13819. * @author anlib
  13820. * @private
  13821. * @param {String} text
  13822. * @param {Number} correctLevel
  13823. * @return {Number} type
  13824. */
  13825. function getTypeNumber(text, correctLevel) {
  13826. var type = 1,
  13827. length = getUTF8Length(text),
  13828. QRCodeLimitLength = [
  13829. [17, 14, 11, 7],
  13830. [32, 26, 20, 14],
  13831. [53, 42, 32, 24],
  13832. [78, 62, 46, 34],
  13833. [106, 84, 60, 44],
  13834. [134, 106, 74, 58],
  13835. [154, 122, 86, 64],
  13836. [192, 152, 108, 84],
  13837. [230, 180, 130, 98],
  13838. [271, 213, 151, 119],
  13839. [321, 251, 177, 137],
  13840. [367, 287, 203, 155],
  13841. [425, 331, 241, 177],
  13842. [458, 362, 258, 194],
  13843. [520, 412, 292, 220],
  13844. [586, 450, 322, 250],
  13845. [644, 504, 364, 280],
  13846. [718, 560, 394, 310],
  13847. [792, 624, 442, 338],
  13848. [858, 666, 482, 382],
  13849. [929, 711, 509, 403],
  13850. [1003, 779, 565, 439],
  13851. [1091, 857, 611, 461],
  13852. [1171, 911, 661, 511],
  13853. [1273, 997, 715, 535],
  13854. [1367, 1059, 751, 593],
  13855. [1465, 1125, 805, 625],
  13856. [1528, 1190, 868, 658],
  13857. [1628, 1264, 908, 698],
  13858. [1732, 1370, 982, 742],
  13859. [1840, 1452, 1030, 790],
  13860. [1952, 1538, 1112, 842],
  13861. [2068, 1628, 1168, 898],
  13862. [2188, 1722, 1228, 958],
  13863. [2303, 1809, 1283, 983],
  13864. [2431, 1911, 1351, 1051],
  13865. [2563, 1989, 1423, 1093],
  13866. [2699, 2099, 1499, 1139],
  13867. [2809, 2213, 1579, 1219],
  13868. [2953, 2331, 1663, 1273]];
  13869. for (var _i24 = 0, len = QRCodeLimitLength.length; _i24 <= len; _i24++) {
  13870. var limit = 0;
  13871. switch (correctLevel) {
  13872. case QRErrorCorrectLevel.L:
  13873. limit = QRCodeLimitLength[_i24][0];
  13874. break;
  13875. case QRErrorCorrectLevel.M:
  13876. limit = QRCodeLimitLength[_i24][1];
  13877. break;
  13878. case QRErrorCorrectLevel.Q:
  13879. limit = QRCodeLimitLength[_i24][2];
  13880. break;
  13881. case QRErrorCorrectLevel.H:
  13882. limit = QRCodeLimitLength[_i24][3];
  13883. break;}
  13884. if (length <= limit) {
  13885. break;
  13886. } else {
  13887. type++;
  13888. }
  13889. }
  13890. if (type > QRCodeLimitLength.length) {
  13891. // throw new Error('Too long data'); //supfire
  13892. throwError('Too long data');
  13893. }
  13894. return type;
  13895. }
  13896. function getUTF8Length(text) {
  13897. var replacedText = encodeURI(text).toString().replace(/\%[0-9a-fA-F]{2}/g, 'a');
  13898. return replacedText.length + (replacedText.length != text ? 3 : 0);
  13899. }var
  13900. Fn = /*#__PURE__*/function () {
  13901. function Fn(el, opts) {_classCallCheck(this, Fn);
  13902. this._opts = {
  13903. width: 300,
  13904. height: 300,
  13905. typeNumber: 4,
  13906. colorDark: '#000000',
  13907. colorLight: '#ffffff',
  13908. correctLevel: Fn.correctLevel.H,
  13909. logo: false,
  13910. successTips: false };
  13911. if (typeof opts === 'string') {
  13912. opts = {
  13913. text: opts };
  13914. }
  13915. // Overwrites options 简单拷贝
  13916. if (opts) {
  13917. for (var _i25 in opts) {
  13918. if (opts.hasOwnProperty(_i25)) {
  13919. this._opts[_i25] = opts[_i25];
  13920. }
  13921. }
  13922. }
  13923. this._el = el;
  13924. this._QRCode = null;
  13925. this._drawing = new Drawing(this._el, this._opts);
  13926. if (this._opts.text) {
  13927. this.makeCode(this._opts.text);
  13928. }
  13929. }_createClass(Fn, [{ key: "makeCode", value: function makeCode(
  13930. text) {
  13931. this._QRCode = new QRCodeModel(getTypeNumber(text, this._opts.correctLevel), this._opts.
  13932. correctLevel);
  13933. this._QRCode.addData(text);
  13934. this._QRCode.make();
  13935. this._drawing.draw(this._QRCode);
  13936. } }, { key: "clear", value: function clear()
  13937. {
  13938. this._drawing.clear();
  13939. } }]);return Fn;}();
  13940. Fn.correctLevel = QRErrorCorrectLevel;
  13941. return Fn;
  13942. }();
  13943. /** anlib **/
  13944. var drawingOptsSuccessTips = true;
  13945. /**
  13946. * 抛出错误
  13947. */
  13948. function throwError(str) {
  13949. uni.hideLoading();
  13950. uni.showToast({
  13951. title: '有字符暂不支持',
  13952. icon: 'none',
  13953. duration: 2000 });
  13954. drawingOptsSuccessTips = false;
  13955. //throw new Error(str);
  13956. }var _default =
  13957. QRCode;exports.default = _default;
  13958. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  13959. /***/ })
  13960. }]);
  13961. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map