vendor.js 661 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484
  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) {
  10. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 3);
  11. Object.defineProperty(exports, "__esModule", {
  12. value: true
  13. });
  14. exports.createApp = createApp;
  15. exports.createComponent = createComponent;
  16. exports.createPage = createPage;
  17. exports.createPlugin = createPlugin;
  18. exports.createSubpackageApp = createSubpackageApp;
  19. exports.default = void 0;
  20. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 4));
  21. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 10));
  22. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 14));
  23. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 17));
  24. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 12));
  25. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 21);
  26. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 24));
  27. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  28. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  29. var realAtob;
  30. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  31. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  32. if (typeof atob !== 'function') {
  33. realAtob = function realAtob(str) {
  34. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  35. if (!b64re.test(str)) {
  36. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  37. }
  38. // Adding the padding if missing, for semplicity
  39. str += '=='.slice(2 - (str.length & 3));
  40. var bitmap;
  41. var result = '';
  42. var r1;
  43. var r2;
  44. var i = 0;
  45. for (; i < str.length;) {
  46. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 | (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  47. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  48. }
  49. return result;
  50. };
  51. } else {
  52. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  53. realAtob = atob;
  54. }
  55. function b64DecodeUnicode(str) {
  56. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  57. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  58. }).join(''));
  59. }
  60. function getCurrentUserInfo() {
  61. var token = wx.getStorageSync('uni_id_token') || '';
  62. var tokenArr = token.split('.');
  63. if (!token || tokenArr.length !== 3) {
  64. return {
  65. uid: null,
  66. role: [],
  67. permission: [],
  68. tokenExpired: 0
  69. };
  70. }
  71. var userInfo;
  72. try {
  73. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  74. } catch (error) {
  75. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  76. }
  77. userInfo.tokenExpired = userInfo.exp * 1000;
  78. delete userInfo.exp;
  79. delete userInfo.iat;
  80. return userInfo;
  81. }
  82. function uniIdMixin(Vue) {
  83. Vue.prototype.uniIDHasRole = function (roleId) {
  84. var _getCurrentUserInfo = getCurrentUserInfo(),
  85. role = _getCurrentUserInfo.role;
  86. return role.indexOf(roleId) > -1;
  87. };
  88. Vue.prototype.uniIDHasPermission = function (permissionId) {
  89. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  90. permission = _getCurrentUserInfo2.permission;
  91. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  92. };
  93. Vue.prototype.uniIDTokenValid = function () {
  94. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  95. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  96. return tokenExpired > Date.now();
  97. };
  98. }
  99. var _toString = Object.prototype.toString;
  100. var hasOwnProperty = Object.prototype.hasOwnProperty;
  101. function isFn(fn) {
  102. return typeof fn === 'function';
  103. }
  104. function isStr(str) {
  105. return typeof str === 'string';
  106. }
  107. function isObject(obj) {
  108. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  109. }
  110. function isPlainObject(obj) {
  111. return _toString.call(obj) === '[object Object]';
  112. }
  113. function hasOwn(obj, key) {
  114. return hasOwnProperty.call(obj, key);
  115. }
  116. function noop() {}
  117. /**
  118. * Create a cached version of a pure function.
  119. */
  120. function cached(fn) {
  121. var cache = Object.create(null);
  122. return function cachedFn(str) {
  123. var hit = cache[str];
  124. return hit || (cache[str] = fn(str));
  125. };
  126. }
  127. /**
  128. * Camelize a hyphen-delimited string.
  129. */
  130. var camelizeRE = /-(\w)/g;
  131. var camelize = cached(function (str) {
  132. return str.replace(camelizeRE, function (_, c) {
  133. return c ? c.toUpperCase() : '';
  134. });
  135. });
  136. function sortObject(obj) {
  137. var sortObj = {};
  138. if (isPlainObject(obj)) {
  139. Object.keys(obj).sort().forEach(function (key) {
  140. sortObj[key] = obj[key];
  141. });
  142. }
  143. return !Object.keys(sortObj) ? obj : sortObj;
  144. }
  145. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  146. var globalInterceptors = {};
  147. var scopedInterceptors = {};
  148. function mergeHook(parentVal, childVal) {
  149. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  150. return res ? dedupeHooks(res) : res;
  151. }
  152. function dedupeHooks(hooks) {
  153. var res = [];
  154. for (var i = 0; i < hooks.length; i++) {
  155. if (res.indexOf(hooks[i]) === -1) {
  156. res.push(hooks[i]);
  157. }
  158. }
  159. return res;
  160. }
  161. function removeHook(hooks, hook) {
  162. var index = hooks.indexOf(hook);
  163. if (index !== -1) {
  164. hooks.splice(index, 1);
  165. }
  166. }
  167. function mergeInterceptorHook(interceptor, option) {
  168. Object.keys(option).forEach(function (hook) {
  169. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  170. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  171. }
  172. });
  173. }
  174. function removeInterceptorHook(interceptor, option) {
  175. if (!interceptor || !option) {
  176. return;
  177. }
  178. Object.keys(option).forEach(function (hook) {
  179. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  180. removeHook(interceptor[hook], option[hook]);
  181. }
  182. });
  183. }
  184. function addInterceptor(method, option) {
  185. if (typeof method === 'string' && isPlainObject(option)) {
  186. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  187. } else if (isPlainObject(method)) {
  188. mergeInterceptorHook(globalInterceptors, method);
  189. }
  190. }
  191. function removeInterceptor(method, option) {
  192. if (typeof method === 'string') {
  193. if (isPlainObject(option)) {
  194. removeInterceptorHook(scopedInterceptors[method], option);
  195. } else {
  196. delete scopedInterceptors[method];
  197. }
  198. } else if (isPlainObject(method)) {
  199. removeInterceptorHook(globalInterceptors, method);
  200. }
  201. }
  202. function wrapperHook(hook) {
  203. return function (data) {
  204. return hook(data) || data;
  205. };
  206. }
  207. function isPromise(obj) {
  208. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  209. }
  210. function queue(hooks, data) {
  211. var promise = false;
  212. for (var i = 0; i < hooks.length; i++) {
  213. var hook = hooks[i];
  214. if (promise) {
  215. promise = Promise.resolve(wrapperHook(hook));
  216. } else {
  217. var res = hook(data);
  218. if (isPromise(res)) {
  219. promise = Promise.resolve(res);
  220. }
  221. if (res === false) {
  222. return {
  223. then: function then() {}
  224. };
  225. }
  226. }
  227. }
  228. return promise || {
  229. then: function then(callback) {
  230. return callback(data);
  231. }
  232. };
  233. }
  234. function wrapperOptions(interceptor) {
  235. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  236. ['success', 'fail', 'complete'].forEach(function (name) {
  237. if (Array.isArray(interceptor[name])) {
  238. var oldCallback = options[name];
  239. options[name] = function callbackInterceptor(res) {
  240. queue(interceptor[name], res).then(function (res) {
  241. /* eslint-disable no-mixed-operators */
  242. return isFn(oldCallback) && oldCallback(res) || res;
  243. });
  244. };
  245. }
  246. });
  247. return options;
  248. }
  249. function wrapperReturnValue(method, returnValue) {
  250. var returnValueHooks = [];
  251. if (Array.isArray(globalInterceptors.returnValue)) {
  252. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  253. }
  254. var interceptor = scopedInterceptors[method];
  255. if (interceptor && Array.isArray(interceptor.returnValue)) {
  256. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  257. }
  258. returnValueHooks.forEach(function (hook) {
  259. returnValue = hook(returnValue) || returnValue;
  260. });
  261. return returnValue;
  262. }
  263. function getApiInterceptorHooks(method) {
  264. var interceptor = Object.create(null);
  265. Object.keys(globalInterceptors).forEach(function (hook) {
  266. if (hook !== 'returnValue') {
  267. interceptor[hook] = globalInterceptors[hook].slice();
  268. }
  269. });
  270. var scopedInterceptor = scopedInterceptors[method];
  271. if (scopedInterceptor) {
  272. Object.keys(scopedInterceptor).forEach(function (hook) {
  273. if (hook !== 'returnValue') {
  274. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  275. }
  276. });
  277. }
  278. return interceptor;
  279. }
  280. function invokeApi(method, api, options) {
  281. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  282. params[_key - 3] = arguments[_key];
  283. }
  284. var interceptor = getApiInterceptorHooks(method);
  285. if (interceptor && Object.keys(interceptor).length) {
  286. if (Array.isArray(interceptor.invoke)) {
  287. var res = queue(interceptor.invoke, options);
  288. return res.then(function (options) {
  289. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  290. });
  291. } else {
  292. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  293. }
  294. }
  295. return api.apply(void 0, [options].concat(params));
  296. }
  297. var promiseInterceptor = {
  298. returnValue: function returnValue(res) {
  299. if (!isPromise(res)) {
  300. return res;
  301. }
  302. return new Promise(function (resolve, reject) {
  303. res.then(function (res) {
  304. if (res[0]) {
  305. reject(res[0]);
  306. } else {
  307. resolve(res[1]);
  308. }
  309. });
  310. });
  311. }
  312. };
  313. var SYNC_API_RE = /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting/;
  314. var CONTEXT_API_RE = /^create|Manager$/;
  315. // Context例外情况
  316. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  317. // 同步例外情况
  318. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  319. var CALLBACK_API_RE = /^on|^off/;
  320. function isContextApi(name) {
  321. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  322. }
  323. function isSyncApi(name) {
  324. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  325. }
  326. function isCallbackApi(name) {
  327. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  328. }
  329. function handlePromise(promise) {
  330. return promise.then(function (data) {
  331. return [null, data];
  332. }).catch(function (err) {
  333. return [err];
  334. });
  335. }
  336. function shouldPromise(name) {
  337. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  338. return false;
  339. }
  340. return true;
  341. }
  342. /* eslint-disable no-extend-native */
  343. if (!Promise.prototype.finally) {
  344. Promise.prototype.finally = function (callback) {
  345. var promise = this.constructor;
  346. return this.then(function (value) {
  347. return promise.resolve(callback()).then(function () {
  348. return value;
  349. });
  350. }, function (reason) {
  351. return promise.resolve(callback()).then(function () {
  352. throw reason;
  353. });
  354. });
  355. };
  356. }
  357. function promisify(name, api) {
  358. if (!shouldPromise(name)) {
  359. return api;
  360. }
  361. return function promiseApi() {
  362. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  363. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  364. params[_key2 - 1] = arguments[_key2];
  365. }
  366. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  367. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  368. }
  369. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  370. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  371. success: resolve,
  372. fail: reject
  373. })].concat(params));
  374. })));
  375. };
  376. }
  377. var EPS = 1e-4;
  378. var BASE_DEVICE_WIDTH = 750;
  379. var isIOS = false;
  380. var deviceWidth = 0;
  381. var deviceDPR = 0;
  382. function checkDeviceWidth() {
  383. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  384. platform = _wx$getSystemInfoSync.platform,
  385. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  386. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  387. deviceWidth = windowWidth;
  388. deviceDPR = pixelRatio;
  389. isIOS = platform === 'ios';
  390. }
  391. function upx2px(number, newDeviceWidth) {
  392. if (deviceWidth === 0) {
  393. checkDeviceWidth();
  394. }
  395. number = Number(number);
  396. if (number === 0) {
  397. return 0;
  398. }
  399. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  400. if (result < 0) {
  401. result = -result;
  402. }
  403. result = Math.floor(result + EPS);
  404. if (result === 0) {
  405. if (deviceDPR === 1 || !isIOS) {
  406. result = 1;
  407. } else {
  408. result = 0.5;
  409. }
  410. }
  411. return number < 0 ? -result : result;
  412. }
  413. var LOCALE_ZH_HANS = 'zh-Hans';
  414. var LOCALE_ZH_HANT = 'zh-Hant';
  415. var LOCALE_EN = 'en';
  416. var LOCALE_FR = 'fr';
  417. var LOCALE_ES = 'es';
  418. var messages = {};
  419. var locale;
  420. {
  421. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  422. }
  423. function initI18nMessages() {
  424. if (!isEnableLocale()) {
  425. return;
  426. }
  427. var localeKeys = Object.keys(__uniConfig.locales);
  428. if (localeKeys.length) {
  429. localeKeys.forEach(function (locale) {
  430. var curMessages = messages[locale];
  431. var userMessages = __uniConfig.locales[locale];
  432. if (curMessages) {
  433. Object.assign(curMessages, userMessages);
  434. } else {
  435. messages[locale] = userMessages;
  436. }
  437. });
  438. }
  439. }
  440. initI18nMessages();
  441. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  442. var t = i18n.t;
  443. var i18nMixin = i18n.mixin = {
  444. beforeCreate: function beforeCreate() {
  445. var _this = this;
  446. var unwatch = i18n.i18n.watchLocale(function () {
  447. _this.$forceUpdate();
  448. });
  449. this.$once('hook:beforeDestroy', function () {
  450. unwatch();
  451. });
  452. },
  453. methods: {
  454. $$t: function $$t(key, values) {
  455. return t(key, values);
  456. }
  457. }
  458. };
  459. var setLocale = i18n.setLocale;
  460. var getLocale = i18n.getLocale;
  461. function initAppLocale(Vue, appVm, locale) {
  462. var state = Vue.observable({
  463. locale: locale || i18n.getLocale()
  464. });
  465. var localeWatchers = [];
  466. appVm.$watchLocale = function (fn) {
  467. localeWatchers.push(fn);
  468. };
  469. Object.defineProperty(appVm, '$locale', {
  470. get: function get() {
  471. return state.locale;
  472. },
  473. set: function set(v) {
  474. state.locale = v;
  475. localeWatchers.forEach(function (watch) {
  476. return watch(v);
  477. });
  478. }
  479. });
  480. }
  481. function isEnableLocale() {
  482. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  483. }
  484. function include(str, parts) {
  485. return !!parts.find(function (part) {
  486. return str.indexOf(part) !== -1;
  487. });
  488. }
  489. function startsWith(str, parts) {
  490. return parts.find(function (part) {
  491. return str.indexOf(part) === 0;
  492. });
  493. }
  494. function normalizeLocale(locale, messages) {
  495. if (!locale) {
  496. return;
  497. }
  498. locale = locale.trim().replace(/_/g, '-');
  499. if (messages && messages[locale]) {
  500. return locale;
  501. }
  502. locale = locale.toLowerCase();
  503. if (locale === 'chinese') {
  504. // 支付宝
  505. return LOCALE_ZH_HANS;
  506. }
  507. if (locale.indexOf('zh') === 0) {
  508. if (locale.indexOf('-hans') > -1) {
  509. return LOCALE_ZH_HANS;
  510. }
  511. if (locale.indexOf('-hant') > -1) {
  512. return LOCALE_ZH_HANT;
  513. }
  514. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  515. return LOCALE_ZH_HANT;
  516. }
  517. return LOCALE_ZH_HANS;
  518. }
  519. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  520. if (lang) {
  521. return lang;
  522. }
  523. }
  524. // export function initI18n() {
  525. // const localeKeys = Object.keys(__uniConfig.locales || {})
  526. // if (localeKeys.length) {
  527. // localeKeys.forEach((locale) =>
  528. // i18n.add(locale, __uniConfig.locales[locale])
  529. // )
  530. // }
  531. // }
  532. function getLocale$1() {
  533. // 优先使用 $locale
  534. var app = getApp({
  535. allowDefault: true
  536. });
  537. if (app && app.$vm) {
  538. return app.$vm.$locale;
  539. }
  540. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  541. }
  542. function setLocale$1(locale) {
  543. var app = getApp();
  544. if (!app) {
  545. return false;
  546. }
  547. var oldLocale = app.$vm.$locale;
  548. if (oldLocale !== locale) {
  549. app.$vm.$locale = locale;
  550. onLocaleChangeCallbacks.forEach(function (fn) {
  551. return fn({
  552. locale: locale
  553. });
  554. });
  555. return true;
  556. }
  557. return false;
  558. }
  559. var onLocaleChangeCallbacks = [];
  560. function onLocaleChange(fn) {
  561. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  562. onLocaleChangeCallbacks.push(fn);
  563. }
  564. }
  565. if (typeof global !== 'undefined') {
  566. global.getLocale = getLocale$1;
  567. }
  568. var interceptors = {
  569. promiseInterceptor: promiseInterceptor
  570. };
  571. var baseApi = /*#__PURE__*/Object.freeze({
  572. __proto__: null,
  573. upx2px: upx2px,
  574. getLocale: getLocale$1,
  575. setLocale: setLocale$1,
  576. onLocaleChange: onLocaleChange,
  577. addInterceptor: addInterceptor,
  578. removeInterceptor: removeInterceptor,
  579. interceptors: interceptors
  580. });
  581. function findExistsPageIndex(url) {
  582. var pages = getCurrentPages();
  583. var len = pages.length;
  584. while (len--) {
  585. var page = pages[len];
  586. if (page.$page && page.$page.fullPath === url) {
  587. return len;
  588. }
  589. }
  590. return -1;
  591. }
  592. var redirectTo = {
  593. name: function name(fromArgs) {
  594. if (fromArgs.exists === 'back' && fromArgs.delta) {
  595. return 'navigateBack';
  596. }
  597. return 'redirectTo';
  598. },
  599. args: function args(fromArgs) {
  600. if (fromArgs.exists === 'back' && fromArgs.url) {
  601. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  602. if (existsPageIndex !== -1) {
  603. var delta = getCurrentPages().length - 1 - existsPageIndex;
  604. if (delta > 0) {
  605. fromArgs.delta = delta;
  606. }
  607. }
  608. }
  609. }
  610. };
  611. var previewImage = {
  612. args: function args(fromArgs) {
  613. var currentIndex = parseInt(fromArgs.current);
  614. if (isNaN(currentIndex)) {
  615. return;
  616. }
  617. var urls = fromArgs.urls;
  618. if (!Array.isArray(urls)) {
  619. return;
  620. }
  621. var len = urls.length;
  622. if (!len) {
  623. return;
  624. }
  625. if (currentIndex < 0) {
  626. currentIndex = 0;
  627. } else if (currentIndex >= len) {
  628. currentIndex = len - 1;
  629. }
  630. if (currentIndex > 0) {
  631. fromArgs.current = urls[currentIndex];
  632. fromArgs.urls = urls.filter(function (item, index) {
  633. return index < currentIndex ? item !== urls[currentIndex] : true;
  634. });
  635. } else {
  636. fromArgs.current = urls[0];
  637. }
  638. return {
  639. indicator: false,
  640. loop: false
  641. };
  642. }
  643. };
  644. var UUID_KEY = '__DC_STAT_UUID';
  645. var deviceId;
  646. function useDeviceId(result) {
  647. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  648. if (!deviceId) {
  649. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  650. wx.setStorage({
  651. key: UUID_KEY,
  652. data: deviceId
  653. });
  654. }
  655. result.deviceId = deviceId;
  656. }
  657. function addSafeAreaInsets(result) {
  658. if (result.safeArea) {
  659. var safeArea = result.safeArea;
  660. result.safeAreaInsets = {
  661. top: safeArea.top,
  662. left: safeArea.left,
  663. right: result.windowWidth - safeArea.right,
  664. bottom: result.screenHeight - safeArea.bottom
  665. };
  666. }
  667. }
  668. function populateParameters(result) {
  669. var _result$brand = result.brand,
  670. brand = _result$brand === void 0 ? '' : _result$brand,
  671. _result$model = result.model,
  672. model = _result$model === void 0 ? '' : _result$model,
  673. _result$system = result.system,
  674. system = _result$system === void 0 ? '' : _result$system,
  675. _result$language = result.language,
  676. language = _result$language === void 0 ? '' : _result$language,
  677. theme = result.theme,
  678. version = result.version,
  679. platform = result.platform,
  680. fontSizeSetting = result.fontSizeSetting,
  681. SDKVersion = result.SDKVersion,
  682. pixelRatio = result.pixelRatio,
  683. deviceOrientation = result.deviceOrientation;
  684. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  685. // osName osVersion
  686. var osName = '';
  687. var osVersion = '';
  688. {
  689. osName = system.split(' ')[0] || '';
  690. osVersion = system.split(' ')[1] || '';
  691. }
  692. var hostVersion = version;
  693. // deviceType
  694. var deviceType = getGetDeviceType(result, model);
  695. // deviceModel
  696. var deviceBrand = getDeviceBrand(brand);
  697. // hostName
  698. var _hostName = getHostName(result);
  699. // deviceOrientation
  700. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  701. // devicePixelRatio
  702. var _devicePixelRatio = pixelRatio;
  703. // SDKVersion
  704. var _SDKVersion = SDKVersion;
  705. // hostLanguage
  706. var hostLanguage = language.replace(/_/g, '-');
  707. // wx.getAccountInfoSync
  708. var parameters = {
  709. appId: "__UNI__C76B472",
  710. appName: "wechat",
  711. appVersion: "1.0.0",
  712. appVersionCode: "100",
  713. appLanguage: getAppLanguage(hostLanguage),
  714. uniCompileVersion: "3.6.15",
  715. uniRuntimeVersion: "3.6.15",
  716. uniPlatform: undefined || "mp-weixin",
  717. deviceBrand: deviceBrand,
  718. deviceModel: model,
  719. deviceType: deviceType,
  720. devicePixelRatio: _devicePixelRatio,
  721. deviceOrientation: _deviceOrientation,
  722. osName: osName.toLocaleLowerCase(),
  723. osVersion: osVersion,
  724. hostTheme: theme,
  725. hostVersion: hostVersion,
  726. hostLanguage: hostLanguage,
  727. hostName: _hostName,
  728. hostSDKVersion: _SDKVersion,
  729. hostFontSizeSetting: fontSizeSetting,
  730. windowTop: 0,
  731. windowBottom: 0,
  732. // TODO
  733. osLanguage: undefined,
  734. osTheme: undefined,
  735. ua: undefined,
  736. hostPackageName: undefined,
  737. browserName: undefined,
  738. browserVersion: undefined
  739. };
  740. Object.assign(result, parameters);
  741. }
  742. function getGetDeviceType(result, model) {
  743. var deviceType = result.deviceType || 'phone';
  744. {
  745. var deviceTypeMaps = {
  746. ipad: 'pad',
  747. windows: 'pc',
  748. mac: 'pc'
  749. };
  750. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  751. var _model = model.toLocaleLowerCase();
  752. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  753. var _m = deviceTypeMapsKeys[index];
  754. if (_model.indexOf(_m) !== -1) {
  755. deviceType = deviceTypeMaps[_m];
  756. break;
  757. }
  758. }
  759. }
  760. return deviceType;
  761. }
  762. function getDeviceBrand(brand) {
  763. var deviceBrand = brand;
  764. if (deviceBrand) {
  765. deviceBrand = brand.toLocaleLowerCase();
  766. }
  767. return deviceBrand;
  768. }
  769. function getAppLanguage(defaultLanguage) {
  770. return getLocale$1 ? getLocale$1() : defaultLanguage;
  771. }
  772. function getHostName(result) {
  773. var _platform = 'WeChat';
  774. var _hostName = result.hostName || _platform; // mp-jd
  775. {
  776. if (result.environment) {
  777. _hostName = result.environment;
  778. } else if (result.host && result.host.env) {
  779. _hostName = result.host.env;
  780. }
  781. }
  782. return _hostName;
  783. }
  784. var getSystemInfo = {
  785. returnValue: function returnValue(result) {
  786. useDeviceId(result);
  787. addSafeAreaInsets(result);
  788. populateParameters(result);
  789. }
  790. };
  791. var showActionSheet = {
  792. args: function args(fromArgs) {
  793. if ((0, _typeof2.default)(fromArgs) === 'object') {
  794. fromArgs.alertText = fromArgs.title;
  795. }
  796. }
  797. };
  798. var getAppBaseInfo = {
  799. returnValue: function returnValue(result) {
  800. var _result = result,
  801. version = _result.version,
  802. language = _result.language,
  803. SDKVersion = _result.SDKVersion,
  804. theme = _result.theme;
  805. var _hostName = getHostName(result);
  806. var hostLanguage = language.replace('_', '-');
  807. result = sortObject(Object.assign(result, {
  808. appId: "__UNI__C76B472",
  809. appName: "wechat",
  810. appVersion: "1.0.0",
  811. appVersionCode: "100",
  812. appLanguage: getAppLanguage(hostLanguage),
  813. hostVersion: version,
  814. hostLanguage: hostLanguage,
  815. hostName: _hostName,
  816. hostSDKVersion: SDKVersion,
  817. hostTheme: theme
  818. }));
  819. }
  820. };
  821. var getDeviceInfo = {
  822. returnValue: function returnValue(result) {
  823. var _result2 = result,
  824. brand = _result2.brand,
  825. model = _result2.model;
  826. var deviceType = getGetDeviceType(result, model);
  827. var deviceBrand = getDeviceBrand(brand);
  828. useDeviceId(result);
  829. result = sortObject(Object.assign(result, {
  830. deviceType: deviceType,
  831. deviceBrand: deviceBrand,
  832. deviceModel: model
  833. }));
  834. }
  835. };
  836. var getWindowInfo = {
  837. returnValue: function returnValue(result) {
  838. addSafeAreaInsets(result);
  839. result = sortObject(Object.assign(result, {
  840. windowTop: 0,
  841. windowBottom: 0
  842. }));
  843. }
  844. };
  845. var getAppAuthorizeSetting = {
  846. returnValue: function returnValue(result) {
  847. var locationReducedAccuracy = result.locationReducedAccuracy;
  848. result.locationAccuracy = 'unsupported';
  849. if (locationReducedAccuracy === true) {
  850. result.locationAccuracy = 'reduced';
  851. } else if (locationReducedAccuracy === false) {
  852. result.locationAccuracy = 'full';
  853. }
  854. }
  855. };
  856. // import navigateTo from 'uni-helpers/navigate-to'
  857. var protocols = {
  858. redirectTo: redirectTo,
  859. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  860. previewImage: previewImage,
  861. getSystemInfo: getSystemInfo,
  862. getSystemInfoSync: getSystemInfo,
  863. showActionSheet: showActionSheet,
  864. getAppBaseInfo: getAppBaseInfo,
  865. getDeviceInfo: getDeviceInfo,
  866. getWindowInfo: getWindowInfo,
  867. getAppAuthorizeSetting: getAppAuthorizeSetting
  868. };
  869. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  870. var canIUses = [];
  871. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  872. function processCallback(methodName, method, returnValue) {
  873. return function (res) {
  874. return method(processReturnValue(methodName, res, returnValue));
  875. };
  876. }
  877. function processArgs(methodName, fromArgs) {
  878. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  879. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  880. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  881. if (isPlainObject(fromArgs)) {
  882. // 一般 api 的参数解析
  883. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  884. if (isFn(argsOption)) {
  885. argsOption = argsOption(fromArgs, toArgs) || {};
  886. }
  887. for (var key in fromArgs) {
  888. if (hasOwn(argsOption, key)) {
  889. var keyOption = argsOption[key];
  890. if (isFn(keyOption)) {
  891. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  892. }
  893. if (!keyOption) {
  894. // 不支持的参数
  895. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  896. } else if (isStr(keyOption)) {
  897. // 重写参数 key
  898. toArgs[keyOption] = fromArgs[key];
  899. } else if (isPlainObject(keyOption)) {
  900. // {name:newName,value:value}可重新指定参数 key:value
  901. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  902. }
  903. } else if (CALLBACKS.indexOf(key) !== -1) {
  904. if (isFn(fromArgs[key])) {
  905. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  906. }
  907. } else {
  908. if (!keepFromArgs) {
  909. toArgs[key] = fromArgs[key];
  910. }
  911. }
  912. }
  913. return toArgs;
  914. } else if (isFn(fromArgs)) {
  915. fromArgs = processCallback(methodName, fromArgs, returnValue);
  916. }
  917. return fromArgs;
  918. }
  919. function processReturnValue(methodName, res, returnValue) {
  920. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  921. if (isFn(protocols.returnValue)) {
  922. // 处理通用 returnValue
  923. res = protocols.returnValue(methodName, res);
  924. }
  925. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  926. }
  927. function wrapper(methodName, method) {
  928. if (hasOwn(protocols, methodName)) {
  929. var protocol = protocols[methodName];
  930. if (!protocol) {
  931. // 暂不支持的 api
  932. return function () {
  933. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  934. };
  935. }
  936. return function (arg1, arg2) {
  937. // 目前 api 最多两个参数
  938. var options = protocol;
  939. if (isFn(protocol)) {
  940. options = protocol(arg1);
  941. }
  942. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  943. var args = [arg1];
  944. if (typeof arg2 !== 'undefined') {
  945. args.push(arg2);
  946. }
  947. if (isFn(options.name)) {
  948. methodName = options.name(arg1);
  949. } else if (isStr(options.name)) {
  950. methodName = options.name;
  951. }
  952. var returnValue = wx[methodName].apply(wx, args);
  953. if (isSyncApi(methodName)) {
  954. // 同步 api
  955. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  956. }
  957. return returnValue;
  958. };
  959. }
  960. return method;
  961. }
  962. var todoApis = Object.create(null);
  963. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  964. function createTodoApi(name) {
  965. return function todoApi(_ref) {
  966. var fail = _ref.fail,
  967. complete = _ref.complete;
  968. var res = {
  969. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  970. };
  971. isFn(fail) && fail(res);
  972. isFn(complete) && complete(res);
  973. };
  974. }
  975. TODOS.forEach(function (name) {
  976. todoApis[name] = createTodoApi(name);
  977. });
  978. var providers = {
  979. oauth: ['weixin'],
  980. share: ['weixin'],
  981. payment: ['wxpay'],
  982. push: ['weixin']
  983. };
  984. function getProvider(_ref2) {
  985. var service = _ref2.service,
  986. success = _ref2.success,
  987. fail = _ref2.fail,
  988. complete = _ref2.complete;
  989. var res = false;
  990. if (providers[service]) {
  991. res = {
  992. errMsg: 'getProvider:ok',
  993. service: service,
  994. provider: providers[service]
  995. };
  996. isFn(success) && success(res);
  997. } else {
  998. res = {
  999. errMsg: 'getProvider:fail service not found'
  1000. };
  1001. isFn(fail) && fail(res);
  1002. }
  1003. isFn(complete) && complete(res);
  1004. }
  1005. var extraApi = /*#__PURE__*/Object.freeze({
  1006. __proto__: null,
  1007. getProvider: getProvider
  1008. });
  1009. var getEmitter = function () {
  1010. var Emitter;
  1011. return function getUniEmitter() {
  1012. if (!Emitter) {
  1013. Emitter = new _vue.default();
  1014. }
  1015. return Emitter;
  1016. };
  1017. }();
  1018. function apply(ctx, method, args) {
  1019. return ctx[method].apply(ctx, args);
  1020. }
  1021. function $on() {
  1022. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  1023. }
  1024. function $off() {
  1025. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  1026. }
  1027. function $once() {
  1028. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  1029. }
  1030. function $emit() {
  1031. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  1032. }
  1033. var eventApi = /*#__PURE__*/Object.freeze({
  1034. __proto__: null,
  1035. $on: $on,
  1036. $off: $off,
  1037. $once: $once,
  1038. $emit: $emit
  1039. });
  1040. /**
  1041. * 框架内 try-catch
  1042. */
  1043. /**
  1044. * 开发者 try-catch
  1045. */
  1046. function tryCatch(fn) {
  1047. return function () {
  1048. try {
  1049. return fn.apply(fn, arguments);
  1050. } catch (e) {
  1051. // TODO
  1052. console.error(e);
  1053. }
  1054. };
  1055. }
  1056. function getApiCallbacks(params) {
  1057. var apiCallbacks = {};
  1058. for (var name in params) {
  1059. var param = params[name];
  1060. if (isFn(param)) {
  1061. apiCallbacks[name] = tryCatch(param);
  1062. delete params[name];
  1063. }
  1064. }
  1065. return apiCallbacks;
  1066. }
  1067. var cid;
  1068. var cidErrMsg;
  1069. var enabled;
  1070. function normalizePushMessage(message) {
  1071. try {
  1072. return JSON.parse(message);
  1073. } catch (e) {}
  1074. return message;
  1075. }
  1076. function invokePushCallback(args) {
  1077. if (args.type === 'enabled') {
  1078. enabled = true;
  1079. } else if (args.type === 'clientId') {
  1080. cid = args.cid;
  1081. cidErrMsg = args.errMsg;
  1082. invokeGetPushCidCallbacks(cid, args.errMsg);
  1083. } else if (args.type === 'pushMsg') {
  1084. var message = {
  1085. type: 'receive',
  1086. data: normalizePushMessage(args.message)
  1087. };
  1088. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  1089. var callback = onPushMessageCallbacks[i];
  1090. callback(message);
  1091. // 该消息已被阻止
  1092. if (message.stopped) {
  1093. break;
  1094. }
  1095. }
  1096. } else if (args.type === 'click') {
  1097. onPushMessageCallbacks.forEach(function (callback) {
  1098. callback({
  1099. type: 'click',
  1100. data: normalizePushMessage(args.message)
  1101. });
  1102. });
  1103. }
  1104. }
  1105. var getPushCidCallbacks = [];
  1106. function invokeGetPushCidCallbacks(cid, errMsg) {
  1107. getPushCidCallbacks.forEach(function (callback) {
  1108. callback(cid, errMsg);
  1109. });
  1110. getPushCidCallbacks.length = 0;
  1111. }
  1112. function getPushClientId(args) {
  1113. if (!isPlainObject(args)) {
  1114. args = {};
  1115. }
  1116. var _getApiCallbacks = getApiCallbacks(args),
  1117. success = _getApiCallbacks.success,
  1118. fail = _getApiCallbacks.fail,
  1119. complete = _getApiCallbacks.complete;
  1120. var hasSuccess = isFn(success);
  1121. var hasFail = isFn(fail);
  1122. var hasComplete = isFn(complete);
  1123. Promise.resolve().then(function () {
  1124. if (typeof enabled === 'undefined') {
  1125. enabled = false;
  1126. cid = '';
  1127. cidErrMsg = 'uniPush is not enabled';
  1128. }
  1129. getPushCidCallbacks.push(function (cid, errMsg) {
  1130. var res;
  1131. if (cid) {
  1132. res = {
  1133. errMsg: 'getPushClientId:ok',
  1134. cid: cid
  1135. };
  1136. hasSuccess && success(res);
  1137. } else {
  1138. res = {
  1139. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  1140. };
  1141. hasFail && fail(res);
  1142. }
  1143. hasComplete && complete(res);
  1144. });
  1145. if (typeof cid !== 'undefined') {
  1146. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1147. }
  1148. });
  1149. }
  1150. var onPushMessageCallbacks = [];
  1151. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1152. var onPushMessage = function onPushMessage(fn) {
  1153. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1154. onPushMessageCallbacks.push(fn);
  1155. }
  1156. };
  1157. var offPushMessage = function offPushMessage(fn) {
  1158. if (!fn) {
  1159. onPushMessageCallbacks.length = 0;
  1160. } else {
  1161. var index = onPushMessageCallbacks.indexOf(fn);
  1162. if (index > -1) {
  1163. onPushMessageCallbacks.splice(index, 1);
  1164. }
  1165. }
  1166. };
  1167. var api = /*#__PURE__*/Object.freeze({
  1168. __proto__: null,
  1169. getPushClientId: getPushClientId,
  1170. onPushMessage: onPushMessage,
  1171. offPushMessage: offPushMessage,
  1172. invokePushCallback: invokePushCallback
  1173. });
  1174. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1175. function findVmByVueId(vm, vuePid) {
  1176. var $children = vm.$children;
  1177. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1178. for (var i = $children.length - 1; i >= 0; i--) {
  1179. var childVm = $children[i];
  1180. if (childVm.$scope._$vueId === vuePid) {
  1181. return childVm;
  1182. }
  1183. }
  1184. // 反向递归查找
  1185. var parentVm;
  1186. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1187. parentVm = findVmByVueId($children[_i], vuePid);
  1188. if (parentVm) {
  1189. return parentVm;
  1190. }
  1191. }
  1192. }
  1193. function initBehavior(options) {
  1194. return Behavior(options);
  1195. }
  1196. function isPage() {
  1197. return !!this.route;
  1198. }
  1199. function initRelation(detail) {
  1200. this.triggerEvent('__l', detail);
  1201. }
  1202. function selectAllComponents(mpInstance, selector, $refs) {
  1203. var components = mpInstance.selectAllComponents(selector) || [];
  1204. components.forEach(function (component) {
  1205. var ref = component.dataset.ref;
  1206. $refs[ref] = component.$vm || toSkip(component);
  1207. {
  1208. if (component.dataset.vueGeneric === 'scoped') {
  1209. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1210. selectAllComponents(scopedComponent, selector, $refs);
  1211. });
  1212. }
  1213. }
  1214. });
  1215. }
  1216. function syncRefs(refs, newRefs) {
  1217. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  1218. var newKeys = Object.keys(newRefs);
  1219. newKeys.forEach(function (key) {
  1220. var oldValue = refs[key];
  1221. var newValue = newRefs[key];
  1222. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  1223. return oldValue.includes(value);
  1224. })) {
  1225. return;
  1226. }
  1227. refs[key] = newValue;
  1228. oldKeys.delete(key);
  1229. });
  1230. oldKeys.forEach(function (key) {
  1231. delete refs[key];
  1232. });
  1233. return refs;
  1234. }
  1235. function initRefs(vm) {
  1236. var mpInstance = vm.$scope;
  1237. var refs = {};
  1238. Object.defineProperty(vm, '$refs', {
  1239. get: function get() {
  1240. var $refs = {};
  1241. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1242. // TODO 暂不考虑 for 中的 scoped
  1243. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  1244. forComponents.forEach(function (component) {
  1245. var ref = component.dataset.ref;
  1246. if (!$refs[ref]) {
  1247. $refs[ref] = [];
  1248. }
  1249. $refs[ref].push(component.$vm || toSkip(component));
  1250. });
  1251. return syncRefs(refs, $refs);
  1252. }
  1253. });
  1254. }
  1255. function handleLink(event) {
  1256. var _ref3 = event.detail || event.value,
  1257. vuePid = _ref3.vuePid,
  1258. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  1259. var parentVm;
  1260. if (vuePid) {
  1261. parentVm = findVmByVueId(this.$vm, vuePid);
  1262. }
  1263. if (!parentVm) {
  1264. parentVm = this.$vm;
  1265. }
  1266. vueOptions.parent = parentVm;
  1267. }
  1268. function markMPComponent(component) {
  1269. // 在 Vue 中标记为小程序组件
  1270. var IS_MP = '__v_isMPComponent';
  1271. Object.defineProperty(component, IS_MP, {
  1272. configurable: true,
  1273. enumerable: false,
  1274. value: true
  1275. });
  1276. return component;
  1277. }
  1278. function toSkip(obj) {
  1279. var OB = '__ob__';
  1280. var SKIP = '__v_skip';
  1281. if (isObject(obj) && Object.isExtensible(obj)) {
  1282. // 避免被 @vue/composition-api 观测
  1283. Object.defineProperty(obj, OB, {
  1284. configurable: true,
  1285. enumerable: false,
  1286. value: (0, _defineProperty2.default)({}, SKIP, true)
  1287. });
  1288. }
  1289. return obj;
  1290. }
  1291. var MPPage = Page;
  1292. var MPComponent = Component;
  1293. var customizeRE = /:/g;
  1294. var customize = cached(function (str) {
  1295. return camelize(str.replace(customizeRE, '-'));
  1296. });
  1297. function initTriggerEvent(mpInstance) {
  1298. var oldTriggerEvent = mpInstance.triggerEvent;
  1299. var newTriggerEvent = function newTriggerEvent(event) {
  1300. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  1301. args[_key3 - 1] = arguments[_key3];
  1302. }
  1303. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  1304. if (this.$vm || this.dataset && this.dataset.comType) {
  1305. event = customize(event);
  1306. } else {
  1307. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  1308. var newEvent = customize(event);
  1309. if (newEvent !== event) {
  1310. oldTriggerEvent.apply(this, [newEvent].concat(args));
  1311. }
  1312. }
  1313. return oldTriggerEvent.apply(this, [event].concat(args));
  1314. };
  1315. try {
  1316. // 京东小程序 triggerEvent 为只读
  1317. mpInstance.triggerEvent = newTriggerEvent;
  1318. } catch (error) {
  1319. mpInstance._triggerEvent = newTriggerEvent;
  1320. }
  1321. }
  1322. function initHook(name, options, isComponent) {
  1323. var oldHook = options[name];
  1324. options[name] = function () {
  1325. markMPComponent(this);
  1326. initTriggerEvent(this);
  1327. if (oldHook) {
  1328. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  1329. args[_key4] = arguments[_key4];
  1330. }
  1331. return oldHook.apply(this, args);
  1332. }
  1333. };
  1334. }
  1335. if (!MPPage.__$wrappered) {
  1336. MPPage.__$wrappered = true;
  1337. Page = function Page() {
  1338. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1339. initHook('onLoad', options);
  1340. return MPPage(options);
  1341. };
  1342. Page.after = MPPage.after;
  1343. Component = function Component() {
  1344. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1345. initHook('created', options);
  1346. return MPComponent(options);
  1347. };
  1348. }
  1349. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  1350. function initMocks(vm, mocks) {
  1351. var mpInstance = vm.$mp[vm.mpType];
  1352. mocks.forEach(function (mock) {
  1353. if (hasOwn(mpInstance, mock)) {
  1354. vm[mock] = mpInstance[mock];
  1355. }
  1356. });
  1357. }
  1358. function hasHook(hook, vueOptions) {
  1359. if (!vueOptions) {
  1360. return true;
  1361. }
  1362. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  1363. return true;
  1364. }
  1365. vueOptions = vueOptions.default || vueOptions;
  1366. if (isFn(vueOptions)) {
  1367. if (isFn(vueOptions.extendOptions[hook])) {
  1368. return true;
  1369. }
  1370. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  1371. return true;
  1372. }
  1373. return false;
  1374. }
  1375. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  1376. return true;
  1377. }
  1378. var mixins = vueOptions.mixins;
  1379. if (Array.isArray(mixins)) {
  1380. return !!mixins.find(function (mixin) {
  1381. return hasHook(hook, mixin);
  1382. });
  1383. }
  1384. }
  1385. function initHooks(mpOptions, hooks, vueOptions) {
  1386. hooks.forEach(function (hook) {
  1387. if (hasHook(hook, vueOptions)) {
  1388. mpOptions[hook] = function (args) {
  1389. return this.$vm && this.$vm.__call_hook(hook, args);
  1390. };
  1391. }
  1392. });
  1393. }
  1394. function initUnknownHooks(mpOptions, vueOptions) {
  1395. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1396. findHooks(vueOptions).forEach(function (hook) {
  1397. return initHook$1(mpOptions, hook, excludes);
  1398. });
  1399. }
  1400. function findHooks(vueOptions) {
  1401. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  1402. if (vueOptions) {
  1403. Object.keys(vueOptions).forEach(function (name) {
  1404. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  1405. hooks.push(name);
  1406. }
  1407. });
  1408. }
  1409. return hooks;
  1410. }
  1411. function initHook$1(mpOptions, hook, excludes) {
  1412. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  1413. mpOptions[hook] = function (args) {
  1414. return this.$vm && this.$vm.__call_hook(hook, args);
  1415. };
  1416. }
  1417. }
  1418. function initVueComponent(Vue, vueOptions) {
  1419. vueOptions = vueOptions.default || vueOptions;
  1420. var VueComponent;
  1421. if (isFn(vueOptions)) {
  1422. VueComponent = vueOptions;
  1423. } else {
  1424. VueComponent = Vue.extend(vueOptions);
  1425. }
  1426. vueOptions = VueComponent.options;
  1427. return [VueComponent, vueOptions];
  1428. }
  1429. function initSlots(vm, vueSlots) {
  1430. if (Array.isArray(vueSlots) && vueSlots.length) {
  1431. var $slots = Object.create(null);
  1432. vueSlots.forEach(function (slotName) {
  1433. $slots[slotName] = true;
  1434. });
  1435. vm.$scopedSlots = vm.$slots = $slots;
  1436. }
  1437. }
  1438. function initVueIds(vueIds, mpInstance) {
  1439. vueIds = (vueIds || '').split(',');
  1440. var len = vueIds.length;
  1441. if (len === 1) {
  1442. mpInstance._$vueId = vueIds[0];
  1443. } else if (len === 2) {
  1444. mpInstance._$vueId = vueIds[0];
  1445. mpInstance._$vuePid = vueIds[1];
  1446. }
  1447. }
  1448. function initData(vueOptions, context) {
  1449. var data = vueOptions.data || {};
  1450. var methods = vueOptions.methods || {};
  1451. if (typeof data === 'function') {
  1452. try {
  1453. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  1454. } catch (e) {
  1455. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"wechat","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  1456. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  1457. }
  1458. }
  1459. } else {
  1460. try {
  1461. // 对 data 格式化
  1462. data = JSON.parse(JSON.stringify(data));
  1463. } catch (e) {}
  1464. }
  1465. if (!isPlainObject(data)) {
  1466. data = {};
  1467. }
  1468. Object.keys(methods).forEach(function (methodName) {
  1469. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  1470. data[methodName] = methods[methodName];
  1471. }
  1472. });
  1473. return data;
  1474. }
  1475. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  1476. function createObserver(name) {
  1477. return function observer(newVal, oldVal) {
  1478. if (this.$vm) {
  1479. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  1480. }
  1481. };
  1482. }
  1483. function initBehaviors(vueOptions, initBehavior) {
  1484. var vueBehaviors = vueOptions.behaviors;
  1485. var vueExtends = vueOptions.extends;
  1486. var vueMixins = vueOptions.mixins;
  1487. var vueProps = vueOptions.props;
  1488. if (!vueProps) {
  1489. vueOptions.props = vueProps = [];
  1490. }
  1491. var behaviors = [];
  1492. if (Array.isArray(vueBehaviors)) {
  1493. vueBehaviors.forEach(function (behavior) {
  1494. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  1495. if (behavior === 'uni://form-field') {
  1496. if (Array.isArray(vueProps)) {
  1497. vueProps.push('name');
  1498. vueProps.push('value');
  1499. } else {
  1500. vueProps.name = {
  1501. type: String,
  1502. default: ''
  1503. };
  1504. vueProps.value = {
  1505. type: [String, Number, Boolean, Array, Object, Date],
  1506. default: ''
  1507. };
  1508. }
  1509. }
  1510. });
  1511. }
  1512. if (isPlainObject(vueExtends) && vueExtends.props) {
  1513. behaviors.push(initBehavior({
  1514. properties: initProperties(vueExtends.props, true)
  1515. }));
  1516. }
  1517. if (Array.isArray(vueMixins)) {
  1518. vueMixins.forEach(function (vueMixin) {
  1519. if (isPlainObject(vueMixin) && vueMixin.props) {
  1520. behaviors.push(initBehavior({
  1521. properties: initProperties(vueMixin.props, true)
  1522. }));
  1523. }
  1524. });
  1525. }
  1526. return behaviors;
  1527. }
  1528. function parsePropType(key, type, defaultValue, file) {
  1529. // [String]=>String
  1530. if (Array.isArray(type) && type.length === 1) {
  1531. return type[0];
  1532. }
  1533. return type;
  1534. }
  1535. function initProperties(props) {
  1536. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  1537. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  1538. var options = arguments.length > 3 ? arguments[3] : undefined;
  1539. var properties = {};
  1540. if (!isBehavior) {
  1541. properties.vueId = {
  1542. type: String,
  1543. value: ''
  1544. };
  1545. {
  1546. if (options.virtualHost) {
  1547. properties.virtualHostStyle = {
  1548. type: null,
  1549. value: ''
  1550. };
  1551. properties.virtualHostClass = {
  1552. type: null,
  1553. value: ''
  1554. };
  1555. }
  1556. }
  1557. // scopedSlotsCompiler auto
  1558. properties.scopedSlotsCompiler = {
  1559. type: String,
  1560. value: ''
  1561. };
  1562. properties.vueSlots = {
  1563. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  1564. type: null,
  1565. value: [],
  1566. observer: function observer(newVal, oldVal) {
  1567. var $slots = Object.create(null);
  1568. newVal.forEach(function (slotName) {
  1569. $slots[slotName] = true;
  1570. });
  1571. this.setData({
  1572. $slots: $slots
  1573. });
  1574. }
  1575. };
  1576. }
  1577. if (Array.isArray(props)) {
  1578. // ['title']
  1579. props.forEach(function (key) {
  1580. properties[key] = {
  1581. type: null,
  1582. observer: createObserver(key)
  1583. };
  1584. });
  1585. } else if (isPlainObject(props)) {
  1586. // {title:{type:String,default:''},content:String}
  1587. Object.keys(props).forEach(function (key) {
  1588. var opts = props[key];
  1589. if (isPlainObject(opts)) {
  1590. // title:{type:String,default:''}
  1591. var value = opts.default;
  1592. if (isFn(value)) {
  1593. value = value();
  1594. }
  1595. opts.type = parsePropType(key, opts.type);
  1596. properties[key] = {
  1597. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  1598. value: value,
  1599. observer: createObserver(key)
  1600. };
  1601. } else {
  1602. // content:String
  1603. var type = parsePropType(key, opts);
  1604. properties[key] = {
  1605. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  1606. observer: createObserver(key)
  1607. };
  1608. }
  1609. });
  1610. }
  1611. return properties;
  1612. }
  1613. function wrapper$1(event) {
  1614. // TODO 又得兼容 mpvue 的 mp 对象
  1615. try {
  1616. event.mp = JSON.parse(JSON.stringify(event));
  1617. } catch (e) {}
  1618. event.stopPropagation = noop;
  1619. event.preventDefault = noop;
  1620. event.target = event.target || {};
  1621. if (!hasOwn(event, 'detail')) {
  1622. event.detail = {};
  1623. }
  1624. if (hasOwn(event, 'markerId')) {
  1625. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  1626. event.detail.markerId = event.markerId;
  1627. }
  1628. if (isPlainObject(event.detail)) {
  1629. event.target = Object.assign({}, event.target, event.detail);
  1630. }
  1631. return event;
  1632. }
  1633. function getExtraValue(vm, dataPathsArray) {
  1634. var context = vm;
  1635. dataPathsArray.forEach(function (dataPathArray) {
  1636. var dataPath = dataPathArray[0];
  1637. var value = dataPathArray[2];
  1638. if (dataPath || typeof value !== 'undefined') {
  1639. // ['','',index,'disable']
  1640. var propPath = dataPathArray[1];
  1641. var valuePath = dataPathArray[3];
  1642. var vFor;
  1643. if (Number.isInteger(dataPath)) {
  1644. vFor = dataPath;
  1645. } else if (!dataPath) {
  1646. vFor = context;
  1647. } else if (typeof dataPath === 'string' && dataPath) {
  1648. if (dataPath.indexOf('#s#') === 0) {
  1649. vFor = dataPath.substr(3);
  1650. } else {
  1651. vFor = vm.__get_value(dataPath, context);
  1652. }
  1653. }
  1654. if (Number.isInteger(vFor)) {
  1655. context = value;
  1656. } else if (!propPath) {
  1657. context = vFor[value];
  1658. } else {
  1659. if (Array.isArray(vFor)) {
  1660. context = vFor.find(function (vForItem) {
  1661. return vm.__get_value(propPath, vForItem) === value;
  1662. });
  1663. } else if (isPlainObject(vFor)) {
  1664. context = Object.keys(vFor).find(function (vForKey) {
  1665. return vm.__get_value(propPath, vFor[vForKey]) === value;
  1666. });
  1667. } else {
  1668. console.error('v-for 暂不支持循环数据:', vFor);
  1669. }
  1670. }
  1671. if (valuePath) {
  1672. context = vm.__get_value(valuePath, context);
  1673. }
  1674. }
  1675. });
  1676. return context;
  1677. }
  1678. function processEventExtra(vm, extra, event, __args__) {
  1679. var extraObj = {};
  1680. if (Array.isArray(extra) && extra.length) {
  1681. /**
  1682. *[
  1683. * ['data.items', 'data.id', item.data.id],
  1684. * ['metas', 'id', meta.id]
  1685. *],
  1686. *[
  1687. * ['data.items', 'data.id', item.data.id],
  1688. * ['metas', 'id', meta.id]
  1689. *],
  1690. *'test'
  1691. */
  1692. extra.forEach(function (dataPath, index) {
  1693. if (typeof dataPath === 'string') {
  1694. if (!dataPath) {
  1695. // model,prop.sync
  1696. extraObj['$' + index] = vm;
  1697. } else {
  1698. if (dataPath === '$event') {
  1699. // $event
  1700. extraObj['$' + index] = event;
  1701. } else if (dataPath === 'arguments') {
  1702. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  1703. } else if (dataPath.indexOf('$event.') === 0) {
  1704. // $event.target.value
  1705. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1706. } else {
  1707. extraObj['$' + index] = vm.__get_value(dataPath);
  1708. }
  1709. }
  1710. } else {
  1711. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1712. }
  1713. });
  1714. }
  1715. return extraObj;
  1716. }
  1717. function getObjByArray(arr) {
  1718. var obj = {};
  1719. for (var i = 1; i < arr.length; i++) {
  1720. var element = arr[i];
  1721. obj[element[0]] = element[1];
  1722. }
  1723. return obj;
  1724. }
  1725. function processEventArgs(vm, event) {
  1726. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1727. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  1728. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  1729. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  1730. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1731. // fixed 用户直接触发 mpInstance.triggerEvent
  1732. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  1733. if (isCustom) {
  1734. // 自定义事件
  1735. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  1736. if (!args.length) {
  1737. // 无参数,直接传入 event 或 detail 数组
  1738. if (isCustomMPEvent) {
  1739. return [event];
  1740. }
  1741. return __args__;
  1742. }
  1743. }
  1744. var extraObj = processEventExtra(vm, extra, event, __args__);
  1745. var ret = [];
  1746. args.forEach(function (arg) {
  1747. if (arg === '$event') {
  1748. if (methodName === '__set_model' && !isCustom) {
  1749. // input v-model value
  1750. ret.push(event.target.value);
  1751. } else {
  1752. if (isCustom && !isCustomMPEvent) {
  1753. ret.push(__args__[0]);
  1754. } else {
  1755. // wxcomponent 组件或内置组件
  1756. ret.push(event);
  1757. }
  1758. }
  1759. } else {
  1760. if (Array.isArray(arg) && arg[0] === 'o') {
  1761. ret.push(getObjByArray(arg));
  1762. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1763. ret.push(extraObj[arg]);
  1764. } else {
  1765. ret.push(arg);
  1766. }
  1767. }
  1768. });
  1769. return ret;
  1770. }
  1771. var ONCE = '~';
  1772. var CUSTOM = '^';
  1773. function isMatchEventType(eventType, optType) {
  1774. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  1775. }
  1776. function getContextVm(vm) {
  1777. var $parent = vm.$parent;
  1778. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1779. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1780. $parent = $parent.$parent;
  1781. }
  1782. return $parent && $parent.$parent;
  1783. }
  1784. function handleEvent(event) {
  1785. var _this2 = this;
  1786. event = wrapper$1(event);
  1787. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1788. var dataset = (event.currentTarget || event.target).dataset;
  1789. if (!dataset) {
  1790. return console.warn('事件信息不存在');
  1791. }
  1792. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1793. if (!eventOpts) {
  1794. return console.warn('事件信息不存在');
  1795. }
  1796. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1797. var eventType = event.type;
  1798. var ret = [];
  1799. eventOpts.forEach(function (eventOpt) {
  1800. var type = eventOpt[0];
  1801. var eventsArray = eventOpt[1];
  1802. var isCustom = type.charAt(0) === CUSTOM;
  1803. type = isCustom ? type.slice(1) : type;
  1804. var isOnce = type.charAt(0) === ONCE;
  1805. type = isOnce ? type.slice(1) : type;
  1806. if (eventsArray && isMatchEventType(eventType, type)) {
  1807. eventsArray.forEach(function (eventArray) {
  1808. var methodName = eventArray[0];
  1809. if (methodName) {
  1810. var handlerCtx = _this2.$vm;
  1811. if (handlerCtx.$options.generic) {
  1812. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1813. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1814. }
  1815. if (methodName === '$emit') {
  1816. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  1817. return;
  1818. }
  1819. var handler = handlerCtx[methodName];
  1820. if (!isFn(handler)) {
  1821. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  1822. var path = _this2.route || _this2.is;
  1823. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  1824. }
  1825. if (isOnce) {
  1826. if (handler.once) {
  1827. return;
  1828. }
  1829. handler.once = true;
  1830. }
  1831. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  1832. params = Array.isArray(params) ? params : [];
  1833. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1834. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1835. // eslint-disable-next-line no-sparse-arrays
  1836. params = params.concat([,,,,,,,,,, event]);
  1837. }
  1838. ret.push(handler.apply(handlerCtx, params));
  1839. }
  1840. });
  1841. }
  1842. });
  1843. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  1844. return ret[0];
  1845. }
  1846. }
  1847. var eventChannels = {};
  1848. var eventChannelStack = [];
  1849. function getEventChannel(id) {
  1850. if (id) {
  1851. var eventChannel = eventChannels[id];
  1852. delete eventChannels[id];
  1853. return eventChannel;
  1854. }
  1855. return eventChannelStack.shift();
  1856. }
  1857. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  1858. function initEventChannel() {
  1859. _vue.default.prototype.getOpenerEventChannel = function () {
  1860. // 微信小程序使用自身getOpenerEventChannel
  1861. {
  1862. return this.$scope.getOpenerEventChannel();
  1863. }
  1864. };
  1865. var callHook = _vue.default.prototype.__call_hook;
  1866. _vue.default.prototype.__call_hook = function (hook, args) {
  1867. if (hook === 'onLoad' && args && args.__id__) {
  1868. this.__eventChannel__ = getEventChannel(args.__id__);
  1869. delete args.__id__;
  1870. }
  1871. return callHook.call(this, hook, args);
  1872. };
  1873. }
  1874. function initScopedSlotsParams() {
  1875. var center = {};
  1876. var parents = {};
  1877. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1878. var has = center[vueId];
  1879. if (!has) {
  1880. parents[vueId] = this;
  1881. this.$on('hook:destroyed', function () {
  1882. delete parents[vueId];
  1883. });
  1884. }
  1885. return has;
  1886. };
  1887. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1888. var data = center[vueId];
  1889. if (data) {
  1890. var object = data[name] || {};
  1891. return key ? object[key] : object;
  1892. } else {
  1893. parents[vueId] = this;
  1894. this.$on('hook:destroyed', function () {
  1895. delete parents[vueId];
  1896. });
  1897. }
  1898. };
  1899. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1900. var vueIds = this.$options.propsData.vueId;
  1901. if (vueIds) {
  1902. var vueId = vueIds.split(',')[0];
  1903. var object = center[vueId] = center[vueId] || {};
  1904. object[name] = value;
  1905. if (parents[vueId]) {
  1906. parents[vueId].$forceUpdate();
  1907. }
  1908. }
  1909. };
  1910. _vue.default.mixin({
  1911. destroyed: function destroyed() {
  1912. var propsData = this.$options.propsData;
  1913. var vueId = propsData && propsData.vueId;
  1914. if (vueId) {
  1915. delete center[vueId];
  1916. delete parents[vueId];
  1917. }
  1918. }
  1919. });
  1920. }
  1921. function parseBaseApp(vm, _ref4) {
  1922. var mocks = _ref4.mocks,
  1923. initRefs = _ref4.initRefs;
  1924. initEventChannel();
  1925. {
  1926. initScopedSlotsParams();
  1927. }
  1928. if (vm.$options.store) {
  1929. _vue.default.prototype.$store = vm.$options.store;
  1930. }
  1931. uniIdMixin(_vue.default);
  1932. _vue.default.prototype.mpHost = "mp-weixin";
  1933. _vue.default.mixin({
  1934. beforeCreate: function beforeCreate() {
  1935. if (!this.$options.mpType) {
  1936. return;
  1937. }
  1938. this.mpType = this.$options.mpType;
  1939. this.$mp = (0, _defineProperty2.default)({
  1940. data: {}
  1941. }, this.mpType, this.$options.mpInstance);
  1942. this.$scope = this.$options.mpInstance;
  1943. delete this.$options.mpType;
  1944. delete this.$options.mpInstance;
  1945. if (this.mpType === 'page' && typeof getApp === 'function') {
  1946. // hack vue-i18n
  1947. var app = getApp();
  1948. if (app.$vm && app.$vm.$i18n) {
  1949. this._i18n = app.$vm.$i18n;
  1950. }
  1951. }
  1952. if (this.mpType !== 'app') {
  1953. initRefs(this);
  1954. initMocks(this, mocks);
  1955. }
  1956. }
  1957. });
  1958. var appOptions = {
  1959. onLaunch: function onLaunch(args) {
  1960. if (this.$vm) {
  1961. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1962. return;
  1963. }
  1964. {
  1965. if (wx.canIUse && !wx.canIUse('nextTick')) {
  1966. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1967. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1968. }
  1969. }
  1970. this.$vm = vm;
  1971. this.$vm.$mp = {
  1972. app: this
  1973. };
  1974. this.$vm.$scope = this;
  1975. // vm 上也挂载 globalData
  1976. this.$vm.globalData = this.globalData;
  1977. this.$vm._isMounted = true;
  1978. this.$vm.__call_hook('mounted', args);
  1979. this.$vm.__call_hook('onLaunch', args);
  1980. }
  1981. };
  1982. // 兼容旧版本 globalData
  1983. appOptions.globalData = vm.$options.globalData || {};
  1984. // 将 methods 中的方法挂在 getApp() 中
  1985. var methods = vm.$options.methods;
  1986. if (methods) {
  1987. Object.keys(methods).forEach(function (name) {
  1988. appOptions[name] = methods[name];
  1989. });
  1990. }
  1991. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  1992. initHooks(appOptions, hooks);
  1993. initUnknownHooks(appOptions, vm.$options);
  1994. return appOptions;
  1995. }
  1996. function parseApp(vm) {
  1997. return parseBaseApp(vm, {
  1998. mocks: mocks,
  1999. initRefs: initRefs
  2000. });
  2001. }
  2002. function createApp(vm) {
  2003. App(parseApp(vm));
  2004. return vm;
  2005. }
  2006. var encodeReserveRE = /[!'()*]/g;
  2007. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  2008. return '%' + c.charCodeAt(0).toString(16);
  2009. };
  2010. var commaRE = /%2C/g;
  2011. // fixed encodeURIComponent which is more conformant to RFC3986:
  2012. // - escapes [!'()*]
  2013. // - preserve commas
  2014. var encode = function encode(str) {
  2015. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  2016. };
  2017. function stringifyQuery(obj) {
  2018. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  2019. var res = obj ? Object.keys(obj).map(function (key) {
  2020. var val = obj[key];
  2021. if (val === undefined) {
  2022. return '';
  2023. }
  2024. if (val === null) {
  2025. return encodeStr(key);
  2026. }
  2027. if (Array.isArray(val)) {
  2028. var result = [];
  2029. val.forEach(function (val2) {
  2030. if (val2 === undefined) {
  2031. return;
  2032. }
  2033. if (val2 === null) {
  2034. result.push(encodeStr(key));
  2035. } else {
  2036. result.push(encodeStr(key) + '=' + encodeStr(val2));
  2037. }
  2038. });
  2039. return result.join('&');
  2040. }
  2041. return encodeStr(key) + '=' + encodeStr(val);
  2042. }).filter(function (x) {
  2043. return x.length > 0;
  2044. }).join('&') : null;
  2045. return res ? "?".concat(res) : '';
  2046. }
  2047. function parseBaseComponent(vueComponentOptions) {
  2048. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  2049. isPage = _ref5.isPage,
  2050. initRelation = _ref5.initRelation;
  2051. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  2052. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  2053. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  2054. VueComponent = _initVueComponent2[0],
  2055. vueOptions = _initVueComponent2[1];
  2056. var options = _objectSpread({
  2057. multipleSlots: true,
  2058. addGlobalClass: true
  2059. }, vueOptions.options || {});
  2060. {
  2061. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  2062. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  2063. Object.assign(options, vueOptions['mp-weixin'].options);
  2064. }
  2065. }
  2066. var componentOptions = {
  2067. options: options,
  2068. data: initData(vueOptions, _vue.default.prototype),
  2069. behaviors: initBehaviors(vueOptions, initBehavior),
  2070. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  2071. lifetimes: {
  2072. attached: function attached() {
  2073. var properties = this.properties;
  2074. var options = {
  2075. mpType: isPage.call(this) ? 'page' : 'component',
  2076. mpInstance: this,
  2077. propsData: properties
  2078. };
  2079. initVueIds(properties.vueId, this);
  2080. // 处理父子关系
  2081. initRelation.call(this, {
  2082. vuePid: this._$vuePid,
  2083. vueOptions: options
  2084. });
  2085. // 初始化 vue 实例
  2086. this.$vm = new VueComponent(options);
  2087. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  2088. initSlots(this.$vm, properties.vueSlots);
  2089. // 触发首次 setData
  2090. this.$vm.$mount();
  2091. },
  2092. ready: function ready() {
  2093. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  2094. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  2095. if (this.$vm) {
  2096. this.$vm._isMounted = true;
  2097. this.$vm.__call_hook('mounted');
  2098. this.$vm.__call_hook('onReady');
  2099. }
  2100. },
  2101. detached: function detached() {
  2102. this.$vm && this.$vm.$destroy();
  2103. }
  2104. },
  2105. pageLifetimes: {
  2106. show: function show(args) {
  2107. this.$vm && this.$vm.__call_hook('onPageShow', args);
  2108. },
  2109. hide: function hide() {
  2110. this.$vm && this.$vm.__call_hook('onPageHide');
  2111. },
  2112. resize: function resize(size) {
  2113. this.$vm && this.$vm.__call_hook('onPageResize', size);
  2114. }
  2115. },
  2116. methods: {
  2117. __l: handleLink,
  2118. __e: handleEvent
  2119. }
  2120. };
  2121. // externalClasses
  2122. if (vueOptions.externalClasses) {
  2123. componentOptions.externalClasses = vueOptions.externalClasses;
  2124. }
  2125. if (Array.isArray(vueOptions.wxsCallMethods)) {
  2126. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  2127. componentOptions.methods[callMethod] = function (args) {
  2128. return this.$vm[callMethod](args);
  2129. };
  2130. });
  2131. }
  2132. if (needVueOptions) {
  2133. return [componentOptions, vueOptions, VueComponent];
  2134. }
  2135. if (isPage) {
  2136. return componentOptions;
  2137. }
  2138. return [componentOptions, VueComponent];
  2139. }
  2140. function parseComponent(vueComponentOptions, needVueOptions) {
  2141. return parseBaseComponent(vueComponentOptions, {
  2142. isPage: isPage,
  2143. initRelation: initRelation
  2144. }, needVueOptions);
  2145. }
  2146. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  2147. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  2148. function parseBasePage(vuePageOptions) {
  2149. var _parseComponent = parseComponent(vuePageOptions, true),
  2150. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  2151. pageOptions = _parseComponent2[0],
  2152. vueOptions = _parseComponent2[1];
  2153. initHooks(pageOptions.methods, hooks$1, vueOptions);
  2154. pageOptions.methods.onLoad = function (query) {
  2155. this.options = query;
  2156. var copyQuery = Object.assign({}, query);
  2157. delete copyQuery.__id__;
  2158. this.$page = {
  2159. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  2160. };
  2161. this.$vm.$mp.query = query; // 兼容 mpvue
  2162. this.$vm.__call_hook('onLoad', query);
  2163. };
  2164. {
  2165. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  2166. }
  2167. return pageOptions;
  2168. }
  2169. function parsePage(vuePageOptions) {
  2170. return parseBasePage(vuePageOptions);
  2171. }
  2172. function createPage(vuePageOptions) {
  2173. {
  2174. return Component(parsePage(vuePageOptions));
  2175. }
  2176. }
  2177. function createComponent(vueOptions) {
  2178. {
  2179. return Component(parseComponent(vueOptions));
  2180. }
  2181. }
  2182. function createSubpackageApp(vm) {
  2183. var appOptions = parseApp(vm);
  2184. var app = getApp({
  2185. allowDefault: true
  2186. });
  2187. vm.$scope = app;
  2188. var globalData = app.globalData;
  2189. if (globalData) {
  2190. Object.keys(appOptions.globalData).forEach(function (name) {
  2191. if (!hasOwn(globalData, name)) {
  2192. globalData[name] = appOptions.globalData[name];
  2193. }
  2194. });
  2195. }
  2196. Object.keys(appOptions).forEach(function (name) {
  2197. if (!hasOwn(app, name)) {
  2198. app[name] = appOptions[name];
  2199. }
  2200. });
  2201. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2202. wx.onAppShow(function () {
  2203. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  2204. args[_key5] = arguments[_key5];
  2205. }
  2206. vm.__call_hook('onShow', args);
  2207. });
  2208. }
  2209. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2210. wx.onAppHide(function () {
  2211. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  2212. args[_key6] = arguments[_key6];
  2213. }
  2214. vm.__call_hook('onHide', args);
  2215. });
  2216. }
  2217. if (isFn(appOptions.onLaunch)) {
  2218. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2219. vm.__call_hook('onLaunch', args);
  2220. }
  2221. return vm;
  2222. }
  2223. function createPlugin(vm) {
  2224. var appOptions = parseApp(vm);
  2225. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2226. wx.onAppShow(function () {
  2227. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  2228. args[_key7] = arguments[_key7];
  2229. }
  2230. vm.__call_hook('onShow', args);
  2231. });
  2232. }
  2233. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2234. wx.onAppHide(function () {
  2235. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  2236. args[_key8] = arguments[_key8];
  2237. }
  2238. vm.__call_hook('onHide', args);
  2239. });
  2240. }
  2241. if (isFn(appOptions.onLaunch)) {
  2242. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2243. vm.__call_hook('onLaunch', args);
  2244. }
  2245. return vm;
  2246. }
  2247. todos.forEach(function (todoApi) {
  2248. protocols[todoApi] = false;
  2249. });
  2250. canIUses.forEach(function (canIUseApi) {
  2251. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  2252. if (!wx.canIUse(apiName)) {
  2253. protocols[canIUseApi] = false;
  2254. }
  2255. });
  2256. var uni = {};
  2257. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  2258. uni = new Proxy({}, {
  2259. get: function get(target, name) {
  2260. if (hasOwn(target, name)) {
  2261. return target[name];
  2262. }
  2263. if (baseApi[name]) {
  2264. return baseApi[name];
  2265. }
  2266. if (api[name]) {
  2267. return promisify(name, api[name]);
  2268. }
  2269. {
  2270. if (extraApi[name]) {
  2271. return promisify(name, extraApi[name]);
  2272. }
  2273. if (todoApis[name]) {
  2274. return promisify(name, todoApis[name]);
  2275. }
  2276. }
  2277. if (eventApi[name]) {
  2278. return eventApi[name];
  2279. }
  2280. if (typeof wx[name] !== 'function' && !hasOwn(protocols, name)) {
  2281. return;
  2282. }
  2283. return promisify(name, wrapper(name, wx[name]));
  2284. },
  2285. set: function set(target, name, value) {
  2286. target[name] = value;
  2287. return true;
  2288. }
  2289. });
  2290. } else {
  2291. Object.keys(baseApi).forEach(function (name) {
  2292. uni[name] = baseApi[name];
  2293. });
  2294. {
  2295. Object.keys(todoApis).forEach(function (name) {
  2296. uni[name] = promisify(name, todoApis[name]);
  2297. });
  2298. Object.keys(extraApi).forEach(function (name) {
  2299. uni[name] = promisify(name, todoApis[name]);
  2300. });
  2301. }
  2302. Object.keys(eventApi).forEach(function (name) {
  2303. uni[name] = eventApi[name];
  2304. });
  2305. Object.keys(api).forEach(function (name) {
  2306. uni[name] = promisify(name, api[name]);
  2307. });
  2308. Object.keys(wx).forEach(function (name) {
  2309. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2310. uni[name] = promisify(name, wrapper(name, wx[name]));
  2311. }
  2312. });
  2313. }
  2314. wx.createApp = createApp;
  2315. wx.createPage = createPage;
  2316. wx.createComponent = createComponent;
  2317. wx.createSubpackageApp = createSubpackageApp;
  2318. wx.createPlugin = createPlugin;
  2319. var uni$1 = uni;
  2320. var _default = uni$1;
  2321. exports.default = _default;
  2322. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  2323. /***/ }),
  2324. /***/ 10:
  2325. /*!***************************************************************!*\
  2326. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  2327. \***************************************************************/
  2328. /*! no static exports found */
  2329. /***/ (function(module, exports, __webpack_require__) {
  2330. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 11);
  2331. function _defineProperty(obj, key, value) {
  2332. key = toPropertyKey(key);
  2333. if (key in obj) {
  2334. Object.defineProperty(obj, key, {
  2335. value: value,
  2336. enumerable: true,
  2337. configurable: true,
  2338. writable: true
  2339. });
  2340. } else {
  2341. obj[key] = value;
  2342. }
  2343. return obj;
  2344. }
  2345. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2346. /***/ }),
  2347. /***/ 11:
  2348. /*!**************************************************************!*\
  2349. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  2350. \**************************************************************/
  2351. /*! no static exports found */
  2352. /***/ (function(module, exports, __webpack_require__) {
  2353. var _typeof = __webpack_require__(/*! ./typeof.js */ 12)["default"];
  2354. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 13);
  2355. function _toPropertyKey(arg) {
  2356. var key = toPrimitive(arg, "string");
  2357. return _typeof(key) === "symbol" ? key : String(key);
  2358. }
  2359. module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2360. /***/ }),
  2361. /***/ 12:
  2362. /*!*******************************************************!*\
  2363. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  2364. \*******************************************************/
  2365. /*! no static exports found */
  2366. /***/ (function(module, exports) {
  2367. function _typeof(obj) {
  2368. "@babel/helpers - typeof";
  2369. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  2370. return typeof obj;
  2371. } : function (obj) {
  2372. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  2373. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
  2374. }
  2375. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2376. /***/ }),
  2377. /***/ 13:
  2378. /*!************************************************************!*\
  2379. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  2380. \************************************************************/
  2381. /*! no static exports found */
  2382. /***/ (function(module, exports, __webpack_require__) {
  2383. var _typeof = __webpack_require__(/*! ./typeof.js */ 12)["default"];
  2384. function _toPrimitive(input, hint) {
  2385. if (_typeof(input) !== "object" || input === null) return input;
  2386. var prim = input[Symbol.toPrimitive];
  2387. if (prim !== undefined) {
  2388. var res = prim.call(input, hint || "default");
  2389. if (_typeof(res) !== "object") return res;
  2390. throw new TypeError("@@toPrimitive must return a primitive value.");
  2391. }
  2392. return (hint === "string" ? String : Number)(input);
  2393. }
  2394. module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2395. /***/ }),
  2396. /***/ 14:
  2397. /*!**********************************************************!*\
  2398. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  2399. \**********************************************************/
  2400. /*! no static exports found */
  2401. /***/ (function(module, exports, __webpack_require__) {
  2402. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 15);
  2403. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 16);
  2404. function _construct(Parent, args, Class) {
  2405. if (isNativeReflectConstruct()) {
  2406. module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
  2407. } else {
  2408. module.exports = _construct = function _construct(Parent, args, Class) {
  2409. var a = [null];
  2410. a.push.apply(a, args);
  2411. var Constructor = Function.bind.apply(Parent, a);
  2412. var instance = new Constructor();
  2413. if (Class) setPrototypeOf(instance, Class.prototype);
  2414. return instance;
  2415. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2416. }
  2417. return _construct.apply(null, arguments);
  2418. }
  2419. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2420. /***/ }),
  2421. /***/ 15:
  2422. /*!***************************************************************!*\
  2423. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  2424. \***************************************************************/
  2425. /*! no static exports found */
  2426. /***/ (function(module, exports) {
  2427. function _setPrototypeOf(o, p) {
  2428. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  2429. o.__proto__ = p;
  2430. return o;
  2431. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2432. return _setPrototypeOf(o, p);
  2433. }
  2434. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2435. /***/ }),
  2436. /***/ 16:
  2437. /*!*************************************************************************!*\
  2438. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  2439. \*************************************************************************/
  2440. /*! no static exports found */
  2441. /***/ (function(module, exports) {
  2442. function _isNativeReflectConstruct() {
  2443. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  2444. if (Reflect.construct.sham) return false;
  2445. if (typeof Proxy === "function") return true;
  2446. try {
  2447. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  2448. return true;
  2449. } catch (e) {
  2450. return false;
  2451. }
  2452. }
  2453. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2454. /***/ }),
  2455. /***/ 17:
  2456. /*!******************************************************************!*\
  2457. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  2458. \******************************************************************/
  2459. /*! no static exports found */
  2460. /***/ (function(module, exports, __webpack_require__) {
  2461. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 18);
  2462. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 19);
  2463. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 7);
  2464. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 20);
  2465. function _toConsumableArray(arr) {
  2466. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  2467. }
  2468. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2469. /***/ }),
  2470. /***/ 18:
  2471. /*!******************************************************************!*\
  2472. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  2473. \******************************************************************/
  2474. /*! no static exports found */
  2475. /***/ (function(module, exports, __webpack_require__) {
  2476. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 8);
  2477. function _arrayWithoutHoles(arr) {
  2478. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  2479. }
  2480. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2481. /***/ }),
  2482. /***/ 19:
  2483. /*!****************************************************************!*\
  2484. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  2485. \****************************************************************/
  2486. /*! no static exports found */
  2487. /***/ (function(module, exports) {
  2488. function _iterableToArray(iter) {
  2489. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  2490. }
  2491. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2492. /***/ }),
  2493. /***/ 2:
  2494. /*!***********************************!*\
  2495. !*** (webpack)/buildin/global.js ***!
  2496. \***********************************/
  2497. /*! no static exports found */
  2498. /***/ (function(module, exports) {
  2499. var g;
  2500. // This works in non-strict mode
  2501. g = (function() {
  2502. return this;
  2503. })();
  2504. try {
  2505. // This works if eval is allowed (see CSP)
  2506. g = g || new Function("return this")();
  2507. } catch (e) {
  2508. // This works if the window reference is available
  2509. if (typeof window === "object") g = window;
  2510. }
  2511. // g can still be undefined, but nothing to do about it...
  2512. // We return undefined, instead of nothing here, so it's
  2513. // easier to handle this case. if(!global) { ...}
  2514. module.exports = g;
  2515. /***/ }),
  2516. /***/ 20:
  2517. /*!******************************************************************!*\
  2518. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  2519. \******************************************************************/
  2520. /*! no static exports found */
  2521. /***/ (function(module, exports) {
  2522. function _nonIterableSpread() {
  2523. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  2524. }
  2525. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2526. /***/ }),
  2527. /***/ 21:
  2528. /*!*************************************************************!*\
  2529. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  2530. \*************************************************************/
  2531. /*! no static exports found */
  2532. /***/ (function(module, exports, __webpack_require__) {
  2533. "use strict";
  2534. /* WEBPACK VAR INJECTION */(function(uni, global) {
  2535. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 3);
  2536. Object.defineProperty(exports, "__esModule", {
  2537. value: true
  2538. });
  2539. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  2540. exports.compileI18nJsonStr = compileI18nJsonStr;
  2541. exports.hasI18nJson = hasI18nJson;
  2542. exports.initVueI18n = initVueI18n;
  2543. exports.isI18nStr = isI18nStr;
  2544. exports.isString = void 0;
  2545. exports.normalizeLocale = normalizeLocale;
  2546. exports.parseI18nJson = parseI18nJson;
  2547. exports.resolveLocale = resolveLocale;
  2548. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 4));
  2549. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 22));
  2550. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 23));
  2551. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 12));
  2552. var isArray = Array.isArray;
  2553. var isObject = function isObject(val) {
  2554. return val !== null && (0, _typeof2.default)(val) === 'object';
  2555. };
  2556. var defaultDelimiters = ['{', '}'];
  2557. var BaseFormatter = /*#__PURE__*/function () {
  2558. function BaseFormatter() {
  2559. (0, _classCallCheck2.default)(this, BaseFormatter);
  2560. this._caches = Object.create(null);
  2561. }
  2562. (0, _createClass2.default)(BaseFormatter, [{
  2563. key: "interpolate",
  2564. value: function interpolate(message, values) {
  2565. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  2566. if (!values) {
  2567. return [message];
  2568. }
  2569. var tokens = this._caches[message];
  2570. if (!tokens) {
  2571. tokens = parse(message, delimiters);
  2572. this._caches[message] = tokens;
  2573. }
  2574. return compile(tokens, values);
  2575. }
  2576. }]);
  2577. return BaseFormatter;
  2578. }();
  2579. exports.Formatter = BaseFormatter;
  2580. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  2581. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  2582. function parse(format, _ref) {
  2583. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  2584. startDelimiter = _ref2[0],
  2585. endDelimiter = _ref2[1];
  2586. var tokens = [];
  2587. var position = 0;
  2588. var text = '';
  2589. while (position < format.length) {
  2590. var char = format[position++];
  2591. if (char === startDelimiter) {
  2592. if (text) {
  2593. tokens.push({
  2594. type: 'text',
  2595. value: text
  2596. });
  2597. }
  2598. text = '';
  2599. var sub = '';
  2600. char = format[position++];
  2601. while (char !== undefined && char !== endDelimiter) {
  2602. sub += char;
  2603. char = format[position++];
  2604. }
  2605. var isClosed = char === endDelimiter;
  2606. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  2607. tokens.push({
  2608. value: sub,
  2609. type: type
  2610. });
  2611. }
  2612. // else if (char === '%') {
  2613. // // when found rails i18n syntax, skip text capture
  2614. // if (format[position] !== '{') {
  2615. // text += char
  2616. // }
  2617. // }
  2618. else {
  2619. text += char;
  2620. }
  2621. }
  2622. text && tokens.push({
  2623. type: 'text',
  2624. value: text
  2625. });
  2626. return tokens;
  2627. }
  2628. function compile(tokens, values) {
  2629. var compiled = [];
  2630. var index = 0;
  2631. var mode = isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  2632. if (mode === 'unknown') {
  2633. return compiled;
  2634. }
  2635. while (index < tokens.length) {
  2636. var token = tokens[index];
  2637. switch (token.type) {
  2638. case 'text':
  2639. compiled.push(token.value);
  2640. break;
  2641. case 'list':
  2642. compiled.push(values[parseInt(token.value, 10)]);
  2643. break;
  2644. case 'named':
  2645. if (mode === 'named') {
  2646. compiled.push(values[token.value]);
  2647. } else {
  2648. if (true) {
  2649. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  2650. }
  2651. }
  2652. break;
  2653. case 'unknown':
  2654. if (true) {
  2655. console.warn("Detect 'unknown' type of token!");
  2656. }
  2657. break;
  2658. }
  2659. index++;
  2660. }
  2661. return compiled;
  2662. }
  2663. var LOCALE_ZH_HANS = 'zh-Hans';
  2664. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  2665. var LOCALE_ZH_HANT = 'zh-Hant';
  2666. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  2667. var LOCALE_EN = 'en';
  2668. exports.LOCALE_EN = LOCALE_EN;
  2669. var LOCALE_FR = 'fr';
  2670. exports.LOCALE_FR = LOCALE_FR;
  2671. var LOCALE_ES = 'es';
  2672. exports.LOCALE_ES = LOCALE_ES;
  2673. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2674. var hasOwn = function hasOwn(val, key) {
  2675. return hasOwnProperty.call(val, key);
  2676. };
  2677. var defaultFormatter = new BaseFormatter();
  2678. function include(str, parts) {
  2679. return !!parts.find(function (part) {
  2680. return str.indexOf(part) !== -1;
  2681. });
  2682. }
  2683. function startsWith(str, parts) {
  2684. return parts.find(function (part) {
  2685. return str.indexOf(part) === 0;
  2686. });
  2687. }
  2688. function normalizeLocale(locale, messages) {
  2689. if (!locale) {
  2690. return;
  2691. }
  2692. locale = locale.trim().replace(/_/g, '-');
  2693. if (messages && messages[locale]) {
  2694. return locale;
  2695. }
  2696. locale = locale.toLowerCase();
  2697. if (locale.indexOf('zh') === 0) {
  2698. if (locale.indexOf('-hans') > -1) {
  2699. return LOCALE_ZH_HANS;
  2700. }
  2701. if (locale.indexOf('-hant') > -1) {
  2702. return LOCALE_ZH_HANT;
  2703. }
  2704. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  2705. return LOCALE_ZH_HANT;
  2706. }
  2707. return LOCALE_ZH_HANS;
  2708. }
  2709. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  2710. if (lang) {
  2711. return lang;
  2712. }
  2713. }
  2714. var I18n = /*#__PURE__*/function () {
  2715. function I18n(_ref3) {
  2716. var locale = _ref3.locale,
  2717. fallbackLocale = _ref3.fallbackLocale,
  2718. messages = _ref3.messages,
  2719. watcher = _ref3.watcher,
  2720. formater = _ref3.formater;
  2721. (0, _classCallCheck2.default)(this, I18n);
  2722. this.locale = LOCALE_EN;
  2723. this.fallbackLocale = LOCALE_EN;
  2724. this.message = {};
  2725. this.messages = {};
  2726. this.watchers = [];
  2727. if (fallbackLocale) {
  2728. this.fallbackLocale = fallbackLocale;
  2729. }
  2730. this.formater = formater || defaultFormatter;
  2731. this.messages = messages || {};
  2732. this.setLocale(locale || LOCALE_EN);
  2733. if (watcher) {
  2734. this.watchLocale(watcher);
  2735. }
  2736. }
  2737. (0, _createClass2.default)(I18n, [{
  2738. key: "setLocale",
  2739. value: function setLocale(locale) {
  2740. var _this = this;
  2741. var oldLocale = this.locale;
  2742. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  2743. if (!this.messages[this.locale]) {
  2744. // 可能初始化时不存在
  2745. this.messages[this.locale] = {};
  2746. }
  2747. this.message = this.messages[this.locale];
  2748. // 仅发生变化时,通知
  2749. if (oldLocale !== this.locale) {
  2750. this.watchers.forEach(function (watcher) {
  2751. watcher(_this.locale, oldLocale);
  2752. });
  2753. }
  2754. }
  2755. }, {
  2756. key: "getLocale",
  2757. value: function getLocale() {
  2758. return this.locale;
  2759. }
  2760. }, {
  2761. key: "watchLocale",
  2762. value: function watchLocale(fn) {
  2763. var _this2 = this;
  2764. var index = this.watchers.push(fn) - 1;
  2765. return function () {
  2766. _this2.watchers.splice(index, 1);
  2767. };
  2768. }
  2769. }, {
  2770. key: "add",
  2771. value: function add(locale, message) {
  2772. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  2773. var curMessages = this.messages[locale];
  2774. if (curMessages) {
  2775. if (override) {
  2776. Object.assign(curMessages, message);
  2777. } else {
  2778. Object.keys(message).forEach(function (key) {
  2779. if (!hasOwn(curMessages, key)) {
  2780. curMessages[key] = message[key];
  2781. }
  2782. });
  2783. }
  2784. } else {
  2785. this.messages[locale] = message;
  2786. }
  2787. }
  2788. }, {
  2789. key: "f",
  2790. value: function f(message, values, delimiters) {
  2791. return this.formater.interpolate(message, values, delimiters).join('');
  2792. }
  2793. }, {
  2794. key: "t",
  2795. value: function t(key, locale, values) {
  2796. var message = this.message;
  2797. if (typeof locale === 'string') {
  2798. locale = normalizeLocale(locale, this.messages);
  2799. locale && (message = this.messages[locale]);
  2800. } else {
  2801. values = locale;
  2802. }
  2803. if (!hasOwn(message, key)) {
  2804. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  2805. return key;
  2806. }
  2807. return this.formater.interpolate(message[key], values).join('');
  2808. }
  2809. }]);
  2810. return I18n;
  2811. }();
  2812. exports.I18n = I18n;
  2813. function watchAppLocale(appVm, i18n) {
  2814. // 需要保证 watch 的触发在组件渲染之前
  2815. if (appVm.$watchLocale) {
  2816. // vue2
  2817. appVm.$watchLocale(function (newLocale) {
  2818. i18n.setLocale(newLocale);
  2819. });
  2820. } else {
  2821. appVm.$watch(function () {
  2822. return appVm.$locale;
  2823. }, function (newLocale) {
  2824. i18n.setLocale(newLocale);
  2825. });
  2826. }
  2827. }
  2828. function getDefaultLocale() {
  2829. if (typeof uni !== 'undefined' && uni.getLocale) {
  2830. return uni.getLocale();
  2831. }
  2832. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  2833. if (typeof global !== 'undefined' && global.getLocale) {
  2834. return global.getLocale();
  2835. }
  2836. return LOCALE_EN;
  2837. }
  2838. function initVueI18n(locale) {
  2839. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  2840. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  2841. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  2842. // 兼容旧版本入参
  2843. if (typeof locale !== 'string') {
  2844. var _ref4 = [messages, locale];
  2845. locale = _ref4[0];
  2846. messages = _ref4[1];
  2847. }
  2848. if (typeof locale !== 'string') {
  2849. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  2850. locale = getDefaultLocale();
  2851. }
  2852. if (typeof fallbackLocale !== 'string') {
  2853. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  2854. }
  2855. var i18n = new I18n({
  2856. locale: locale,
  2857. fallbackLocale: fallbackLocale,
  2858. messages: messages,
  2859. watcher: watcher
  2860. });
  2861. var _t = function t(key, values) {
  2862. if (typeof getApp !== 'function') {
  2863. // app view
  2864. /* eslint-disable no-func-assign */
  2865. _t = function t(key, values) {
  2866. return i18n.t(key, values);
  2867. };
  2868. } else {
  2869. var isWatchedAppLocale = false;
  2870. _t = function t(key, values) {
  2871. var appVm = getApp().$vm;
  2872. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  2873. // options: {
  2874. // type: Array,
  2875. // default () {
  2876. // return [{
  2877. // icon: 'shop',
  2878. // text: t("uni-goods-nav.options.shop"),
  2879. // }, {
  2880. // icon: 'cart',
  2881. // text: t("uni-goods-nav.options.cart")
  2882. // }]
  2883. // }
  2884. // },
  2885. if (appVm) {
  2886. // 触发响应式
  2887. appVm.$locale;
  2888. if (!isWatchedAppLocale) {
  2889. isWatchedAppLocale = true;
  2890. watchAppLocale(appVm, i18n);
  2891. }
  2892. }
  2893. return i18n.t(key, values);
  2894. };
  2895. }
  2896. return _t(key, values);
  2897. };
  2898. return {
  2899. i18n: i18n,
  2900. f: function f(message, values, delimiters) {
  2901. return i18n.f(message, values, delimiters);
  2902. },
  2903. t: function t(key, values) {
  2904. return _t(key, values);
  2905. },
  2906. add: function add(locale, message) {
  2907. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  2908. return i18n.add(locale, message, override);
  2909. },
  2910. watch: function watch(fn) {
  2911. return i18n.watchLocale(fn);
  2912. },
  2913. getLocale: function getLocale() {
  2914. return i18n.getLocale();
  2915. },
  2916. setLocale: function setLocale(newLocale) {
  2917. return i18n.setLocale(newLocale);
  2918. }
  2919. };
  2920. }
  2921. var isString = function isString(val) {
  2922. return typeof val === 'string';
  2923. };
  2924. exports.isString = isString;
  2925. var formater;
  2926. function hasI18nJson(jsonObj, delimiters) {
  2927. if (!formater) {
  2928. formater = new BaseFormatter();
  2929. }
  2930. return walkJsonObj(jsonObj, function (jsonObj, key) {
  2931. var value = jsonObj[key];
  2932. if (isString(value)) {
  2933. if (isI18nStr(value, delimiters)) {
  2934. return true;
  2935. }
  2936. } else {
  2937. return hasI18nJson(value, delimiters);
  2938. }
  2939. });
  2940. }
  2941. function parseI18nJson(jsonObj, values, delimiters) {
  2942. if (!formater) {
  2943. formater = new BaseFormatter();
  2944. }
  2945. walkJsonObj(jsonObj, function (jsonObj, key) {
  2946. var value = jsonObj[key];
  2947. if (isString(value)) {
  2948. if (isI18nStr(value, delimiters)) {
  2949. jsonObj[key] = compileStr(value, values, delimiters);
  2950. }
  2951. } else {
  2952. parseI18nJson(value, values, delimiters);
  2953. }
  2954. });
  2955. return jsonObj;
  2956. }
  2957. function compileI18nJsonStr(jsonStr, _ref5) {
  2958. var locale = _ref5.locale,
  2959. locales = _ref5.locales,
  2960. delimiters = _ref5.delimiters;
  2961. if (!isI18nStr(jsonStr, delimiters)) {
  2962. return jsonStr;
  2963. }
  2964. if (!formater) {
  2965. formater = new BaseFormatter();
  2966. }
  2967. var localeValues = [];
  2968. Object.keys(locales).forEach(function (name) {
  2969. if (name !== locale) {
  2970. localeValues.push({
  2971. locale: name,
  2972. values: locales[name]
  2973. });
  2974. }
  2975. });
  2976. localeValues.unshift({
  2977. locale: locale,
  2978. values: locales[locale]
  2979. });
  2980. try {
  2981. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  2982. } catch (e) {}
  2983. return jsonStr;
  2984. }
  2985. function isI18nStr(value, delimiters) {
  2986. return value.indexOf(delimiters[0]) > -1;
  2987. }
  2988. function compileStr(value, values, delimiters) {
  2989. return formater.interpolate(value, values, delimiters).join('');
  2990. }
  2991. function compileValue(jsonObj, key, localeValues, delimiters) {
  2992. var value = jsonObj[key];
  2993. if (isString(value)) {
  2994. // 存在国际化
  2995. if (isI18nStr(value, delimiters)) {
  2996. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  2997. if (localeValues.length > 1) {
  2998. // 格式化国际化语言
  2999. var valueLocales = jsonObj[key + 'Locales'] = {};
  3000. localeValues.forEach(function (localValue) {
  3001. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  3002. });
  3003. }
  3004. }
  3005. } else {
  3006. compileJsonObj(value, localeValues, delimiters);
  3007. }
  3008. }
  3009. function compileJsonObj(jsonObj, localeValues, delimiters) {
  3010. walkJsonObj(jsonObj, function (jsonObj, key) {
  3011. compileValue(jsonObj, key, localeValues, delimiters);
  3012. });
  3013. return jsonObj;
  3014. }
  3015. function walkJsonObj(jsonObj, walk) {
  3016. if (isArray(jsonObj)) {
  3017. for (var i = 0; i < jsonObj.length; i++) {
  3018. if (walk(jsonObj, i)) {
  3019. return true;
  3020. }
  3021. }
  3022. } else if (isObject(jsonObj)) {
  3023. for (var key in jsonObj) {
  3024. if (walk(jsonObj, key)) {
  3025. return true;
  3026. }
  3027. }
  3028. }
  3029. return false;
  3030. }
  3031. function resolveLocale(locales) {
  3032. return function (locale) {
  3033. if (!locale) {
  3034. return locale;
  3035. }
  3036. locale = normalizeLocale(locale) || locale;
  3037. return resolveLocaleChain(locale).find(function (locale) {
  3038. return locales.indexOf(locale) > -1;
  3039. });
  3040. };
  3041. }
  3042. function resolveLocaleChain(locale) {
  3043. var chain = [];
  3044. var tokens = locale.split('-');
  3045. while (tokens.length) {
  3046. chain.push(tokens.join('-'));
  3047. tokens.pop();
  3048. }
  3049. return chain;
  3050. }
  3051. /* 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)))
  3052. /***/ }),
  3053. /***/ 22:
  3054. /*!***************************************************************!*\
  3055. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  3056. \***************************************************************/
  3057. /*! no static exports found */
  3058. /***/ (function(module, exports) {
  3059. function _classCallCheck(instance, Constructor) {
  3060. if (!(instance instanceof Constructor)) {
  3061. throw new TypeError("Cannot call a class as a function");
  3062. }
  3063. }
  3064. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3065. /***/ }),
  3066. /***/ 23:
  3067. /*!************************************************************!*\
  3068. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  3069. \************************************************************/
  3070. /*! no static exports found */
  3071. /***/ (function(module, exports, __webpack_require__) {
  3072. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 11);
  3073. function _defineProperties(target, props) {
  3074. for (var i = 0; i < props.length; i++) {
  3075. var descriptor = props[i];
  3076. descriptor.enumerable = descriptor.enumerable || false;
  3077. descriptor.configurable = true;
  3078. if ("value" in descriptor) descriptor.writable = true;
  3079. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  3080. }
  3081. }
  3082. function _createClass(Constructor, protoProps, staticProps) {
  3083. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  3084. if (staticProps) _defineProperties(Constructor, staticProps);
  3085. Object.defineProperty(Constructor, "prototype", {
  3086. writable: false
  3087. });
  3088. return Constructor;
  3089. }
  3090. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3091. /***/ }),
  3092. /***/ 24:
  3093. /*!******************************************************************************************!*\
  3094. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3095. \******************************************************************************************/
  3096. /*! exports provided: default */
  3097. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3098. "use strict";
  3099. __webpack_require__.r(__webpack_exports__);
  3100. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3101. * Vue.js v2.6.11
  3102. * (c) 2014-2022 Evan You
  3103. * Released under the MIT License.
  3104. */
  3105. /* */
  3106. var emptyObject = Object.freeze({});
  3107. // These helpers produce better VM code in JS engines due to their
  3108. // explicitness and function inlining.
  3109. function isUndef (v) {
  3110. return v === undefined || v === null
  3111. }
  3112. function isDef (v) {
  3113. return v !== undefined && v !== null
  3114. }
  3115. function isTrue (v) {
  3116. return v === true
  3117. }
  3118. function isFalse (v) {
  3119. return v === false
  3120. }
  3121. /**
  3122. * Check if value is primitive.
  3123. */
  3124. function isPrimitive (value) {
  3125. return (
  3126. typeof value === 'string' ||
  3127. typeof value === 'number' ||
  3128. // $flow-disable-line
  3129. typeof value === 'symbol' ||
  3130. typeof value === 'boolean'
  3131. )
  3132. }
  3133. /**
  3134. * Quick object check - this is primarily used to tell
  3135. * Objects from primitive values when we know the value
  3136. * is a JSON-compliant type.
  3137. */
  3138. function isObject (obj) {
  3139. return obj !== null && typeof obj === 'object'
  3140. }
  3141. /**
  3142. * Get the raw type string of a value, e.g., [object Object].
  3143. */
  3144. var _toString = Object.prototype.toString;
  3145. function toRawType (value) {
  3146. return _toString.call(value).slice(8, -1)
  3147. }
  3148. /**
  3149. * Strict object type check. Only returns true
  3150. * for plain JavaScript objects.
  3151. */
  3152. function isPlainObject (obj) {
  3153. return _toString.call(obj) === '[object Object]'
  3154. }
  3155. function isRegExp (v) {
  3156. return _toString.call(v) === '[object RegExp]'
  3157. }
  3158. /**
  3159. * Check if val is a valid array index.
  3160. */
  3161. function isValidArrayIndex (val) {
  3162. var n = parseFloat(String(val));
  3163. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3164. }
  3165. function isPromise (val) {
  3166. return (
  3167. isDef(val) &&
  3168. typeof val.then === 'function' &&
  3169. typeof val.catch === 'function'
  3170. )
  3171. }
  3172. /**
  3173. * Convert a value to a string that is actually rendered.
  3174. */
  3175. function toString (val) {
  3176. return val == null
  3177. ? ''
  3178. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3179. ? JSON.stringify(val, null, 2)
  3180. : String(val)
  3181. }
  3182. /**
  3183. * Convert an input value to a number for persistence.
  3184. * If the conversion fails, return original string.
  3185. */
  3186. function toNumber (val) {
  3187. var n = parseFloat(val);
  3188. return isNaN(n) ? val : n
  3189. }
  3190. /**
  3191. * Make a map and return a function for checking if a key
  3192. * is in that map.
  3193. */
  3194. function makeMap (
  3195. str,
  3196. expectsLowerCase
  3197. ) {
  3198. var map = Object.create(null);
  3199. var list = str.split(',');
  3200. for (var i = 0; i < list.length; i++) {
  3201. map[list[i]] = true;
  3202. }
  3203. return expectsLowerCase
  3204. ? function (val) { return map[val.toLowerCase()]; }
  3205. : function (val) { return map[val]; }
  3206. }
  3207. /**
  3208. * Check if a tag is a built-in tag.
  3209. */
  3210. var isBuiltInTag = makeMap('slot,component', true);
  3211. /**
  3212. * Check if an attribute is a reserved attribute.
  3213. */
  3214. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  3215. /**
  3216. * Remove an item from an array.
  3217. */
  3218. function remove (arr, item) {
  3219. if (arr.length) {
  3220. var index = arr.indexOf(item);
  3221. if (index > -1) {
  3222. return arr.splice(index, 1)
  3223. }
  3224. }
  3225. }
  3226. /**
  3227. * Check whether an object has the property.
  3228. */
  3229. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3230. function hasOwn (obj, key) {
  3231. return hasOwnProperty.call(obj, key)
  3232. }
  3233. /**
  3234. * Create a cached version of a pure function.
  3235. */
  3236. function cached (fn) {
  3237. var cache = Object.create(null);
  3238. return (function cachedFn (str) {
  3239. var hit = cache[str];
  3240. return hit || (cache[str] = fn(str))
  3241. })
  3242. }
  3243. /**
  3244. * Camelize a hyphen-delimited string.
  3245. */
  3246. var camelizeRE = /-(\w)/g;
  3247. var camelize = cached(function (str) {
  3248. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3249. });
  3250. /**
  3251. * Capitalize a string.
  3252. */
  3253. var capitalize = cached(function (str) {
  3254. return str.charAt(0).toUpperCase() + str.slice(1)
  3255. });
  3256. /**
  3257. * Hyphenate a camelCase string.
  3258. */
  3259. var hyphenateRE = /\B([A-Z])/g;
  3260. var hyphenate = cached(function (str) {
  3261. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3262. });
  3263. /**
  3264. * Simple bind polyfill for environments that do not support it,
  3265. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3266. * since native bind is now performant enough in most browsers.
  3267. * But removing it would mean breaking code that was able to run in
  3268. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3269. */
  3270. /* istanbul ignore next */
  3271. function polyfillBind (fn, ctx) {
  3272. function boundFn (a) {
  3273. var l = arguments.length;
  3274. return l
  3275. ? l > 1
  3276. ? fn.apply(ctx, arguments)
  3277. : fn.call(ctx, a)
  3278. : fn.call(ctx)
  3279. }
  3280. boundFn._length = fn.length;
  3281. return boundFn
  3282. }
  3283. function nativeBind (fn, ctx) {
  3284. return fn.bind(ctx)
  3285. }
  3286. var bind = Function.prototype.bind
  3287. ? nativeBind
  3288. : polyfillBind;
  3289. /**
  3290. * Convert an Array-like object to a real Array.
  3291. */
  3292. function toArray (list, start) {
  3293. start = start || 0;
  3294. var i = list.length - start;
  3295. var ret = new Array(i);
  3296. while (i--) {
  3297. ret[i] = list[i + start];
  3298. }
  3299. return ret
  3300. }
  3301. /**
  3302. * Mix properties into target object.
  3303. */
  3304. function extend (to, _from) {
  3305. for (var key in _from) {
  3306. to[key] = _from[key];
  3307. }
  3308. return to
  3309. }
  3310. /**
  3311. * Merge an Array of Objects into a single Object.
  3312. */
  3313. function toObject (arr) {
  3314. var res = {};
  3315. for (var i = 0; i < arr.length; i++) {
  3316. if (arr[i]) {
  3317. extend(res, arr[i]);
  3318. }
  3319. }
  3320. return res
  3321. }
  3322. /* eslint-disable no-unused-vars */
  3323. /**
  3324. * Perform no operation.
  3325. * Stubbing args to make Flow happy without leaving useless transpiled code
  3326. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3327. */
  3328. function noop (a, b, c) {}
  3329. /**
  3330. * Always return false.
  3331. */
  3332. var no = function (a, b, c) { return false; };
  3333. /* eslint-enable no-unused-vars */
  3334. /**
  3335. * Return the same value.
  3336. */
  3337. var identity = function (_) { return _; };
  3338. /**
  3339. * Check if two values are loosely equal - that is,
  3340. * if they are plain objects, do they have the same shape?
  3341. */
  3342. function looseEqual (a, b) {
  3343. if (a === b) { return true }
  3344. var isObjectA = isObject(a);
  3345. var isObjectB = isObject(b);
  3346. if (isObjectA && isObjectB) {
  3347. try {
  3348. var isArrayA = Array.isArray(a);
  3349. var isArrayB = Array.isArray(b);
  3350. if (isArrayA && isArrayB) {
  3351. return a.length === b.length && a.every(function (e, i) {
  3352. return looseEqual(e, b[i])
  3353. })
  3354. } else if (a instanceof Date && b instanceof Date) {
  3355. return a.getTime() === b.getTime()
  3356. } else if (!isArrayA && !isArrayB) {
  3357. var keysA = Object.keys(a);
  3358. var keysB = Object.keys(b);
  3359. return keysA.length === keysB.length && keysA.every(function (key) {
  3360. return looseEqual(a[key], b[key])
  3361. })
  3362. } else {
  3363. /* istanbul ignore next */
  3364. return false
  3365. }
  3366. } catch (e) {
  3367. /* istanbul ignore next */
  3368. return false
  3369. }
  3370. } else if (!isObjectA && !isObjectB) {
  3371. return String(a) === String(b)
  3372. } else {
  3373. return false
  3374. }
  3375. }
  3376. /**
  3377. * Return the first index at which a loosely equal value can be
  3378. * found in the array (if value is a plain object, the array must
  3379. * contain an object of the same shape), or -1 if it is not present.
  3380. */
  3381. function looseIndexOf (arr, val) {
  3382. for (var i = 0; i < arr.length; i++) {
  3383. if (looseEqual(arr[i], val)) { return i }
  3384. }
  3385. return -1
  3386. }
  3387. /**
  3388. * Ensure a function is called only once.
  3389. */
  3390. function once (fn) {
  3391. var called = false;
  3392. return function () {
  3393. if (!called) {
  3394. called = true;
  3395. fn.apply(this, arguments);
  3396. }
  3397. }
  3398. }
  3399. var ASSET_TYPES = [
  3400. 'component',
  3401. 'directive',
  3402. 'filter'
  3403. ];
  3404. var LIFECYCLE_HOOKS = [
  3405. 'beforeCreate',
  3406. 'created',
  3407. 'beforeMount',
  3408. 'mounted',
  3409. 'beforeUpdate',
  3410. 'updated',
  3411. 'beforeDestroy',
  3412. 'destroyed',
  3413. 'activated',
  3414. 'deactivated',
  3415. 'errorCaptured',
  3416. 'serverPrefetch'
  3417. ];
  3418. /* */
  3419. var config = ({
  3420. /**
  3421. * Option merge strategies (used in core/util/options)
  3422. */
  3423. // $flow-disable-line
  3424. optionMergeStrategies: Object.create(null),
  3425. /**
  3426. * Whether to suppress warnings.
  3427. */
  3428. silent: false,
  3429. /**
  3430. * Show production mode tip message on boot?
  3431. */
  3432. productionTip: "development" !== 'production',
  3433. /**
  3434. * Whether to enable devtools
  3435. */
  3436. devtools: "development" !== 'production',
  3437. /**
  3438. * Whether to record perf
  3439. */
  3440. performance: false,
  3441. /**
  3442. * Error handler for watcher errors
  3443. */
  3444. errorHandler: null,
  3445. /**
  3446. * Warn handler for watcher warns
  3447. */
  3448. warnHandler: null,
  3449. /**
  3450. * Ignore certain custom elements
  3451. */
  3452. ignoredElements: [],
  3453. /**
  3454. * Custom user key aliases for v-on
  3455. */
  3456. // $flow-disable-line
  3457. keyCodes: Object.create(null),
  3458. /**
  3459. * Check if a tag is reserved so that it cannot be registered as a
  3460. * component. This is platform-dependent and may be overwritten.
  3461. */
  3462. isReservedTag: no,
  3463. /**
  3464. * Check if an attribute is reserved so that it cannot be used as a component
  3465. * prop. This is platform-dependent and may be overwritten.
  3466. */
  3467. isReservedAttr: no,
  3468. /**
  3469. * Check if a tag is an unknown element.
  3470. * Platform-dependent.
  3471. */
  3472. isUnknownElement: no,
  3473. /**
  3474. * Get the namespace of an element
  3475. */
  3476. getTagNamespace: noop,
  3477. /**
  3478. * Parse the real tag name for the specific platform.
  3479. */
  3480. parsePlatformTagName: identity,
  3481. /**
  3482. * Check if an attribute must be bound using property, e.g. value
  3483. * Platform-dependent.
  3484. */
  3485. mustUseProp: no,
  3486. /**
  3487. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  3488. * This will significantly reduce performance if set to false.
  3489. */
  3490. async: true,
  3491. /**
  3492. * Exposed for legacy reasons
  3493. */
  3494. _lifecycleHooks: LIFECYCLE_HOOKS
  3495. });
  3496. /* */
  3497. /**
  3498. * unicode letters used for parsing html tags, component names and property paths.
  3499. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  3500. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  3501. */
  3502. 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/;
  3503. /**
  3504. * Check if a string starts with $ or _
  3505. */
  3506. function isReserved (str) {
  3507. var c = (str + '').charCodeAt(0);
  3508. return c === 0x24 || c === 0x5F
  3509. }
  3510. /**
  3511. * Define a property.
  3512. */
  3513. function def (obj, key, val, enumerable) {
  3514. Object.defineProperty(obj, key, {
  3515. value: val,
  3516. enumerable: !!enumerable,
  3517. writable: true,
  3518. configurable: true
  3519. });
  3520. }
  3521. /**
  3522. * Parse simple path.
  3523. */
  3524. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  3525. function parsePath (path) {
  3526. if (bailRE.test(path)) {
  3527. return
  3528. }
  3529. var segments = path.split('.');
  3530. return function (obj) {
  3531. for (var i = 0; i < segments.length; i++) {
  3532. if (!obj) { return }
  3533. obj = obj[segments[i]];
  3534. }
  3535. return obj
  3536. }
  3537. }
  3538. /* */
  3539. // can we use __proto__?
  3540. var hasProto = '__proto__' in {};
  3541. // Browser environment sniffing
  3542. var inBrowser = typeof window !== 'undefined';
  3543. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  3544. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  3545. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  3546. var isIE = UA && /msie|trident/.test(UA);
  3547. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  3548. var isEdge = UA && UA.indexOf('edge/') > 0;
  3549. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  3550. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  3551. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  3552. var isPhantomJS = UA && /phantomjs/.test(UA);
  3553. var isFF = UA && UA.match(/firefox\/(\d+)/);
  3554. // Firefox has a "watch" function on Object.prototype...
  3555. var nativeWatch = ({}).watch;
  3556. if (inBrowser) {
  3557. try {
  3558. var opts = {};
  3559. Object.defineProperty(opts, 'passive', ({
  3560. get: function get () {
  3561. }
  3562. })); // https://github.com/facebook/flow/issues/285
  3563. window.addEventListener('test-passive', null, opts);
  3564. } catch (e) {}
  3565. }
  3566. // this needs to be lazy-evaled because vue may be required before
  3567. // vue-server-renderer can set VUE_ENV
  3568. var _isServer;
  3569. var isServerRendering = function () {
  3570. if (_isServer === undefined) {
  3571. /* istanbul ignore if */
  3572. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  3573. // detect presence of vue-server-renderer and avoid
  3574. // Webpack shimming the process
  3575. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  3576. } else {
  3577. _isServer = false;
  3578. }
  3579. }
  3580. return _isServer
  3581. };
  3582. // detect devtools
  3583. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3584. /* istanbul ignore next */
  3585. function isNative (Ctor) {
  3586. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  3587. }
  3588. var hasSymbol =
  3589. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  3590. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  3591. var _Set;
  3592. /* istanbul ignore if */ // $flow-disable-line
  3593. if (typeof Set !== 'undefined' && isNative(Set)) {
  3594. // use native Set when available.
  3595. _Set = Set;
  3596. } else {
  3597. // a non-standard Set polyfill that only works with primitive keys.
  3598. _Set = /*@__PURE__*/(function () {
  3599. function Set () {
  3600. this.set = Object.create(null);
  3601. }
  3602. Set.prototype.has = function has (key) {
  3603. return this.set[key] === true
  3604. };
  3605. Set.prototype.add = function add (key) {
  3606. this.set[key] = true;
  3607. };
  3608. Set.prototype.clear = function clear () {
  3609. this.set = Object.create(null);
  3610. };
  3611. return Set;
  3612. }());
  3613. }
  3614. /* */
  3615. var warn = noop;
  3616. var tip = noop;
  3617. var generateComponentTrace = (noop); // work around flow check
  3618. var formatComponentName = (noop);
  3619. if (true) {
  3620. var hasConsole = typeof console !== 'undefined';
  3621. var classifyRE = /(?:^|[-_])(\w)/g;
  3622. var classify = function (str) { return str
  3623. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  3624. .replace(/[-_]/g, ''); };
  3625. warn = function (msg, vm) {
  3626. var trace = vm ? generateComponentTrace(vm) : '';
  3627. if (config.warnHandler) {
  3628. config.warnHandler.call(null, msg, vm, trace);
  3629. } else if (hasConsole && (!config.silent)) {
  3630. console.error(("[Vue warn]: " + msg + trace));
  3631. }
  3632. };
  3633. tip = function (msg, vm) {
  3634. if (hasConsole && (!config.silent)) {
  3635. console.warn("[Vue tip]: " + msg + (
  3636. vm ? generateComponentTrace(vm) : ''
  3637. ));
  3638. }
  3639. };
  3640. formatComponentName = function (vm, includeFile) {
  3641. if (vm.$root === vm) {
  3642. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  3643. return ('') + vm.$options.__file
  3644. }
  3645. return '<Root>'
  3646. }
  3647. var options = typeof vm === 'function' && vm.cid != null
  3648. ? vm.options
  3649. : vm._isVue
  3650. ? vm.$options || vm.constructor.options
  3651. : vm;
  3652. var name = options.name || options._componentTag;
  3653. var file = options.__file;
  3654. if (!name && file) {
  3655. var match = file.match(/([^/\\]+)\.vue$/);
  3656. name = match && match[1];
  3657. }
  3658. return (
  3659. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  3660. (file && includeFile !== false ? (" at " + file) : '')
  3661. )
  3662. };
  3663. var repeat = function (str, n) {
  3664. var res = '';
  3665. while (n) {
  3666. if (n % 2 === 1) { res += str; }
  3667. if (n > 1) { str += str; }
  3668. n >>= 1;
  3669. }
  3670. return res
  3671. };
  3672. generateComponentTrace = function (vm) {
  3673. if (vm._isVue && vm.$parent) {
  3674. var tree = [];
  3675. var currentRecursiveSequence = 0;
  3676. while (vm && vm.$options.name !== 'PageBody') {
  3677. if (tree.length > 0) {
  3678. var last = tree[tree.length - 1];
  3679. if (last.constructor === vm.constructor) {
  3680. currentRecursiveSequence++;
  3681. vm = vm.$parent;
  3682. continue
  3683. } else if (currentRecursiveSequence > 0) {
  3684. tree[tree.length - 1] = [last, currentRecursiveSequence];
  3685. currentRecursiveSequence = 0;
  3686. }
  3687. }
  3688. !vm.$options.isReserved && tree.push(vm);
  3689. vm = vm.$parent;
  3690. }
  3691. return '\n\nfound in\n\n' + tree
  3692. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  3693. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  3694. : formatComponentName(vm))); })
  3695. .join('\n')
  3696. } else {
  3697. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  3698. }
  3699. };
  3700. }
  3701. /* */
  3702. var uid = 0;
  3703. /**
  3704. * A dep is an observable that can have multiple
  3705. * directives subscribing to it.
  3706. */
  3707. var Dep = function Dep () {
  3708. this.id = uid++;
  3709. this.subs = [];
  3710. };
  3711. Dep.prototype.addSub = function addSub (sub) {
  3712. this.subs.push(sub);
  3713. };
  3714. Dep.prototype.removeSub = function removeSub (sub) {
  3715. remove(this.subs, sub);
  3716. };
  3717. Dep.prototype.depend = function depend () {
  3718. if (Dep.SharedObject.target) {
  3719. Dep.SharedObject.target.addDep(this);
  3720. }
  3721. };
  3722. Dep.prototype.notify = function notify () {
  3723. // stabilize the subscriber list first
  3724. var subs = this.subs.slice();
  3725. if ( true && !config.async) {
  3726. // subs aren't sorted in scheduler if not running async
  3727. // we need to sort them now to make sure they fire in correct
  3728. // order
  3729. subs.sort(function (a, b) { return a.id - b.id; });
  3730. }
  3731. for (var i = 0, l = subs.length; i < l; i++) {
  3732. subs[i].update();
  3733. }
  3734. };
  3735. // The current target watcher being evaluated.
  3736. // This is globally unique because only one watcher
  3737. // can be evaluated at a time.
  3738. // fixed by xxxxxx (nvue shared vuex)
  3739. /* eslint-disable no-undef */
  3740. Dep.SharedObject = {};
  3741. Dep.SharedObject.target = null;
  3742. Dep.SharedObject.targetStack = [];
  3743. function pushTarget (target) {
  3744. Dep.SharedObject.targetStack.push(target);
  3745. Dep.SharedObject.target = target;
  3746. Dep.target = target;
  3747. }
  3748. function popTarget () {
  3749. Dep.SharedObject.targetStack.pop();
  3750. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  3751. Dep.target = Dep.SharedObject.target;
  3752. }
  3753. /* */
  3754. var VNode = function VNode (
  3755. tag,
  3756. data,
  3757. children,
  3758. text,
  3759. elm,
  3760. context,
  3761. componentOptions,
  3762. asyncFactory
  3763. ) {
  3764. this.tag = tag;
  3765. this.data = data;
  3766. this.children = children;
  3767. this.text = text;
  3768. this.elm = elm;
  3769. this.ns = undefined;
  3770. this.context = context;
  3771. this.fnContext = undefined;
  3772. this.fnOptions = undefined;
  3773. this.fnScopeId = undefined;
  3774. this.key = data && data.key;
  3775. this.componentOptions = componentOptions;
  3776. this.componentInstance = undefined;
  3777. this.parent = undefined;
  3778. this.raw = false;
  3779. this.isStatic = false;
  3780. this.isRootInsert = true;
  3781. this.isComment = false;
  3782. this.isCloned = false;
  3783. this.isOnce = false;
  3784. this.asyncFactory = asyncFactory;
  3785. this.asyncMeta = undefined;
  3786. this.isAsyncPlaceholder = false;
  3787. };
  3788. var prototypeAccessors = { child: { configurable: true } };
  3789. // DEPRECATED: alias for componentInstance for backwards compat.
  3790. /* istanbul ignore next */
  3791. prototypeAccessors.child.get = function () {
  3792. return this.componentInstance
  3793. };
  3794. Object.defineProperties( VNode.prototype, prototypeAccessors );
  3795. var createEmptyVNode = function (text) {
  3796. if ( text === void 0 ) text = '';
  3797. var node = new VNode();
  3798. node.text = text;
  3799. node.isComment = true;
  3800. return node
  3801. };
  3802. function createTextVNode (val) {
  3803. return new VNode(undefined, undefined, undefined, String(val))
  3804. }
  3805. // optimized shallow clone
  3806. // used for static nodes and slot nodes because they may be reused across
  3807. // multiple renders, cloning them avoids errors when DOM manipulations rely
  3808. // on their elm reference.
  3809. function cloneVNode (vnode) {
  3810. var cloned = new VNode(
  3811. vnode.tag,
  3812. vnode.data,
  3813. // #7975
  3814. // clone children array to avoid mutating original in case of cloning
  3815. // a child.
  3816. vnode.children && vnode.children.slice(),
  3817. vnode.text,
  3818. vnode.elm,
  3819. vnode.context,
  3820. vnode.componentOptions,
  3821. vnode.asyncFactory
  3822. );
  3823. cloned.ns = vnode.ns;
  3824. cloned.isStatic = vnode.isStatic;
  3825. cloned.key = vnode.key;
  3826. cloned.isComment = vnode.isComment;
  3827. cloned.fnContext = vnode.fnContext;
  3828. cloned.fnOptions = vnode.fnOptions;
  3829. cloned.fnScopeId = vnode.fnScopeId;
  3830. cloned.asyncMeta = vnode.asyncMeta;
  3831. cloned.isCloned = true;
  3832. return cloned
  3833. }
  3834. /*
  3835. * not type checking this file because flow doesn't play well with
  3836. * dynamically accessing methods on Array prototype
  3837. */
  3838. var arrayProto = Array.prototype;
  3839. var arrayMethods = Object.create(arrayProto);
  3840. var methodsToPatch = [
  3841. 'push',
  3842. 'pop',
  3843. 'shift',
  3844. 'unshift',
  3845. 'splice',
  3846. 'sort',
  3847. 'reverse'
  3848. ];
  3849. /**
  3850. * Intercept mutating methods and emit events
  3851. */
  3852. methodsToPatch.forEach(function (method) {
  3853. // cache original method
  3854. var original = arrayProto[method];
  3855. def(arrayMethods, method, function mutator () {
  3856. var args = [], len = arguments.length;
  3857. while ( len-- ) args[ len ] = arguments[ len ];
  3858. var result = original.apply(this, args);
  3859. var ob = this.__ob__;
  3860. var inserted;
  3861. switch (method) {
  3862. case 'push':
  3863. case 'unshift':
  3864. inserted = args;
  3865. break
  3866. case 'splice':
  3867. inserted = args.slice(2);
  3868. break
  3869. }
  3870. if (inserted) { ob.observeArray(inserted); }
  3871. // notify change
  3872. ob.dep.notify();
  3873. return result
  3874. });
  3875. });
  3876. /* */
  3877. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  3878. /**
  3879. * In some cases we may want to disable observation inside a component's
  3880. * update computation.
  3881. */
  3882. var shouldObserve = true;
  3883. function toggleObserving (value) {
  3884. shouldObserve = value;
  3885. }
  3886. /**
  3887. * Observer class that is attached to each observed
  3888. * object. Once attached, the observer converts the target
  3889. * object's property keys into getter/setters that
  3890. * collect dependencies and dispatch updates.
  3891. */
  3892. var Observer = function Observer (value) {
  3893. this.value = value;
  3894. this.dep = new Dep();
  3895. this.vmCount = 0;
  3896. def(value, '__ob__', this);
  3897. if (Array.isArray(value)) {
  3898. if (hasProto) {
  3899. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  3900. if(value.push !== value.__proto__.push){
  3901. copyAugment(value, arrayMethods, arrayKeys);
  3902. } else {
  3903. protoAugment(value, arrayMethods);
  3904. }
  3905. }
  3906. } else {
  3907. copyAugment(value, arrayMethods, arrayKeys);
  3908. }
  3909. this.observeArray(value);
  3910. } else {
  3911. this.walk(value);
  3912. }
  3913. };
  3914. /**
  3915. * Walk through all properties and convert them into
  3916. * getter/setters. This method should only be called when
  3917. * value type is Object.
  3918. */
  3919. Observer.prototype.walk = function walk (obj) {
  3920. var keys = Object.keys(obj);
  3921. for (var i = 0; i < keys.length; i++) {
  3922. defineReactive$$1(obj, keys[i]);
  3923. }
  3924. };
  3925. /**
  3926. * Observe a list of Array items.
  3927. */
  3928. Observer.prototype.observeArray = function observeArray (items) {
  3929. for (var i = 0, l = items.length; i < l; i++) {
  3930. observe(items[i]);
  3931. }
  3932. };
  3933. // helpers
  3934. /**
  3935. * Augment a target Object or Array by intercepting
  3936. * the prototype chain using __proto__
  3937. */
  3938. function protoAugment (target, src) {
  3939. /* eslint-disable no-proto */
  3940. target.__proto__ = src;
  3941. /* eslint-enable no-proto */
  3942. }
  3943. /**
  3944. * Augment a target Object or Array by defining
  3945. * hidden properties.
  3946. */
  3947. /* istanbul ignore next */
  3948. function copyAugment (target, src, keys) {
  3949. for (var i = 0, l = keys.length; i < l; i++) {
  3950. var key = keys[i];
  3951. def(target, key, src[key]);
  3952. }
  3953. }
  3954. /**
  3955. * Attempt to create an observer instance for a value,
  3956. * returns the new observer if successfully observed,
  3957. * or the existing observer if the value already has one.
  3958. */
  3959. function observe (value, asRootData) {
  3960. if (!isObject(value) || value instanceof VNode) {
  3961. return
  3962. }
  3963. var ob;
  3964. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  3965. ob = value.__ob__;
  3966. } else if (
  3967. shouldObserve &&
  3968. !isServerRendering() &&
  3969. (Array.isArray(value) || isPlainObject(value)) &&
  3970. Object.isExtensible(value) &&
  3971. !value._isVue &&
  3972. !value.__v_isMPComponent
  3973. ) {
  3974. ob = new Observer(value);
  3975. }
  3976. if (asRootData && ob) {
  3977. ob.vmCount++;
  3978. }
  3979. return ob
  3980. }
  3981. /**
  3982. * Define a reactive property on an Object.
  3983. */
  3984. function defineReactive$$1 (
  3985. obj,
  3986. key,
  3987. val,
  3988. customSetter,
  3989. shallow
  3990. ) {
  3991. var dep = new Dep();
  3992. var property = Object.getOwnPropertyDescriptor(obj, key);
  3993. if (property && property.configurable === false) {
  3994. return
  3995. }
  3996. // cater for pre-defined getter/setters
  3997. var getter = property && property.get;
  3998. var setter = property && property.set;
  3999. if ((!getter || setter) && arguments.length === 2) {
  4000. val = obj[key];
  4001. }
  4002. var childOb = !shallow && observe(val);
  4003. Object.defineProperty(obj, key, {
  4004. enumerable: true,
  4005. configurable: true,
  4006. get: function reactiveGetter () {
  4007. var value = getter ? getter.call(obj) : val;
  4008. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4009. dep.depend();
  4010. if (childOb) {
  4011. childOb.dep.depend();
  4012. if (Array.isArray(value)) {
  4013. dependArray(value);
  4014. }
  4015. }
  4016. }
  4017. return value
  4018. },
  4019. set: function reactiveSetter (newVal) {
  4020. var value = getter ? getter.call(obj) : val;
  4021. /* eslint-disable no-self-compare */
  4022. if (newVal === value || (newVal !== newVal && value !== value)) {
  4023. return
  4024. }
  4025. /* eslint-enable no-self-compare */
  4026. if ( true && customSetter) {
  4027. customSetter();
  4028. }
  4029. // #7981: for accessor properties without setter
  4030. if (getter && !setter) { return }
  4031. if (setter) {
  4032. setter.call(obj, newVal);
  4033. } else {
  4034. val = newVal;
  4035. }
  4036. childOb = !shallow && observe(newVal);
  4037. dep.notify();
  4038. }
  4039. });
  4040. }
  4041. /**
  4042. * Set a property on an object. Adds the new property and
  4043. * triggers change notification if the property doesn't
  4044. * already exist.
  4045. */
  4046. function set (target, key, val) {
  4047. if ( true &&
  4048. (isUndef(target) || isPrimitive(target))
  4049. ) {
  4050. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4051. }
  4052. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4053. target.length = Math.max(target.length, key);
  4054. target.splice(key, 1, val);
  4055. return val
  4056. }
  4057. if (key in target && !(key in Object.prototype)) {
  4058. target[key] = val;
  4059. return val
  4060. }
  4061. var ob = (target).__ob__;
  4062. if (target._isVue || (ob && ob.vmCount)) {
  4063. true && warn(
  4064. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4065. 'at runtime - declare it upfront in the data option.'
  4066. );
  4067. return val
  4068. }
  4069. if (!ob) {
  4070. target[key] = val;
  4071. return val
  4072. }
  4073. defineReactive$$1(ob.value, key, val);
  4074. ob.dep.notify();
  4075. return val
  4076. }
  4077. /**
  4078. * Delete a property and trigger change if necessary.
  4079. */
  4080. function del (target, key) {
  4081. if ( true &&
  4082. (isUndef(target) || isPrimitive(target))
  4083. ) {
  4084. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4085. }
  4086. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4087. target.splice(key, 1);
  4088. return
  4089. }
  4090. var ob = (target).__ob__;
  4091. if (target._isVue || (ob && ob.vmCount)) {
  4092. true && warn(
  4093. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4094. '- just set it to null.'
  4095. );
  4096. return
  4097. }
  4098. if (!hasOwn(target, key)) {
  4099. return
  4100. }
  4101. delete target[key];
  4102. if (!ob) {
  4103. return
  4104. }
  4105. ob.dep.notify();
  4106. }
  4107. /**
  4108. * Collect dependencies on array elements when the array is touched, since
  4109. * we cannot intercept array element access like property getters.
  4110. */
  4111. function dependArray (value) {
  4112. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4113. e = value[i];
  4114. e && e.__ob__ && e.__ob__.dep.depend();
  4115. if (Array.isArray(e)) {
  4116. dependArray(e);
  4117. }
  4118. }
  4119. }
  4120. /* */
  4121. /**
  4122. * Option overwriting strategies are functions that handle
  4123. * how to merge a parent option value and a child option
  4124. * value into the final value.
  4125. */
  4126. var strats = config.optionMergeStrategies;
  4127. /**
  4128. * Options with restrictions
  4129. */
  4130. if (true) {
  4131. strats.el = strats.propsData = function (parent, child, vm, key) {
  4132. if (!vm) {
  4133. warn(
  4134. "option \"" + key + "\" can only be used during instance " +
  4135. 'creation with the `new` keyword.'
  4136. );
  4137. }
  4138. return defaultStrat(parent, child)
  4139. };
  4140. }
  4141. /**
  4142. * Helper that recursively merges two data objects together.
  4143. */
  4144. function mergeData (to, from) {
  4145. if (!from) { return to }
  4146. var key, toVal, fromVal;
  4147. var keys = hasSymbol
  4148. ? Reflect.ownKeys(from)
  4149. : Object.keys(from);
  4150. for (var i = 0; i < keys.length; i++) {
  4151. key = keys[i];
  4152. // in case the object is already observed...
  4153. if (key === '__ob__') { continue }
  4154. toVal = to[key];
  4155. fromVal = from[key];
  4156. if (!hasOwn(to, key)) {
  4157. set(to, key, fromVal);
  4158. } else if (
  4159. toVal !== fromVal &&
  4160. isPlainObject(toVal) &&
  4161. isPlainObject(fromVal)
  4162. ) {
  4163. mergeData(toVal, fromVal);
  4164. }
  4165. }
  4166. return to
  4167. }
  4168. /**
  4169. * Data
  4170. */
  4171. function mergeDataOrFn (
  4172. parentVal,
  4173. childVal,
  4174. vm
  4175. ) {
  4176. if (!vm) {
  4177. // in a Vue.extend merge, both should be functions
  4178. if (!childVal) {
  4179. return parentVal
  4180. }
  4181. if (!parentVal) {
  4182. return childVal
  4183. }
  4184. // when parentVal & childVal are both present,
  4185. // we need to return a function that returns the
  4186. // merged result of both functions... no need to
  4187. // check if parentVal is a function here because
  4188. // it has to be a function to pass previous merges.
  4189. return function mergedDataFn () {
  4190. return mergeData(
  4191. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  4192. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  4193. )
  4194. }
  4195. } else {
  4196. return function mergedInstanceDataFn () {
  4197. // instance merge
  4198. var instanceData = typeof childVal === 'function'
  4199. ? childVal.call(vm, vm)
  4200. : childVal;
  4201. var defaultData = typeof parentVal === 'function'
  4202. ? parentVal.call(vm, vm)
  4203. : parentVal;
  4204. if (instanceData) {
  4205. return mergeData(instanceData, defaultData)
  4206. } else {
  4207. return defaultData
  4208. }
  4209. }
  4210. }
  4211. }
  4212. strats.data = function (
  4213. parentVal,
  4214. childVal,
  4215. vm
  4216. ) {
  4217. if (!vm) {
  4218. if (childVal && typeof childVal !== 'function') {
  4219. true && warn(
  4220. 'The "data" option should be a function ' +
  4221. 'that returns a per-instance value in component ' +
  4222. 'definitions.',
  4223. vm
  4224. );
  4225. return parentVal
  4226. }
  4227. return mergeDataOrFn(parentVal, childVal)
  4228. }
  4229. return mergeDataOrFn(parentVal, childVal, vm)
  4230. };
  4231. /**
  4232. * Hooks and props are merged as arrays.
  4233. */
  4234. function mergeHook (
  4235. parentVal,
  4236. childVal
  4237. ) {
  4238. var res = childVal
  4239. ? parentVal
  4240. ? parentVal.concat(childVal)
  4241. : Array.isArray(childVal)
  4242. ? childVal
  4243. : [childVal]
  4244. : parentVal;
  4245. return res
  4246. ? dedupeHooks(res)
  4247. : res
  4248. }
  4249. function dedupeHooks (hooks) {
  4250. var res = [];
  4251. for (var i = 0; i < hooks.length; i++) {
  4252. if (res.indexOf(hooks[i]) === -1) {
  4253. res.push(hooks[i]);
  4254. }
  4255. }
  4256. return res
  4257. }
  4258. LIFECYCLE_HOOKS.forEach(function (hook) {
  4259. strats[hook] = mergeHook;
  4260. });
  4261. /**
  4262. * Assets
  4263. *
  4264. * When a vm is present (instance creation), we need to do
  4265. * a three-way merge between constructor options, instance
  4266. * options and parent options.
  4267. */
  4268. function mergeAssets (
  4269. parentVal,
  4270. childVal,
  4271. vm,
  4272. key
  4273. ) {
  4274. var res = Object.create(parentVal || null);
  4275. if (childVal) {
  4276. true && assertObjectType(key, childVal, vm);
  4277. return extend(res, childVal)
  4278. } else {
  4279. return res
  4280. }
  4281. }
  4282. ASSET_TYPES.forEach(function (type) {
  4283. strats[type + 's'] = mergeAssets;
  4284. });
  4285. /**
  4286. * Watchers.
  4287. *
  4288. * Watchers hashes should not overwrite one
  4289. * another, so we merge them as arrays.
  4290. */
  4291. strats.watch = function (
  4292. parentVal,
  4293. childVal,
  4294. vm,
  4295. key
  4296. ) {
  4297. // work around Firefox's Object.prototype.watch...
  4298. if (parentVal === nativeWatch) { parentVal = undefined; }
  4299. if (childVal === nativeWatch) { childVal = undefined; }
  4300. /* istanbul ignore if */
  4301. if (!childVal) { return Object.create(parentVal || null) }
  4302. if (true) {
  4303. assertObjectType(key, childVal, vm);
  4304. }
  4305. if (!parentVal) { return childVal }
  4306. var ret = {};
  4307. extend(ret, parentVal);
  4308. for (var key$1 in childVal) {
  4309. var parent = ret[key$1];
  4310. var child = childVal[key$1];
  4311. if (parent && !Array.isArray(parent)) {
  4312. parent = [parent];
  4313. }
  4314. ret[key$1] = parent
  4315. ? parent.concat(child)
  4316. : Array.isArray(child) ? child : [child];
  4317. }
  4318. return ret
  4319. };
  4320. /**
  4321. * Other object hashes.
  4322. */
  4323. strats.props =
  4324. strats.methods =
  4325. strats.inject =
  4326. strats.computed = function (
  4327. parentVal,
  4328. childVal,
  4329. vm,
  4330. key
  4331. ) {
  4332. if (childVal && "development" !== 'production') {
  4333. assertObjectType(key, childVal, vm);
  4334. }
  4335. if (!parentVal) { return childVal }
  4336. var ret = Object.create(null);
  4337. extend(ret, parentVal);
  4338. if (childVal) { extend(ret, childVal); }
  4339. return ret
  4340. };
  4341. strats.provide = mergeDataOrFn;
  4342. /**
  4343. * Default strategy.
  4344. */
  4345. var defaultStrat = function (parentVal, childVal) {
  4346. return childVal === undefined
  4347. ? parentVal
  4348. : childVal
  4349. };
  4350. /**
  4351. * Validate component names
  4352. */
  4353. function checkComponents (options) {
  4354. for (var key in options.components) {
  4355. validateComponentName(key);
  4356. }
  4357. }
  4358. function validateComponentName (name) {
  4359. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4360. warn(
  4361. 'Invalid component name: "' + name + '". Component names ' +
  4362. 'should conform to valid custom element name in html5 specification.'
  4363. );
  4364. }
  4365. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4366. warn(
  4367. 'Do not use built-in or reserved HTML elements as component ' +
  4368. 'id: ' + name
  4369. );
  4370. }
  4371. }
  4372. /**
  4373. * Ensure all props option syntax are normalized into the
  4374. * Object-based format.
  4375. */
  4376. function normalizeProps (options, vm) {
  4377. var props = options.props;
  4378. if (!props) { return }
  4379. var res = {};
  4380. var i, val, name;
  4381. if (Array.isArray(props)) {
  4382. i = props.length;
  4383. while (i--) {
  4384. val = props[i];
  4385. if (typeof val === 'string') {
  4386. name = camelize(val);
  4387. res[name] = { type: null };
  4388. } else if (true) {
  4389. warn('props must be strings when using array syntax.');
  4390. }
  4391. }
  4392. } else if (isPlainObject(props)) {
  4393. for (var key in props) {
  4394. val = props[key];
  4395. name = camelize(key);
  4396. res[name] = isPlainObject(val)
  4397. ? val
  4398. : { type: val };
  4399. }
  4400. } else if (true) {
  4401. warn(
  4402. "Invalid value for option \"props\": expected an Array or an Object, " +
  4403. "but got " + (toRawType(props)) + ".",
  4404. vm
  4405. );
  4406. }
  4407. options.props = res;
  4408. }
  4409. /**
  4410. * Normalize all injections into Object-based format
  4411. */
  4412. function normalizeInject (options, vm) {
  4413. var inject = options.inject;
  4414. if (!inject) { return }
  4415. var normalized = options.inject = {};
  4416. if (Array.isArray(inject)) {
  4417. for (var i = 0; i < inject.length; i++) {
  4418. normalized[inject[i]] = { from: inject[i] };
  4419. }
  4420. } else if (isPlainObject(inject)) {
  4421. for (var key in inject) {
  4422. var val = inject[key];
  4423. normalized[key] = isPlainObject(val)
  4424. ? extend({ from: key }, val)
  4425. : { from: val };
  4426. }
  4427. } else if (true) {
  4428. warn(
  4429. "Invalid value for option \"inject\": expected an Array or an Object, " +
  4430. "but got " + (toRawType(inject)) + ".",
  4431. vm
  4432. );
  4433. }
  4434. }
  4435. /**
  4436. * Normalize raw function directives into object format.
  4437. */
  4438. function normalizeDirectives (options) {
  4439. var dirs = options.directives;
  4440. if (dirs) {
  4441. for (var key in dirs) {
  4442. var def$$1 = dirs[key];
  4443. if (typeof def$$1 === 'function') {
  4444. dirs[key] = { bind: def$$1, update: def$$1 };
  4445. }
  4446. }
  4447. }
  4448. }
  4449. function assertObjectType (name, value, vm) {
  4450. if (!isPlainObject(value)) {
  4451. warn(
  4452. "Invalid value for option \"" + name + "\": expected an Object, " +
  4453. "but got " + (toRawType(value)) + ".",
  4454. vm
  4455. );
  4456. }
  4457. }
  4458. /**
  4459. * Merge two option objects into a new one.
  4460. * Core utility used in both instantiation and inheritance.
  4461. */
  4462. function mergeOptions (
  4463. parent,
  4464. child,
  4465. vm
  4466. ) {
  4467. if (true) {
  4468. checkComponents(child);
  4469. }
  4470. if (typeof child === 'function') {
  4471. child = child.options;
  4472. }
  4473. normalizeProps(child, vm);
  4474. normalizeInject(child, vm);
  4475. normalizeDirectives(child);
  4476. // Apply extends and mixins on the child options,
  4477. // but only if it is a raw options object that isn't
  4478. // the result of another mergeOptions call.
  4479. // Only merged options has the _base property.
  4480. if (!child._base) {
  4481. if (child.extends) {
  4482. parent = mergeOptions(parent, child.extends, vm);
  4483. }
  4484. if (child.mixins) {
  4485. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4486. parent = mergeOptions(parent, child.mixins[i], vm);
  4487. }
  4488. }
  4489. }
  4490. var options = {};
  4491. var key;
  4492. for (key in parent) {
  4493. mergeField(key);
  4494. }
  4495. for (key in child) {
  4496. if (!hasOwn(parent, key)) {
  4497. mergeField(key);
  4498. }
  4499. }
  4500. function mergeField (key) {
  4501. var strat = strats[key] || defaultStrat;
  4502. options[key] = strat(parent[key], child[key], vm, key);
  4503. }
  4504. return options
  4505. }
  4506. /**
  4507. * Resolve an asset.
  4508. * This function is used because child instances need access
  4509. * to assets defined in its ancestor chain.
  4510. */
  4511. function resolveAsset (
  4512. options,
  4513. type,
  4514. id,
  4515. warnMissing
  4516. ) {
  4517. /* istanbul ignore if */
  4518. if (typeof id !== 'string') {
  4519. return
  4520. }
  4521. var assets = options[type];
  4522. // check local registration variations first
  4523. if (hasOwn(assets, id)) { return assets[id] }
  4524. var camelizedId = camelize(id);
  4525. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  4526. var PascalCaseId = capitalize(camelizedId);
  4527. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  4528. // fallback to prototype chain
  4529. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  4530. if ( true && warnMissing && !res) {
  4531. warn(
  4532. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  4533. options
  4534. );
  4535. }
  4536. return res
  4537. }
  4538. /* */
  4539. function validateProp (
  4540. key,
  4541. propOptions,
  4542. propsData,
  4543. vm
  4544. ) {
  4545. var prop = propOptions[key];
  4546. var absent = !hasOwn(propsData, key);
  4547. var value = propsData[key];
  4548. // boolean casting
  4549. var booleanIndex = getTypeIndex(Boolean, prop.type);
  4550. if (booleanIndex > -1) {
  4551. if (absent && !hasOwn(prop, 'default')) {
  4552. value = false;
  4553. } else if (value === '' || value === hyphenate(key)) {
  4554. // only cast empty string / same name to boolean if
  4555. // boolean has higher priority
  4556. var stringIndex = getTypeIndex(String, prop.type);
  4557. if (stringIndex < 0 || booleanIndex < stringIndex) {
  4558. value = true;
  4559. }
  4560. }
  4561. }
  4562. // check default value
  4563. if (value === undefined) {
  4564. value = getPropDefaultValue(vm, prop, key);
  4565. // since the default value is a fresh copy,
  4566. // make sure to observe it.
  4567. var prevShouldObserve = shouldObserve;
  4568. toggleObserving(true);
  4569. observe(value);
  4570. toggleObserving(prevShouldObserve);
  4571. }
  4572. if (
  4573. true
  4574. ) {
  4575. assertProp(prop, key, value, vm, absent);
  4576. }
  4577. return value
  4578. }
  4579. /**
  4580. * Get the default value of a prop.
  4581. */
  4582. function getPropDefaultValue (vm, prop, key) {
  4583. // no default, return undefined
  4584. if (!hasOwn(prop, 'default')) {
  4585. return undefined
  4586. }
  4587. var def = prop.default;
  4588. // warn against non-factory defaults for Object & Array
  4589. if ( true && isObject(def)) {
  4590. warn(
  4591. 'Invalid default value for prop "' + key + '": ' +
  4592. 'Props with type Object/Array must use a factory function ' +
  4593. 'to return the default value.',
  4594. vm
  4595. );
  4596. }
  4597. // the raw prop value was also undefined from previous render,
  4598. // return previous default value to avoid unnecessary watcher trigger
  4599. if (vm && vm.$options.propsData &&
  4600. vm.$options.propsData[key] === undefined &&
  4601. vm._props[key] !== undefined
  4602. ) {
  4603. return vm._props[key]
  4604. }
  4605. // call factory function for non-Function types
  4606. // a value is Function if its prototype is function even across different execution context
  4607. return typeof def === 'function' && getType(prop.type) !== 'Function'
  4608. ? def.call(vm)
  4609. : def
  4610. }
  4611. /**
  4612. * Assert whether a prop is valid.
  4613. */
  4614. function assertProp (
  4615. prop,
  4616. name,
  4617. value,
  4618. vm,
  4619. absent
  4620. ) {
  4621. if (prop.required && absent) {
  4622. warn(
  4623. 'Missing required prop: "' + name + '"',
  4624. vm
  4625. );
  4626. return
  4627. }
  4628. if (value == null && !prop.required) {
  4629. return
  4630. }
  4631. var type = prop.type;
  4632. var valid = !type || type === true;
  4633. var expectedTypes = [];
  4634. if (type) {
  4635. if (!Array.isArray(type)) {
  4636. type = [type];
  4637. }
  4638. for (var i = 0; i < type.length && !valid; i++) {
  4639. var assertedType = assertType(value, type[i]);
  4640. expectedTypes.push(assertedType.expectedType || '');
  4641. valid = assertedType.valid;
  4642. }
  4643. }
  4644. if (!valid) {
  4645. warn(
  4646. getInvalidTypeMessage(name, value, expectedTypes),
  4647. vm
  4648. );
  4649. return
  4650. }
  4651. var validator = prop.validator;
  4652. if (validator) {
  4653. if (!validator(value)) {
  4654. warn(
  4655. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  4656. vm
  4657. );
  4658. }
  4659. }
  4660. }
  4661. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  4662. function assertType (value, type) {
  4663. var valid;
  4664. var expectedType = getType(type);
  4665. if (simpleCheckRE.test(expectedType)) {
  4666. var t = typeof value;
  4667. valid = t === expectedType.toLowerCase();
  4668. // for primitive wrapper objects
  4669. if (!valid && t === 'object') {
  4670. valid = value instanceof type;
  4671. }
  4672. } else if (expectedType === 'Object') {
  4673. valid = isPlainObject(value);
  4674. } else if (expectedType === 'Array') {
  4675. valid = Array.isArray(value);
  4676. } else {
  4677. valid = value instanceof type;
  4678. }
  4679. return {
  4680. valid: valid,
  4681. expectedType: expectedType
  4682. }
  4683. }
  4684. /**
  4685. * Use function string name to check built-in types,
  4686. * because a simple equality check will fail when running
  4687. * across different vms / iframes.
  4688. */
  4689. function getType (fn) {
  4690. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  4691. return match ? match[1] : ''
  4692. }
  4693. function isSameType (a, b) {
  4694. return getType(a) === getType(b)
  4695. }
  4696. function getTypeIndex (type, expectedTypes) {
  4697. if (!Array.isArray(expectedTypes)) {
  4698. return isSameType(expectedTypes, type) ? 0 : -1
  4699. }
  4700. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  4701. if (isSameType(expectedTypes[i], type)) {
  4702. return i
  4703. }
  4704. }
  4705. return -1
  4706. }
  4707. function getInvalidTypeMessage (name, value, expectedTypes) {
  4708. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  4709. " Expected " + (expectedTypes.map(capitalize).join(', '));
  4710. var expectedType = expectedTypes[0];
  4711. var receivedType = toRawType(value);
  4712. var expectedValue = styleValue(value, expectedType);
  4713. var receivedValue = styleValue(value, receivedType);
  4714. // check if we need to specify expected value
  4715. if (expectedTypes.length === 1 &&
  4716. isExplicable(expectedType) &&
  4717. !isBoolean(expectedType, receivedType)) {
  4718. message += " with value " + expectedValue;
  4719. }
  4720. message += ", got " + receivedType + " ";
  4721. // check if we need to specify received value
  4722. if (isExplicable(receivedType)) {
  4723. message += "with value " + receivedValue + ".";
  4724. }
  4725. return message
  4726. }
  4727. function styleValue (value, type) {
  4728. if (type === 'String') {
  4729. return ("\"" + value + "\"")
  4730. } else if (type === 'Number') {
  4731. return ("" + (Number(value)))
  4732. } else {
  4733. return ("" + value)
  4734. }
  4735. }
  4736. function isExplicable (value) {
  4737. var explicitTypes = ['string', 'number', 'boolean'];
  4738. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  4739. }
  4740. function isBoolean () {
  4741. var args = [], len = arguments.length;
  4742. while ( len-- ) args[ len ] = arguments[ len ];
  4743. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  4744. }
  4745. /* */
  4746. function handleError (err, vm, info) {
  4747. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  4748. // See: https://github.com/vuejs/vuex/issues/1505
  4749. pushTarget();
  4750. try {
  4751. if (vm) {
  4752. var cur = vm;
  4753. while ((cur = cur.$parent)) {
  4754. var hooks = cur.$options.errorCaptured;
  4755. if (hooks) {
  4756. for (var i = 0; i < hooks.length; i++) {
  4757. try {
  4758. var capture = hooks[i].call(cur, err, vm, info) === false;
  4759. if (capture) { return }
  4760. } catch (e) {
  4761. globalHandleError(e, cur, 'errorCaptured hook');
  4762. }
  4763. }
  4764. }
  4765. }
  4766. }
  4767. globalHandleError(err, vm, info);
  4768. } finally {
  4769. popTarget();
  4770. }
  4771. }
  4772. function invokeWithErrorHandling (
  4773. handler,
  4774. context,
  4775. args,
  4776. vm,
  4777. info
  4778. ) {
  4779. var res;
  4780. try {
  4781. res = args ? handler.apply(context, args) : handler.call(context);
  4782. if (res && !res._isVue && isPromise(res) && !res._handled) {
  4783. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  4784. // issue #9511
  4785. // avoid catch triggering multiple times when nested calls
  4786. res._handled = true;
  4787. }
  4788. } catch (e) {
  4789. handleError(e, vm, info);
  4790. }
  4791. return res
  4792. }
  4793. function globalHandleError (err, vm, info) {
  4794. if (config.errorHandler) {
  4795. try {
  4796. return config.errorHandler.call(null, err, vm, info)
  4797. } catch (e) {
  4798. // if the user intentionally throws the original error in the handler,
  4799. // do not log it twice
  4800. if (e !== err) {
  4801. logError(e, null, 'config.errorHandler');
  4802. }
  4803. }
  4804. }
  4805. logError(err, vm, info);
  4806. }
  4807. function logError (err, vm, info) {
  4808. if (true) {
  4809. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  4810. }
  4811. /* istanbul ignore else */
  4812. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  4813. console.error(err);
  4814. } else {
  4815. throw err
  4816. }
  4817. }
  4818. /* */
  4819. var callbacks = [];
  4820. var pending = false;
  4821. function flushCallbacks () {
  4822. pending = false;
  4823. var copies = callbacks.slice(0);
  4824. callbacks.length = 0;
  4825. for (var i = 0; i < copies.length; i++) {
  4826. copies[i]();
  4827. }
  4828. }
  4829. // Here we have async deferring wrappers using microtasks.
  4830. // In 2.5 we used (macro) tasks (in combination with microtasks).
  4831. // However, it has subtle problems when state is changed right before repaint
  4832. // (e.g. #6813, out-in transitions).
  4833. // Also, using (macro) tasks in event handler would cause some weird behaviors
  4834. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  4835. // So we now use microtasks everywhere, again.
  4836. // A major drawback of this tradeoff is that there are some scenarios
  4837. // where microtasks have too high a priority and fire in between supposedly
  4838. // sequential events (e.g. #4521, #6690, which have workarounds)
  4839. // or even between bubbling of the same event (#6566).
  4840. var timerFunc;
  4841. // The nextTick behavior leverages the microtask queue, which can be accessed
  4842. // via either native Promise.then or MutationObserver.
  4843. // MutationObserver has wider support, however it is seriously bugged in
  4844. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  4845. // completely stops working after triggering a few times... so, if native
  4846. // Promise is available, we will use it:
  4847. /* istanbul ignore next, $flow-disable-line */
  4848. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  4849. var p = Promise.resolve();
  4850. timerFunc = function () {
  4851. p.then(flushCallbacks);
  4852. // In problematic UIWebViews, Promise.then doesn't completely break, but
  4853. // it can get stuck in a weird state where callbacks are pushed into the
  4854. // microtask queue but the queue isn't being flushed, until the browser
  4855. // needs to do some other work, e.g. handle a timer. Therefore we can
  4856. // "force" the microtask queue to be flushed by adding an empty timer.
  4857. if (isIOS) { setTimeout(noop); }
  4858. };
  4859. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  4860. isNative(MutationObserver) ||
  4861. // PhantomJS and iOS 7.x
  4862. MutationObserver.toString() === '[object MutationObserverConstructor]'
  4863. )) {
  4864. // Use MutationObserver where native Promise is not available,
  4865. // e.g. PhantomJS, iOS7, Android 4.4
  4866. // (#6466 MutationObserver is unreliable in IE11)
  4867. var counter = 1;
  4868. var observer = new MutationObserver(flushCallbacks);
  4869. var textNode = document.createTextNode(String(counter));
  4870. observer.observe(textNode, {
  4871. characterData: true
  4872. });
  4873. timerFunc = function () {
  4874. counter = (counter + 1) % 2;
  4875. textNode.data = String(counter);
  4876. };
  4877. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  4878. // Fallback to setImmediate.
  4879. // Technically it leverages the (macro) task queue,
  4880. // but it is still a better choice than setTimeout.
  4881. timerFunc = function () {
  4882. setImmediate(flushCallbacks);
  4883. };
  4884. } else {
  4885. // Fallback to setTimeout.
  4886. timerFunc = function () {
  4887. setTimeout(flushCallbacks, 0);
  4888. };
  4889. }
  4890. function nextTick (cb, ctx) {
  4891. var _resolve;
  4892. callbacks.push(function () {
  4893. if (cb) {
  4894. try {
  4895. cb.call(ctx);
  4896. } catch (e) {
  4897. handleError(e, ctx, 'nextTick');
  4898. }
  4899. } else if (_resolve) {
  4900. _resolve(ctx);
  4901. }
  4902. });
  4903. if (!pending) {
  4904. pending = true;
  4905. timerFunc();
  4906. }
  4907. // $flow-disable-line
  4908. if (!cb && typeof Promise !== 'undefined') {
  4909. return new Promise(function (resolve) {
  4910. _resolve = resolve;
  4911. })
  4912. }
  4913. }
  4914. /* */
  4915. /* not type checking this file because flow doesn't play well with Proxy */
  4916. var initProxy;
  4917. if (true) {
  4918. var allowedGlobals = makeMap(
  4919. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  4920. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  4921. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  4922. 'require' // for Webpack/Browserify
  4923. );
  4924. var warnNonPresent = function (target, key) {
  4925. warn(
  4926. "Property or method \"" + key + "\" is not defined on the instance but " +
  4927. 'referenced during render. Make sure that this property is reactive, ' +
  4928. 'either in the data option, or for class-based components, by ' +
  4929. 'initializing the property. ' +
  4930. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  4931. target
  4932. );
  4933. };
  4934. var warnReservedPrefix = function (target, key) {
  4935. warn(
  4936. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  4937. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  4938. 'prevent conflicts with Vue internals. ' +
  4939. 'See: https://vuejs.org/v2/api/#data',
  4940. target
  4941. );
  4942. };
  4943. var hasProxy =
  4944. typeof Proxy !== 'undefined' && isNative(Proxy);
  4945. if (hasProxy) {
  4946. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  4947. config.keyCodes = new Proxy(config.keyCodes, {
  4948. set: function set (target, key, value) {
  4949. if (isBuiltInModifier(key)) {
  4950. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  4951. return false
  4952. } else {
  4953. target[key] = value;
  4954. return true
  4955. }
  4956. }
  4957. });
  4958. }
  4959. var hasHandler = {
  4960. has: function has (target, key) {
  4961. var has = key in target;
  4962. var isAllowed = allowedGlobals(key) ||
  4963. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  4964. if (!has && !isAllowed) {
  4965. if (key in target.$data) { warnReservedPrefix(target, key); }
  4966. else { warnNonPresent(target, key); }
  4967. }
  4968. return has || !isAllowed
  4969. }
  4970. };
  4971. var getHandler = {
  4972. get: function get (target, key) {
  4973. if (typeof key === 'string' && !(key in target)) {
  4974. if (key in target.$data) { warnReservedPrefix(target, key); }
  4975. else { warnNonPresent(target, key); }
  4976. }
  4977. return target[key]
  4978. }
  4979. };
  4980. initProxy = function initProxy (vm) {
  4981. if (hasProxy) {
  4982. // determine which proxy handler to use
  4983. var options = vm.$options;
  4984. var handlers = options.render && options.render._withStripped
  4985. ? getHandler
  4986. : hasHandler;
  4987. vm._renderProxy = new Proxy(vm, handlers);
  4988. } else {
  4989. vm._renderProxy = vm;
  4990. }
  4991. };
  4992. }
  4993. /* */
  4994. var seenObjects = new _Set();
  4995. /**
  4996. * Recursively traverse an object to evoke all converted
  4997. * getters, so that every nested property inside the object
  4998. * is collected as a "deep" dependency.
  4999. */
  5000. function traverse (val) {
  5001. _traverse(val, seenObjects);
  5002. seenObjects.clear();
  5003. }
  5004. function _traverse (val, seen) {
  5005. var i, keys;
  5006. var isA = Array.isArray(val);
  5007. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5008. return
  5009. }
  5010. if (val.__ob__) {
  5011. var depId = val.__ob__.dep.id;
  5012. if (seen.has(depId)) {
  5013. return
  5014. }
  5015. seen.add(depId);
  5016. }
  5017. if (isA) {
  5018. i = val.length;
  5019. while (i--) { _traverse(val[i], seen); }
  5020. } else {
  5021. keys = Object.keys(val);
  5022. i = keys.length;
  5023. while (i--) { _traverse(val[keys[i]], seen); }
  5024. }
  5025. }
  5026. var mark;
  5027. var measure;
  5028. if (true) {
  5029. var perf = inBrowser && window.performance;
  5030. /* istanbul ignore if */
  5031. if (
  5032. perf &&
  5033. perf.mark &&
  5034. perf.measure &&
  5035. perf.clearMarks &&
  5036. perf.clearMeasures
  5037. ) {
  5038. mark = function (tag) { return perf.mark(tag); };
  5039. measure = function (name, startTag, endTag) {
  5040. perf.measure(name, startTag, endTag);
  5041. perf.clearMarks(startTag);
  5042. perf.clearMarks(endTag);
  5043. // perf.clearMeasures(name)
  5044. };
  5045. }
  5046. }
  5047. /* */
  5048. var normalizeEvent = cached(function (name) {
  5049. var passive = name.charAt(0) === '&';
  5050. name = passive ? name.slice(1) : name;
  5051. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5052. name = once$$1 ? name.slice(1) : name;
  5053. var capture = name.charAt(0) === '!';
  5054. name = capture ? name.slice(1) : name;
  5055. return {
  5056. name: name,
  5057. once: once$$1,
  5058. capture: capture,
  5059. passive: passive
  5060. }
  5061. });
  5062. function createFnInvoker (fns, vm) {
  5063. function invoker () {
  5064. var arguments$1 = arguments;
  5065. var fns = invoker.fns;
  5066. if (Array.isArray(fns)) {
  5067. var cloned = fns.slice();
  5068. for (var i = 0; i < cloned.length; i++) {
  5069. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5070. }
  5071. } else {
  5072. // return handler return value for single handlers
  5073. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5074. }
  5075. }
  5076. invoker.fns = fns;
  5077. return invoker
  5078. }
  5079. function updateListeners (
  5080. on,
  5081. oldOn,
  5082. add,
  5083. remove$$1,
  5084. createOnceHandler,
  5085. vm
  5086. ) {
  5087. var name, def$$1, cur, old, event;
  5088. for (name in on) {
  5089. def$$1 = cur = on[name];
  5090. old = oldOn[name];
  5091. event = normalizeEvent(name);
  5092. if (isUndef(cur)) {
  5093. true && warn(
  5094. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5095. vm
  5096. );
  5097. } else if (isUndef(old)) {
  5098. if (isUndef(cur.fns)) {
  5099. cur = on[name] = createFnInvoker(cur, vm);
  5100. }
  5101. if (isTrue(event.once)) {
  5102. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5103. }
  5104. add(event.name, cur, event.capture, event.passive, event.params);
  5105. } else if (cur !== old) {
  5106. old.fns = cur;
  5107. on[name] = old;
  5108. }
  5109. }
  5110. for (name in oldOn) {
  5111. if (isUndef(on[name])) {
  5112. event = normalizeEvent(name);
  5113. remove$$1(event.name, oldOn[name], event.capture);
  5114. }
  5115. }
  5116. }
  5117. /* */
  5118. /* */
  5119. // fixed by xxxxxx (mp properties)
  5120. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5121. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5122. if (isUndef(propOptions)) {
  5123. return res
  5124. }
  5125. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5126. var attrs = data.attrs;
  5127. var props = data.props;
  5128. if (isDef(attrs) || isDef(props)) {
  5129. for (var key in propOptions) {
  5130. var altKey = hyphenate(key);
  5131. var result = checkProp(res, props, key, altKey, true) ||
  5132. checkProp(res, attrs, key, altKey, false);
  5133. // externalClass
  5134. if (
  5135. result &&
  5136. res[key] &&
  5137. externalClasses.indexOf(altKey) !== -1 &&
  5138. context[camelize(res[key])]
  5139. ) {
  5140. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5141. res[key] = context[camelize(res[key])];
  5142. }
  5143. }
  5144. }
  5145. return res
  5146. }
  5147. function extractPropsFromVNodeData (
  5148. data,
  5149. Ctor,
  5150. tag,
  5151. context// fixed by xxxxxx
  5152. ) {
  5153. // we are only extracting raw values here.
  5154. // validation and default values are handled in the child
  5155. // component itself.
  5156. var propOptions = Ctor.options.props;
  5157. if (isUndef(propOptions)) {
  5158. // fixed by xxxxxx
  5159. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5160. }
  5161. var res = {};
  5162. var attrs = data.attrs;
  5163. var props = data.props;
  5164. if (isDef(attrs) || isDef(props)) {
  5165. for (var key in propOptions) {
  5166. var altKey = hyphenate(key);
  5167. if (true) {
  5168. var keyInLowerCase = key.toLowerCase();
  5169. if (
  5170. key !== keyInLowerCase &&
  5171. attrs && hasOwn(attrs, keyInLowerCase)
  5172. ) {
  5173. tip(
  5174. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5175. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5176. " \"" + key + "\". " +
  5177. "Note that HTML attributes are case-insensitive and camelCased " +
  5178. "props need to use their kebab-case equivalents when using in-DOM " +
  5179. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5180. );
  5181. }
  5182. }
  5183. checkProp(res, props, key, altKey, true) ||
  5184. checkProp(res, attrs, key, altKey, false);
  5185. }
  5186. }
  5187. // fixed by xxxxxx
  5188. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  5189. }
  5190. function checkProp (
  5191. res,
  5192. hash,
  5193. key,
  5194. altKey,
  5195. preserve
  5196. ) {
  5197. if (isDef(hash)) {
  5198. if (hasOwn(hash, key)) {
  5199. res[key] = hash[key];
  5200. if (!preserve) {
  5201. delete hash[key];
  5202. }
  5203. return true
  5204. } else if (hasOwn(hash, altKey)) {
  5205. res[key] = hash[altKey];
  5206. if (!preserve) {
  5207. delete hash[altKey];
  5208. }
  5209. return true
  5210. }
  5211. }
  5212. return false
  5213. }
  5214. /* */
  5215. // The template compiler attempts to minimize the need for normalization by
  5216. // statically analyzing the template at compile time.
  5217. //
  5218. // For plain HTML markup, normalization can be completely skipped because the
  5219. // generated render function is guaranteed to return Array<VNode>. There are
  5220. // two cases where extra normalization is needed:
  5221. // 1. When the children contains components - because a functional component
  5222. // may return an Array instead of a single root. In this case, just a simple
  5223. // normalization is needed - if any child is an Array, we flatten the whole
  5224. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  5225. // because functional components already normalize their own children.
  5226. function simpleNormalizeChildren (children) {
  5227. for (var i = 0; i < children.length; i++) {
  5228. if (Array.isArray(children[i])) {
  5229. return Array.prototype.concat.apply([], children)
  5230. }
  5231. }
  5232. return children
  5233. }
  5234. // 2. When the children contains constructs that always generated nested Arrays,
  5235. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  5236. // with hand-written render functions / JSX. In such cases a full normalization
  5237. // is needed to cater to all possible types of children values.
  5238. function normalizeChildren (children) {
  5239. return isPrimitive(children)
  5240. ? [createTextVNode(children)]
  5241. : Array.isArray(children)
  5242. ? normalizeArrayChildren(children)
  5243. : undefined
  5244. }
  5245. function isTextNode (node) {
  5246. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  5247. }
  5248. function normalizeArrayChildren (children, nestedIndex) {
  5249. var res = [];
  5250. var i, c, lastIndex, last;
  5251. for (i = 0; i < children.length; i++) {
  5252. c = children[i];
  5253. if (isUndef(c) || typeof c === 'boolean') { continue }
  5254. lastIndex = res.length - 1;
  5255. last = res[lastIndex];
  5256. // nested
  5257. if (Array.isArray(c)) {
  5258. if (c.length > 0) {
  5259. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  5260. // merge adjacent text nodes
  5261. if (isTextNode(c[0]) && isTextNode(last)) {
  5262. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5263. c.shift();
  5264. }
  5265. res.push.apply(res, c);
  5266. }
  5267. } else if (isPrimitive(c)) {
  5268. if (isTextNode(last)) {
  5269. // merge adjacent text nodes
  5270. // this is necessary for SSR hydration because text nodes are
  5271. // essentially merged when rendered to HTML strings
  5272. res[lastIndex] = createTextVNode(last.text + c);
  5273. } else if (c !== '') {
  5274. // convert primitive to vnode
  5275. res.push(createTextVNode(c));
  5276. }
  5277. } else {
  5278. if (isTextNode(c) && isTextNode(last)) {
  5279. // merge adjacent text nodes
  5280. res[lastIndex] = createTextVNode(last.text + c.text);
  5281. } else {
  5282. // default key for nested array children (likely generated by v-for)
  5283. if (isTrue(children._isVList) &&
  5284. isDef(c.tag) &&
  5285. isUndef(c.key) &&
  5286. isDef(nestedIndex)) {
  5287. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5288. }
  5289. res.push(c);
  5290. }
  5291. }
  5292. }
  5293. return res
  5294. }
  5295. /* */
  5296. function initProvide (vm) {
  5297. var provide = vm.$options.provide;
  5298. if (provide) {
  5299. vm._provided = typeof provide === 'function'
  5300. ? provide.call(vm)
  5301. : provide;
  5302. }
  5303. }
  5304. function initInjections (vm) {
  5305. var result = resolveInject(vm.$options.inject, vm);
  5306. if (result) {
  5307. toggleObserving(false);
  5308. Object.keys(result).forEach(function (key) {
  5309. /* istanbul ignore else */
  5310. if (true) {
  5311. defineReactive$$1(vm, key, result[key], function () {
  5312. warn(
  5313. "Avoid mutating an injected value directly since the changes will be " +
  5314. "overwritten whenever the provided component re-renders. " +
  5315. "injection being mutated: \"" + key + "\"",
  5316. vm
  5317. );
  5318. });
  5319. } else {}
  5320. });
  5321. toggleObserving(true);
  5322. }
  5323. }
  5324. function resolveInject (inject, vm) {
  5325. if (inject) {
  5326. // inject is :any because flow is not smart enough to figure out cached
  5327. var result = Object.create(null);
  5328. var keys = hasSymbol
  5329. ? Reflect.ownKeys(inject)
  5330. : Object.keys(inject);
  5331. for (var i = 0; i < keys.length; i++) {
  5332. var key = keys[i];
  5333. // #6574 in case the inject object is observed...
  5334. if (key === '__ob__') { continue }
  5335. var provideKey = inject[key].from;
  5336. var source = vm;
  5337. while (source) {
  5338. if (source._provided && hasOwn(source._provided, provideKey)) {
  5339. result[key] = source._provided[provideKey];
  5340. break
  5341. }
  5342. source = source.$parent;
  5343. }
  5344. if (!source) {
  5345. if ('default' in inject[key]) {
  5346. var provideDefault = inject[key].default;
  5347. result[key] = typeof provideDefault === 'function'
  5348. ? provideDefault.call(vm)
  5349. : provideDefault;
  5350. } else if (true) {
  5351. warn(("Injection \"" + key + "\" not found"), vm);
  5352. }
  5353. }
  5354. }
  5355. return result
  5356. }
  5357. }
  5358. /* */
  5359. /**
  5360. * Runtime helper for resolving raw children VNodes into a slot object.
  5361. */
  5362. function resolveSlots (
  5363. children,
  5364. context
  5365. ) {
  5366. if (!children || !children.length) {
  5367. return {}
  5368. }
  5369. var slots = {};
  5370. for (var i = 0, l = children.length; i < l; i++) {
  5371. var child = children[i];
  5372. var data = child.data;
  5373. // remove slot attribute if the node is resolved as a Vue slot node
  5374. if (data && data.attrs && data.attrs.slot) {
  5375. delete data.attrs.slot;
  5376. }
  5377. // named slots should only be respected if the vnode was rendered in the
  5378. // same context.
  5379. if ((child.context === context || child.fnContext === context) &&
  5380. data && data.slot != null
  5381. ) {
  5382. var name = data.slot;
  5383. var slot = (slots[name] || (slots[name] = []));
  5384. if (child.tag === 'template') {
  5385. slot.push.apply(slot, child.children || []);
  5386. } else {
  5387. slot.push(child);
  5388. }
  5389. } else {
  5390. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  5391. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  5392. (slots['page'] || (slots['page'] = [])).push(child);
  5393. }else{
  5394. (slots.default || (slots.default = [])).push(child);
  5395. }
  5396. }
  5397. }
  5398. // ignore slots that contains only whitespace
  5399. for (var name$1 in slots) {
  5400. if (slots[name$1].every(isWhitespace)) {
  5401. delete slots[name$1];
  5402. }
  5403. }
  5404. return slots
  5405. }
  5406. function isWhitespace (node) {
  5407. return (node.isComment && !node.asyncFactory) || node.text === ' '
  5408. }
  5409. /* */
  5410. function normalizeScopedSlots (
  5411. slots,
  5412. normalSlots,
  5413. prevSlots
  5414. ) {
  5415. var res;
  5416. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  5417. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  5418. var key = slots && slots.$key;
  5419. if (!slots) {
  5420. res = {};
  5421. } else if (slots._normalized) {
  5422. // fast path 1: child component re-render only, parent did not change
  5423. return slots._normalized
  5424. } else if (
  5425. isStable &&
  5426. prevSlots &&
  5427. prevSlots !== emptyObject &&
  5428. key === prevSlots.$key &&
  5429. !hasNormalSlots &&
  5430. !prevSlots.$hasNormal
  5431. ) {
  5432. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  5433. // only need to normalize once
  5434. return prevSlots
  5435. } else {
  5436. res = {};
  5437. for (var key$1 in slots) {
  5438. if (slots[key$1] && key$1[0] !== '$') {
  5439. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  5440. }
  5441. }
  5442. }
  5443. // expose normal slots on scopedSlots
  5444. for (var key$2 in normalSlots) {
  5445. if (!(key$2 in res)) {
  5446. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  5447. }
  5448. }
  5449. // avoriaz seems to mock a non-extensible $scopedSlots object
  5450. // and when that is passed down this would cause an error
  5451. if (slots && Object.isExtensible(slots)) {
  5452. (slots)._normalized = res;
  5453. }
  5454. def(res, '$stable', isStable);
  5455. def(res, '$key', key);
  5456. def(res, '$hasNormal', hasNormalSlots);
  5457. return res
  5458. }
  5459. function normalizeScopedSlot(normalSlots, key, fn) {
  5460. var normalized = function () {
  5461. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  5462. res = res && typeof res === 'object' && !Array.isArray(res)
  5463. ? [res] // single vnode
  5464. : normalizeChildren(res);
  5465. return res && (
  5466. res.length === 0 ||
  5467. (res.length === 1 && res[0].isComment) // #9658
  5468. ) ? undefined
  5469. : res
  5470. };
  5471. // this is a slot using the new v-slot syntax without scope. although it is
  5472. // compiled as a scoped slot, render fn users would expect it to be present
  5473. // on this.$slots because the usage is semantically a normal slot.
  5474. if (fn.proxy) {
  5475. Object.defineProperty(normalSlots, key, {
  5476. get: normalized,
  5477. enumerable: true,
  5478. configurable: true
  5479. });
  5480. }
  5481. return normalized
  5482. }
  5483. function proxyNormalSlot(slots, key) {
  5484. return function () { return slots[key]; }
  5485. }
  5486. /* */
  5487. /**
  5488. * Runtime helper for rendering v-for lists.
  5489. */
  5490. function renderList (
  5491. val,
  5492. render
  5493. ) {
  5494. var ret, i, l, keys, key;
  5495. if (Array.isArray(val) || typeof val === 'string') {
  5496. ret = new Array(val.length);
  5497. for (i = 0, l = val.length; i < l; i++) {
  5498. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  5499. }
  5500. } else if (typeof val === 'number') {
  5501. ret = new Array(val);
  5502. for (i = 0; i < val; i++) {
  5503. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  5504. }
  5505. } else if (isObject(val)) {
  5506. if (hasSymbol && val[Symbol.iterator]) {
  5507. ret = [];
  5508. var iterator = val[Symbol.iterator]();
  5509. var result = iterator.next();
  5510. while (!result.done) {
  5511. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  5512. result = iterator.next();
  5513. }
  5514. } else {
  5515. keys = Object.keys(val);
  5516. ret = new Array(keys.length);
  5517. for (i = 0, l = keys.length; i < l; i++) {
  5518. key = keys[i];
  5519. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  5520. }
  5521. }
  5522. }
  5523. if (!isDef(ret)) {
  5524. ret = [];
  5525. }
  5526. (ret)._isVList = true;
  5527. return ret
  5528. }
  5529. /* */
  5530. /**
  5531. * Runtime helper for rendering <slot>
  5532. */
  5533. function renderSlot (
  5534. name,
  5535. fallback,
  5536. props,
  5537. bindObject
  5538. ) {
  5539. var scopedSlotFn = this.$scopedSlots[name];
  5540. var nodes;
  5541. if (scopedSlotFn) { // scoped slot
  5542. props = props || {};
  5543. if (bindObject) {
  5544. if ( true && !isObject(bindObject)) {
  5545. warn(
  5546. 'slot v-bind without argument expects an Object',
  5547. this
  5548. );
  5549. }
  5550. props = extend(extend({}, bindObject), props);
  5551. }
  5552. // fixed by xxxxxx app-plus scopedSlot
  5553. nodes = scopedSlotFn(props, this, props._i) || fallback;
  5554. } else {
  5555. nodes = this.$slots[name] || fallback;
  5556. }
  5557. var target = props && props.slot;
  5558. if (target) {
  5559. return this.$createElement('template', { slot: target }, nodes)
  5560. } else {
  5561. return nodes
  5562. }
  5563. }
  5564. /* */
  5565. /**
  5566. * Runtime helper for resolving filters
  5567. */
  5568. function resolveFilter (id) {
  5569. return resolveAsset(this.$options, 'filters', id, true) || identity
  5570. }
  5571. /* */
  5572. function isKeyNotMatch (expect, actual) {
  5573. if (Array.isArray(expect)) {
  5574. return expect.indexOf(actual) === -1
  5575. } else {
  5576. return expect !== actual
  5577. }
  5578. }
  5579. /**
  5580. * Runtime helper for checking keyCodes from config.
  5581. * exposed as Vue.prototype._k
  5582. * passing in eventKeyName as last argument separately for backwards compat
  5583. */
  5584. function checkKeyCodes (
  5585. eventKeyCode,
  5586. key,
  5587. builtInKeyCode,
  5588. eventKeyName,
  5589. builtInKeyName
  5590. ) {
  5591. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  5592. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  5593. return isKeyNotMatch(builtInKeyName, eventKeyName)
  5594. } else if (mappedKeyCode) {
  5595. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  5596. } else if (eventKeyName) {
  5597. return hyphenate(eventKeyName) !== key
  5598. }
  5599. }
  5600. /* */
  5601. /**
  5602. * Runtime helper for merging v-bind="object" into a VNode's data.
  5603. */
  5604. function bindObjectProps (
  5605. data,
  5606. tag,
  5607. value,
  5608. asProp,
  5609. isSync
  5610. ) {
  5611. if (value) {
  5612. if (!isObject(value)) {
  5613. true && warn(
  5614. 'v-bind without argument expects an Object or Array value',
  5615. this
  5616. );
  5617. } else {
  5618. if (Array.isArray(value)) {
  5619. value = toObject(value);
  5620. }
  5621. var hash;
  5622. var loop = function ( key ) {
  5623. if (
  5624. key === 'class' ||
  5625. key === 'style' ||
  5626. isReservedAttribute(key)
  5627. ) {
  5628. hash = data;
  5629. } else {
  5630. var type = data.attrs && data.attrs.type;
  5631. hash = asProp || config.mustUseProp(tag, type, key)
  5632. ? data.domProps || (data.domProps = {})
  5633. : data.attrs || (data.attrs = {});
  5634. }
  5635. var camelizedKey = camelize(key);
  5636. var hyphenatedKey = hyphenate(key);
  5637. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  5638. hash[key] = value[key];
  5639. if (isSync) {
  5640. var on = data.on || (data.on = {});
  5641. on[("update:" + key)] = function ($event) {
  5642. value[key] = $event;
  5643. };
  5644. }
  5645. }
  5646. };
  5647. for (var key in value) loop( key );
  5648. }
  5649. }
  5650. return data
  5651. }
  5652. /* */
  5653. /**
  5654. * Runtime helper for rendering static trees.
  5655. */
  5656. function renderStatic (
  5657. index,
  5658. isInFor
  5659. ) {
  5660. var cached = this._staticTrees || (this._staticTrees = []);
  5661. var tree = cached[index];
  5662. // if has already-rendered static tree and not inside v-for,
  5663. // we can reuse the same tree.
  5664. if (tree && !isInFor) {
  5665. return tree
  5666. }
  5667. // otherwise, render a fresh tree.
  5668. tree = cached[index] = this.$options.staticRenderFns[index].call(
  5669. this._renderProxy,
  5670. null,
  5671. this // for render fns generated for functional component templates
  5672. );
  5673. markStatic(tree, ("__static__" + index), false);
  5674. return tree
  5675. }
  5676. /**
  5677. * Runtime helper for v-once.
  5678. * Effectively it means marking the node as static with a unique key.
  5679. */
  5680. function markOnce (
  5681. tree,
  5682. index,
  5683. key
  5684. ) {
  5685. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  5686. return tree
  5687. }
  5688. function markStatic (
  5689. tree,
  5690. key,
  5691. isOnce
  5692. ) {
  5693. if (Array.isArray(tree)) {
  5694. for (var i = 0; i < tree.length; i++) {
  5695. if (tree[i] && typeof tree[i] !== 'string') {
  5696. markStaticNode(tree[i], (key + "_" + i), isOnce);
  5697. }
  5698. }
  5699. } else {
  5700. markStaticNode(tree, key, isOnce);
  5701. }
  5702. }
  5703. function markStaticNode (node, key, isOnce) {
  5704. node.isStatic = true;
  5705. node.key = key;
  5706. node.isOnce = isOnce;
  5707. }
  5708. /* */
  5709. function bindObjectListeners (data, value) {
  5710. if (value) {
  5711. if (!isPlainObject(value)) {
  5712. true && warn(
  5713. 'v-on without argument expects an Object value',
  5714. this
  5715. );
  5716. } else {
  5717. var on = data.on = data.on ? extend({}, data.on) : {};
  5718. for (var key in value) {
  5719. var existing = on[key];
  5720. var ours = value[key];
  5721. on[key] = existing ? [].concat(existing, ours) : ours;
  5722. }
  5723. }
  5724. }
  5725. return data
  5726. }
  5727. /* */
  5728. function resolveScopedSlots (
  5729. fns, // see flow/vnode
  5730. res,
  5731. // the following are added in 2.6
  5732. hasDynamicKeys,
  5733. contentHashKey
  5734. ) {
  5735. res = res || { $stable: !hasDynamicKeys };
  5736. for (var i = 0; i < fns.length; i++) {
  5737. var slot = fns[i];
  5738. if (Array.isArray(slot)) {
  5739. resolveScopedSlots(slot, res, hasDynamicKeys);
  5740. } else if (slot) {
  5741. // marker for reverse proxying v-slot without scope on this.$slots
  5742. if (slot.proxy) {
  5743. slot.fn.proxy = true;
  5744. }
  5745. res[slot.key] = slot.fn;
  5746. }
  5747. }
  5748. if (contentHashKey) {
  5749. (res).$key = contentHashKey;
  5750. }
  5751. return res
  5752. }
  5753. /* */
  5754. function bindDynamicKeys (baseObj, values) {
  5755. for (var i = 0; i < values.length; i += 2) {
  5756. var key = values[i];
  5757. if (typeof key === 'string' && key) {
  5758. baseObj[values[i]] = values[i + 1];
  5759. } else if ( true && key !== '' && key !== null) {
  5760. // null is a special value for explicitly removing a binding
  5761. warn(
  5762. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  5763. this
  5764. );
  5765. }
  5766. }
  5767. return baseObj
  5768. }
  5769. // helper to dynamically append modifier runtime markers to event names.
  5770. // ensure only append when value is already string, otherwise it will be cast
  5771. // to string and cause the type check to miss.
  5772. function prependModifier (value, symbol) {
  5773. return typeof value === 'string' ? symbol + value : value
  5774. }
  5775. /* */
  5776. function installRenderHelpers (target) {
  5777. target._o = markOnce;
  5778. target._n = toNumber;
  5779. target._s = toString;
  5780. target._l = renderList;
  5781. target._t = renderSlot;
  5782. target._q = looseEqual;
  5783. target._i = looseIndexOf;
  5784. target._m = renderStatic;
  5785. target._f = resolveFilter;
  5786. target._k = checkKeyCodes;
  5787. target._b = bindObjectProps;
  5788. target._v = createTextVNode;
  5789. target._e = createEmptyVNode;
  5790. target._u = resolveScopedSlots;
  5791. target._g = bindObjectListeners;
  5792. target._d = bindDynamicKeys;
  5793. target._p = prependModifier;
  5794. }
  5795. /* */
  5796. function FunctionalRenderContext (
  5797. data,
  5798. props,
  5799. children,
  5800. parent,
  5801. Ctor
  5802. ) {
  5803. var this$1 = this;
  5804. var options = Ctor.options;
  5805. // ensure the createElement function in functional components
  5806. // gets a unique context - this is necessary for correct named slot check
  5807. var contextVm;
  5808. if (hasOwn(parent, '_uid')) {
  5809. contextVm = Object.create(parent);
  5810. // $flow-disable-line
  5811. contextVm._original = parent;
  5812. } else {
  5813. // the context vm passed in is a functional context as well.
  5814. // in this case we want to make sure we are able to get a hold to the
  5815. // real context instance.
  5816. contextVm = parent;
  5817. // $flow-disable-line
  5818. parent = parent._original;
  5819. }
  5820. var isCompiled = isTrue(options._compiled);
  5821. var needNormalization = !isCompiled;
  5822. this.data = data;
  5823. this.props = props;
  5824. this.children = children;
  5825. this.parent = parent;
  5826. this.listeners = data.on || emptyObject;
  5827. this.injections = resolveInject(options.inject, parent);
  5828. this.slots = function () {
  5829. if (!this$1.$slots) {
  5830. normalizeScopedSlots(
  5831. data.scopedSlots,
  5832. this$1.$slots = resolveSlots(children, parent)
  5833. );
  5834. }
  5835. return this$1.$slots
  5836. };
  5837. Object.defineProperty(this, 'scopedSlots', ({
  5838. enumerable: true,
  5839. get: function get () {
  5840. return normalizeScopedSlots(data.scopedSlots, this.slots())
  5841. }
  5842. }));
  5843. // support for compiled functional template
  5844. if (isCompiled) {
  5845. // exposing $options for renderStatic()
  5846. this.$options = options;
  5847. // pre-resolve slots for renderSlot()
  5848. this.$slots = this.slots();
  5849. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  5850. }
  5851. if (options._scopeId) {
  5852. this._c = function (a, b, c, d) {
  5853. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  5854. if (vnode && !Array.isArray(vnode)) {
  5855. vnode.fnScopeId = options._scopeId;
  5856. vnode.fnContext = parent;
  5857. }
  5858. return vnode
  5859. };
  5860. } else {
  5861. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  5862. }
  5863. }
  5864. installRenderHelpers(FunctionalRenderContext.prototype);
  5865. function createFunctionalComponent (
  5866. Ctor,
  5867. propsData,
  5868. data,
  5869. contextVm,
  5870. children
  5871. ) {
  5872. var options = Ctor.options;
  5873. var props = {};
  5874. var propOptions = options.props;
  5875. if (isDef(propOptions)) {
  5876. for (var key in propOptions) {
  5877. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  5878. }
  5879. } else {
  5880. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  5881. if (isDef(data.props)) { mergeProps(props, data.props); }
  5882. }
  5883. var renderContext = new FunctionalRenderContext(
  5884. data,
  5885. props,
  5886. children,
  5887. contextVm,
  5888. Ctor
  5889. );
  5890. var vnode = options.render.call(null, renderContext._c, renderContext);
  5891. if (vnode instanceof VNode) {
  5892. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  5893. } else if (Array.isArray(vnode)) {
  5894. var vnodes = normalizeChildren(vnode) || [];
  5895. var res = new Array(vnodes.length);
  5896. for (var i = 0; i < vnodes.length; i++) {
  5897. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  5898. }
  5899. return res
  5900. }
  5901. }
  5902. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  5903. // #7817 clone node before setting fnContext, otherwise if the node is reused
  5904. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  5905. // that should not be matched to match.
  5906. var clone = cloneVNode(vnode);
  5907. clone.fnContext = contextVm;
  5908. clone.fnOptions = options;
  5909. if (true) {
  5910. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  5911. }
  5912. if (data.slot) {
  5913. (clone.data || (clone.data = {})).slot = data.slot;
  5914. }
  5915. return clone
  5916. }
  5917. function mergeProps (to, from) {
  5918. for (var key in from) {
  5919. to[camelize(key)] = from[key];
  5920. }
  5921. }
  5922. /* */
  5923. /* */
  5924. /* */
  5925. /* */
  5926. // inline hooks to be invoked on component VNodes during patch
  5927. var componentVNodeHooks = {
  5928. init: function init (vnode, hydrating) {
  5929. if (
  5930. vnode.componentInstance &&
  5931. !vnode.componentInstance._isDestroyed &&
  5932. vnode.data.keepAlive
  5933. ) {
  5934. // kept-alive components, treat as a patch
  5935. var mountedNode = vnode; // work around flow
  5936. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  5937. } else {
  5938. var child = vnode.componentInstance = createComponentInstanceForVnode(
  5939. vnode,
  5940. activeInstance
  5941. );
  5942. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  5943. }
  5944. },
  5945. prepatch: function prepatch (oldVnode, vnode) {
  5946. var options = vnode.componentOptions;
  5947. var child = vnode.componentInstance = oldVnode.componentInstance;
  5948. updateChildComponent(
  5949. child,
  5950. options.propsData, // updated props
  5951. options.listeners, // updated listeners
  5952. vnode, // new parent vnode
  5953. options.children // new children
  5954. );
  5955. },
  5956. insert: function insert (vnode) {
  5957. var context = vnode.context;
  5958. var componentInstance = vnode.componentInstance;
  5959. if (!componentInstance._isMounted) {
  5960. callHook(componentInstance, 'onServiceCreated');
  5961. callHook(componentInstance, 'onServiceAttached');
  5962. componentInstance._isMounted = true;
  5963. callHook(componentInstance, 'mounted');
  5964. }
  5965. if (vnode.data.keepAlive) {
  5966. if (context._isMounted) {
  5967. // vue-router#1212
  5968. // During updates, a kept-alive component's child components may
  5969. // change, so directly walking the tree here may call activated hooks
  5970. // on incorrect children. Instead we push them into a queue which will
  5971. // be processed after the whole patch process ended.
  5972. queueActivatedComponent(componentInstance);
  5973. } else {
  5974. activateChildComponent(componentInstance, true /* direct */);
  5975. }
  5976. }
  5977. },
  5978. destroy: function destroy (vnode) {
  5979. var componentInstance = vnode.componentInstance;
  5980. if (!componentInstance._isDestroyed) {
  5981. if (!vnode.data.keepAlive) {
  5982. componentInstance.$destroy();
  5983. } else {
  5984. deactivateChildComponent(componentInstance, true /* direct */);
  5985. }
  5986. }
  5987. }
  5988. };
  5989. var hooksToMerge = Object.keys(componentVNodeHooks);
  5990. function createComponent (
  5991. Ctor,
  5992. data,
  5993. context,
  5994. children,
  5995. tag
  5996. ) {
  5997. if (isUndef(Ctor)) {
  5998. return
  5999. }
  6000. var baseCtor = context.$options._base;
  6001. // plain options object: turn it into a constructor
  6002. if (isObject(Ctor)) {
  6003. Ctor = baseCtor.extend(Ctor);
  6004. }
  6005. // if at this stage it's not a constructor or an async component factory,
  6006. // reject.
  6007. if (typeof Ctor !== 'function') {
  6008. if (true) {
  6009. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6010. }
  6011. return
  6012. }
  6013. // async component
  6014. var asyncFactory;
  6015. if (isUndef(Ctor.cid)) {
  6016. asyncFactory = Ctor;
  6017. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6018. if (Ctor === undefined) {
  6019. // return a placeholder node for async component, which is rendered
  6020. // as a comment node but preserves all the raw information for the node.
  6021. // the information will be used for async server-rendering and hydration.
  6022. return createAsyncPlaceholder(
  6023. asyncFactory,
  6024. data,
  6025. context,
  6026. children,
  6027. tag
  6028. )
  6029. }
  6030. }
  6031. data = data || {};
  6032. // resolve constructor options in case global mixins are applied after
  6033. // component constructor creation
  6034. resolveConstructorOptions(Ctor);
  6035. // transform component v-model data into props & events
  6036. if (isDef(data.model)) {
  6037. transformModel(Ctor.options, data);
  6038. }
  6039. // extract props
  6040. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6041. // functional component
  6042. if (isTrue(Ctor.options.functional)) {
  6043. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6044. }
  6045. // extract listeners, since these needs to be treated as
  6046. // child component listeners instead of DOM listeners
  6047. var listeners = data.on;
  6048. // replace with listeners with .native modifier
  6049. // so it gets processed during parent component patch.
  6050. data.on = data.nativeOn;
  6051. if (isTrue(Ctor.options.abstract)) {
  6052. // abstract components do not keep anything
  6053. // other than props & listeners & slot
  6054. // work around flow
  6055. var slot = data.slot;
  6056. data = {};
  6057. if (slot) {
  6058. data.slot = slot;
  6059. }
  6060. }
  6061. // install component management hooks onto the placeholder node
  6062. installComponentHooks(data);
  6063. // return a placeholder vnode
  6064. var name = Ctor.options.name || tag;
  6065. var vnode = new VNode(
  6066. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6067. data, undefined, undefined, undefined, context,
  6068. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6069. asyncFactory
  6070. );
  6071. return vnode
  6072. }
  6073. function createComponentInstanceForVnode (
  6074. vnode, // we know it's MountedComponentVNode but flow doesn't
  6075. parent // activeInstance in lifecycle state
  6076. ) {
  6077. var options = {
  6078. _isComponent: true,
  6079. _parentVnode: vnode,
  6080. parent: parent
  6081. };
  6082. // check inline-template render functions
  6083. var inlineTemplate = vnode.data.inlineTemplate;
  6084. if (isDef(inlineTemplate)) {
  6085. options.render = inlineTemplate.render;
  6086. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6087. }
  6088. return new vnode.componentOptions.Ctor(options)
  6089. }
  6090. function installComponentHooks (data) {
  6091. var hooks = data.hook || (data.hook = {});
  6092. for (var i = 0; i < hooksToMerge.length; i++) {
  6093. var key = hooksToMerge[i];
  6094. var existing = hooks[key];
  6095. var toMerge = componentVNodeHooks[key];
  6096. if (existing !== toMerge && !(existing && existing._merged)) {
  6097. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6098. }
  6099. }
  6100. }
  6101. function mergeHook$1 (f1, f2) {
  6102. var merged = function (a, b) {
  6103. // flow complains about extra args which is why we use any
  6104. f1(a, b);
  6105. f2(a, b);
  6106. };
  6107. merged._merged = true;
  6108. return merged
  6109. }
  6110. // transform component v-model info (value and callback) into
  6111. // prop and event handler respectively.
  6112. function transformModel (options, data) {
  6113. var prop = (options.model && options.model.prop) || 'value';
  6114. var event = (options.model && options.model.event) || 'input'
  6115. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6116. var on = data.on || (data.on = {});
  6117. var existing = on[event];
  6118. var callback = data.model.callback;
  6119. if (isDef(existing)) {
  6120. if (
  6121. Array.isArray(existing)
  6122. ? existing.indexOf(callback) === -1
  6123. : existing !== callback
  6124. ) {
  6125. on[event] = [callback].concat(existing);
  6126. }
  6127. } else {
  6128. on[event] = callback;
  6129. }
  6130. }
  6131. /* */
  6132. var SIMPLE_NORMALIZE = 1;
  6133. var ALWAYS_NORMALIZE = 2;
  6134. // wrapper function for providing a more flexible interface
  6135. // without getting yelled at by flow
  6136. function createElement (
  6137. context,
  6138. tag,
  6139. data,
  6140. children,
  6141. normalizationType,
  6142. alwaysNormalize
  6143. ) {
  6144. if (Array.isArray(data) || isPrimitive(data)) {
  6145. normalizationType = children;
  6146. children = data;
  6147. data = undefined;
  6148. }
  6149. if (isTrue(alwaysNormalize)) {
  6150. normalizationType = ALWAYS_NORMALIZE;
  6151. }
  6152. return _createElement(context, tag, data, children, normalizationType)
  6153. }
  6154. function _createElement (
  6155. context,
  6156. tag,
  6157. data,
  6158. children,
  6159. normalizationType
  6160. ) {
  6161. if (isDef(data) && isDef((data).__ob__)) {
  6162. true && warn(
  6163. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6164. 'Always create fresh vnode data objects in each render!',
  6165. context
  6166. );
  6167. return createEmptyVNode()
  6168. }
  6169. // object syntax in v-bind
  6170. if (isDef(data) && isDef(data.is)) {
  6171. tag = data.is;
  6172. }
  6173. if (!tag) {
  6174. // in case of component :is set to falsy value
  6175. return createEmptyVNode()
  6176. }
  6177. // warn against non-primitive key
  6178. if ( true &&
  6179. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6180. ) {
  6181. {
  6182. warn(
  6183. 'Avoid using non-primitive value as key, ' +
  6184. 'use string/number value instead.',
  6185. context
  6186. );
  6187. }
  6188. }
  6189. // support single function children as default scoped slot
  6190. if (Array.isArray(children) &&
  6191. typeof children[0] === 'function'
  6192. ) {
  6193. data = data || {};
  6194. data.scopedSlots = { default: children[0] };
  6195. children.length = 0;
  6196. }
  6197. if (normalizationType === ALWAYS_NORMALIZE) {
  6198. children = normalizeChildren(children);
  6199. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6200. children = simpleNormalizeChildren(children);
  6201. }
  6202. var vnode, ns;
  6203. if (typeof tag === 'string') {
  6204. var Ctor;
  6205. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6206. if (config.isReservedTag(tag)) {
  6207. // platform built-in elements
  6208. if ( true && isDef(data) && isDef(data.nativeOn)) {
  6209. warn(
  6210. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  6211. context
  6212. );
  6213. }
  6214. vnode = new VNode(
  6215. config.parsePlatformTagName(tag), data, children,
  6216. undefined, undefined, context
  6217. );
  6218. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6219. // component
  6220. vnode = createComponent(Ctor, data, context, children, tag);
  6221. } else {
  6222. // unknown or unlisted namespaced elements
  6223. // check at runtime because it may get assigned a namespace when its
  6224. // parent normalizes children
  6225. vnode = new VNode(
  6226. tag, data, children,
  6227. undefined, undefined, context
  6228. );
  6229. }
  6230. } else {
  6231. // direct component options / constructor
  6232. vnode = createComponent(tag, data, context, children);
  6233. }
  6234. if (Array.isArray(vnode)) {
  6235. return vnode
  6236. } else if (isDef(vnode)) {
  6237. if (isDef(ns)) { applyNS(vnode, ns); }
  6238. if (isDef(data)) { registerDeepBindings(data); }
  6239. return vnode
  6240. } else {
  6241. return createEmptyVNode()
  6242. }
  6243. }
  6244. function applyNS (vnode, ns, force) {
  6245. vnode.ns = ns;
  6246. if (vnode.tag === 'foreignObject') {
  6247. // use default namespace inside foreignObject
  6248. ns = undefined;
  6249. force = true;
  6250. }
  6251. if (isDef(vnode.children)) {
  6252. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6253. var child = vnode.children[i];
  6254. if (isDef(child.tag) && (
  6255. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6256. applyNS(child, ns, force);
  6257. }
  6258. }
  6259. }
  6260. }
  6261. // ref #5318
  6262. // necessary to ensure parent re-render when deep bindings like :style and
  6263. // :class are used on slot nodes
  6264. function registerDeepBindings (data) {
  6265. if (isObject(data.style)) {
  6266. traverse(data.style);
  6267. }
  6268. if (isObject(data.class)) {
  6269. traverse(data.class);
  6270. }
  6271. }
  6272. /* */
  6273. function initRender (vm) {
  6274. vm._vnode = null; // the root of the child tree
  6275. vm._staticTrees = null; // v-once cached trees
  6276. var options = vm.$options;
  6277. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6278. var renderContext = parentVnode && parentVnode.context;
  6279. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6280. vm.$scopedSlots = emptyObject;
  6281. // bind the createElement fn to this instance
  6282. // so that we get proper render context inside it.
  6283. // args order: tag, data, children, normalizationType, alwaysNormalize
  6284. // internal version is used by render functions compiled from templates
  6285. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6286. // normalization is always applied for the public version, used in
  6287. // user-written render functions.
  6288. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6289. // $attrs & $listeners are exposed for easier HOC creation.
  6290. // they need to be reactive so that HOCs using them are always updated
  6291. var parentData = parentVnode && parentVnode.data;
  6292. /* istanbul ignore else */
  6293. if (true) {
  6294. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6295. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6296. }, true);
  6297. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6298. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6299. }, true);
  6300. } else {}
  6301. }
  6302. var currentRenderingInstance = null;
  6303. function renderMixin (Vue) {
  6304. // install runtime convenience helpers
  6305. installRenderHelpers(Vue.prototype);
  6306. Vue.prototype.$nextTick = function (fn) {
  6307. return nextTick(fn, this)
  6308. };
  6309. Vue.prototype._render = function () {
  6310. var vm = this;
  6311. var ref = vm.$options;
  6312. var render = ref.render;
  6313. var _parentVnode = ref._parentVnode;
  6314. if (_parentVnode) {
  6315. vm.$scopedSlots = normalizeScopedSlots(
  6316. _parentVnode.data.scopedSlots,
  6317. vm.$slots,
  6318. vm.$scopedSlots
  6319. );
  6320. }
  6321. // set parent vnode. this allows render functions to have access
  6322. // to the data on the placeholder node.
  6323. vm.$vnode = _parentVnode;
  6324. // render self
  6325. var vnode;
  6326. try {
  6327. // There's no need to maintain a stack because all render fns are called
  6328. // separately from one another. Nested component's render fns are called
  6329. // when parent component is patched.
  6330. currentRenderingInstance = vm;
  6331. vnode = render.call(vm._renderProxy, vm.$createElement);
  6332. } catch (e) {
  6333. handleError(e, vm, "render");
  6334. // return error render result,
  6335. // or previous vnode to prevent render error causing blank component
  6336. /* istanbul ignore else */
  6337. if ( true && vm.$options.renderError) {
  6338. try {
  6339. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6340. } catch (e) {
  6341. handleError(e, vm, "renderError");
  6342. vnode = vm._vnode;
  6343. }
  6344. } else {
  6345. vnode = vm._vnode;
  6346. }
  6347. } finally {
  6348. currentRenderingInstance = null;
  6349. }
  6350. // if the returned array contains only a single node, allow it
  6351. if (Array.isArray(vnode) && vnode.length === 1) {
  6352. vnode = vnode[0];
  6353. }
  6354. // return empty vnode in case the render function errored out
  6355. if (!(vnode instanceof VNode)) {
  6356. if ( true && Array.isArray(vnode)) {
  6357. warn(
  6358. 'Multiple root nodes returned from render function. Render function ' +
  6359. 'should return a single root node.',
  6360. vm
  6361. );
  6362. }
  6363. vnode = createEmptyVNode();
  6364. }
  6365. // set parent
  6366. vnode.parent = _parentVnode;
  6367. return vnode
  6368. };
  6369. }
  6370. /* */
  6371. function ensureCtor (comp, base) {
  6372. if (
  6373. comp.__esModule ||
  6374. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  6375. ) {
  6376. comp = comp.default;
  6377. }
  6378. return isObject(comp)
  6379. ? base.extend(comp)
  6380. : comp
  6381. }
  6382. function createAsyncPlaceholder (
  6383. factory,
  6384. data,
  6385. context,
  6386. children,
  6387. tag
  6388. ) {
  6389. var node = createEmptyVNode();
  6390. node.asyncFactory = factory;
  6391. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  6392. return node
  6393. }
  6394. function resolveAsyncComponent (
  6395. factory,
  6396. baseCtor
  6397. ) {
  6398. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  6399. return factory.errorComp
  6400. }
  6401. if (isDef(factory.resolved)) {
  6402. return factory.resolved
  6403. }
  6404. var owner = currentRenderingInstance;
  6405. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  6406. // already pending
  6407. factory.owners.push(owner);
  6408. }
  6409. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  6410. return factory.loadingComp
  6411. }
  6412. if (owner && !isDef(factory.owners)) {
  6413. var owners = factory.owners = [owner];
  6414. var sync = true;
  6415. var timerLoading = null;
  6416. var timerTimeout = null
  6417. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  6418. var forceRender = function (renderCompleted) {
  6419. for (var i = 0, l = owners.length; i < l; i++) {
  6420. (owners[i]).$forceUpdate();
  6421. }
  6422. if (renderCompleted) {
  6423. owners.length = 0;
  6424. if (timerLoading !== null) {
  6425. clearTimeout(timerLoading);
  6426. timerLoading = null;
  6427. }
  6428. if (timerTimeout !== null) {
  6429. clearTimeout(timerTimeout);
  6430. timerTimeout = null;
  6431. }
  6432. }
  6433. };
  6434. var resolve = once(function (res) {
  6435. // cache resolved
  6436. factory.resolved = ensureCtor(res, baseCtor);
  6437. // invoke callbacks only if this is not a synchronous resolve
  6438. // (async resolves are shimmed as synchronous during SSR)
  6439. if (!sync) {
  6440. forceRender(true);
  6441. } else {
  6442. owners.length = 0;
  6443. }
  6444. });
  6445. var reject = once(function (reason) {
  6446. true && warn(
  6447. "Failed to resolve async component: " + (String(factory)) +
  6448. (reason ? ("\nReason: " + reason) : '')
  6449. );
  6450. if (isDef(factory.errorComp)) {
  6451. factory.error = true;
  6452. forceRender(true);
  6453. }
  6454. });
  6455. var res = factory(resolve, reject);
  6456. if (isObject(res)) {
  6457. if (isPromise(res)) {
  6458. // () => Promise
  6459. if (isUndef(factory.resolved)) {
  6460. res.then(resolve, reject);
  6461. }
  6462. } else if (isPromise(res.component)) {
  6463. res.component.then(resolve, reject);
  6464. if (isDef(res.error)) {
  6465. factory.errorComp = ensureCtor(res.error, baseCtor);
  6466. }
  6467. if (isDef(res.loading)) {
  6468. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  6469. if (res.delay === 0) {
  6470. factory.loading = true;
  6471. } else {
  6472. timerLoading = setTimeout(function () {
  6473. timerLoading = null;
  6474. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  6475. factory.loading = true;
  6476. forceRender(false);
  6477. }
  6478. }, res.delay || 200);
  6479. }
  6480. }
  6481. if (isDef(res.timeout)) {
  6482. timerTimeout = setTimeout(function () {
  6483. timerTimeout = null;
  6484. if (isUndef(factory.resolved)) {
  6485. reject(
  6486. true
  6487. ? ("timeout (" + (res.timeout) + "ms)")
  6488. : undefined
  6489. );
  6490. }
  6491. }, res.timeout);
  6492. }
  6493. }
  6494. }
  6495. sync = false;
  6496. // return in case resolved synchronously
  6497. return factory.loading
  6498. ? factory.loadingComp
  6499. : factory.resolved
  6500. }
  6501. }
  6502. /* */
  6503. function isAsyncPlaceholder (node) {
  6504. return node.isComment && node.asyncFactory
  6505. }
  6506. /* */
  6507. function getFirstComponentChild (children) {
  6508. if (Array.isArray(children)) {
  6509. for (var i = 0; i < children.length; i++) {
  6510. var c = children[i];
  6511. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  6512. return c
  6513. }
  6514. }
  6515. }
  6516. }
  6517. /* */
  6518. /* */
  6519. function initEvents (vm) {
  6520. vm._events = Object.create(null);
  6521. vm._hasHookEvent = false;
  6522. // init parent attached events
  6523. var listeners = vm.$options._parentListeners;
  6524. if (listeners) {
  6525. updateComponentListeners(vm, listeners);
  6526. }
  6527. }
  6528. var target;
  6529. function add (event, fn) {
  6530. target.$on(event, fn);
  6531. }
  6532. function remove$1 (event, fn) {
  6533. target.$off(event, fn);
  6534. }
  6535. function createOnceHandler (event, fn) {
  6536. var _target = target;
  6537. return function onceHandler () {
  6538. var res = fn.apply(null, arguments);
  6539. if (res !== null) {
  6540. _target.$off(event, onceHandler);
  6541. }
  6542. }
  6543. }
  6544. function updateComponentListeners (
  6545. vm,
  6546. listeners,
  6547. oldListeners
  6548. ) {
  6549. target = vm;
  6550. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  6551. target = undefined;
  6552. }
  6553. function eventsMixin (Vue) {
  6554. var hookRE = /^hook:/;
  6555. Vue.prototype.$on = function (event, fn) {
  6556. var vm = this;
  6557. if (Array.isArray(event)) {
  6558. for (var i = 0, l = event.length; i < l; i++) {
  6559. vm.$on(event[i], fn);
  6560. }
  6561. } else {
  6562. (vm._events[event] || (vm._events[event] = [])).push(fn);
  6563. // optimize hook:event cost by using a boolean flag marked at registration
  6564. // instead of a hash lookup
  6565. if (hookRE.test(event)) {
  6566. vm._hasHookEvent = true;
  6567. }
  6568. }
  6569. return vm
  6570. };
  6571. Vue.prototype.$once = function (event, fn) {
  6572. var vm = this;
  6573. function on () {
  6574. vm.$off(event, on);
  6575. fn.apply(vm, arguments);
  6576. }
  6577. on.fn = fn;
  6578. vm.$on(event, on);
  6579. return vm
  6580. };
  6581. Vue.prototype.$off = function (event, fn) {
  6582. var vm = this;
  6583. // all
  6584. if (!arguments.length) {
  6585. vm._events = Object.create(null);
  6586. return vm
  6587. }
  6588. // array of events
  6589. if (Array.isArray(event)) {
  6590. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  6591. vm.$off(event[i$1], fn);
  6592. }
  6593. return vm
  6594. }
  6595. // specific event
  6596. var cbs = vm._events[event];
  6597. if (!cbs) {
  6598. return vm
  6599. }
  6600. if (!fn) {
  6601. vm._events[event] = null;
  6602. return vm
  6603. }
  6604. // specific handler
  6605. var cb;
  6606. var i = cbs.length;
  6607. while (i--) {
  6608. cb = cbs[i];
  6609. if (cb === fn || cb.fn === fn) {
  6610. cbs.splice(i, 1);
  6611. break
  6612. }
  6613. }
  6614. return vm
  6615. };
  6616. Vue.prototype.$emit = function (event) {
  6617. var vm = this;
  6618. if (true) {
  6619. var lowerCaseEvent = event.toLowerCase();
  6620. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  6621. tip(
  6622. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  6623. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  6624. "Note that HTML attributes are case-insensitive and you cannot use " +
  6625. "v-on to listen to camelCase events when using in-DOM templates. " +
  6626. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  6627. );
  6628. }
  6629. }
  6630. var cbs = vm._events[event];
  6631. if (cbs) {
  6632. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  6633. var args = toArray(arguments, 1);
  6634. var info = "event handler for \"" + event + "\"";
  6635. for (var i = 0, l = cbs.length; i < l; i++) {
  6636. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  6637. }
  6638. }
  6639. return vm
  6640. };
  6641. }
  6642. /* */
  6643. var activeInstance = null;
  6644. var isUpdatingChildComponent = false;
  6645. function setActiveInstance(vm) {
  6646. var prevActiveInstance = activeInstance;
  6647. activeInstance = vm;
  6648. return function () {
  6649. activeInstance = prevActiveInstance;
  6650. }
  6651. }
  6652. function initLifecycle (vm) {
  6653. var options = vm.$options;
  6654. // locate first non-abstract parent
  6655. var parent = options.parent;
  6656. if (parent && !options.abstract) {
  6657. while (parent.$options.abstract && parent.$parent) {
  6658. parent = parent.$parent;
  6659. }
  6660. parent.$children.push(vm);
  6661. }
  6662. vm.$parent = parent;
  6663. vm.$root = parent ? parent.$root : vm;
  6664. vm.$children = [];
  6665. vm.$refs = {};
  6666. vm._watcher = null;
  6667. vm._inactive = null;
  6668. vm._directInactive = false;
  6669. vm._isMounted = false;
  6670. vm._isDestroyed = false;
  6671. vm._isBeingDestroyed = false;
  6672. }
  6673. function lifecycleMixin (Vue) {
  6674. Vue.prototype._update = function (vnode, hydrating) {
  6675. var vm = this;
  6676. var prevEl = vm.$el;
  6677. var prevVnode = vm._vnode;
  6678. var restoreActiveInstance = setActiveInstance(vm);
  6679. vm._vnode = vnode;
  6680. // Vue.prototype.__patch__ is injected in entry points
  6681. // based on the rendering backend used.
  6682. if (!prevVnode) {
  6683. // initial render
  6684. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  6685. } else {
  6686. // updates
  6687. vm.$el = vm.__patch__(prevVnode, vnode);
  6688. }
  6689. restoreActiveInstance();
  6690. // update __vue__ reference
  6691. if (prevEl) {
  6692. prevEl.__vue__ = null;
  6693. }
  6694. if (vm.$el) {
  6695. vm.$el.__vue__ = vm;
  6696. }
  6697. // if parent is an HOC, update its $el as well
  6698. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  6699. vm.$parent.$el = vm.$el;
  6700. }
  6701. // updated hook is called by the scheduler to ensure that children are
  6702. // updated in a parent's updated hook.
  6703. };
  6704. Vue.prototype.$forceUpdate = function () {
  6705. var vm = this;
  6706. if (vm._watcher) {
  6707. vm._watcher.update();
  6708. }
  6709. };
  6710. Vue.prototype.$destroy = function () {
  6711. var vm = this;
  6712. if (vm._isBeingDestroyed) {
  6713. return
  6714. }
  6715. callHook(vm, 'beforeDestroy');
  6716. vm._isBeingDestroyed = true;
  6717. // remove self from parent
  6718. var parent = vm.$parent;
  6719. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  6720. remove(parent.$children, vm);
  6721. }
  6722. // teardown watchers
  6723. if (vm._watcher) {
  6724. vm._watcher.teardown();
  6725. }
  6726. var i = vm._watchers.length;
  6727. while (i--) {
  6728. vm._watchers[i].teardown();
  6729. }
  6730. // remove reference from data ob
  6731. // frozen object may not have observer.
  6732. if (vm._data.__ob__) {
  6733. vm._data.__ob__.vmCount--;
  6734. }
  6735. // call the last hook...
  6736. vm._isDestroyed = true;
  6737. // invoke destroy hooks on current rendered tree
  6738. vm.__patch__(vm._vnode, null);
  6739. // fire destroyed hook
  6740. callHook(vm, 'destroyed');
  6741. // turn off all instance listeners.
  6742. vm.$off();
  6743. // remove __vue__ reference
  6744. if (vm.$el) {
  6745. vm.$el.__vue__ = null;
  6746. }
  6747. // release circular reference (#6759)
  6748. if (vm.$vnode) {
  6749. vm.$vnode.parent = null;
  6750. }
  6751. };
  6752. }
  6753. function updateChildComponent (
  6754. vm,
  6755. propsData,
  6756. listeners,
  6757. parentVnode,
  6758. renderChildren
  6759. ) {
  6760. if (true) {
  6761. isUpdatingChildComponent = true;
  6762. }
  6763. // determine whether component has slot children
  6764. // we need to do this before overwriting $options._renderChildren.
  6765. // check if there are dynamic scopedSlots (hand-written or compiled but with
  6766. // dynamic slot names). Static scoped slots compiled from template has the
  6767. // "$stable" marker.
  6768. var newScopedSlots = parentVnode.data.scopedSlots;
  6769. var oldScopedSlots = vm.$scopedSlots;
  6770. var hasDynamicScopedSlot = !!(
  6771. (newScopedSlots && !newScopedSlots.$stable) ||
  6772. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  6773. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  6774. );
  6775. // Any static slot children from the parent may have changed during parent's
  6776. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  6777. // update is necessary to ensure correctness.
  6778. var needsForceUpdate = !!(
  6779. renderChildren || // has new static slots
  6780. vm.$options._renderChildren || // has old static slots
  6781. hasDynamicScopedSlot
  6782. );
  6783. vm.$options._parentVnode = parentVnode;
  6784. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  6785. if (vm._vnode) { // update child tree's parent
  6786. vm._vnode.parent = parentVnode;
  6787. }
  6788. vm.$options._renderChildren = renderChildren;
  6789. // update $attrs and $listeners hash
  6790. // these are also reactive so they may trigger child update if the child
  6791. // used them during render
  6792. vm.$attrs = parentVnode.data.attrs || emptyObject;
  6793. vm.$listeners = listeners || emptyObject;
  6794. // update props
  6795. if (propsData && vm.$options.props) {
  6796. toggleObserving(false);
  6797. var props = vm._props;
  6798. var propKeys = vm.$options._propKeys || [];
  6799. for (var i = 0; i < propKeys.length; i++) {
  6800. var key = propKeys[i];
  6801. var propOptions = vm.$options.props; // wtf flow?
  6802. props[key] = validateProp(key, propOptions, propsData, vm);
  6803. }
  6804. toggleObserving(true);
  6805. // keep a copy of raw propsData
  6806. vm.$options.propsData = propsData;
  6807. }
  6808. // fixed by xxxxxx update properties(mp runtime)
  6809. vm._$updateProperties && vm._$updateProperties(vm);
  6810. // update listeners
  6811. listeners = listeners || emptyObject;
  6812. var oldListeners = vm.$options._parentListeners;
  6813. vm.$options._parentListeners = listeners;
  6814. updateComponentListeners(vm, listeners, oldListeners);
  6815. // resolve slots + force update if has children
  6816. if (needsForceUpdate) {
  6817. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  6818. vm.$forceUpdate();
  6819. }
  6820. if (true) {
  6821. isUpdatingChildComponent = false;
  6822. }
  6823. }
  6824. function isInInactiveTree (vm) {
  6825. while (vm && (vm = vm.$parent)) {
  6826. if (vm._inactive) { return true }
  6827. }
  6828. return false
  6829. }
  6830. function activateChildComponent (vm, direct) {
  6831. if (direct) {
  6832. vm._directInactive = false;
  6833. if (isInInactiveTree(vm)) {
  6834. return
  6835. }
  6836. } else if (vm._directInactive) {
  6837. return
  6838. }
  6839. if (vm._inactive || vm._inactive === null) {
  6840. vm._inactive = false;
  6841. for (var i = 0; i < vm.$children.length; i++) {
  6842. activateChildComponent(vm.$children[i]);
  6843. }
  6844. callHook(vm, 'activated');
  6845. }
  6846. }
  6847. function deactivateChildComponent (vm, direct) {
  6848. if (direct) {
  6849. vm._directInactive = true;
  6850. if (isInInactiveTree(vm)) {
  6851. return
  6852. }
  6853. }
  6854. if (!vm._inactive) {
  6855. vm._inactive = true;
  6856. for (var i = 0; i < vm.$children.length; i++) {
  6857. deactivateChildComponent(vm.$children[i]);
  6858. }
  6859. callHook(vm, 'deactivated');
  6860. }
  6861. }
  6862. function callHook (vm, hook) {
  6863. // #7573 disable dep collection when invoking lifecycle hooks
  6864. pushTarget();
  6865. var handlers = vm.$options[hook];
  6866. var info = hook + " hook";
  6867. if (handlers) {
  6868. for (var i = 0, j = handlers.length; i < j; i++) {
  6869. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  6870. }
  6871. }
  6872. if (vm._hasHookEvent) {
  6873. vm.$emit('hook:' + hook);
  6874. }
  6875. popTarget();
  6876. }
  6877. /* */
  6878. var MAX_UPDATE_COUNT = 100;
  6879. var queue = [];
  6880. var activatedChildren = [];
  6881. var has = {};
  6882. var circular = {};
  6883. var waiting = false;
  6884. var flushing = false;
  6885. var index = 0;
  6886. /**
  6887. * Reset the scheduler's state.
  6888. */
  6889. function resetSchedulerState () {
  6890. index = queue.length = activatedChildren.length = 0;
  6891. has = {};
  6892. if (true) {
  6893. circular = {};
  6894. }
  6895. waiting = flushing = false;
  6896. }
  6897. // Async edge case #6566 requires saving the timestamp when event listeners are
  6898. // attached. However, calling performance.now() has a perf overhead especially
  6899. // if the page has thousands of event listeners. Instead, we take a timestamp
  6900. // every time the scheduler flushes and use that for all event listeners
  6901. // attached during that flush.
  6902. var currentFlushTimestamp = 0;
  6903. // Async edge case fix requires storing an event listener's attach timestamp.
  6904. var getNow = Date.now;
  6905. // Determine what event timestamp the browser is using. Annoyingly, the
  6906. // timestamp can either be hi-res (relative to page load) or low-res
  6907. // (relative to UNIX epoch), so in order to compare time we have to use the
  6908. // same timestamp type when saving the flush timestamp.
  6909. // All IE versions use low-res event timestamps, and have problematic clock
  6910. // implementations (#9632)
  6911. if (inBrowser && !isIE) {
  6912. var performance = window.performance;
  6913. if (
  6914. performance &&
  6915. typeof performance.now === 'function' &&
  6916. getNow() > document.createEvent('Event').timeStamp
  6917. ) {
  6918. // if the event timestamp, although evaluated AFTER the Date.now(), is
  6919. // smaller than it, it means the event is using a hi-res timestamp,
  6920. // and we need to use the hi-res version for event listener timestamps as
  6921. // well.
  6922. getNow = function () { return performance.now(); };
  6923. }
  6924. }
  6925. /**
  6926. * Flush both queues and run the watchers.
  6927. */
  6928. function flushSchedulerQueue () {
  6929. currentFlushTimestamp = getNow();
  6930. flushing = true;
  6931. var watcher, id;
  6932. // Sort queue before flush.
  6933. // This ensures that:
  6934. // 1. Components are updated from parent to child. (because parent is always
  6935. // created before the child)
  6936. // 2. A component's user watchers are run before its render watcher (because
  6937. // user watchers are created before the render watcher)
  6938. // 3. If a component is destroyed during a parent component's watcher run,
  6939. // its watchers can be skipped.
  6940. queue.sort(function (a, b) { return a.id - b.id; });
  6941. // do not cache length because more watchers might be pushed
  6942. // as we run existing watchers
  6943. for (index = 0; index < queue.length; index++) {
  6944. watcher = queue[index];
  6945. if (watcher.before) {
  6946. watcher.before();
  6947. }
  6948. id = watcher.id;
  6949. has[id] = null;
  6950. watcher.run();
  6951. // in dev build, check and stop circular updates.
  6952. if ( true && has[id] != null) {
  6953. circular[id] = (circular[id] || 0) + 1;
  6954. if (circular[id] > MAX_UPDATE_COUNT) {
  6955. warn(
  6956. 'You may have an infinite update loop ' + (
  6957. watcher.user
  6958. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  6959. : "in a component render function."
  6960. ),
  6961. watcher.vm
  6962. );
  6963. break
  6964. }
  6965. }
  6966. }
  6967. // keep copies of post queues before resetting state
  6968. var activatedQueue = activatedChildren.slice();
  6969. var updatedQueue = queue.slice();
  6970. resetSchedulerState();
  6971. // call component updated and activated hooks
  6972. callActivatedHooks(activatedQueue);
  6973. callUpdatedHooks(updatedQueue);
  6974. // devtool hook
  6975. /* istanbul ignore if */
  6976. if (devtools && config.devtools) {
  6977. devtools.emit('flush');
  6978. }
  6979. }
  6980. function callUpdatedHooks (queue) {
  6981. var i = queue.length;
  6982. while (i--) {
  6983. var watcher = queue[i];
  6984. var vm = watcher.vm;
  6985. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  6986. callHook(vm, 'updated');
  6987. }
  6988. }
  6989. }
  6990. /**
  6991. * Queue a kept-alive component that was activated during patch.
  6992. * The queue will be processed after the entire tree has been patched.
  6993. */
  6994. function queueActivatedComponent (vm) {
  6995. // setting _inactive to false here so that a render function can
  6996. // rely on checking whether it's in an inactive tree (e.g. router-view)
  6997. vm._inactive = false;
  6998. activatedChildren.push(vm);
  6999. }
  7000. function callActivatedHooks (queue) {
  7001. for (var i = 0; i < queue.length; i++) {
  7002. queue[i]._inactive = true;
  7003. activateChildComponent(queue[i], true /* true */);
  7004. }
  7005. }
  7006. /**
  7007. * Push a watcher into the watcher queue.
  7008. * Jobs with duplicate IDs will be skipped unless it's
  7009. * pushed when the queue is being flushed.
  7010. */
  7011. function queueWatcher (watcher) {
  7012. var id = watcher.id;
  7013. if (has[id] == null) {
  7014. has[id] = true;
  7015. if (!flushing) {
  7016. queue.push(watcher);
  7017. } else {
  7018. // if already flushing, splice the watcher based on its id
  7019. // if already past its id, it will be run next immediately.
  7020. var i = queue.length - 1;
  7021. while (i > index && queue[i].id > watcher.id) {
  7022. i--;
  7023. }
  7024. queue.splice(i + 1, 0, watcher);
  7025. }
  7026. // queue the flush
  7027. if (!waiting) {
  7028. waiting = true;
  7029. if ( true && !config.async) {
  7030. flushSchedulerQueue();
  7031. return
  7032. }
  7033. nextTick(flushSchedulerQueue);
  7034. }
  7035. }
  7036. }
  7037. /* */
  7038. var uid$2 = 0;
  7039. /**
  7040. * A watcher parses an expression, collects dependencies,
  7041. * and fires callback when the expression value changes.
  7042. * This is used for both the $watch() api and directives.
  7043. */
  7044. var Watcher = function Watcher (
  7045. vm,
  7046. expOrFn,
  7047. cb,
  7048. options,
  7049. isRenderWatcher
  7050. ) {
  7051. this.vm = vm;
  7052. if (isRenderWatcher) {
  7053. vm._watcher = this;
  7054. }
  7055. vm._watchers.push(this);
  7056. // options
  7057. if (options) {
  7058. this.deep = !!options.deep;
  7059. this.user = !!options.user;
  7060. this.lazy = !!options.lazy;
  7061. this.sync = !!options.sync;
  7062. this.before = options.before;
  7063. } else {
  7064. this.deep = this.user = this.lazy = this.sync = false;
  7065. }
  7066. this.cb = cb;
  7067. this.id = ++uid$2; // uid for batching
  7068. this.active = true;
  7069. this.dirty = this.lazy; // for lazy watchers
  7070. this.deps = [];
  7071. this.newDeps = [];
  7072. this.depIds = new _Set();
  7073. this.newDepIds = new _Set();
  7074. this.expression = true
  7075. ? expOrFn.toString()
  7076. : undefined;
  7077. // parse expression for getter
  7078. if (typeof expOrFn === 'function') {
  7079. this.getter = expOrFn;
  7080. } else {
  7081. this.getter = parsePath(expOrFn);
  7082. if (!this.getter) {
  7083. this.getter = noop;
  7084. true && warn(
  7085. "Failed watching path: \"" + expOrFn + "\" " +
  7086. 'Watcher only accepts simple dot-delimited paths. ' +
  7087. 'For full control, use a function instead.',
  7088. vm
  7089. );
  7090. }
  7091. }
  7092. this.value = this.lazy
  7093. ? undefined
  7094. : this.get();
  7095. };
  7096. /**
  7097. * Evaluate the getter, and re-collect dependencies.
  7098. */
  7099. Watcher.prototype.get = function get () {
  7100. pushTarget(this);
  7101. var value;
  7102. var vm = this.vm;
  7103. try {
  7104. value = this.getter.call(vm, vm);
  7105. } catch (e) {
  7106. if (this.user) {
  7107. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7108. } else {
  7109. throw e
  7110. }
  7111. } finally {
  7112. // "touch" every property so they are all tracked as
  7113. // dependencies for deep watching
  7114. if (this.deep) {
  7115. traverse(value);
  7116. }
  7117. popTarget();
  7118. this.cleanupDeps();
  7119. }
  7120. return value
  7121. };
  7122. /**
  7123. * Add a dependency to this directive.
  7124. */
  7125. Watcher.prototype.addDep = function addDep (dep) {
  7126. var id = dep.id;
  7127. if (!this.newDepIds.has(id)) {
  7128. this.newDepIds.add(id);
  7129. this.newDeps.push(dep);
  7130. if (!this.depIds.has(id)) {
  7131. dep.addSub(this);
  7132. }
  7133. }
  7134. };
  7135. /**
  7136. * Clean up for dependency collection.
  7137. */
  7138. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7139. var i = this.deps.length;
  7140. while (i--) {
  7141. var dep = this.deps[i];
  7142. if (!this.newDepIds.has(dep.id)) {
  7143. dep.removeSub(this);
  7144. }
  7145. }
  7146. var tmp = this.depIds;
  7147. this.depIds = this.newDepIds;
  7148. this.newDepIds = tmp;
  7149. this.newDepIds.clear();
  7150. tmp = this.deps;
  7151. this.deps = this.newDeps;
  7152. this.newDeps = tmp;
  7153. this.newDeps.length = 0;
  7154. };
  7155. /**
  7156. * Subscriber interface.
  7157. * Will be called when a dependency changes.
  7158. */
  7159. Watcher.prototype.update = function update () {
  7160. /* istanbul ignore else */
  7161. if (this.lazy) {
  7162. this.dirty = true;
  7163. } else if (this.sync) {
  7164. this.run();
  7165. } else {
  7166. queueWatcher(this);
  7167. }
  7168. };
  7169. /**
  7170. * Scheduler job interface.
  7171. * Will be called by the scheduler.
  7172. */
  7173. Watcher.prototype.run = function run () {
  7174. if (this.active) {
  7175. var value = this.get();
  7176. if (
  7177. value !== this.value ||
  7178. // Deep watchers and watchers on Object/Arrays should fire even
  7179. // when the value is the same, because the value may
  7180. // have mutated.
  7181. isObject(value) ||
  7182. this.deep
  7183. ) {
  7184. // set new value
  7185. var oldValue = this.value;
  7186. this.value = value;
  7187. if (this.user) {
  7188. try {
  7189. this.cb.call(this.vm, value, oldValue);
  7190. } catch (e) {
  7191. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  7192. }
  7193. } else {
  7194. this.cb.call(this.vm, value, oldValue);
  7195. }
  7196. }
  7197. }
  7198. };
  7199. /**
  7200. * Evaluate the value of the watcher.
  7201. * This only gets called for lazy watchers.
  7202. */
  7203. Watcher.prototype.evaluate = function evaluate () {
  7204. this.value = this.get();
  7205. this.dirty = false;
  7206. };
  7207. /**
  7208. * Depend on all deps collected by this watcher.
  7209. */
  7210. Watcher.prototype.depend = function depend () {
  7211. var i = this.deps.length;
  7212. while (i--) {
  7213. this.deps[i].depend();
  7214. }
  7215. };
  7216. /**
  7217. * Remove self from all dependencies' subscriber list.
  7218. */
  7219. Watcher.prototype.teardown = function teardown () {
  7220. if (this.active) {
  7221. // remove self from vm's watcher list
  7222. // this is a somewhat expensive operation so we skip it
  7223. // if the vm is being destroyed.
  7224. if (!this.vm._isBeingDestroyed) {
  7225. remove(this.vm._watchers, this);
  7226. }
  7227. var i = this.deps.length;
  7228. while (i--) {
  7229. this.deps[i].removeSub(this);
  7230. }
  7231. this.active = false;
  7232. }
  7233. };
  7234. /* */
  7235. var sharedPropertyDefinition = {
  7236. enumerable: true,
  7237. configurable: true,
  7238. get: noop,
  7239. set: noop
  7240. };
  7241. function proxy (target, sourceKey, key) {
  7242. sharedPropertyDefinition.get = function proxyGetter () {
  7243. return this[sourceKey][key]
  7244. };
  7245. sharedPropertyDefinition.set = function proxySetter (val) {
  7246. this[sourceKey][key] = val;
  7247. };
  7248. Object.defineProperty(target, key, sharedPropertyDefinition);
  7249. }
  7250. function initState (vm) {
  7251. vm._watchers = [];
  7252. var opts = vm.$options;
  7253. if (opts.props) { initProps(vm, opts.props); }
  7254. if (opts.methods) { initMethods(vm, opts.methods); }
  7255. if (opts.data) {
  7256. initData(vm);
  7257. } else {
  7258. observe(vm._data = {}, true /* asRootData */);
  7259. }
  7260. if (opts.computed) { initComputed(vm, opts.computed); }
  7261. if (opts.watch && opts.watch !== nativeWatch) {
  7262. initWatch(vm, opts.watch);
  7263. }
  7264. }
  7265. function initProps (vm, propsOptions) {
  7266. var propsData = vm.$options.propsData || {};
  7267. var props = vm._props = {};
  7268. // cache prop keys so that future props updates can iterate using Array
  7269. // instead of dynamic object key enumeration.
  7270. var keys = vm.$options._propKeys = [];
  7271. var isRoot = !vm.$parent;
  7272. // root instance props should be converted
  7273. if (!isRoot) {
  7274. toggleObserving(false);
  7275. }
  7276. var loop = function ( key ) {
  7277. keys.push(key);
  7278. var value = validateProp(key, propsOptions, propsData, vm);
  7279. /* istanbul ignore else */
  7280. if (true) {
  7281. var hyphenatedKey = hyphenate(key);
  7282. if (isReservedAttribute(hyphenatedKey) ||
  7283. config.isReservedAttr(hyphenatedKey)) {
  7284. warn(
  7285. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7286. vm
  7287. );
  7288. }
  7289. defineReactive$$1(props, key, value, function () {
  7290. if (!isRoot && !isUpdatingChildComponent) {
  7291. {
  7292. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  7293. return
  7294. }
  7295. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7296. if(
  7297. key === 'value' &&
  7298. Array.isArray(vm.$options.behaviors) &&
  7299. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7300. ){
  7301. return
  7302. }
  7303. if(vm._getFormData){
  7304. return
  7305. }
  7306. var $parent = vm.$parent;
  7307. while($parent){
  7308. if($parent.__next_tick_pending){
  7309. return
  7310. }
  7311. $parent = $parent.$parent;
  7312. }
  7313. }
  7314. warn(
  7315. "Avoid mutating a prop directly since the value will be " +
  7316. "overwritten whenever the parent component re-renders. " +
  7317. "Instead, use a data or computed property based on the prop's " +
  7318. "value. Prop being mutated: \"" + key + "\"",
  7319. vm
  7320. );
  7321. }
  7322. });
  7323. } else {}
  7324. // static props are already proxied on the component's prototype
  7325. // during Vue.extend(). We only need to proxy props defined at
  7326. // instantiation here.
  7327. if (!(key in vm)) {
  7328. proxy(vm, "_props", key);
  7329. }
  7330. };
  7331. for (var key in propsOptions) loop( key );
  7332. toggleObserving(true);
  7333. }
  7334. function initData (vm) {
  7335. var data = vm.$options.data;
  7336. data = vm._data = typeof data === 'function'
  7337. ? getData(data, vm)
  7338. : data || {};
  7339. if (!isPlainObject(data)) {
  7340. data = {};
  7341. true && warn(
  7342. 'data functions should return an object:\n' +
  7343. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7344. vm
  7345. );
  7346. }
  7347. // proxy data on instance
  7348. var keys = Object.keys(data);
  7349. var props = vm.$options.props;
  7350. var methods = vm.$options.methods;
  7351. var i = keys.length;
  7352. while (i--) {
  7353. var key = keys[i];
  7354. if (true) {
  7355. if (methods && hasOwn(methods, key)) {
  7356. warn(
  7357. ("Method \"" + key + "\" has already been defined as a data property."),
  7358. vm
  7359. );
  7360. }
  7361. }
  7362. if (props && hasOwn(props, key)) {
  7363. true && warn(
  7364. "The data property \"" + key + "\" is already declared as a prop. " +
  7365. "Use prop default value instead.",
  7366. vm
  7367. );
  7368. } else if (!isReserved(key)) {
  7369. proxy(vm, "_data", key);
  7370. }
  7371. }
  7372. // observe data
  7373. observe(data, true /* asRootData */);
  7374. }
  7375. function getData (data, vm) {
  7376. // #7573 disable dep collection when invoking data getters
  7377. pushTarget();
  7378. try {
  7379. return data.call(vm, vm)
  7380. } catch (e) {
  7381. handleError(e, vm, "data()");
  7382. return {}
  7383. } finally {
  7384. popTarget();
  7385. }
  7386. }
  7387. var computedWatcherOptions = { lazy: true };
  7388. function initComputed (vm, computed) {
  7389. // $flow-disable-line
  7390. var watchers = vm._computedWatchers = Object.create(null);
  7391. // computed properties are just getters during SSR
  7392. var isSSR = isServerRendering();
  7393. for (var key in computed) {
  7394. var userDef = computed[key];
  7395. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  7396. if ( true && getter == null) {
  7397. warn(
  7398. ("Getter is missing for computed property \"" + key + "\"."),
  7399. vm
  7400. );
  7401. }
  7402. if (!isSSR) {
  7403. // create internal watcher for the computed property.
  7404. watchers[key] = new Watcher(
  7405. vm,
  7406. getter || noop,
  7407. noop,
  7408. computedWatcherOptions
  7409. );
  7410. }
  7411. // component-defined computed properties are already defined on the
  7412. // component prototype. We only need to define computed properties defined
  7413. // at instantiation here.
  7414. if (!(key in vm)) {
  7415. defineComputed(vm, key, userDef);
  7416. } else if (true) {
  7417. if (key in vm.$data) {
  7418. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  7419. } else if (vm.$options.props && key in vm.$options.props) {
  7420. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  7421. }
  7422. }
  7423. }
  7424. }
  7425. function defineComputed (
  7426. target,
  7427. key,
  7428. userDef
  7429. ) {
  7430. var shouldCache = !isServerRendering();
  7431. if (typeof userDef === 'function') {
  7432. sharedPropertyDefinition.get = shouldCache
  7433. ? createComputedGetter(key)
  7434. : createGetterInvoker(userDef);
  7435. sharedPropertyDefinition.set = noop;
  7436. } else {
  7437. sharedPropertyDefinition.get = userDef.get
  7438. ? shouldCache && userDef.cache !== false
  7439. ? createComputedGetter(key)
  7440. : createGetterInvoker(userDef.get)
  7441. : noop;
  7442. sharedPropertyDefinition.set = userDef.set || noop;
  7443. }
  7444. if ( true &&
  7445. sharedPropertyDefinition.set === noop) {
  7446. sharedPropertyDefinition.set = function () {
  7447. warn(
  7448. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  7449. this
  7450. );
  7451. };
  7452. }
  7453. Object.defineProperty(target, key, sharedPropertyDefinition);
  7454. }
  7455. function createComputedGetter (key) {
  7456. return function computedGetter () {
  7457. var watcher = this._computedWatchers && this._computedWatchers[key];
  7458. if (watcher) {
  7459. if (watcher.dirty) {
  7460. watcher.evaluate();
  7461. }
  7462. if (Dep.SharedObject.target) {// fixed by xxxxxx
  7463. watcher.depend();
  7464. }
  7465. return watcher.value
  7466. }
  7467. }
  7468. }
  7469. function createGetterInvoker(fn) {
  7470. return function computedGetter () {
  7471. return fn.call(this, this)
  7472. }
  7473. }
  7474. function initMethods (vm, methods) {
  7475. var props = vm.$options.props;
  7476. for (var key in methods) {
  7477. if (true) {
  7478. if (typeof methods[key] !== 'function') {
  7479. warn(
  7480. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  7481. "Did you reference the function correctly?",
  7482. vm
  7483. );
  7484. }
  7485. if (props && hasOwn(props, key)) {
  7486. warn(
  7487. ("Method \"" + key + "\" has already been defined as a prop."),
  7488. vm
  7489. );
  7490. }
  7491. if ((key in vm) && isReserved(key)) {
  7492. warn(
  7493. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  7494. "Avoid defining component methods that start with _ or $."
  7495. );
  7496. }
  7497. }
  7498. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  7499. }
  7500. }
  7501. function initWatch (vm, watch) {
  7502. for (var key in watch) {
  7503. var handler = watch[key];
  7504. if (Array.isArray(handler)) {
  7505. for (var i = 0; i < handler.length; i++) {
  7506. createWatcher(vm, key, handler[i]);
  7507. }
  7508. } else {
  7509. createWatcher(vm, key, handler);
  7510. }
  7511. }
  7512. }
  7513. function createWatcher (
  7514. vm,
  7515. expOrFn,
  7516. handler,
  7517. options
  7518. ) {
  7519. if (isPlainObject(handler)) {
  7520. options = handler;
  7521. handler = handler.handler;
  7522. }
  7523. if (typeof handler === 'string') {
  7524. handler = vm[handler];
  7525. }
  7526. return vm.$watch(expOrFn, handler, options)
  7527. }
  7528. function stateMixin (Vue) {
  7529. // flow somehow has problems with directly declared definition object
  7530. // when using Object.defineProperty, so we have to procedurally build up
  7531. // the object here.
  7532. var dataDef = {};
  7533. dataDef.get = function () { return this._data };
  7534. var propsDef = {};
  7535. propsDef.get = function () { return this._props };
  7536. if (true) {
  7537. dataDef.set = function () {
  7538. warn(
  7539. 'Avoid replacing instance root $data. ' +
  7540. 'Use nested data properties instead.',
  7541. this
  7542. );
  7543. };
  7544. propsDef.set = function () {
  7545. warn("$props is readonly.", this);
  7546. };
  7547. }
  7548. Object.defineProperty(Vue.prototype, '$data', dataDef);
  7549. Object.defineProperty(Vue.prototype, '$props', propsDef);
  7550. Vue.prototype.$set = set;
  7551. Vue.prototype.$delete = del;
  7552. Vue.prototype.$watch = function (
  7553. expOrFn,
  7554. cb,
  7555. options
  7556. ) {
  7557. var vm = this;
  7558. if (isPlainObject(cb)) {
  7559. return createWatcher(vm, expOrFn, cb, options)
  7560. }
  7561. options = options || {};
  7562. options.user = true;
  7563. var watcher = new Watcher(vm, expOrFn, cb, options);
  7564. if (options.immediate) {
  7565. try {
  7566. cb.call(vm, watcher.value);
  7567. } catch (error) {
  7568. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  7569. }
  7570. }
  7571. return function unwatchFn () {
  7572. watcher.teardown();
  7573. }
  7574. };
  7575. }
  7576. /* */
  7577. var uid$3 = 0;
  7578. function initMixin (Vue) {
  7579. Vue.prototype._init = function (options) {
  7580. var vm = this;
  7581. // a uid
  7582. vm._uid = uid$3++;
  7583. var startTag, endTag;
  7584. /* istanbul ignore if */
  7585. if ( true && config.performance && mark) {
  7586. startTag = "vue-perf-start:" + (vm._uid);
  7587. endTag = "vue-perf-end:" + (vm._uid);
  7588. mark(startTag);
  7589. }
  7590. // a flag to avoid this being observed
  7591. vm._isVue = true;
  7592. // merge options
  7593. if (options && options._isComponent) {
  7594. // optimize internal component instantiation
  7595. // since dynamic options merging is pretty slow, and none of the
  7596. // internal component options needs special treatment.
  7597. initInternalComponent(vm, options);
  7598. } else {
  7599. vm.$options = mergeOptions(
  7600. resolveConstructorOptions(vm.constructor),
  7601. options || {},
  7602. vm
  7603. );
  7604. }
  7605. /* istanbul ignore else */
  7606. if (true) {
  7607. initProxy(vm);
  7608. } else {}
  7609. // expose real self
  7610. vm._self = vm;
  7611. initLifecycle(vm);
  7612. initEvents(vm);
  7613. initRender(vm);
  7614. callHook(vm, 'beforeCreate');
  7615. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  7616. initState(vm);
  7617. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  7618. !vm._$fallback && callHook(vm, 'created');
  7619. /* istanbul ignore if */
  7620. if ( true && config.performance && mark) {
  7621. vm._name = formatComponentName(vm, false);
  7622. mark(endTag);
  7623. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  7624. }
  7625. if (vm.$options.el) {
  7626. vm.$mount(vm.$options.el);
  7627. }
  7628. };
  7629. }
  7630. function initInternalComponent (vm, options) {
  7631. var opts = vm.$options = Object.create(vm.constructor.options);
  7632. // doing this because it's faster than dynamic enumeration.
  7633. var parentVnode = options._parentVnode;
  7634. opts.parent = options.parent;
  7635. opts._parentVnode = parentVnode;
  7636. var vnodeComponentOptions = parentVnode.componentOptions;
  7637. opts.propsData = vnodeComponentOptions.propsData;
  7638. opts._parentListeners = vnodeComponentOptions.listeners;
  7639. opts._renderChildren = vnodeComponentOptions.children;
  7640. opts._componentTag = vnodeComponentOptions.tag;
  7641. if (options.render) {
  7642. opts.render = options.render;
  7643. opts.staticRenderFns = options.staticRenderFns;
  7644. }
  7645. }
  7646. function resolveConstructorOptions (Ctor) {
  7647. var options = Ctor.options;
  7648. if (Ctor.super) {
  7649. var superOptions = resolveConstructorOptions(Ctor.super);
  7650. var cachedSuperOptions = Ctor.superOptions;
  7651. if (superOptions !== cachedSuperOptions) {
  7652. // super option changed,
  7653. // need to resolve new options.
  7654. Ctor.superOptions = superOptions;
  7655. // check if there are any late-modified/attached options (#4976)
  7656. var modifiedOptions = resolveModifiedOptions(Ctor);
  7657. // update base extend options
  7658. if (modifiedOptions) {
  7659. extend(Ctor.extendOptions, modifiedOptions);
  7660. }
  7661. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  7662. if (options.name) {
  7663. options.components[options.name] = Ctor;
  7664. }
  7665. }
  7666. }
  7667. return options
  7668. }
  7669. function resolveModifiedOptions (Ctor) {
  7670. var modified;
  7671. var latest = Ctor.options;
  7672. var sealed = Ctor.sealedOptions;
  7673. for (var key in latest) {
  7674. if (latest[key] !== sealed[key]) {
  7675. if (!modified) { modified = {}; }
  7676. modified[key] = latest[key];
  7677. }
  7678. }
  7679. return modified
  7680. }
  7681. function Vue (options) {
  7682. if ( true &&
  7683. !(this instanceof Vue)
  7684. ) {
  7685. warn('Vue is a constructor and should be called with the `new` keyword');
  7686. }
  7687. this._init(options);
  7688. }
  7689. initMixin(Vue);
  7690. stateMixin(Vue);
  7691. eventsMixin(Vue);
  7692. lifecycleMixin(Vue);
  7693. renderMixin(Vue);
  7694. /* */
  7695. function initUse (Vue) {
  7696. Vue.use = function (plugin) {
  7697. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  7698. if (installedPlugins.indexOf(plugin) > -1) {
  7699. return this
  7700. }
  7701. // additional parameters
  7702. var args = toArray(arguments, 1);
  7703. args.unshift(this);
  7704. if (typeof plugin.install === 'function') {
  7705. plugin.install.apply(plugin, args);
  7706. } else if (typeof plugin === 'function') {
  7707. plugin.apply(null, args);
  7708. }
  7709. installedPlugins.push(plugin);
  7710. return this
  7711. };
  7712. }
  7713. /* */
  7714. function initMixin$1 (Vue) {
  7715. Vue.mixin = function (mixin) {
  7716. this.options = mergeOptions(this.options, mixin);
  7717. return this
  7718. };
  7719. }
  7720. /* */
  7721. function initExtend (Vue) {
  7722. /**
  7723. * Each instance constructor, including Vue, has a unique
  7724. * cid. This enables us to create wrapped "child
  7725. * constructors" for prototypal inheritance and cache them.
  7726. */
  7727. Vue.cid = 0;
  7728. var cid = 1;
  7729. /**
  7730. * Class inheritance
  7731. */
  7732. Vue.extend = function (extendOptions) {
  7733. extendOptions = extendOptions || {};
  7734. var Super = this;
  7735. var SuperId = Super.cid;
  7736. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  7737. if (cachedCtors[SuperId]) {
  7738. return cachedCtors[SuperId]
  7739. }
  7740. var name = extendOptions.name || Super.options.name;
  7741. if ( true && name) {
  7742. validateComponentName(name);
  7743. }
  7744. var Sub = function VueComponent (options) {
  7745. this._init(options);
  7746. };
  7747. Sub.prototype = Object.create(Super.prototype);
  7748. Sub.prototype.constructor = Sub;
  7749. Sub.cid = cid++;
  7750. Sub.options = mergeOptions(
  7751. Super.options,
  7752. extendOptions
  7753. );
  7754. Sub['super'] = Super;
  7755. // For props and computed properties, we define the proxy getters on
  7756. // the Vue instances at extension time, on the extended prototype. This
  7757. // avoids Object.defineProperty calls for each instance created.
  7758. if (Sub.options.props) {
  7759. initProps$1(Sub);
  7760. }
  7761. if (Sub.options.computed) {
  7762. initComputed$1(Sub);
  7763. }
  7764. // allow further extension/mixin/plugin usage
  7765. Sub.extend = Super.extend;
  7766. Sub.mixin = Super.mixin;
  7767. Sub.use = Super.use;
  7768. // create asset registers, so extended classes
  7769. // can have their private assets too.
  7770. ASSET_TYPES.forEach(function (type) {
  7771. Sub[type] = Super[type];
  7772. });
  7773. // enable recursive self-lookup
  7774. if (name) {
  7775. Sub.options.components[name] = Sub;
  7776. }
  7777. // keep a reference to the super options at extension time.
  7778. // later at instantiation we can check if Super's options have
  7779. // been updated.
  7780. Sub.superOptions = Super.options;
  7781. Sub.extendOptions = extendOptions;
  7782. Sub.sealedOptions = extend({}, Sub.options);
  7783. // cache constructor
  7784. cachedCtors[SuperId] = Sub;
  7785. return Sub
  7786. };
  7787. }
  7788. function initProps$1 (Comp) {
  7789. var props = Comp.options.props;
  7790. for (var key in props) {
  7791. proxy(Comp.prototype, "_props", key);
  7792. }
  7793. }
  7794. function initComputed$1 (Comp) {
  7795. var computed = Comp.options.computed;
  7796. for (var key in computed) {
  7797. defineComputed(Comp.prototype, key, computed[key]);
  7798. }
  7799. }
  7800. /* */
  7801. function initAssetRegisters (Vue) {
  7802. /**
  7803. * Create asset registration methods.
  7804. */
  7805. ASSET_TYPES.forEach(function (type) {
  7806. Vue[type] = function (
  7807. id,
  7808. definition
  7809. ) {
  7810. if (!definition) {
  7811. return this.options[type + 's'][id]
  7812. } else {
  7813. /* istanbul ignore if */
  7814. if ( true && type === 'component') {
  7815. validateComponentName(id);
  7816. }
  7817. if (type === 'component' && isPlainObject(definition)) {
  7818. definition.name = definition.name || id;
  7819. definition = this.options._base.extend(definition);
  7820. }
  7821. if (type === 'directive' && typeof definition === 'function') {
  7822. definition = { bind: definition, update: definition };
  7823. }
  7824. this.options[type + 's'][id] = definition;
  7825. return definition
  7826. }
  7827. };
  7828. });
  7829. }
  7830. /* */
  7831. function getComponentName (opts) {
  7832. return opts && (opts.Ctor.options.name || opts.tag)
  7833. }
  7834. function matches (pattern, name) {
  7835. if (Array.isArray(pattern)) {
  7836. return pattern.indexOf(name) > -1
  7837. } else if (typeof pattern === 'string') {
  7838. return pattern.split(',').indexOf(name) > -1
  7839. } else if (isRegExp(pattern)) {
  7840. return pattern.test(name)
  7841. }
  7842. /* istanbul ignore next */
  7843. return false
  7844. }
  7845. function pruneCache (keepAliveInstance, filter) {
  7846. var cache = keepAliveInstance.cache;
  7847. var keys = keepAliveInstance.keys;
  7848. var _vnode = keepAliveInstance._vnode;
  7849. for (var key in cache) {
  7850. var cachedNode = cache[key];
  7851. if (cachedNode) {
  7852. var name = getComponentName(cachedNode.componentOptions);
  7853. if (name && !filter(name)) {
  7854. pruneCacheEntry(cache, key, keys, _vnode);
  7855. }
  7856. }
  7857. }
  7858. }
  7859. function pruneCacheEntry (
  7860. cache,
  7861. key,
  7862. keys,
  7863. current
  7864. ) {
  7865. var cached$$1 = cache[key];
  7866. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  7867. cached$$1.componentInstance.$destroy();
  7868. }
  7869. cache[key] = null;
  7870. remove(keys, key);
  7871. }
  7872. var patternTypes = [String, RegExp, Array];
  7873. var KeepAlive = {
  7874. name: 'keep-alive',
  7875. abstract: true,
  7876. props: {
  7877. include: patternTypes,
  7878. exclude: patternTypes,
  7879. max: [String, Number]
  7880. },
  7881. created: function created () {
  7882. this.cache = Object.create(null);
  7883. this.keys = [];
  7884. },
  7885. destroyed: function destroyed () {
  7886. for (var key in this.cache) {
  7887. pruneCacheEntry(this.cache, key, this.keys);
  7888. }
  7889. },
  7890. mounted: function mounted () {
  7891. var this$1 = this;
  7892. this.$watch('include', function (val) {
  7893. pruneCache(this$1, function (name) { return matches(val, name); });
  7894. });
  7895. this.$watch('exclude', function (val) {
  7896. pruneCache(this$1, function (name) { return !matches(val, name); });
  7897. });
  7898. },
  7899. render: function render () {
  7900. var slot = this.$slots.default;
  7901. var vnode = getFirstComponentChild(slot);
  7902. var componentOptions = vnode && vnode.componentOptions;
  7903. if (componentOptions) {
  7904. // check pattern
  7905. var name = getComponentName(componentOptions);
  7906. var ref = this;
  7907. var include = ref.include;
  7908. var exclude = ref.exclude;
  7909. if (
  7910. // not included
  7911. (include && (!name || !matches(include, name))) ||
  7912. // excluded
  7913. (exclude && name && matches(exclude, name))
  7914. ) {
  7915. return vnode
  7916. }
  7917. var ref$1 = this;
  7918. var cache = ref$1.cache;
  7919. var keys = ref$1.keys;
  7920. var key = vnode.key == null
  7921. // same constructor may get registered as different local components
  7922. // so cid alone is not enough (#3269)
  7923. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  7924. : vnode.key;
  7925. if (cache[key]) {
  7926. vnode.componentInstance = cache[key].componentInstance;
  7927. // make current key freshest
  7928. remove(keys, key);
  7929. keys.push(key);
  7930. } else {
  7931. cache[key] = vnode;
  7932. keys.push(key);
  7933. // prune oldest entry
  7934. if (this.max && keys.length > parseInt(this.max)) {
  7935. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  7936. }
  7937. }
  7938. vnode.data.keepAlive = true;
  7939. }
  7940. return vnode || (slot && slot[0])
  7941. }
  7942. };
  7943. var builtInComponents = {
  7944. KeepAlive: KeepAlive
  7945. };
  7946. /* */
  7947. function initGlobalAPI (Vue) {
  7948. // config
  7949. var configDef = {};
  7950. configDef.get = function () { return config; };
  7951. if (true) {
  7952. configDef.set = function () {
  7953. warn(
  7954. 'Do not replace the Vue.config object, set individual fields instead.'
  7955. );
  7956. };
  7957. }
  7958. Object.defineProperty(Vue, 'config', configDef);
  7959. // exposed util methods.
  7960. // NOTE: these are not considered part of the public API - avoid relying on
  7961. // them unless you are aware of the risk.
  7962. Vue.util = {
  7963. warn: warn,
  7964. extend: extend,
  7965. mergeOptions: mergeOptions,
  7966. defineReactive: defineReactive$$1
  7967. };
  7968. Vue.set = set;
  7969. Vue.delete = del;
  7970. Vue.nextTick = nextTick;
  7971. // 2.6 explicit observable API
  7972. Vue.observable = function (obj) {
  7973. observe(obj);
  7974. return obj
  7975. };
  7976. Vue.options = Object.create(null);
  7977. ASSET_TYPES.forEach(function (type) {
  7978. Vue.options[type + 's'] = Object.create(null);
  7979. });
  7980. // this is used to identify the "base" constructor to extend all plain-object
  7981. // components with in Weex's multi-instance scenarios.
  7982. Vue.options._base = Vue;
  7983. extend(Vue.options.components, builtInComponents);
  7984. initUse(Vue);
  7985. initMixin$1(Vue);
  7986. initExtend(Vue);
  7987. initAssetRegisters(Vue);
  7988. }
  7989. initGlobalAPI(Vue);
  7990. Object.defineProperty(Vue.prototype, '$isServer', {
  7991. get: isServerRendering
  7992. });
  7993. Object.defineProperty(Vue.prototype, '$ssrContext', {
  7994. get: function get () {
  7995. /* istanbul ignore next */
  7996. return this.$vnode && this.$vnode.ssrContext
  7997. }
  7998. });
  7999. // expose FunctionalRenderContext for ssr runtime helper installation
  8000. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8001. value: FunctionalRenderContext
  8002. });
  8003. Vue.version = '2.6.11';
  8004. /**
  8005. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8006. */
  8007. var ARRAYTYPE = '[object Array]';
  8008. var OBJECTTYPE = '[object Object]';
  8009. var NULLTYPE = '[object Null]';
  8010. var UNDEFINEDTYPE = '[object Undefined]';
  8011. // const FUNCTIONTYPE = '[object Function]'
  8012. function diff(current, pre) {
  8013. var result = {};
  8014. syncKeys(current, pre);
  8015. _diff(current, pre, '', result);
  8016. return result
  8017. }
  8018. function syncKeys(current, pre) {
  8019. if (current === pre) { return }
  8020. var rootCurrentType = type(current);
  8021. var rootPreType = type(pre);
  8022. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8023. if(Object.keys(current).length >= Object.keys(pre).length){
  8024. for (var key in pre) {
  8025. var currentValue = current[key];
  8026. if (currentValue === undefined) {
  8027. current[key] = null;
  8028. } else {
  8029. syncKeys(currentValue, pre[key]);
  8030. }
  8031. }
  8032. }
  8033. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8034. if (current.length >= pre.length) {
  8035. pre.forEach(function (item, index) {
  8036. syncKeys(current[index], item);
  8037. });
  8038. }
  8039. }
  8040. }
  8041. function nullOrUndefined(currentType, preType) {
  8042. if(
  8043. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  8044. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  8045. ) {
  8046. return false
  8047. }
  8048. return true
  8049. }
  8050. function _diff(current, pre, path, result) {
  8051. if (current === pre) { return }
  8052. var rootCurrentType = type(current);
  8053. var rootPreType = type(pre);
  8054. if (rootCurrentType == OBJECTTYPE) {
  8055. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8056. setResult(result, path, current);
  8057. } else {
  8058. var loop = function ( key ) {
  8059. var currentValue = current[key];
  8060. var preValue = pre[key];
  8061. var currentType = type(currentValue);
  8062. var preType = type(preValue);
  8063. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8064. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  8065. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8066. }
  8067. } else if (currentType == ARRAYTYPE) {
  8068. if (preType != ARRAYTYPE) {
  8069. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8070. } else {
  8071. if (currentValue.length < preValue.length) {
  8072. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8073. } else {
  8074. currentValue.forEach(function (item, index) {
  8075. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8076. });
  8077. }
  8078. }
  8079. } else if (currentType == OBJECTTYPE) {
  8080. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8081. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8082. } else {
  8083. for (var subKey in currentValue) {
  8084. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8085. }
  8086. }
  8087. }
  8088. };
  8089. for (var key in current) loop( key );
  8090. }
  8091. } else if (rootCurrentType == ARRAYTYPE) {
  8092. if (rootPreType != ARRAYTYPE) {
  8093. setResult(result, path, current);
  8094. } else {
  8095. if (current.length < pre.length) {
  8096. setResult(result, path, current);
  8097. } else {
  8098. current.forEach(function (item, index) {
  8099. _diff(item, pre[index], path + '[' + index + ']', result);
  8100. });
  8101. }
  8102. }
  8103. } else {
  8104. setResult(result, path, current);
  8105. }
  8106. }
  8107. function setResult(result, k, v) {
  8108. // if (type(v) != FUNCTIONTYPE) {
  8109. result[k] = v;
  8110. // }
  8111. }
  8112. function type(obj) {
  8113. return Object.prototype.toString.call(obj)
  8114. }
  8115. /* */
  8116. function flushCallbacks$1(vm) {
  8117. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8118. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"wechat","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8119. var mpInstance = vm.$scope;
  8120. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8121. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8122. }
  8123. var copies = vm.__next_tick_callbacks.slice(0);
  8124. vm.__next_tick_callbacks.length = 0;
  8125. for (var i = 0; i < copies.length; i++) {
  8126. copies[i]();
  8127. }
  8128. }
  8129. }
  8130. function hasRenderWatcher(vm) {
  8131. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8132. }
  8133. function nextTick$1(vm, cb) {
  8134. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8135. //2.nextTick 之前存在 render watcher
  8136. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8137. if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"wechat","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  8138. var mpInstance = vm.$scope;
  8139. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8140. ']:nextVueTick');
  8141. }
  8142. return nextTick(cb, vm)
  8143. }else{
  8144. if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"wechat","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  8145. var mpInstance$1 = vm.$scope;
  8146. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8147. ']:nextMPTick');
  8148. }
  8149. }
  8150. var _resolve;
  8151. if (!vm.__next_tick_callbacks) {
  8152. vm.__next_tick_callbacks = [];
  8153. }
  8154. vm.__next_tick_callbacks.push(function () {
  8155. if (cb) {
  8156. try {
  8157. cb.call(vm);
  8158. } catch (e) {
  8159. handleError(e, vm, 'nextTick');
  8160. }
  8161. } else if (_resolve) {
  8162. _resolve(vm);
  8163. }
  8164. });
  8165. // $flow-disable-line
  8166. if (!cb && typeof Promise !== 'undefined') {
  8167. return new Promise(function (resolve) {
  8168. _resolve = resolve;
  8169. })
  8170. }
  8171. }
  8172. /* */
  8173. function clearInstance(key, value) {
  8174. // 简易去除 Vue 和小程序组件实例
  8175. if (value) {
  8176. if (value._isVue || value.__v_isMPComponent) {
  8177. return {}
  8178. }
  8179. }
  8180. return value
  8181. }
  8182. function cloneWithData(vm) {
  8183. // 确保当前 vm 所有数据被同步
  8184. var ret = Object.create(null);
  8185. var dataKeys = [].concat(
  8186. Object.keys(vm._data || {}),
  8187. Object.keys(vm._computedWatchers || {}));
  8188. dataKeys.reduce(function(ret, key) {
  8189. ret[key] = vm[key];
  8190. return ret
  8191. }, ret);
  8192. // vue-composition-api
  8193. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  8194. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  8195. if (rawBindings) {
  8196. Object.keys(rawBindings).forEach(function (key) {
  8197. ret[key] = vm[key];
  8198. });
  8199. }
  8200. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8201. Object.assign(ret, vm.$mp.data || {});
  8202. if (
  8203. Array.isArray(vm.$options.behaviors) &&
  8204. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8205. ) { //form-field
  8206. ret['name'] = vm.name;
  8207. ret['value'] = vm.value;
  8208. }
  8209. return JSON.parse(JSON.stringify(ret, clearInstance))
  8210. }
  8211. var patch = function(oldVnode, vnode) {
  8212. var this$1 = this;
  8213. if (vnode === null) { //destroy
  8214. return
  8215. }
  8216. if (this.mpType === 'page' || this.mpType === 'component') {
  8217. var mpInstance = this.$scope;
  8218. var data = Object.create(null);
  8219. try {
  8220. data = cloneWithData(this);
  8221. } catch (err) {
  8222. console.error(err);
  8223. }
  8224. data.__webviewId__ = mpInstance.data.__webviewId__;
  8225. var mpData = Object.create(null);
  8226. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  8227. mpData[key] = mpInstance.data[key];
  8228. });
  8229. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  8230. if (Object.keys(diffData).length) {
  8231. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"wechat","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8232. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  8233. ']差量更新',
  8234. JSON.stringify(diffData));
  8235. }
  8236. this.__next_tick_pending = true;
  8237. mpInstance.setData(diffData, function () {
  8238. this$1.__next_tick_pending = false;
  8239. flushCallbacks$1(this$1);
  8240. });
  8241. } else {
  8242. flushCallbacks$1(this);
  8243. }
  8244. }
  8245. };
  8246. /* */
  8247. function createEmptyRender() {
  8248. }
  8249. function mountComponent$1(
  8250. vm,
  8251. el,
  8252. hydrating
  8253. ) {
  8254. if (!vm.mpType) {//main.js 中的 new Vue
  8255. return vm
  8256. }
  8257. if (vm.mpType === 'app') {
  8258. vm.$options.render = createEmptyRender;
  8259. }
  8260. if (!vm.$options.render) {
  8261. vm.$options.render = createEmptyRender;
  8262. if (true) {
  8263. /* istanbul ignore if */
  8264. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  8265. vm.$options.el || el) {
  8266. warn(
  8267. 'You are using the runtime-only build of Vue where the template ' +
  8268. 'compiler is not available. Either pre-compile the templates into ' +
  8269. 'render functions, or use the compiler-included build.',
  8270. vm
  8271. );
  8272. } else {
  8273. warn(
  8274. 'Failed to mount component: template or render function not defined.',
  8275. vm
  8276. );
  8277. }
  8278. }
  8279. }
  8280. !vm._$fallback && callHook(vm, 'beforeMount');
  8281. var updateComponent = function () {
  8282. vm._update(vm._render(), hydrating);
  8283. };
  8284. // we set this to vm._watcher inside the watcher's constructor
  8285. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8286. // component's mounted hook), which relies on vm._watcher being already defined
  8287. new Watcher(vm, updateComponent, noop, {
  8288. before: function before() {
  8289. if (vm._isMounted && !vm._isDestroyed) {
  8290. callHook(vm, 'beforeUpdate');
  8291. }
  8292. }
  8293. }, true /* isRenderWatcher */);
  8294. hydrating = false;
  8295. return vm
  8296. }
  8297. /* */
  8298. function renderClass (
  8299. staticClass,
  8300. dynamicClass
  8301. ) {
  8302. if (isDef(staticClass) || isDef(dynamicClass)) {
  8303. return concat(staticClass, stringifyClass(dynamicClass))
  8304. }
  8305. /* istanbul ignore next */
  8306. return ''
  8307. }
  8308. function concat (a, b) {
  8309. return a ? b ? (a + ' ' + b) : a : (b || '')
  8310. }
  8311. function stringifyClass (value) {
  8312. if (Array.isArray(value)) {
  8313. return stringifyArray(value)
  8314. }
  8315. if (isObject(value)) {
  8316. return stringifyObject(value)
  8317. }
  8318. if (typeof value === 'string') {
  8319. return value
  8320. }
  8321. /* istanbul ignore next */
  8322. return ''
  8323. }
  8324. function stringifyArray (value) {
  8325. var res = '';
  8326. var stringified;
  8327. for (var i = 0, l = value.length; i < l; i++) {
  8328. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8329. if (res) { res += ' '; }
  8330. res += stringified;
  8331. }
  8332. }
  8333. return res
  8334. }
  8335. function stringifyObject (value) {
  8336. var res = '';
  8337. for (var key in value) {
  8338. if (value[key]) {
  8339. if (res) { res += ' '; }
  8340. res += key;
  8341. }
  8342. }
  8343. return res
  8344. }
  8345. /* */
  8346. var parseStyleText = cached(function (cssText) {
  8347. var res = {};
  8348. var listDelimiter = /;(?![^(]*\))/g;
  8349. var propertyDelimiter = /:(.+)/;
  8350. cssText.split(listDelimiter).forEach(function (item) {
  8351. if (item) {
  8352. var tmp = item.split(propertyDelimiter);
  8353. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8354. }
  8355. });
  8356. return res
  8357. });
  8358. // normalize possible array / string values into Object
  8359. function normalizeStyleBinding (bindingStyle) {
  8360. if (Array.isArray(bindingStyle)) {
  8361. return toObject(bindingStyle)
  8362. }
  8363. if (typeof bindingStyle === 'string') {
  8364. return parseStyleText(bindingStyle)
  8365. }
  8366. return bindingStyle
  8367. }
  8368. /* */
  8369. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  8370. function getTarget(obj, path) {
  8371. var parts = path.split('.');
  8372. var key = parts[0];
  8373. if (key.indexOf('__$n') === 0) { //number index
  8374. key = parseInt(key.replace('__$n', ''));
  8375. }
  8376. if (parts.length === 1) {
  8377. return obj[key]
  8378. }
  8379. return getTarget(obj[key], parts.slice(1).join('.'))
  8380. }
  8381. function internalMixin(Vue) {
  8382. Vue.config.errorHandler = function(err, vm, info) {
  8383. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8384. console.error(err);
  8385. /* eslint-disable no-undef */
  8386. var app = typeof getApp === 'function' && getApp();
  8387. if (app && app.onError) {
  8388. app.onError(err);
  8389. }
  8390. };
  8391. var oldEmit = Vue.prototype.$emit;
  8392. Vue.prototype.$emit = function(event) {
  8393. if (this.$scope && event) {
  8394. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  8395. if (triggerEvent) {
  8396. try {
  8397. triggerEvent.call(this.$scope, event, {
  8398. __args__: toArray(arguments, 1)
  8399. });
  8400. } catch (error) {
  8401. }
  8402. }
  8403. }
  8404. return oldEmit.apply(this, arguments)
  8405. };
  8406. Vue.prototype.$nextTick = function(fn) {
  8407. return nextTick$1(this, fn)
  8408. };
  8409. MP_METHODS.forEach(function (method) {
  8410. Vue.prototype[method] = function(args) {
  8411. if (this.$scope && this.$scope[method]) {
  8412. return this.$scope[method](args)
  8413. }
  8414. // mp-alipay
  8415. if (typeof my === 'undefined') {
  8416. return
  8417. }
  8418. if (method === 'createSelectorQuery') {
  8419. /* eslint-disable no-undef */
  8420. return my.createSelectorQuery(args)
  8421. } else if (method === 'createIntersectionObserver') {
  8422. /* eslint-disable no-undef */
  8423. return my.createIntersectionObserver(args)
  8424. }
  8425. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  8426. };
  8427. });
  8428. Vue.prototype.__init_provide = initProvide;
  8429. Vue.prototype.__init_injections = initInjections;
  8430. Vue.prototype.__call_hook = function(hook, args) {
  8431. var vm = this;
  8432. // #7573 disable dep collection when invoking lifecycle hooks
  8433. pushTarget();
  8434. var handlers = vm.$options[hook];
  8435. var info = hook + " hook";
  8436. var ret;
  8437. if (handlers) {
  8438. for (var i = 0, j = handlers.length; i < j; i++) {
  8439. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  8440. }
  8441. }
  8442. if (vm._hasHookEvent) {
  8443. vm.$emit('hook:' + hook, args);
  8444. }
  8445. popTarget();
  8446. return ret
  8447. };
  8448. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  8449. if (Array.isArray(modifiers)) {
  8450. if (modifiers.indexOf('trim') !== -1) {
  8451. value = value.trim();
  8452. }
  8453. if (modifiers.indexOf('number') !== -1) {
  8454. value = this._n(value);
  8455. }
  8456. }
  8457. if (!target) {
  8458. target = this;
  8459. }
  8460. // 解决动态属性添加
  8461. Vue.set(target, key, value);
  8462. };
  8463. Vue.prototype.__set_sync = function(target, key, value) {
  8464. if (!target) {
  8465. target = this;
  8466. }
  8467. // 解决动态属性添加
  8468. Vue.set(target, key, value);
  8469. };
  8470. Vue.prototype.__get_orig = function(item) {
  8471. if (isPlainObject(item)) {
  8472. return item['$orig'] || item
  8473. }
  8474. return item
  8475. };
  8476. Vue.prototype.__get_value = function(dataPath, target) {
  8477. return getTarget(target || this, dataPath)
  8478. };
  8479. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  8480. return renderClass(staticClass, dynamicClass)
  8481. };
  8482. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  8483. if (!dynamicStyle && !staticStyle) {
  8484. return ''
  8485. }
  8486. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  8487. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  8488. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  8489. };
  8490. Vue.prototype.__map = function(val, iteratee) {
  8491. //TODO 暂不考虑 string
  8492. var ret, i, l, keys, key;
  8493. if (Array.isArray(val)) {
  8494. ret = new Array(val.length);
  8495. for (i = 0, l = val.length; i < l; i++) {
  8496. ret[i] = iteratee(val[i], i);
  8497. }
  8498. return ret
  8499. } else if (isObject(val)) {
  8500. keys = Object.keys(val);
  8501. ret = Object.create(null);
  8502. for (i = 0, l = keys.length; i < l; i++) {
  8503. key = keys[i];
  8504. ret[key] = iteratee(val[key], key, i);
  8505. }
  8506. return ret
  8507. } else if (typeof val === 'number') {
  8508. ret = new Array(val);
  8509. for (i = 0, l = val; i < l; i++) {
  8510. // 第一个参数暂时仍和小程序一致
  8511. ret[i] = iteratee(i, i);
  8512. }
  8513. return ret
  8514. }
  8515. return []
  8516. };
  8517. }
  8518. /* */
  8519. var LIFECYCLE_HOOKS$1 = [
  8520. //App
  8521. 'onLaunch',
  8522. 'onShow',
  8523. 'onHide',
  8524. 'onUniNViewMessage',
  8525. 'onPageNotFound',
  8526. 'onThemeChange',
  8527. 'onError',
  8528. 'onUnhandledRejection',
  8529. //Page
  8530. 'onInit',
  8531. 'onLoad',
  8532. // 'onShow',
  8533. 'onReady',
  8534. // 'onHide',
  8535. 'onUnload',
  8536. 'onPullDownRefresh',
  8537. 'onReachBottom',
  8538. 'onTabItemTap',
  8539. 'onAddToFavorites',
  8540. 'onShareTimeline',
  8541. 'onShareAppMessage',
  8542. 'onResize',
  8543. 'onPageScroll',
  8544. 'onNavigationBarButtonTap',
  8545. 'onBackPress',
  8546. 'onNavigationBarSearchInputChanged',
  8547. 'onNavigationBarSearchInputConfirmed',
  8548. 'onNavigationBarSearchInputClicked',
  8549. //Component
  8550. // 'onReady', // 兼容旧版本,应该移除该事件
  8551. 'onPageShow',
  8552. 'onPageHide',
  8553. 'onPageResize',
  8554. 'onUploadDouyinVideo'
  8555. ];
  8556. function lifecycleMixin$1(Vue) {
  8557. //fixed vue-class-component
  8558. var oldExtend = Vue.extend;
  8559. Vue.extend = function(extendOptions) {
  8560. extendOptions = extendOptions || {};
  8561. var methods = extendOptions.methods;
  8562. if (methods) {
  8563. Object.keys(methods).forEach(function (methodName) {
  8564. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  8565. extendOptions[methodName] = methods[methodName];
  8566. delete methods[methodName];
  8567. }
  8568. });
  8569. }
  8570. return oldExtend.call(this, extendOptions)
  8571. };
  8572. var strategies = Vue.config.optionMergeStrategies;
  8573. var mergeHook = strategies.created;
  8574. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  8575. strategies[hook] = mergeHook;
  8576. });
  8577. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  8578. }
  8579. /* */
  8580. // install platform patch function
  8581. Vue.prototype.__patch__ = patch;
  8582. // public mount method
  8583. Vue.prototype.$mount = function(
  8584. el ,
  8585. hydrating
  8586. ) {
  8587. return mountComponent$1(this, el, hydrating)
  8588. };
  8589. lifecycleMixin$1(Vue);
  8590. internalMixin(Vue);
  8591. /* */
  8592. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  8593. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  8594. /***/ }),
  8595. /***/ 25:
  8596. /*!*********************************************!*\
  8597. !*** D:/hongxing/storage-wechat/pages.json ***!
  8598. \*********************************************/
  8599. /*! no static exports found */
  8600. /***/ (function(module, exports) {
  8601. /***/ }),
  8602. /***/ 3:
  8603. /*!**********************************************************************!*\
  8604. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  8605. \**********************************************************************/
  8606. /*! no static exports found */
  8607. /***/ (function(module, exports) {
  8608. function _interopRequireDefault(obj) {
  8609. return obj && obj.__esModule ? obj : {
  8610. "default": obj
  8611. };
  8612. }
  8613. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  8614. /***/ }),
  8615. /***/ 31:
  8616. /*!**********************************************************************************************************!*\
  8617. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  8618. \**********************************************************************************************************/
  8619. /*! exports provided: default */
  8620. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8621. "use strict";
  8622. __webpack_require__.r(__webpack_exports__);
  8623. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  8624. /* globals __VUE_SSR_CONTEXT__ */
  8625. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  8626. // This module is a runtime utility for cleaner component module output and will
  8627. // be included in the final webpack user bundle.
  8628. function normalizeComponent (
  8629. scriptExports,
  8630. render,
  8631. staticRenderFns,
  8632. functionalTemplate,
  8633. injectStyles,
  8634. scopeId,
  8635. moduleIdentifier, /* server only */
  8636. shadowMode, /* vue-cli only */
  8637. components, // fixed by xxxxxx auto components
  8638. renderjs // fixed by xxxxxx renderjs
  8639. ) {
  8640. // Vue.extend constructor export interop
  8641. var options = typeof scriptExports === 'function'
  8642. ? scriptExports.options
  8643. : scriptExports
  8644. // fixed by xxxxxx auto components
  8645. if (components) {
  8646. if (!options.components) {
  8647. options.components = {}
  8648. }
  8649. var hasOwn = Object.prototype.hasOwnProperty
  8650. for (var name in components) {
  8651. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  8652. options.components[name] = components[name]
  8653. }
  8654. }
  8655. }
  8656. // fixed by xxxxxx renderjs
  8657. if (renderjs) {
  8658. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  8659. this[renderjs.__module] = this
  8660. });
  8661. (options.mixins || (options.mixins = [])).push(renderjs)
  8662. }
  8663. // render functions
  8664. if (render) {
  8665. options.render = render
  8666. options.staticRenderFns = staticRenderFns
  8667. options._compiled = true
  8668. }
  8669. // functional template
  8670. if (functionalTemplate) {
  8671. options.functional = true
  8672. }
  8673. // scopedId
  8674. if (scopeId) {
  8675. options._scopeId = 'data-v-' + scopeId
  8676. }
  8677. var hook
  8678. if (moduleIdentifier) { // server build
  8679. hook = function (context) {
  8680. // 2.3 injection
  8681. context =
  8682. context || // cached call
  8683. (this.$vnode && this.$vnode.ssrContext) || // stateful
  8684. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  8685. // 2.2 with runInNewContext: true
  8686. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  8687. context = __VUE_SSR_CONTEXT__
  8688. }
  8689. // inject component styles
  8690. if (injectStyles) {
  8691. injectStyles.call(this, context)
  8692. }
  8693. // register component module identifier for async chunk inferrence
  8694. if (context && context._registeredComponents) {
  8695. context._registeredComponents.add(moduleIdentifier)
  8696. }
  8697. }
  8698. // used by ssr in case component is cached and beforeCreate
  8699. // never gets called
  8700. options._ssrRegister = hook
  8701. } else if (injectStyles) {
  8702. hook = shadowMode
  8703. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  8704. : injectStyles
  8705. }
  8706. if (hook) {
  8707. if (options.functional) {
  8708. // for template-only hot-reload because in that case the render fn doesn't
  8709. // go through the normalizer
  8710. options._injectStyles = hook
  8711. // register for functioal component in vue file
  8712. var originalRender = options.render
  8713. options.render = function renderWithStyleInjection (h, context) {
  8714. hook.call(context)
  8715. return originalRender(h, context)
  8716. }
  8717. } else {
  8718. // inject component registration as beforeCreate hook
  8719. var existing = options.beforeCreate
  8720. options.beforeCreate = existing
  8721. ? [].concat(existing, hook)
  8722. : [hook]
  8723. }
  8724. }
  8725. return {
  8726. exports: scriptExports,
  8727. options: options
  8728. }
  8729. }
  8730. /***/ }),
  8731. /***/ 32:
  8732. /*!******************************************************!*\
  8733. !*** D:/hongxing/storage-wechat/commons/commons.css ***!
  8734. \******************************************************/
  8735. /*! no static exports found */
  8736. /***/ (function(module, exports, __webpack_require__) {
  8737. // extracted by mini-css-extract-plugin
  8738. if(false) { var cssReload; }
  8739. /***/ }),
  8740. /***/ 33:
  8741. /*!***********************************************!*\
  8742. !*** D:/hongxing/storage-wechat/util/http.js ***!
  8743. \***********************************************/
  8744. /*! no static exports found */
  8745. /***/ (function(module, exports, __webpack_require__) {
  8746. "use strict";
  8747. /* WEBPACK VAR INJECTION */(function(uni) {
  8748. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 3);
  8749. Object.defineProperty(exports, "__esModule", {
  8750. value: true
  8751. });
  8752. exports.default = void 0;
  8753. exports.get = get;
  8754. exports.post = post;
  8755. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 24));
  8756. //const BASE_URL = 'https://ymt.prpiano.com/api'
  8757. //const BASE_URL = 'https://ht.test.prpiano.com/api'
  8758. //xw
  8759. //const BASE_URL = 'http://10.0.52.100:82'
  8760. //dh
  8761. var BASE_URL;
  8762. var BASE_URL2;
  8763. //lb
  8764. //const BASE_URL = 'http://10.0.126.219:82'
  8765. if (true) {
  8766. //线上 https://bytesailing.cn/api/storage/cloudApi
  8767. BASE_URL = 'https://cfm.bytesail.cn/api/storage/cloudApi';
  8768. BASE_URL2 = 'https://cfm.bytesail.cn/api/storage/cloudApi';
  8769. } else {}
  8770. /**
  8771. * 封装get方法
  8772. * @param url
  8773. * @param data
  8774. * @returns {Promise}
  8775. */
  8776. function get(url) {
  8777. var req = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  8778. return new Promise(function (resolve, reject) {
  8779. if (_vue.default.prototype.$token) {
  8780. var hander = {
  8781. 'Authorization': 'Basic c2FiZXI6c2FiZXJfc2VjcmV0'
  8782. };
  8783. } else {
  8784. var hander = {};
  8785. }
  8786. uni.request({
  8787. url: BASE_URL + url,
  8788. data: req,
  8789. method: 'GET',
  8790. header: hander,
  8791. success: function success(res) {
  8792. resolve(res.data);
  8793. },
  8794. fail: function fail(err) {
  8795. return Promise.reject(err);
  8796. }
  8797. });
  8798. });
  8799. }
  8800. /**
  8801. * 封装post请求
  8802. * @param url
  8803. * @param data
  8804. * @returns {Promise}
  8805. */
  8806. var urlList = [];
  8807. function post(url) {
  8808. var req = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  8809. var headers = arguments.length > 2 ? arguments[2] : undefined;
  8810. var httpUrl;
  8811. if (url.indexOf('/cloudApi') == -1) {
  8812. httpUrl = BASE_URL;
  8813. } else {
  8814. httpUrl = BASE_URL2;
  8815. }
  8816. if (urlList.indexOf(url) == -1 || url == '/wx/inventory/selectFabricWTypeDetails' || '/wx/inventory/selectInkEW') {
  8817. urlList.push(url);
  8818. setTimeout(function () {
  8819. urlList.splice(urlList.indexOf(url), 1);
  8820. }, 500);
  8821. } else {
  8822. return Promise.reject('请勿频繁提交');
  8823. }
  8824. return new Promise(function (resolve, reject) {
  8825. if (_vue.default.prototype.$token) {
  8826. var hander = {
  8827. 'Blade-Auth': 'bearer ' + _vue.default.prototype.$token.access_token,
  8828. 'Authorization': 'Basic c2FiZXI6c2FiZXJfc2VjcmV0',
  8829. 'Content-Type': 'application/json;charset=UTF-8'
  8830. };
  8831. } else {
  8832. var hander = {};
  8833. }
  8834. if (headers) hander = headers;
  8835. uni.request({
  8836. url: httpUrl + url,
  8837. data: req,
  8838. method: 'POST',
  8839. header: hander,
  8840. success: function success(res) {
  8841. if (res.data.code == 401) {
  8842. uni.showToast({
  8843. icon: "error",
  8844. title: '前往登录',
  8845. duration: 2000
  8846. });
  8847. _vue.default.prototype.$token = null;
  8848. uni.redirectTo({
  8849. url: "/pages/user/login"
  8850. });
  8851. } else if (res.data.code == 500) {
  8852. uni.showToast({
  8853. icon: "error",
  8854. title: res.data.msg,
  8855. duration: 2000
  8856. });
  8857. } else if (res.data.code == 200) {
  8858. resolve(res.data);
  8859. } else if (!res.data.code) {
  8860. uni.showToast({
  8861. icon: "error",
  8862. title: '服务器错误',
  8863. duration: 2000
  8864. });
  8865. } else {
  8866. uni.showToast({
  8867. icon: "error",
  8868. title: res.data.msg,
  8869. duration: 2000
  8870. });
  8871. }
  8872. },
  8873. fail: function fail(err) {
  8874. uni.showToast({
  8875. icon: "error",
  8876. title: '服务器错误',
  8877. duration: 2000
  8878. });
  8879. return Promise.reject(err);
  8880. }
  8881. });
  8882. });
  8883. }
  8884. var _default = {
  8885. post: post,
  8886. get: get
  8887. };
  8888. exports.default = _default;
  8889. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8890. /***/ }),
  8891. /***/ 34:
  8892. /*!**********************************************************!*\
  8893. !*** D:/hongxing/storage-wechat/js_sdk/zww-md5/w_md5.js ***!
  8894. \**********************************************************/
  8895. /*! no static exports found */
  8896. /***/ (function(module, exports, __webpack_require__) {
  8897. "use strict";
  8898. Object.defineProperty(exports, "__esModule", {
  8899. value: true
  8900. });
  8901. exports.default = void 0;
  8902. var w_md5 = {};
  8903. function hex_md5(string, bit) {
  8904. function md5_RotateLeft(lValue, iShiftBits) {
  8905. return lValue << iShiftBits | lValue >>> 32 - iShiftBits;
  8906. }
  8907. function md5_AddUnsigned(lX, lY) {
  8908. var lX4, lY4, lX8, lY8, lResult;
  8909. lX8 = lX & 0x80000000;
  8910. lY8 = lY & 0x80000000;
  8911. lX4 = lX & 0x40000000;
  8912. lY4 = lY & 0x40000000;
  8913. lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
  8914. if (lX4 & lY4) {
  8915. return lResult ^ 0x80000000 ^ lX8 ^ lY8;
  8916. }
  8917. if (lX4 | lY4) {
  8918. if (lResult & 0x40000000) {
  8919. return lResult ^ 0xC0000000 ^ lX8 ^ lY8;
  8920. } else {
  8921. return lResult ^ 0x40000000 ^ lX8 ^ lY8;
  8922. }
  8923. } else {
  8924. return lResult ^ lX8 ^ lY8;
  8925. }
  8926. }
  8927. function md5_F(x, y, z) {
  8928. return x & y | ~x & z;
  8929. }
  8930. function md5_G(x, y, z) {
  8931. return x & z | y & ~z;
  8932. }
  8933. function md5_H(x, y, z) {
  8934. return x ^ y ^ z;
  8935. }
  8936. function md5_I(x, y, z) {
  8937. return y ^ (x | ~z);
  8938. }
  8939. function md5_FF(a, b, c, d, x, s, ac) {
  8940. a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_F(b, c, d), x), ac));
  8941. return md5_AddUnsigned(md5_RotateLeft(a, s), b);
  8942. }
  8943. ;
  8944. function md5_GG(a, b, c, d, x, s, ac) {
  8945. a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_G(b, c, d), x), ac));
  8946. return md5_AddUnsigned(md5_RotateLeft(a, s), b);
  8947. }
  8948. ;
  8949. function md5_HH(a, b, c, d, x, s, ac) {
  8950. a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_H(b, c, d), x), ac));
  8951. return md5_AddUnsigned(md5_RotateLeft(a, s), b);
  8952. }
  8953. ;
  8954. function md5_II(a, b, c, d, x, s, ac) {
  8955. a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_I(b, c, d), x), ac));
  8956. return md5_AddUnsigned(md5_RotateLeft(a, s), b);
  8957. }
  8958. ;
  8959. function md5_ConvertToWordArray(string) {
  8960. var lWordCount;
  8961. var lMessageLength = string.length;
  8962. var lNumberOfWords_temp1 = lMessageLength + 8;
  8963. var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - lNumberOfWords_temp1 % 64) / 64;
  8964. var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16;
  8965. var lWordArray = Array(lNumberOfWords - 1);
  8966. var lBytePosition = 0;
  8967. var lByteCount = 0;
  8968. while (lByteCount < lMessageLength) {
  8969. lWordCount = (lByteCount - lByteCount % 4) / 4;
  8970. lBytePosition = lByteCount % 4 * 8;
  8971. lWordArray[lWordCount] = lWordArray[lWordCount] | string.charCodeAt(lByteCount) << lBytePosition;
  8972. lByteCount++;
  8973. }
  8974. lWordCount = (lByteCount - lByteCount % 4) / 4;
  8975. lBytePosition = lByteCount % 4 * 8;
  8976. lWordArray[lWordCount] = lWordArray[lWordCount] | 0x80 << lBytePosition;
  8977. lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
  8978. lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
  8979. return lWordArray;
  8980. }
  8981. ;
  8982. function md5_WordToHex(lValue) {
  8983. var WordToHexValue = "",
  8984. WordToHexValue_temp = "",
  8985. lByte,
  8986. lCount;
  8987. for (lCount = 0; lCount <= 3; lCount++) {
  8988. lByte = lValue >>> lCount * 8 & 255;
  8989. WordToHexValue_temp = "0" + lByte.toString(16);
  8990. WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2, 2);
  8991. }
  8992. return WordToHexValue;
  8993. }
  8994. ;
  8995. function md5_Utf8Encode(string) {
  8996. string = string.replace(/\r\n/g, "\n");
  8997. var utftext = "";
  8998. for (var n = 0; n < string.length; n++) {
  8999. var c = string.charCodeAt(n);
  9000. if (c < 128) {
  9001. utftext += String.fromCharCode(c);
  9002. } else if (c > 127 && c < 2048) {
  9003. utftext += String.fromCharCode(c >> 6 | 192);
  9004. utftext += String.fromCharCode(c & 63 | 128);
  9005. } else {
  9006. utftext += String.fromCharCode(c >> 12 | 224);
  9007. utftext += String.fromCharCode(c >> 6 & 63 | 128);
  9008. utftext += String.fromCharCode(c & 63 | 128);
  9009. }
  9010. }
  9011. return utftext;
  9012. }
  9013. ;
  9014. var x = Array();
  9015. var k, AA, BB, CC, DD, a, b, c, d;
  9016. var S11 = 7,
  9017. S12 = 12,
  9018. S13 = 17,
  9019. S14 = 22;
  9020. var S21 = 5,
  9021. S22 = 9,
  9022. S23 = 14,
  9023. S24 = 20;
  9024. var S31 = 4,
  9025. S32 = 11,
  9026. S33 = 16,
  9027. S34 = 23;
  9028. var S41 = 6,
  9029. S42 = 10,
  9030. S43 = 15,
  9031. S44 = 21;
  9032. string = md5_Utf8Encode(string);
  9033. x = md5_ConvertToWordArray(string);
  9034. a = 0x67452301;
  9035. b = 0xEFCDAB89;
  9036. c = 0x98BADCFE;
  9037. d = 0x10325476;
  9038. for (k = 0; k < x.length; k += 16) {
  9039. AA = a;
  9040. BB = b;
  9041. CC = c;
  9042. DD = d;
  9043. a = md5_FF(a, b, c, d, x[k + 0], S11, 0xD76AA478);
  9044. d = md5_FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756);
  9045. c = md5_FF(c, d, a, b, x[k + 2], S13, 0x242070DB);
  9046. b = md5_FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE);
  9047. a = md5_FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF);
  9048. d = md5_FF(d, a, b, c, x[k + 5], S12, 0x4787C62A);
  9049. c = md5_FF(c, d, a, b, x[k + 6], S13, 0xA8304613);
  9050. b = md5_FF(b, c, d, a, x[k + 7], S14, 0xFD469501);
  9051. a = md5_FF(a, b, c, d, x[k + 8], S11, 0x698098D8);
  9052. d = md5_FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF);
  9053. c = md5_FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1);
  9054. b = md5_FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE);
  9055. a = md5_FF(a, b, c, d, x[k + 12], S11, 0x6B901122);
  9056. d = md5_FF(d, a, b, c, x[k + 13], S12, 0xFD987193);
  9057. c = md5_FF(c, d, a, b, x[k + 14], S13, 0xA679438E);
  9058. b = md5_FF(b, c, d, a, x[k + 15], S14, 0x49B40821);
  9059. a = md5_GG(a, b, c, d, x[k + 1], S21, 0xF61E2562);
  9060. d = md5_GG(d, a, b, c, x[k + 6], S22, 0xC040B340);
  9061. c = md5_GG(c, d, a, b, x[k + 11], S23, 0x265E5A51);
  9062. b = md5_GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA);
  9063. a = md5_GG(a, b, c, d, x[k + 5], S21, 0xD62F105D);
  9064. d = md5_GG(d, a, b, c, x[k + 10], S22, 0x2441453);
  9065. c = md5_GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681);
  9066. b = md5_GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8);
  9067. a = md5_GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6);
  9068. d = md5_GG(d, a, b, c, x[k + 14], S22, 0xC33707D6);
  9069. c = md5_GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87);
  9070. b = md5_GG(b, c, d, a, x[k + 8], S24, 0x455A14ED);
  9071. a = md5_GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905);
  9072. d = md5_GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8);
  9073. c = md5_GG(c, d, a, b, x[k + 7], S23, 0x676F02D9);
  9074. b = md5_GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A);
  9075. a = md5_HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942);
  9076. d = md5_HH(d, a, b, c, x[k + 8], S32, 0x8771F681);
  9077. c = md5_HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122);
  9078. b = md5_HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C);
  9079. a = md5_HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44);
  9080. d = md5_HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9);
  9081. c = md5_HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60);
  9082. b = md5_HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70);
  9083. a = md5_HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6);
  9084. d = md5_HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA);
  9085. c = md5_HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085);
  9086. b = md5_HH(b, c, d, a, x[k + 6], S34, 0x4881D05);
  9087. a = md5_HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039);
  9088. d = md5_HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5);
  9089. c = md5_HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8);
  9090. b = md5_HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665);
  9091. a = md5_II(a, b, c, d, x[k + 0], S41, 0xF4292244);
  9092. d = md5_II(d, a, b, c, x[k + 7], S42, 0x432AFF97);
  9093. c = md5_II(c, d, a, b, x[k + 14], S43, 0xAB9423A7);
  9094. b = md5_II(b, c, d, a, x[k + 5], S44, 0xFC93A039);
  9095. a = md5_II(a, b, c, d, x[k + 12], S41, 0x655B59C3);
  9096. d = md5_II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92);
  9097. c = md5_II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D);
  9098. b = md5_II(b, c, d, a, x[k + 1], S44, 0x85845DD1);
  9099. a = md5_II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F);
  9100. d = md5_II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0);
  9101. c = md5_II(c, d, a, b, x[k + 6], S43, 0xA3014314);
  9102. b = md5_II(b, c, d, a, x[k + 13], S44, 0x4E0811A1);
  9103. a = md5_II(a, b, c, d, x[k + 4], S41, 0xF7537E82);
  9104. d = md5_II(d, a, b, c, x[k + 11], S42, 0xBD3AF235);
  9105. c = md5_II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB);
  9106. b = md5_II(b, c, d, a, x[k + 9], S44, 0xEB86D391);
  9107. a = md5_AddUnsigned(a, AA);
  9108. b = md5_AddUnsigned(b, BB);
  9109. c = md5_AddUnsigned(c, CC);
  9110. d = md5_AddUnsigned(d, DD);
  9111. }
  9112. if (bit == 32) {
  9113. return (md5_WordToHex(a) + md5_WordToHex(b) + md5_WordToHex(c) + md5_WordToHex(d)).toLowerCase();
  9114. }
  9115. return (md5_WordToHex(b) + md5_WordToHex(c)).toLowerCase();
  9116. }
  9117. //16位小写
  9118. w_md5.hex_md5_16 = function (string) {
  9119. return hex_md5(string, 16);
  9120. };
  9121. //16位大写
  9122. w_md5.hex_md5_16Upper = function (string) {
  9123. return hex_md5(string, 16).toUpperCase();
  9124. };
  9125. //32位小写
  9126. w_md5.hex_md5_32 = function (string) {
  9127. return hex_md5(string, 32);
  9128. };
  9129. //32位大写
  9130. w_md5.hex_md5_32Upper = function (string) {
  9131. return hex_md5(string, 32).toUpperCase();
  9132. };
  9133. var _default = w_md5;
  9134. exports.default = _default;
  9135. /***/ }),
  9136. /***/ 4:
  9137. /*!**************************************************************!*\
  9138. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  9139. \**************************************************************/
  9140. /*! no static exports found */
  9141. /***/ (function(module, exports, __webpack_require__) {
  9142. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 5);
  9143. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 6);
  9144. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 7);
  9145. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 9);
  9146. function _slicedToArray(arr, i) {
  9147. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  9148. }
  9149. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9150. /***/ }),
  9151. /***/ 408:
  9152. /*!************************************************************************************************!*\
  9153. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  9154. \************************************************************************************************/
  9155. /*! no static exports found */
  9156. /***/ (function(module, exports, __webpack_require__) {
  9157. // TODO(Babel 8): Remove this file.
  9158. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 409)();
  9159. module.exports = runtime;
  9160. /***/ }),
  9161. /***/ 409:
  9162. /*!*******************************************************************!*\
  9163. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  9164. \*******************************************************************/
  9165. /*! no static exports found */
  9166. /***/ (function(module, exports, __webpack_require__) {
  9167. var _typeof = __webpack_require__(/*! ./typeof.js */ 12)["default"];
  9168. function _regeneratorRuntime() {
  9169. "use strict";
  9170. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  9171. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  9172. return exports;
  9173. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9174. var exports = {},
  9175. Op = Object.prototype,
  9176. hasOwn = Op.hasOwnProperty,
  9177. defineProperty = Object.defineProperty || function (obj, key, desc) {
  9178. obj[key] = desc.value;
  9179. },
  9180. $Symbol = "function" == typeof Symbol ? Symbol : {},
  9181. iteratorSymbol = $Symbol.iterator || "@@iterator",
  9182. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  9183. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  9184. function define(obj, key, value) {
  9185. return Object.defineProperty(obj, key, {
  9186. value: value,
  9187. enumerable: !0,
  9188. configurable: !0,
  9189. writable: !0
  9190. }), obj[key];
  9191. }
  9192. try {
  9193. define({}, "");
  9194. } catch (err) {
  9195. define = function define(obj, key, value) {
  9196. return obj[key] = value;
  9197. };
  9198. }
  9199. function wrap(innerFn, outerFn, self, tryLocsList) {
  9200. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  9201. generator = Object.create(protoGenerator.prototype),
  9202. context = new Context(tryLocsList || []);
  9203. return defineProperty(generator, "_invoke", {
  9204. value: makeInvokeMethod(innerFn, self, context)
  9205. }), generator;
  9206. }
  9207. function tryCatch(fn, obj, arg) {
  9208. try {
  9209. return {
  9210. type: "normal",
  9211. arg: fn.call(obj, arg)
  9212. };
  9213. } catch (err) {
  9214. return {
  9215. type: "throw",
  9216. arg: err
  9217. };
  9218. }
  9219. }
  9220. exports.wrap = wrap;
  9221. var ContinueSentinel = {};
  9222. function Generator() {}
  9223. function GeneratorFunction() {}
  9224. function GeneratorFunctionPrototype() {}
  9225. var IteratorPrototype = {};
  9226. define(IteratorPrototype, iteratorSymbol, function () {
  9227. return this;
  9228. });
  9229. var getProto = Object.getPrototypeOf,
  9230. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  9231. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  9232. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  9233. function defineIteratorMethods(prototype) {
  9234. ["next", "throw", "return"].forEach(function (method) {
  9235. define(prototype, method, function (arg) {
  9236. return this._invoke(method, arg);
  9237. });
  9238. });
  9239. }
  9240. function AsyncIterator(generator, PromiseImpl) {
  9241. function invoke(method, arg, resolve, reject) {
  9242. var record = tryCatch(generator[method], generator, arg);
  9243. if ("throw" !== record.type) {
  9244. var result = record.arg,
  9245. value = result.value;
  9246. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  9247. invoke("next", value, resolve, reject);
  9248. }, function (err) {
  9249. invoke("throw", err, resolve, reject);
  9250. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  9251. result.value = unwrapped, resolve(result);
  9252. }, function (error) {
  9253. return invoke("throw", error, resolve, reject);
  9254. });
  9255. }
  9256. reject(record.arg);
  9257. }
  9258. var previousPromise;
  9259. defineProperty(this, "_invoke", {
  9260. value: function value(method, arg) {
  9261. function callInvokeWithMethodAndArg() {
  9262. return new PromiseImpl(function (resolve, reject) {
  9263. invoke(method, arg, resolve, reject);
  9264. });
  9265. }
  9266. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  9267. }
  9268. });
  9269. }
  9270. function makeInvokeMethod(innerFn, self, context) {
  9271. var state = "suspendedStart";
  9272. return function (method, arg) {
  9273. if ("executing" === state) throw new Error("Generator is already running");
  9274. if ("completed" === state) {
  9275. if ("throw" === method) throw arg;
  9276. return doneResult();
  9277. }
  9278. for (context.method = method, context.arg = arg;;) {
  9279. var delegate = context.delegate;
  9280. if (delegate) {
  9281. var delegateResult = maybeInvokeDelegate(delegate, context);
  9282. if (delegateResult) {
  9283. if (delegateResult === ContinueSentinel) continue;
  9284. return delegateResult;
  9285. }
  9286. }
  9287. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  9288. if ("suspendedStart" === state) throw state = "completed", context.arg;
  9289. context.dispatchException(context.arg);
  9290. } else "return" === context.method && context.abrupt("return", context.arg);
  9291. state = "executing";
  9292. var record = tryCatch(innerFn, self, context);
  9293. if ("normal" === record.type) {
  9294. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  9295. return {
  9296. value: record.arg,
  9297. done: context.done
  9298. };
  9299. }
  9300. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  9301. }
  9302. };
  9303. }
  9304. function maybeInvokeDelegate(delegate, context) {
  9305. var methodName = context.method,
  9306. method = delegate.iterator[methodName];
  9307. if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
  9308. var record = tryCatch(method, delegate.iterator, context.arg);
  9309. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  9310. var info = record.arg;
  9311. return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
  9312. }
  9313. function pushTryEntry(locs) {
  9314. var entry = {
  9315. tryLoc: locs[0]
  9316. };
  9317. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  9318. }
  9319. function resetTryEntry(entry) {
  9320. var record = entry.completion || {};
  9321. record.type = "normal", delete record.arg, entry.completion = record;
  9322. }
  9323. function Context(tryLocsList) {
  9324. this.tryEntries = [{
  9325. tryLoc: "root"
  9326. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  9327. }
  9328. function values(iterable) {
  9329. if (iterable) {
  9330. var iteratorMethod = iterable[iteratorSymbol];
  9331. if (iteratorMethod) return iteratorMethod.call(iterable);
  9332. if ("function" == typeof iterable.next) return iterable;
  9333. if (!isNaN(iterable.length)) {
  9334. var i = -1,
  9335. next = function next() {
  9336. for (; ++i < iterable.length;) {
  9337. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  9338. }
  9339. return next.value = undefined, next.done = !0, next;
  9340. };
  9341. return next.next = next;
  9342. }
  9343. }
  9344. return {
  9345. next: doneResult
  9346. };
  9347. }
  9348. function doneResult() {
  9349. return {
  9350. value: undefined,
  9351. done: !0
  9352. };
  9353. }
  9354. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  9355. value: GeneratorFunctionPrototype,
  9356. configurable: !0
  9357. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  9358. value: GeneratorFunction,
  9359. configurable: !0
  9360. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  9361. var ctor = "function" == typeof genFun && genFun.constructor;
  9362. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  9363. }, exports.mark = function (genFun) {
  9364. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  9365. }, exports.awrap = function (arg) {
  9366. return {
  9367. __await: arg
  9368. };
  9369. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  9370. return this;
  9371. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  9372. void 0 === PromiseImpl && (PromiseImpl = Promise);
  9373. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  9374. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  9375. return result.done ? result.value : iter.next();
  9376. });
  9377. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  9378. return this;
  9379. }), define(Gp, "toString", function () {
  9380. return "[object Generator]";
  9381. }), exports.keys = function (val) {
  9382. var object = Object(val),
  9383. keys = [];
  9384. for (var key in object) {
  9385. keys.push(key);
  9386. }
  9387. return keys.reverse(), function next() {
  9388. for (; keys.length;) {
  9389. var key = keys.pop();
  9390. if (key in object) return next.value = key, next.done = !1, next;
  9391. }
  9392. return next.done = !0, next;
  9393. };
  9394. }, exports.values = values, Context.prototype = {
  9395. constructor: Context,
  9396. reset: function reset(skipTempReset) {
  9397. if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {
  9398. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  9399. }
  9400. },
  9401. stop: function stop() {
  9402. this.done = !0;
  9403. var rootRecord = this.tryEntries[0].completion;
  9404. if ("throw" === rootRecord.type) throw rootRecord.arg;
  9405. return this.rval;
  9406. },
  9407. dispatchException: function dispatchException(exception) {
  9408. if (this.done) throw exception;
  9409. var context = this;
  9410. function handle(loc, caught) {
  9411. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  9412. }
  9413. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9414. var entry = this.tryEntries[i],
  9415. record = entry.completion;
  9416. if ("root" === entry.tryLoc) return handle("end");
  9417. if (entry.tryLoc <= this.prev) {
  9418. var hasCatch = hasOwn.call(entry, "catchLoc"),
  9419. hasFinally = hasOwn.call(entry, "finallyLoc");
  9420. if (hasCatch && hasFinally) {
  9421. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  9422. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  9423. } else if (hasCatch) {
  9424. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  9425. } else {
  9426. if (!hasFinally) throw new Error("try statement without catch or finally");
  9427. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  9428. }
  9429. }
  9430. }
  9431. },
  9432. abrupt: function abrupt(type, arg) {
  9433. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9434. var entry = this.tryEntries[i];
  9435. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  9436. var finallyEntry = entry;
  9437. break;
  9438. }
  9439. }
  9440. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  9441. var record = finallyEntry ? finallyEntry.completion : {};
  9442. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  9443. },
  9444. complete: function complete(record, afterLoc) {
  9445. if ("throw" === record.type) throw record.arg;
  9446. return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
  9447. },
  9448. finish: function finish(finallyLoc) {
  9449. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9450. var entry = this.tryEntries[i];
  9451. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  9452. }
  9453. },
  9454. "catch": function _catch(tryLoc) {
  9455. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9456. var entry = this.tryEntries[i];
  9457. if (entry.tryLoc === tryLoc) {
  9458. var record = entry.completion;
  9459. if ("throw" === record.type) {
  9460. var thrown = record.arg;
  9461. resetTryEntry(entry);
  9462. }
  9463. return thrown;
  9464. }
  9465. }
  9466. throw new Error("illegal catch attempt");
  9467. },
  9468. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  9469. return this.delegate = {
  9470. iterator: values(iterable),
  9471. resultName: resultName,
  9472. nextLoc: nextLoc
  9473. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  9474. }
  9475. }, exports;
  9476. }
  9477. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9478. /***/ }),
  9479. /***/ 41:
  9480. /*!********************************************************!*\
  9481. !*** D:/hongxing/storage-wechat/util/cacheConstant.js ***!
  9482. \********************************************************/
  9483. /*! no static exports found */
  9484. /***/ (function(module, exports, __webpack_require__) {
  9485. "use strict";
  9486. Object.defineProperty(exports, "__esModule", {
  9487. value: true
  9488. });
  9489. exports.TOKEN_NAME = exports.OPENID = void 0;
  9490. // 记录微信本地缓存key
  9491. var TOKEN_NAME = 'Authorization';
  9492. exports.TOKEN_NAME = TOKEN_NAME;
  9493. var OPENID = 'openid';
  9494. exports.OPENID = OPENID;
  9495. /***/ }),
  9496. /***/ 410:
  9497. /*!*****************************************************************!*\
  9498. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  9499. \*****************************************************************/
  9500. /*! no static exports found */
  9501. /***/ (function(module, exports) {
  9502. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  9503. try {
  9504. var info = gen[key](arg);
  9505. var value = info.value;
  9506. } catch (error) {
  9507. reject(error);
  9508. return;
  9509. }
  9510. if (info.done) {
  9511. resolve(value);
  9512. } else {
  9513. Promise.resolve(value).then(_next, _throw);
  9514. }
  9515. }
  9516. function _asyncToGenerator(fn) {
  9517. return function () {
  9518. var self = this,
  9519. args = arguments;
  9520. return new Promise(function (resolve, reject) {
  9521. var gen = fn.apply(self, args);
  9522. function _next(value) {
  9523. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  9524. }
  9525. function _throw(err) {
  9526. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  9527. }
  9528. _next(undefined);
  9529. });
  9530. };
  9531. }
  9532. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9533. /***/ }),
  9534. /***/ 411:
  9535. /*!*****************************************************************************************!*\
  9536. !*** D:/hongxing/storage-wechat/uni_modules/uni-forms/components/uni-forms/validate.js ***!
  9537. \*****************************************************************************************/
  9538. /*! no static exports found */
  9539. /***/ (function(module, exports, __webpack_require__) {
  9540. "use strict";
  9541. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 3);
  9542. Object.defineProperty(exports, "__esModule", {
  9543. value: true
  9544. });
  9545. exports.default = void 0;
  9546. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 408));
  9547. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 412));
  9548. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 413));
  9549. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 415));
  9550. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 410));
  9551. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 22));
  9552. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 23));
  9553. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 12));
  9554. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
  9555. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  9556. var pattern = {
  9557. email: /^\S+?@\S+?\.\S+?$/,
  9558. idcard: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
  9559. url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", 'i')
  9560. };
  9561. var FORMAT_MAPPING = {
  9562. "int": 'integer',
  9563. "bool": 'boolean',
  9564. "double": 'number',
  9565. "long": 'number',
  9566. "password": 'string'
  9567. // "fileurls": 'array'
  9568. };
  9569. function formatMessage(args) {
  9570. var resources = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  9571. var defaultMessage = ['label'];
  9572. defaultMessage.forEach(function (item) {
  9573. if (args[item] === undefined) {
  9574. args[item] = '';
  9575. }
  9576. });
  9577. var str = resources;
  9578. for (var key in args) {
  9579. var reg = new RegExp('{' + key + '}');
  9580. str = str.replace(reg, args[key]);
  9581. }
  9582. return str;
  9583. }
  9584. function isEmptyValue(value, type) {
  9585. if (value === undefined || value === null) {
  9586. return true;
  9587. }
  9588. if (typeof value === 'string' && !value) {
  9589. return true;
  9590. }
  9591. if (Array.isArray(value) && !value.length) {
  9592. return true;
  9593. }
  9594. if (type === 'object' && !Object.keys(value).length) {
  9595. return true;
  9596. }
  9597. return false;
  9598. }
  9599. var types = {
  9600. integer: function integer(value) {
  9601. return types.number(value) && parseInt(value, 10) === value;
  9602. },
  9603. string: function string(value) {
  9604. return typeof value === 'string';
  9605. },
  9606. number: function number(value) {
  9607. if (isNaN(value)) {
  9608. return false;
  9609. }
  9610. return typeof value === 'number';
  9611. },
  9612. "boolean": function boolean(value) {
  9613. return typeof value === 'boolean';
  9614. },
  9615. "float": function float(value) {
  9616. return types.number(value) && !types.integer(value);
  9617. },
  9618. array: function array(value) {
  9619. return Array.isArray(value);
  9620. },
  9621. object: function object(value) {
  9622. return (0, _typeof2.default)(value) === 'object' && !types.array(value);
  9623. },
  9624. date: function date(value) {
  9625. return value instanceof Date;
  9626. },
  9627. timestamp: function timestamp(value) {
  9628. if (!this.integer(value) || Math.abs(value).toString().length > 16) {
  9629. return false;
  9630. }
  9631. return true;
  9632. },
  9633. file: function file(value) {
  9634. return typeof value.url === 'string';
  9635. },
  9636. email: function email(value) {
  9637. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  9638. },
  9639. url: function url(value) {
  9640. return typeof value === 'string' && !!value.match(pattern.url);
  9641. },
  9642. pattern: function pattern(reg, value) {
  9643. try {
  9644. return new RegExp(reg).test(value);
  9645. } catch (e) {
  9646. return false;
  9647. }
  9648. },
  9649. method: function method(value) {
  9650. return typeof value === 'function';
  9651. },
  9652. idcard: function idcard(value) {
  9653. return typeof value === 'string' && !!value.match(pattern.idcard);
  9654. },
  9655. 'url-https': function urlHttps(value) {
  9656. return this.url(value) && value.startsWith('https://');
  9657. },
  9658. 'url-scheme': function urlScheme(value) {
  9659. return value.startsWith('://');
  9660. },
  9661. 'url-web': function urlWeb(value) {
  9662. return false;
  9663. }
  9664. };
  9665. var RuleValidator = /*#__PURE__*/function () {
  9666. function RuleValidator(message) {
  9667. (0, _classCallCheck2.default)(this, RuleValidator);
  9668. this._message = message;
  9669. }
  9670. (0, _createClass2.default)(RuleValidator, [{
  9671. key: "validateRule",
  9672. value: function () {
  9673. var _validateRule = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(fieldKey, fieldValue, value, data, allData) {
  9674. var result, rules, hasRequired, message, i, rule, vt, now, resultExpr;
  9675. return _regenerator.default.wrap(function _callee$(_context) {
  9676. while (1) {
  9677. switch (_context.prev = _context.next) {
  9678. case 0:
  9679. result = null;
  9680. rules = fieldValue.rules;
  9681. hasRequired = rules.findIndex(function (item) {
  9682. return item.required;
  9683. });
  9684. if (!(hasRequired < 0)) {
  9685. _context.next = 8;
  9686. break;
  9687. }
  9688. if (!(value === null || value === undefined)) {
  9689. _context.next = 6;
  9690. break;
  9691. }
  9692. return _context.abrupt("return", result);
  9693. case 6:
  9694. if (!(typeof value === 'string' && !value.length)) {
  9695. _context.next = 8;
  9696. break;
  9697. }
  9698. return _context.abrupt("return", result);
  9699. case 8:
  9700. message = this._message;
  9701. if (!(rules === undefined)) {
  9702. _context.next = 11;
  9703. break;
  9704. }
  9705. return _context.abrupt("return", message['default']);
  9706. case 11:
  9707. i = 0;
  9708. case 12:
  9709. if (!(i < rules.length)) {
  9710. _context.next = 35;
  9711. break;
  9712. }
  9713. rule = rules[i];
  9714. vt = this._getValidateType(rule);
  9715. Object.assign(rule, {
  9716. label: fieldValue.label || "[\"".concat(fieldKey, "\"]")
  9717. });
  9718. if (!RuleValidatorHelper[vt]) {
  9719. _context.next = 20;
  9720. break;
  9721. }
  9722. result = RuleValidatorHelper[vt](rule, value, message);
  9723. if (!(result != null)) {
  9724. _context.next = 20;
  9725. break;
  9726. }
  9727. return _context.abrupt("break", 35);
  9728. case 20:
  9729. if (!rule.validateExpr) {
  9730. _context.next = 26;
  9731. break;
  9732. }
  9733. now = Date.now();
  9734. resultExpr = rule.validateExpr(value, allData, now);
  9735. if (!(resultExpr === false)) {
  9736. _context.next = 26;
  9737. break;
  9738. }
  9739. result = this._getMessage(rule, rule.errorMessage || this._message['default']);
  9740. return _context.abrupt("break", 35);
  9741. case 26:
  9742. if (!rule.validateFunction) {
  9743. _context.next = 32;
  9744. break;
  9745. }
  9746. _context.next = 29;
  9747. return this.validateFunction(rule, value, data, allData, vt);
  9748. case 29:
  9749. result = _context.sent;
  9750. if (!(result !== null)) {
  9751. _context.next = 32;
  9752. break;
  9753. }
  9754. return _context.abrupt("break", 35);
  9755. case 32:
  9756. i++;
  9757. _context.next = 12;
  9758. break;
  9759. case 35:
  9760. if (result !== null) {
  9761. result = message.TAG + result;
  9762. }
  9763. return _context.abrupt("return", result);
  9764. case 37:
  9765. case "end":
  9766. return _context.stop();
  9767. }
  9768. }
  9769. }, _callee, this);
  9770. }));
  9771. function validateRule(_x, _x2, _x3, _x4, _x5) {
  9772. return _validateRule.apply(this, arguments);
  9773. }
  9774. return validateRule;
  9775. }()
  9776. }, {
  9777. key: "validateFunction",
  9778. value: function () {
  9779. var _validateFunction = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(rule, value, data, allData, vt) {
  9780. var result, callbackMessage, res;
  9781. return _regenerator.default.wrap(function _callee2$(_context2) {
  9782. while (1) {
  9783. switch (_context2.prev = _context2.next) {
  9784. case 0:
  9785. result = null;
  9786. _context2.prev = 1;
  9787. callbackMessage = null;
  9788. _context2.next = 5;
  9789. return rule.validateFunction(rule, value, allData || data, function (message) {
  9790. callbackMessage = message;
  9791. });
  9792. case 5:
  9793. res = _context2.sent;
  9794. if (callbackMessage || typeof res === 'string' && res || res === false) {
  9795. result = this._getMessage(rule, callbackMessage || res, vt);
  9796. }
  9797. _context2.next = 12;
  9798. break;
  9799. case 9:
  9800. _context2.prev = 9;
  9801. _context2.t0 = _context2["catch"](1);
  9802. result = this._getMessage(rule, _context2.t0.message, vt);
  9803. case 12:
  9804. return _context2.abrupt("return", result);
  9805. case 13:
  9806. case "end":
  9807. return _context2.stop();
  9808. }
  9809. }
  9810. }, _callee2, this, [[1, 9]]);
  9811. }));
  9812. function validateFunction(_x6, _x7, _x8, _x9, _x10) {
  9813. return _validateFunction.apply(this, arguments);
  9814. }
  9815. return validateFunction;
  9816. }()
  9817. }, {
  9818. key: "_getMessage",
  9819. value: function _getMessage(rule, message, vt) {
  9820. return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default']);
  9821. }
  9822. }, {
  9823. key: "_getValidateType",
  9824. value: function _getValidateType(rule) {
  9825. var result = '';
  9826. if (rule.required) {
  9827. result = 'required';
  9828. } else if (rule.format) {
  9829. result = 'format';
  9830. } else if (rule.arrayType) {
  9831. result = 'arrayTypeFormat';
  9832. } else if (rule.range) {
  9833. result = 'range';
  9834. } else if (rule.maximum !== undefined || rule.minimum !== undefined) {
  9835. result = 'rangeNumber';
  9836. } else if (rule.maxLength !== undefined || rule.minLength !== undefined) {
  9837. result = 'rangeLength';
  9838. } else if (rule.pattern) {
  9839. result = 'pattern';
  9840. } else if (rule.validateFunction) {
  9841. result = 'validateFunction';
  9842. }
  9843. return result;
  9844. }
  9845. }]);
  9846. return RuleValidator;
  9847. }();
  9848. var RuleValidatorHelper = {
  9849. required: function required(rule, value, message) {
  9850. if (rule.required && isEmptyValue(value, rule.format || (0, _typeof2.default)(value))) {
  9851. return formatMessage(rule, rule.errorMessage || message.required);
  9852. }
  9853. return null;
  9854. },
  9855. range: function range(rule, value, message) {
  9856. var range = rule.range,
  9857. errorMessage = rule.errorMessage;
  9858. var list = new Array(range.length);
  9859. for (var i = 0; i < range.length; i++) {
  9860. var item = range[i];
  9861. if (types.object(item) && item.value !== undefined) {
  9862. list[i] = item.value;
  9863. } else {
  9864. list[i] = item;
  9865. }
  9866. }
  9867. var result = false;
  9868. if (Array.isArray(value)) {
  9869. result = new Set(value.concat(list)).size === list.length;
  9870. } else {
  9871. if (list.indexOf(value) > -1) {
  9872. result = true;
  9873. }
  9874. }
  9875. if (!result) {
  9876. return formatMessage(rule, errorMessage || message['enum']);
  9877. }
  9878. return null;
  9879. },
  9880. rangeNumber: function rangeNumber(rule, value, message) {
  9881. if (!types.number(value)) {
  9882. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  9883. }
  9884. var minimum = rule.minimum,
  9885. maximum = rule.maximum,
  9886. exclusiveMinimum = rule.exclusiveMinimum,
  9887. exclusiveMaximum = rule.exclusiveMaximum;
  9888. var min = exclusiveMinimum ? value <= minimum : value < minimum;
  9889. var max = exclusiveMaximum ? value >= maximum : value > maximum;
  9890. if (minimum !== undefined && min) {
  9891. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMinimum ? 'exclusiveMinimum' : 'minimum']);
  9892. } else if (maximum !== undefined && max) {
  9893. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMaximum ? 'exclusiveMaximum' : 'maximum']);
  9894. } else if (minimum !== undefined && maximum !== undefined && (min || max)) {
  9895. return formatMessage(rule, rule.errorMessage || message['number'].range);
  9896. }
  9897. return null;
  9898. },
  9899. rangeLength: function rangeLength(rule, value, message) {
  9900. if (!types.string(value) && !types.array(value)) {
  9901. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  9902. }
  9903. var min = rule.minLength;
  9904. var max = rule.maxLength;
  9905. var val = value.length;
  9906. if (min !== undefined && val < min) {
  9907. return formatMessage(rule, rule.errorMessage || message['length'].minLength);
  9908. } else if (max !== undefined && val > max) {
  9909. return formatMessage(rule, rule.errorMessage || message['length'].maxLength);
  9910. } else if (min !== undefined && max !== undefined && (val < min || val > max)) {
  9911. return formatMessage(rule, rule.errorMessage || message['length'].range);
  9912. }
  9913. return null;
  9914. },
  9915. pattern: function pattern(rule, value, message) {
  9916. if (!types['pattern'](rule.pattern, value)) {
  9917. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  9918. }
  9919. return null;
  9920. },
  9921. format: function format(rule, value, message) {
  9922. var customTypes = Object.keys(types);
  9923. var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format || rule.arrayType;
  9924. if (customTypes.indexOf(format) > -1) {
  9925. if (!types[format](value)) {
  9926. return formatMessage(rule, rule.errorMessage || message.typeError);
  9927. }
  9928. }
  9929. return null;
  9930. },
  9931. arrayTypeFormat: function arrayTypeFormat(rule, value, message) {
  9932. if (!Array.isArray(value)) {
  9933. return formatMessage(rule, rule.errorMessage || message.typeError);
  9934. }
  9935. for (var i = 0; i < value.length; i++) {
  9936. var element = value[i];
  9937. var formatResult = this.format(rule, element, message);
  9938. if (formatResult !== null) {
  9939. return formatResult;
  9940. }
  9941. }
  9942. return null;
  9943. }
  9944. };
  9945. var SchemaValidator = /*#__PURE__*/function (_RuleValidator) {
  9946. (0, _inherits2.default)(SchemaValidator, _RuleValidator);
  9947. var _super = _createSuper(SchemaValidator);
  9948. function SchemaValidator(schema, options) {
  9949. var _this;
  9950. (0, _classCallCheck2.default)(this, SchemaValidator);
  9951. _this = _super.call(this, SchemaValidator.message);
  9952. _this._schema = schema;
  9953. _this._options = options || null;
  9954. return _this;
  9955. }
  9956. (0, _createClass2.default)(SchemaValidator, [{
  9957. key: "updateSchema",
  9958. value: function updateSchema(schema) {
  9959. this._schema = schema;
  9960. }
  9961. }, {
  9962. key: "validate",
  9963. value: function () {
  9964. var _validate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(data, allData) {
  9965. var result;
  9966. return _regenerator.default.wrap(function _callee3$(_context3) {
  9967. while (1) {
  9968. switch (_context3.prev = _context3.next) {
  9969. case 0:
  9970. result = this._checkFieldInSchema(data);
  9971. if (result) {
  9972. _context3.next = 5;
  9973. break;
  9974. }
  9975. _context3.next = 4;
  9976. return this.invokeValidate(data, false, allData);
  9977. case 4:
  9978. result = _context3.sent;
  9979. case 5:
  9980. return _context3.abrupt("return", result.length ? result[0] : null);
  9981. case 6:
  9982. case "end":
  9983. return _context3.stop();
  9984. }
  9985. }
  9986. }, _callee3, this);
  9987. }));
  9988. function validate(_x11, _x12) {
  9989. return _validate.apply(this, arguments);
  9990. }
  9991. return validate;
  9992. }()
  9993. }, {
  9994. key: "validateAll",
  9995. value: function () {
  9996. var _validateAll = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(data, allData) {
  9997. var result;
  9998. return _regenerator.default.wrap(function _callee4$(_context4) {
  9999. while (1) {
  10000. switch (_context4.prev = _context4.next) {
  10001. case 0:
  10002. result = this._checkFieldInSchema(data);
  10003. if (result) {
  10004. _context4.next = 5;
  10005. break;
  10006. }
  10007. _context4.next = 4;
  10008. return this.invokeValidate(data, true, allData);
  10009. case 4:
  10010. result = _context4.sent;
  10011. case 5:
  10012. return _context4.abrupt("return", result);
  10013. case 6:
  10014. case "end":
  10015. return _context4.stop();
  10016. }
  10017. }
  10018. }, _callee4, this);
  10019. }));
  10020. function validateAll(_x13, _x14) {
  10021. return _validateAll.apply(this, arguments);
  10022. }
  10023. return validateAll;
  10024. }()
  10025. }, {
  10026. key: "validateUpdate",
  10027. value: function () {
  10028. var _validateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(data, allData) {
  10029. var result;
  10030. return _regenerator.default.wrap(function _callee5$(_context5) {
  10031. while (1) {
  10032. switch (_context5.prev = _context5.next) {
  10033. case 0:
  10034. result = this._checkFieldInSchema(data);
  10035. if (result) {
  10036. _context5.next = 5;
  10037. break;
  10038. }
  10039. _context5.next = 4;
  10040. return this.invokeValidateUpdate(data, false, allData);
  10041. case 4:
  10042. result = _context5.sent;
  10043. case 5:
  10044. return _context5.abrupt("return", result.length ? result[0] : null);
  10045. case 6:
  10046. case "end":
  10047. return _context5.stop();
  10048. }
  10049. }
  10050. }, _callee5, this);
  10051. }));
  10052. function validateUpdate(_x15, _x16) {
  10053. return _validateUpdate.apply(this, arguments);
  10054. }
  10055. return validateUpdate;
  10056. }()
  10057. }, {
  10058. key: "invokeValidate",
  10059. value: function () {
  10060. var _invokeValidate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(data, all, allData) {
  10061. var result, schema, key, value, errorMessage;
  10062. return _regenerator.default.wrap(function _callee6$(_context6) {
  10063. while (1) {
  10064. switch (_context6.prev = _context6.next) {
  10065. case 0:
  10066. result = [];
  10067. schema = this._schema;
  10068. _context6.t0 = _regenerator.default.keys(schema);
  10069. case 3:
  10070. if ((_context6.t1 = _context6.t0()).done) {
  10071. _context6.next = 15;
  10072. break;
  10073. }
  10074. key = _context6.t1.value;
  10075. value = schema[key];
  10076. _context6.next = 8;
  10077. return this.validateRule(key, value, data[key], data, allData);
  10078. case 8:
  10079. errorMessage = _context6.sent;
  10080. if (!(errorMessage != null)) {
  10081. _context6.next = 13;
  10082. break;
  10083. }
  10084. result.push({
  10085. key: key,
  10086. errorMessage: errorMessage
  10087. });
  10088. if (all) {
  10089. _context6.next = 13;
  10090. break;
  10091. }
  10092. return _context6.abrupt("break", 15);
  10093. case 13:
  10094. _context6.next = 3;
  10095. break;
  10096. case 15:
  10097. return _context6.abrupt("return", result);
  10098. case 16:
  10099. case "end":
  10100. return _context6.stop();
  10101. }
  10102. }
  10103. }, _callee6, this);
  10104. }));
  10105. function invokeValidate(_x17, _x18, _x19) {
  10106. return _invokeValidate.apply(this, arguments);
  10107. }
  10108. return invokeValidate;
  10109. }()
  10110. }, {
  10111. key: "invokeValidateUpdate",
  10112. value: function () {
  10113. var _invokeValidateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(data, all, allData) {
  10114. var result, key, errorMessage;
  10115. return _regenerator.default.wrap(function _callee7$(_context7) {
  10116. while (1) {
  10117. switch (_context7.prev = _context7.next) {
  10118. case 0:
  10119. result = [];
  10120. _context7.t0 = _regenerator.default.keys(data);
  10121. case 2:
  10122. if ((_context7.t1 = _context7.t0()).done) {
  10123. _context7.next = 13;
  10124. break;
  10125. }
  10126. key = _context7.t1.value;
  10127. _context7.next = 6;
  10128. return this.validateRule(key, this._schema[key], data[key], data, allData);
  10129. case 6:
  10130. errorMessage = _context7.sent;
  10131. if (!(errorMessage != null)) {
  10132. _context7.next = 11;
  10133. break;
  10134. }
  10135. result.push({
  10136. key: key,
  10137. errorMessage: errorMessage
  10138. });
  10139. if (all) {
  10140. _context7.next = 11;
  10141. break;
  10142. }
  10143. return _context7.abrupt("break", 13);
  10144. case 11:
  10145. _context7.next = 2;
  10146. break;
  10147. case 13:
  10148. return _context7.abrupt("return", result);
  10149. case 14:
  10150. case "end":
  10151. return _context7.stop();
  10152. }
  10153. }
  10154. }, _callee7, this);
  10155. }));
  10156. function invokeValidateUpdate(_x20, _x21, _x22) {
  10157. return _invokeValidateUpdate.apply(this, arguments);
  10158. }
  10159. return invokeValidateUpdate;
  10160. }()
  10161. }, {
  10162. key: "_checkFieldInSchema",
  10163. value: function _checkFieldInSchema(data) {
  10164. var keys = Object.keys(data);
  10165. var keys2 = Object.keys(this._schema);
  10166. if (new Set(keys.concat(keys2)).size === keys2.length) {
  10167. return '';
  10168. }
  10169. var noExistFields = keys.filter(function (key) {
  10170. return keys2.indexOf(key) < 0;
  10171. });
  10172. var errorMessage = formatMessage({
  10173. field: JSON.stringify(noExistFields)
  10174. }, SchemaValidator.message.TAG + SchemaValidator.message['defaultInvalid']);
  10175. return [{
  10176. key: 'invalid',
  10177. errorMessage: errorMessage
  10178. }];
  10179. }
  10180. }]);
  10181. return SchemaValidator;
  10182. }(RuleValidator);
  10183. function Message() {
  10184. return {
  10185. TAG: "",
  10186. default: '验证错误',
  10187. defaultInvalid: '提交的字段{field}在数据库中并不存在',
  10188. validateFunction: '验证无效',
  10189. required: '{label}必填',
  10190. 'enum': '{label}超出范围',
  10191. timestamp: '{label}格式无效',
  10192. whitespace: '{label}不能为空',
  10193. typeError: '{label}类型无效',
  10194. date: {
  10195. format: '{label}日期{value}格式无效',
  10196. parse: '{label}日期无法解析,{value}无效',
  10197. invalid: '{label}日期{value}无效'
  10198. },
  10199. length: {
  10200. minLength: '{label}长度不能少于{minLength}',
  10201. maxLength: '{label}长度不能超过{maxLength}',
  10202. range: '{label}必须介于{minLength}和{maxLength}之间'
  10203. },
  10204. number: {
  10205. minimum: '{label}不能小于{minimum}',
  10206. maximum: '{label}不能大于{maximum}',
  10207. exclusiveMinimum: '{label}不能小于等于{minimum}',
  10208. exclusiveMaximum: '{label}不能大于等于{maximum}',
  10209. range: '{label}必须介于{minimum}and{maximum}之间'
  10210. },
  10211. pattern: {
  10212. mismatch: '{label}格式不匹配'
  10213. }
  10214. };
  10215. }
  10216. SchemaValidator.message = new Message();
  10217. var _default = SchemaValidator;
  10218. exports.default = _default;
  10219. /***/ }),
  10220. /***/ 412:
  10221. /*!*********************************************************!*\
  10222. !*** ./node_modules/@babel/runtime/helpers/inherits.js ***!
  10223. \*********************************************************/
  10224. /*! no static exports found */
  10225. /***/ (function(module, exports, __webpack_require__) {
  10226. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 15);
  10227. function _inherits(subClass, superClass) {
  10228. if (typeof superClass !== "function" && superClass !== null) {
  10229. throw new TypeError("Super expression must either be null or a function");
  10230. }
  10231. subClass.prototype = Object.create(superClass && superClass.prototype, {
  10232. constructor: {
  10233. value: subClass,
  10234. writable: true,
  10235. configurable: true
  10236. }
  10237. });
  10238. Object.defineProperty(subClass, "prototype", {
  10239. writable: false
  10240. });
  10241. if (superClass) setPrototypeOf(subClass, superClass);
  10242. }
  10243. module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
  10244. /***/ }),
  10245. /***/ 413:
  10246. /*!**************************************************************************!*\
  10247. !*** ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
  10248. \**************************************************************************/
  10249. /*! no static exports found */
  10250. /***/ (function(module, exports, __webpack_require__) {
  10251. var _typeof = __webpack_require__(/*! ./typeof.js */ 12)["default"];
  10252. var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ 414);
  10253. function _possibleConstructorReturn(self, call) {
  10254. if (call && (_typeof(call) === "object" || typeof call === "function")) {
  10255. return call;
  10256. } else if (call !== void 0) {
  10257. throw new TypeError("Derived constructors may only return object or undefined");
  10258. }
  10259. return assertThisInitialized(self);
  10260. }
  10261. module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
  10262. /***/ }),
  10263. /***/ 414:
  10264. /*!**********************************************************************!*\
  10265. !*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
  10266. \**********************************************************************/
  10267. /*! no static exports found */
  10268. /***/ (function(module, exports) {
  10269. function _assertThisInitialized(self) {
  10270. if (self === void 0) {
  10271. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  10272. }
  10273. return self;
  10274. }
  10275. module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
  10276. /***/ }),
  10277. /***/ 415:
  10278. /*!***************************************************************!*\
  10279. !*** ./node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
  10280. \***************************************************************/
  10281. /*! no static exports found */
  10282. /***/ (function(module, exports) {
  10283. function _getPrototypeOf(o) {
  10284. module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
  10285. return o.__proto__ || Object.getPrototypeOf(o);
  10286. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  10287. return _getPrototypeOf(o);
  10288. }
  10289. module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  10290. /***/ }),
  10291. /***/ 42:
  10292. /*!**********************************************!*\
  10293. !*** D:/hongxing/storage-wechat/util/api.js ***!
  10294. \**********************************************/
  10295. /*! no static exports found */
  10296. /***/ (function(module, exports, __webpack_require__) {
  10297. "use strict";
  10298. Object.defineProperty(exports, "__esModule", {
  10299. value: true
  10300. });
  10301. exports.addBatch = addBatch;
  10302. exports.getInfo = getInfo;
  10303. exports.getMaterialGroupList = getMaterialGroupList;
  10304. exports.getPurchaseByMaterialIdList = getPurchaseByMaterialIdList;
  10305. exports.isBind = isBind;
  10306. exports.usernameLogin = usernameLogin;
  10307. var _request = __webpack_require__(/*! ./request.js */ 43);
  10308. // 后端接口集合
  10309. // 查看微信用户是否绑定管理系统
  10310. function isBind(data) {
  10311. return (0, _request.request)("/wx/login/isBind", data);
  10312. }
  10313. // 获取用户基本信息(菜单访问权限,用户id,用户名,角色权限字符)
  10314. function getInfo(data) {
  10315. return (0, _request.request)("/wx/login/getUserInfo", data);
  10316. }
  10317. // 用户名、密码、openid登录
  10318. function usernameLogin(data) {
  10319. return (0, _request.request)("/wx/login/usernameLogin", data);
  10320. }
  10321. // 生成二维码列表
  10322. function getMaterialGroupList(data) {
  10323. return (0, _request.request)("/wx/createQrcode/getMaterialGroupList", data);
  10324. }
  10325. // 选择入库单页面列表
  10326. function getPurchaseByMaterialIdList(data) {
  10327. return (0, _request.request)("/wx/createQrcode/getPurchaseByMaterialIdList", data);
  10328. }
  10329. // 添加二维码
  10330. function addBatch(data) {
  10331. return (0, _request.request)("/wx/createQrcode/addBatch", data);
  10332. }
  10333. /***/ }),
  10334. /***/ 43:
  10335. /*!**************************************************!*\
  10336. !*** D:/hongxing/storage-wechat/util/request.js ***!
  10337. \**************************************************/
  10338. /*! no static exports found */
  10339. /***/ (function(module, exports, __webpack_require__) {
  10340. "use strict";
  10341. /* WEBPACK VAR INJECTION */(function(uni) {
  10342. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 3);
  10343. Object.defineProperty(exports, "__esModule", {
  10344. value: true
  10345. });
  10346. exports.request = request;
  10347. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 24));
  10348. var _cacheConstant = __webpack_require__(/*! ./cacheConstant */ 41);
  10349. // 请求后端服务器工具类
  10350. var baseURL = "http://114.115.167.11:8081/api";
  10351. function request(url, data, method) {
  10352. console.log(url, data, method);
  10353. // 赋值token
  10354. var token = _vue.default.prototype.$token;
  10355. console.log();
  10356. console.log(!token);
  10357. if (token) {
  10358. var hander = {
  10359. 'Authorization': _vue.default.prototype.$token
  10360. };
  10361. } else {
  10362. var hander = {};
  10363. }
  10364. // 默认执行get方法
  10365. method = method === undefined ? 'post' : method;
  10366. wx.showNavigationBarLoading();
  10367. return new Promise(function (resove, reject) {
  10368. uni.request({
  10369. url: baseURL + url,
  10370. method: method,
  10371. data: data,
  10372. header: hander,
  10373. success: function success(res) {
  10374. var data = res.data;
  10375. // 对错误进行拦截提示
  10376. if (data.code != 200) {
  10377. uni.showToast({
  10378. title: data.msg,
  10379. icon: 'none',
  10380. duration: 2000
  10381. });
  10382. reject();
  10383. }
  10384. resove(data.data);
  10385. },
  10386. fail: function fail(msg) {
  10387. console.log('请求失败=======', msg);
  10388. uni.showToast({
  10389. title: "网络异常,连接服务器失败",
  10390. icon: 'none',
  10391. duration: 2000
  10392. });
  10393. reject();
  10394. },
  10395. complete: function complete() {
  10396. uni.hideNavigationBarLoading();
  10397. }
  10398. });
  10399. });
  10400. }
  10401. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10402. /***/ }),
  10403. /***/ 451:
  10404. /*!*****************************************************************************************************!*\
  10405. !*** D:/hongxing/storage-wechat/uni_modules/uni-search-bar/components/uni-search-bar/i18n/index.js ***!
  10406. \*****************************************************************************************************/
  10407. /*! no static exports found */
  10408. /***/ (function(module, exports, __webpack_require__) {
  10409. "use strict";
  10410. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 3);
  10411. Object.defineProperty(exports, "__esModule", {
  10412. value: true
  10413. });
  10414. exports.default = void 0;
  10415. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 452));
  10416. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 453));
  10417. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 454));
  10418. var _default = {
  10419. en: _en.default,
  10420. 'zh-Hans': _zhHans.default,
  10421. 'zh-Hant': _zhHant.default
  10422. };
  10423. exports.default = _default;
  10424. /***/ }),
  10425. /***/ 452:
  10426. /*!****************************************************************************************************!*\
  10427. !*** D:/hongxing/storage-wechat/uni_modules/uni-search-bar/components/uni-search-bar/i18n/en.json ***!
  10428. \****************************************************************************************************/
  10429. /*! exports provided: uni-search-bar.cancel, uni-search-bar.placeholder, default */
  10430. /***/ (function(module) {
  10431. module.exports = JSON.parse("{\"uni-search-bar.cancel\":\"cancel\",\"uni-search-bar.placeholder\":\"Search enter content\"}");
  10432. /***/ }),
  10433. /***/ 453:
  10434. /*!*********************************************************************************************************!*\
  10435. !*** D:/hongxing/storage-wechat/uni_modules/uni-search-bar/components/uni-search-bar/i18n/zh-Hans.json ***!
  10436. \*********************************************************************************************************/
  10437. /*! exports provided: uni-search-bar.cancel, uni-search-bar.placeholder, default */
  10438. /***/ (function(module) {
  10439. module.exports = JSON.parse("{\"uni-search-bar.cancel\":\"cancel\",\"uni-search-bar.placeholder\":\"请输入搜索内容\"}");
  10440. /***/ }),
  10441. /***/ 454:
  10442. /*!*********************************************************************************************************!*\
  10443. !*** D:/hongxing/storage-wechat/uni_modules/uni-search-bar/components/uni-search-bar/i18n/zh-Hant.json ***!
  10444. \*********************************************************************************************************/
  10445. /*! exports provided: uni-search-bar.cancel, uni-search-bar.placeholder, default */
  10446. /***/ (function(module) {
  10447. module.exports = JSON.parse("{\"uni-search-bar.cancel\":\"cancel\",\"uni-search-bar.placeholder\":\"請輸入搜索內容\"}");
  10448. /***/ }),
  10449. /***/ 462:
  10450. /*!**************************************************************************************!*\
  10451. !*** D:/hongxing/storage-wechat/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  10452. \**************************************************************************************/
  10453. /*! no static exports found */
  10454. /***/ (function(module, exports, __webpack_require__) {
  10455. "use strict";
  10456. Object.defineProperty(exports, "__esModule", {
  10457. value: true
  10458. });
  10459. exports.default = void 0;
  10460. var _default = {
  10461. "id": "2852637",
  10462. "name": "uniui图标库",
  10463. "font_family": "uniicons",
  10464. "css_prefix_text": "uniui-",
  10465. "description": "",
  10466. "glyphs": [{
  10467. "icon_id": "25027049",
  10468. "name": "yanse",
  10469. "font_class": "color",
  10470. "unicode": "e6cf",
  10471. "unicode_decimal": 59087
  10472. }, {
  10473. "icon_id": "25027048",
  10474. "name": "wallet",
  10475. "font_class": "wallet",
  10476. "unicode": "e6b1",
  10477. "unicode_decimal": 59057
  10478. }, {
  10479. "icon_id": "25015720",
  10480. "name": "settings-filled",
  10481. "font_class": "settings-filled",
  10482. "unicode": "e6ce",
  10483. "unicode_decimal": 59086
  10484. }, {
  10485. "icon_id": "25015434",
  10486. "name": "shimingrenzheng-filled",
  10487. "font_class": "auth-filled",
  10488. "unicode": "e6cc",
  10489. "unicode_decimal": 59084
  10490. }, {
  10491. "icon_id": "24934246",
  10492. "name": "shop-filled",
  10493. "font_class": "shop-filled",
  10494. "unicode": "e6cd",
  10495. "unicode_decimal": 59085
  10496. }, {
  10497. "icon_id": "24934159",
  10498. "name": "staff-filled-01",
  10499. "font_class": "staff-filled",
  10500. "unicode": "e6cb",
  10501. "unicode_decimal": 59083
  10502. }, {
  10503. "icon_id": "24932461",
  10504. "name": "VIP-filled",
  10505. "font_class": "vip-filled",
  10506. "unicode": "e6c6",
  10507. "unicode_decimal": 59078
  10508. }, {
  10509. "icon_id": "24932462",
  10510. "name": "plus_circle_fill",
  10511. "font_class": "plus-filled",
  10512. "unicode": "e6c7",
  10513. "unicode_decimal": 59079
  10514. }, {
  10515. "icon_id": "24932463",
  10516. "name": "folder_add-filled",
  10517. "font_class": "folder-add-filled",
  10518. "unicode": "e6c8",
  10519. "unicode_decimal": 59080
  10520. }, {
  10521. "icon_id": "24932464",
  10522. "name": "yanse-filled",
  10523. "font_class": "color-filled",
  10524. "unicode": "e6c9",
  10525. "unicode_decimal": 59081
  10526. }, {
  10527. "icon_id": "24932465",
  10528. "name": "tune-filled",
  10529. "font_class": "tune-filled",
  10530. "unicode": "e6ca",
  10531. "unicode_decimal": 59082
  10532. }, {
  10533. "icon_id": "24932455",
  10534. "name": "a-rilidaka-filled",
  10535. "font_class": "calendar-filled",
  10536. "unicode": "e6c0",
  10537. "unicode_decimal": 59072
  10538. }, {
  10539. "icon_id": "24932456",
  10540. "name": "notification-filled",
  10541. "font_class": "notification-filled",
  10542. "unicode": "e6c1",
  10543. "unicode_decimal": 59073
  10544. }, {
  10545. "icon_id": "24932457",
  10546. "name": "wallet-filled",
  10547. "font_class": "wallet-filled",
  10548. "unicode": "e6c2",
  10549. "unicode_decimal": 59074
  10550. }, {
  10551. "icon_id": "24932458",
  10552. "name": "paihangbang-filled",
  10553. "font_class": "medal-filled",
  10554. "unicode": "e6c3",
  10555. "unicode_decimal": 59075
  10556. }, {
  10557. "icon_id": "24932459",
  10558. "name": "gift-filled",
  10559. "font_class": "gift-filled",
  10560. "unicode": "e6c4",
  10561. "unicode_decimal": 59076
  10562. }, {
  10563. "icon_id": "24932460",
  10564. "name": "fire-filled",
  10565. "font_class": "fire-filled",
  10566. "unicode": "e6c5",
  10567. "unicode_decimal": 59077
  10568. }, {
  10569. "icon_id": "24928001",
  10570. "name": "refreshempty",
  10571. "font_class": "refreshempty",
  10572. "unicode": "e6bf",
  10573. "unicode_decimal": 59071
  10574. }, {
  10575. "icon_id": "24926853",
  10576. "name": "location-ellipse",
  10577. "font_class": "location-filled",
  10578. "unicode": "e6af",
  10579. "unicode_decimal": 59055
  10580. }, {
  10581. "icon_id": "24926735",
  10582. "name": "person-filled",
  10583. "font_class": "person-filled",
  10584. "unicode": "e69d",
  10585. "unicode_decimal": 59037
  10586. }, {
  10587. "icon_id": "24926703",
  10588. "name": "personadd-filled",
  10589. "font_class": "personadd-filled",
  10590. "unicode": "e698",
  10591. "unicode_decimal": 59032
  10592. }, {
  10593. "icon_id": "24923351",
  10594. "name": "back",
  10595. "font_class": "back",
  10596. "unicode": "e6b9",
  10597. "unicode_decimal": 59065
  10598. }, {
  10599. "icon_id": "24923352",
  10600. "name": "forward",
  10601. "font_class": "forward",
  10602. "unicode": "e6ba",
  10603. "unicode_decimal": 59066
  10604. }, {
  10605. "icon_id": "24923353",
  10606. "name": "arrowthinright",
  10607. "font_class": "arrow-right",
  10608. "unicode": "e6bb",
  10609. "unicode_decimal": 59067
  10610. }, {
  10611. "icon_id": "24923353",
  10612. "name": "arrowthinright",
  10613. "font_class": "arrowthinright",
  10614. "unicode": "e6bb",
  10615. "unicode_decimal": 59067
  10616. }, {
  10617. "icon_id": "24923354",
  10618. "name": "arrowthinleft",
  10619. "font_class": "arrow-left",
  10620. "unicode": "e6bc",
  10621. "unicode_decimal": 59068
  10622. }, {
  10623. "icon_id": "24923354",
  10624. "name": "arrowthinleft",
  10625. "font_class": "arrowthinleft",
  10626. "unicode": "e6bc",
  10627. "unicode_decimal": 59068
  10628. }, {
  10629. "icon_id": "24923355",
  10630. "name": "arrowthinup",
  10631. "font_class": "arrow-up",
  10632. "unicode": "e6bd",
  10633. "unicode_decimal": 59069
  10634. }, {
  10635. "icon_id": "24923355",
  10636. "name": "arrowthinup",
  10637. "font_class": "arrowthinup",
  10638. "unicode": "e6bd",
  10639. "unicode_decimal": 59069
  10640. }, {
  10641. "icon_id": "24923356",
  10642. "name": "arrowthindown",
  10643. "font_class": "arrow-down",
  10644. "unicode": "e6be",
  10645. "unicode_decimal": 59070
  10646. }, {
  10647. "icon_id": "24923356",
  10648. "name": "arrowthindown",
  10649. "font_class": "arrowthindown",
  10650. "unicode": "e6be",
  10651. "unicode_decimal": 59070
  10652. }, {
  10653. "icon_id": "24923349",
  10654. "name": "arrowdown",
  10655. "font_class": "bottom",
  10656. "unicode": "e6b8",
  10657. "unicode_decimal": 59064
  10658. }, {
  10659. "icon_id": "24923349",
  10660. "name": "arrowdown",
  10661. "font_class": "arrowdown",
  10662. "unicode": "e6b8",
  10663. "unicode_decimal": 59064
  10664. }, {
  10665. "icon_id": "24923346",
  10666. "name": "arrowright",
  10667. "font_class": "right",
  10668. "unicode": "e6b5",
  10669. "unicode_decimal": 59061
  10670. }, {
  10671. "icon_id": "24923346",
  10672. "name": "arrowright",
  10673. "font_class": "arrowright",
  10674. "unicode": "e6b5",
  10675. "unicode_decimal": 59061
  10676. }, {
  10677. "icon_id": "24923347",
  10678. "name": "arrowup",
  10679. "font_class": "top",
  10680. "unicode": "e6b6",
  10681. "unicode_decimal": 59062
  10682. }, {
  10683. "icon_id": "24923347",
  10684. "name": "arrowup",
  10685. "font_class": "arrowup",
  10686. "unicode": "e6b6",
  10687. "unicode_decimal": 59062
  10688. }, {
  10689. "icon_id": "24923348",
  10690. "name": "arrowleft",
  10691. "font_class": "left",
  10692. "unicode": "e6b7",
  10693. "unicode_decimal": 59063
  10694. }, {
  10695. "icon_id": "24923348",
  10696. "name": "arrowleft",
  10697. "font_class": "arrowleft",
  10698. "unicode": "e6b7",
  10699. "unicode_decimal": 59063
  10700. }, {
  10701. "icon_id": "24923334",
  10702. "name": "eye",
  10703. "font_class": "eye",
  10704. "unicode": "e651",
  10705. "unicode_decimal": 58961
  10706. }, {
  10707. "icon_id": "24923335",
  10708. "name": "eye-filled",
  10709. "font_class": "eye-filled",
  10710. "unicode": "e66a",
  10711. "unicode_decimal": 58986
  10712. }, {
  10713. "icon_id": "24923336",
  10714. "name": "eye-slash",
  10715. "font_class": "eye-slash",
  10716. "unicode": "e6b3",
  10717. "unicode_decimal": 59059
  10718. }, {
  10719. "icon_id": "24923337",
  10720. "name": "eye-slash-filled",
  10721. "font_class": "eye-slash-filled",
  10722. "unicode": "e6b4",
  10723. "unicode_decimal": 59060
  10724. }, {
  10725. "icon_id": "24923305",
  10726. "name": "info-filled",
  10727. "font_class": "info-filled",
  10728. "unicode": "e649",
  10729. "unicode_decimal": 58953
  10730. }, {
  10731. "icon_id": "24923299",
  10732. "name": "reload-01",
  10733. "font_class": "reload",
  10734. "unicode": "e6b2",
  10735. "unicode_decimal": 59058
  10736. }, {
  10737. "icon_id": "24923195",
  10738. "name": "mic_slash_fill",
  10739. "font_class": "micoff-filled",
  10740. "unicode": "e6b0",
  10741. "unicode_decimal": 59056
  10742. }, {
  10743. "icon_id": "24923165",
  10744. "name": "map-pin-ellipse",
  10745. "font_class": "map-pin-ellipse",
  10746. "unicode": "e6ac",
  10747. "unicode_decimal": 59052
  10748. }, {
  10749. "icon_id": "24923166",
  10750. "name": "map-pin",
  10751. "font_class": "map-pin",
  10752. "unicode": "e6ad",
  10753. "unicode_decimal": 59053
  10754. }, {
  10755. "icon_id": "24923167",
  10756. "name": "location",
  10757. "font_class": "location",
  10758. "unicode": "e6ae",
  10759. "unicode_decimal": 59054
  10760. }, {
  10761. "icon_id": "24923064",
  10762. "name": "starhalf",
  10763. "font_class": "starhalf",
  10764. "unicode": "e683",
  10765. "unicode_decimal": 59011
  10766. }, {
  10767. "icon_id": "24923065",
  10768. "name": "star",
  10769. "font_class": "star",
  10770. "unicode": "e688",
  10771. "unicode_decimal": 59016
  10772. }, {
  10773. "icon_id": "24923066",
  10774. "name": "star-filled",
  10775. "font_class": "star-filled",
  10776. "unicode": "e68f",
  10777. "unicode_decimal": 59023
  10778. }, {
  10779. "icon_id": "24899646",
  10780. "name": "a-rilidaka",
  10781. "font_class": "calendar",
  10782. "unicode": "e6a0",
  10783. "unicode_decimal": 59040
  10784. }, {
  10785. "icon_id": "24899647",
  10786. "name": "fire",
  10787. "font_class": "fire",
  10788. "unicode": "e6a1",
  10789. "unicode_decimal": 59041
  10790. }, {
  10791. "icon_id": "24899648",
  10792. "name": "paihangbang",
  10793. "font_class": "medal",
  10794. "unicode": "e6a2",
  10795. "unicode_decimal": 59042
  10796. }, {
  10797. "icon_id": "24899649",
  10798. "name": "font",
  10799. "font_class": "font",
  10800. "unicode": "e6a3",
  10801. "unicode_decimal": 59043
  10802. }, {
  10803. "icon_id": "24899650",
  10804. "name": "gift",
  10805. "font_class": "gift",
  10806. "unicode": "e6a4",
  10807. "unicode_decimal": 59044
  10808. }, {
  10809. "icon_id": "24899651",
  10810. "name": "link",
  10811. "font_class": "link",
  10812. "unicode": "e6a5",
  10813. "unicode_decimal": 59045
  10814. }, {
  10815. "icon_id": "24899652",
  10816. "name": "notification",
  10817. "font_class": "notification",
  10818. "unicode": "e6a6",
  10819. "unicode_decimal": 59046
  10820. }, {
  10821. "icon_id": "24899653",
  10822. "name": "staff",
  10823. "font_class": "staff",
  10824. "unicode": "e6a7",
  10825. "unicode_decimal": 59047
  10826. }, {
  10827. "icon_id": "24899654",
  10828. "name": "VIP",
  10829. "font_class": "vip",
  10830. "unicode": "e6a8",
  10831. "unicode_decimal": 59048
  10832. }, {
  10833. "icon_id": "24899655",
  10834. "name": "folder_add",
  10835. "font_class": "folder-add",
  10836. "unicode": "e6a9",
  10837. "unicode_decimal": 59049
  10838. }, {
  10839. "icon_id": "24899656",
  10840. "name": "tune",
  10841. "font_class": "tune",
  10842. "unicode": "e6aa",
  10843. "unicode_decimal": 59050
  10844. }, {
  10845. "icon_id": "24899657",
  10846. "name": "shimingrenzheng",
  10847. "font_class": "auth",
  10848. "unicode": "e6ab",
  10849. "unicode_decimal": 59051
  10850. }, {
  10851. "icon_id": "24899565",
  10852. "name": "person",
  10853. "font_class": "person",
  10854. "unicode": "e699",
  10855. "unicode_decimal": 59033
  10856. }, {
  10857. "icon_id": "24899566",
  10858. "name": "email-filled",
  10859. "font_class": "email-filled",
  10860. "unicode": "e69a",
  10861. "unicode_decimal": 59034
  10862. }, {
  10863. "icon_id": "24899567",
  10864. "name": "phone-filled",
  10865. "font_class": "phone-filled",
  10866. "unicode": "e69b",
  10867. "unicode_decimal": 59035
  10868. }, {
  10869. "icon_id": "24899568",
  10870. "name": "phone",
  10871. "font_class": "phone",
  10872. "unicode": "e69c",
  10873. "unicode_decimal": 59036
  10874. }, {
  10875. "icon_id": "24899570",
  10876. "name": "email",
  10877. "font_class": "email",
  10878. "unicode": "e69e",
  10879. "unicode_decimal": 59038
  10880. }, {
  10881. "icon_id": "24899571",
  10882. "name": "personadd",
  10883. "font_class": "personadd",
  10884. "unicode": "e69f",
  10885. "unicode_decimal": 59039
  10886. }, {
  10887. "icon_id": "24899558",
  10888. "name": "chatboxes-filled",
  10889. "font_class": "chatboxes-filled",
  10890. "unicode": "e692",
  10891. "unicode_decimal": 59026
  10892. }, {
  10893. "icon_id": "24899559",
  10894. "name": "contact",
  10895. "font_class": "contact",
  10896. "unicode": "e693",
  10897. "unicode_decimal": 59027
  10898. }, {
  10899. "icon_id": "24899560",
  10900. "name": "chatbubble-filled",
  10901. "font_class": "chatbubble-filled",
  10902. "unicode": "e694",
  10903. "unicode_decimal": 59028
  10904. }, {
  10905. "icon_id": "24899561",
  10906. "name": "contact-filled",
  10907. "font_class": "contact-filled",
  10908. "unicode": "e695",
  10909. "unicode_decimal": 59029
  10910. }, {
  10911. "icon_id": "24899562",
  10912. "name": "chatboxes",
  10913. "font_class": "chatboxes",
  10914. "unicode": "e696",
  10915. "unicode_decimal": 59030
  10916. }, {
  10917. "icon_id": "24899563",
  10918. "name": "chatbubble",
  10919. "font_class": "chatbubble",
  10920. "unicode": "e697",
  10921. "unicode_decimal": 59031
  10922. }, {
  10923. "icon_id": "24881290",
  10924. "name": "upload-filled",
  10925. "font_class": "upload-filled",
  10926. "unicode": "e68e",
  10927. "unicode_decimal": 59022
  10928. }, {
  10929. "icon_id": "24881292",
  10930. "name": "upload",
  10931. "font_class": "upload",
  10932. "unicode": "e690",
  10933. "unicode_decimal": 59024
  10934. }, {
  10935. "icon_id": "24881293",
  10936. "name": "weixin",
  10937. "font_class": "weixin",
  10938. "unicode": "e691",
  10939. "unicode_decimal": 59025
  10940. }, {
  10941. "icon_id": "24881274",
  10942. "name": "compose",
  10943. "font_class": "compose",
  10944. "unicode": "e67f",
  10945. "unicode_decimal": 59007
  10946. }, {
  10947. "icon_id": "24881275",
  10948. "name": "qq",
  10949. "font_class": "qq",
  10950. "unicode": "e680",
  10951. "unicode_decimal": 59008
  10952. }, {
  10953. "icon_id": "24881276",
  10954. "name": "download-filled",
  10955. "font_class": "download-filled",
  10956. "unicode": "e681",
  10957. "unicode_decimal": 59009
  10958. }, {
  10959. "icon_id": "24881277",
  10960. "name": "pengyouquan",
  10961. "font_class": "pyq",
  10962. "unicode": "e682",
  10963. "unicode_decimal": 59010
  10964. }, {
  10965. "icon_id": "24881279",
  10966. "name": "sound",
  10967. "font_class": "sound",
  10968. "unicode": "e684",
  10969. "unicode_decimal": 59012
  10970. }, {
  10971. "icon_id": "24881280",
  10972. "name": "trash-filled",
  10973. "font_class": "trash-filled",
  10974. "unicode": "e685",
  10975. "unicode_decimal": 59013
  10976. }, {
  10977. "icon_id": "24881281",
  10978. "name": "sound-filled",
  10979. "font_class": "sound-filled",
  10980. "unicode": "e686",
  10981. "unicode_decimal": 59014
  10982. }, {
  10983. "icon_id": "24881282",
  10984. "name": "trash",
  10985. "font_class": "trash",
  10986. "unicode": "e687",
  10987. "unicode_decimal": 59015
  10988. }, {
  10989. "icon_id": "24881284",
  10990. "name": "videocam-filled",
  10991. "font_class": "videocam-filled",
  10992. "unicode": "e689",
  10993. "unicode_decimal": 59017
  10994. }, {
  10995. "icon_id": "24881285",
  10996. "name": "spinner-cycle",
  10997. "font_class": "spinner-cycle",
  10998. "unicode": "e68a",
  10999. "unicode_decimal": 59018
  11000. }, {
  11001. "icon_id": "24881286",
  11002. "name": "weibo",
  11003. "font_class": "weibo",
  11004. "unicode": "e68b",
  11005. "unicode_decimal": 59019
  11006. }, {
  11007. "icon_id": "24881288",
  11008. "name": "videocam",
  11009. "font_class": "videocam",
  11010. "unicode": "e68c",
  11011. "unicode_decimal": 59020
  11012. }, {
  11013. "icon_id": "24881289",
  11014. "name": "download",
  11015. "font_class": "download",
  11016. "unicode": "e68d",
  11017. "unicode_decimal": 59021
  11018. }, {
  11019. "icon_id": "24879601",
  11020. "name": "help",
  11021. "font_class": "help",
  11022. "unicode": "e679",
  11023. "unicode_decimal": 59001
  11024. }, {
  11025. "icon_id": "24879602",
  11026. "name": "navigate-filled",
  11027. "font_class": "navigate-filled",
  11028. "unicode": "e67a",
  11029. "unicode_decimal": 59002
  11030. }, {
  11031. "icon_id": "24879603",
  11032. "name": "plusempty",
  11033. "font_class": "plusempty",
  11034. "unicode": "e67b",
  11035. "unicode_decimal": 59003
  11036. }, {
  11037. "icon_id": "24879604",
  11038. "name": "smallcircle",
  11039. "font_class": "smallcircle",
  11040. "unicode": "e67c",
  11041. "unicode_decimal": 59004
  11042. }, {
  11043. "icon_id": "24879605",
  11044. "name": "minus-filled",
  11045. "font_class": "minus-filled",
  11046. "unicode": "e67d",
  11047. "unicode_decimal": 59005
  11048. }, {
  11049. "icon_id": "24879606",
  11050. "name": "micoff",
  11051. "font_class": "micoff",
  11052. "unicode": "e67e",
  11053. "unicode_decimal": 59006
  11054. }, {
  11055. "icon_id": "24879588",
  11056. "name": "closeempty",
  11057. "font_class": "closeempty",
  11058. "unicode": "e66c",
  11059. "unicode_decimal": 58988
  11060. }, {
  11061. "icon_id": "24879589",
  11062. "name": "clear",
  11063. "font_class": "clear",
  11064. "unicode": "e66d",
  11065. "unicode_decimal": 58989
  11066. }, {
  11067. "icon_id": "24879590",
  11068. "name": "navigate",
  11069. "font_class": "navigate",
  11070. "unicode": "e66e",
  11071. "unicode_decimal": 58990
  11072. }, {
  11073. "icon_id": "24879591",
  11074. "name": "minus",
  11075. "font_class": "minus",
  11076. "unicode": "e66f",
  11077. "unicode_decimal": 58991
  11078. }, {
  11079. "icon_id": "24879592",
  11080. "name": "image",
  11081. "font_class": "image",
  11082. "unicode": "e670",
  11083. "unicode_decimal": 58992
  11084. }, {
  11085. "icon_id": "24879593",
  11086. "name": "mic",
  11087. "font_class": "mic",
  11088. "unicode": "e671",
  11089. "unicode_decimal": 58993
  11090. }, {
  11091. "icon_id": "24879594",
  11092. "name": "paperplane",
  11093. "font_class": "paperplane",
  11094. "unicode": "e672",
  11095. "unicode_decimal": 58994
  11096. }, {
  11097. "icon_id": "24879595",
  11098. "name": "close",
  11099. "font_class": "close",
  11100. "unicode": "e673",
  11101. "unicode_decimal": 58995
  11102. }, {
  11103. "icon_id": "24879596",
  11104. "name": "help-filled",
  11105. "font_class": "help-filled",
  11106. "unicode": "e674",
  11107. "unicode_decimal": 58996
  11108. }, {
  11109. "icon_id": "24879597",
  11110. "name": "plus-filled",
  11111. "font_class": "paperplane-filled",
  11112. "unicode": "e675",
  11113. "unicode_decimal": 58997
  11114. }, {
  11115. "icon_id": "24879598",
  11116. "name": "plus",
  11117. "font_class": "plus",
  11118. "unicode": "e676",
  11119. "unicode_decimal": 58998
  11120. }, {
  11121. "icon_id": "24879599",
  11122. "name": "mic-filled",
  11123. "font_class": "mic-filled",
  11124. "unicode": "e677",
  11125. "unicode_decimal": 58999
  11126. }, {
  11127. "icon_id": "24879600",
  11128. "name": "image-filled",
  11129. "font_class": "image-filled",
  11130. "unicode": "e678",
  11131. "unicode_decimal": 59000
  11132. }, {
  11133. "icon_id": "24855900",
  11134. "name": "locked-filled",
  11135. "font_class": "locked-filled",
  11136. "unicode": "e668",
  11137. "unicode_decimal": 58984
  11138. }, {
  11139. "icon_id": "24855901",
  11140. "name": "info",
  11141. "font_class": "info",
  11142. "unicode": "e669",
  11143. "unicode_decimal": 58985
  11144. }, {
  11145. "icon_id": "24855903",
  11146. "name": "locked",
  11147. "font_class": "locked",
  11148. "unicode": "e66b",
  11149. "unicode_decimal": 58987
  11150. }, {
  11151. "icon_id": "24855884",
  11152. "name": "camera-filled",
  11153. "font_class": "camera-filled",
  11154. "unicode": "e658",
  11155. "unicode_decimal": 58968
  11156. }, {
  11157. "icon_id": "24855885",
  11158. "name": "chat-filled",
  11159. "font_class": "chat-filled",
  11160. "unicode": "e659",
  11161. "unicode_decimal": 58969
  11162. }, {
  11163. "icon_id": "24855886",
  11164. "name": "camera",
  11165. "font_class": "camera",
  11166. "unicode": "e65a",
  11167. "unicode_decimal": 58970
  11168. }, {
  11169. "icon_id": "24855887",
  11170. "name": "circle",
  11171. "font_class": "circle",
  11172. "unicode": "e65b",
  11173. "unicode_decimal": 58971
  11174. }, {
  11175. "icon_id": "24855888",
  11176. "name": "checkmarkempty",
  11177. "font_class": "checkmarkempty",
  11178. "unicode": "e65c",
  11179. "unicode_decimal": 58972
  11180. }, {
  11181. "icon_id": "24855889",
  11182. "name": "chat",
  11183. "font_class": "chat",
  11184. "unicode": "e65d",
  11185. "unicode_decimal": 58973
  11186. }, {
  11187. "icon_id": "24855890",
  11188. "name": "circle-filled",
  11189. "font_class": "circle-filled",
  11190. "unicode": "e65e",
  11191. "unicode_decimal": 58974
  11192. }, {
  11193. "icon_id": "24855891",
  11194. "name": "flag",
  11195. "font_class": "flag",
  11196. "unicode": "e65f",
  11197. "unicode_decimal": 58975
  11198. }, {
  11199. "icon_id": "24855892",
  11200. "name": "flag-filled",
  11201. "font_class": "flag-filled",
  11202. "unicode": "e660",
  11203. "unicode_decimal": 58976
  11204. }, {
  11205. "icon_id": "24855893",
  11206. "name": "gear-filled",
  11207. "font_class": "gear-filled",
  11208. "unicode": "e661",
  11209. "unicode_decimal": 58977
  11210. }, {
  11211. "icon_id": "24855894",
  11212. "name": "home",
  11213. "font_class": "home",
  11214. "unicode": "e662",
  11215. "unicode_decimal": 58978
  11216. }, {
  11217. "icon_id": "24855895",
  11218. "name": "home-filled",
  11219. "font_class": "home-filled",
  11220. "unicode": "e663",
  11221. "unicode_decimal": 58979
  11222. }, {
  11223. "icon_id": "24855896",
  11224. "name": "gear",
  11225. "font_class": "gear",
  11226. "unicode": "e664",
  11227. "unicode_decimal": 58980
  11228. }, {
  11229. "icon_id": "24855897",
  11230. "name": "smallcircle-filled",
  11231. "font_class": "smallcircle-filled",
  11232. "unicode": "e665",
  11233. "unicode_decimal": 58981
  11234. }, {
  11235. "icon_id": "24855898",
  11236. "name": "map-filled",
  11237. "font_class": "map-filled",
  11238. "unicode": "e666",
  11239. "unicode_decimal": 58982
  11240. }, {
  11241. "icon_id": "24855899",
  11242. "name": "map",
  11243. "font_class": "map",
  11244. "unicode": "e667",
  11245. "unicode_decimal": 58983
  11246. }, {
  11247. "icon_id": "24855825",
  11248. "name": "refresh-filled",
  11249. "font_class": "refresh-filled",
  11250. "unicode": "e656",
  11251. "unicode_decimal": 58966
  11252. }, {
  11253. "icon_id": "24855826",
  11254. "name": "refresh",
  11255. "font_class": "refresh",
  11256. "unicode": "e657",
  11257. "unicode_decimal": 58967
  11258. }, {
  11259. "icon_id": "24855808",
  11260. "name": "cloud-upload",
  11261. "font_class": "cloud-upload",
  11262. "unicode": "e645",
  11263. "unicode_decimal": 58949
  11264. }, {
  11265. "icon_id": "24855809",
  11266. "name": "cloud-download-filled",
  11267. "font_class": "cloud-download-filled",
  11268. "unicode": "e646",
  11269. "unicode_decimal": 58950
  11270. }, {
  11271. "icon_id": "24855810",
  11272. "name": "cloud-download",
  11273. "font_class": "cloud-download",
  11274. "unicode": "e647",
  11275. "unicode_decimal": 58951
  11276. }, {
  11277. "icon_id": "24855811",
  11278. "name": "cloud-upload-filled",
  11279. "font_class": "cloud-upload-filled",
  11280. "unicode": "e648",
  11281. "unicode_decimal": 58952
  11282. }, {
  11283. "icon_id": "24855813",
  11284. "name": "redo",
  11285. "font_class": "redo",
  11286. "unicode": "e64a",
  11287. "unicode_decimal": 58954
  11288. }, {
  11289. "icon_id": "24855814",
  11290. "name": "images-filled",
  11291. "font_class": "images-filled",
  11292. "unicode": "e64b",
  11293. "unicode_decimal": 58955
  11294. }, {
  11295. "icon_id": "24855815",
  11296. "name": "undo-filled",
  11297. "font_class": "undo-filled",
  11298. "unicode": "e64c",
  11299. "unicode_decimal": 58956
  11300. }, {
  11301. "icon_id": "24855816",
  11302. "name": "more",
  11303. "font_class": "more",
  11304. "unicode": "e64d",
  11305. "unicode_decimal": 58957
  11306. }, {
  11307. "icon_id": "24855817",
  11308. "name": "more-filled",
  11309. "font_class": "more-filled",
  11310. "unicode": "e64e",
  11311. "unicode_decimal": 58958
  11312. }, {
  11313. "icon_id": "24855818",
  11314. "name": "undo",
  11315. "font_class": "undo",
  11316. "unicode": "e64f",
  11317. "unicode_decimal": 58959
  11318. }, {
  11319. "icon_id": "24855819",
  11320. "name": "images",
  11321. "font_class": "images",
  11322. "unicode": "e650",
  11323. "unicode_decimal": 58960
  11324. }, {
  11325. "icon_id": "24855821",
  11326. "name": "paperclip",
  11327. "font_class": "paperclip",
  11328. "unicode": "e652",
  11329. "unicode_decimal": 58962
  11330. }, {
  11331. "icon_id": "24855822",
  11332. "name": "settings",
  11333. "font_class": "settings",
  11334. "unicode": "e653",
  11335. "unicode_decimal": 58963
  11336. }, {
  11337. "icon_id": "24855823",
  11338. "name": "search",
  11339. "font_class": "search",
  11340. "unicode": "e654",
  11341. "unicode_decimal": 58964
  11342. }, {
  11343. "icon_id": "24855824",
  11344. "name": "redo-filled",
  11345. "font_class": "redo-filled",
  11346. "unicode": "e655",
  11347. "unicode_decimal": 58965
  11348. }, {
  11349. "icon_id": "24841702",
  11350. "name": "list",
  11351. "font_class": "list",
  11352. "unicode": "e644",
  11353. "unicode_decimal": 58948
  11354. }, {
  11355. "icon_id": "24841489",
  11356. "name": "mail-open-filled",
  11357. "font_class": "mail-open-filled",
  11358. "unicode": "e63a",
  11359. "unicode_decimal": 58938
  11360. }, {
  11361. "icon_id": "24841491",
  11362. "name": "hand-thumbsdown-filled",
  11363. "font_class": "hand-down-filled",
  11364. "unicode": "e63c",
  11365. "unicode_decimal": 58940
  11366. }, {
  11367. "icon_id": "24841492",
  11368. "name": "hand-thumbsdown",
  11369. "font_class": "hand-down",
  11370. "unicode": "e63d",
  11371. "unicode_decimal": 58941
  11372. }, {
  11373. "icon_id": "24841493",
  11374. "name": "hand-thumbsup-filled",
  11375. "font_class": "hand-up-filled",
  11376. "unicode": "e63e",
  11377. "unicode_decimal": 58942
  11378. }, {
  11379. "icon_id": "24841494",
  11380. "name": "hand-thumbsup",
  11381. "font_class": "hand-up",
  11382. "unicode": "e63f",
  11383. "unicode_decimal": 58943
  11384. }, {
  11385. "icon_id": "24841496",
  11386. "name": "heart-filled",
  11387. "font_class": "heart-filled",
  11388. "unicode": "e641",
  11389. "unicode_decimal": 58945
  11390. }, {
  11391. "icon_id": "24841498",
  11392. "name": "mail-open",
  11393. "font_class": "mail-open",
  11394. "unicode": "e643",
  11395. "unicode_decimal": 58947
  11396. }, {
  11397. "icon_id": "24841488",
  11398. "name": "heart",
  11399. "font_class": "heart",
  11400. "unicode": "e639",
  11401. "unicode_decimal": 58937
  11402. }, {
  11403. "icon_id": "24839963",
  11404. "name": "loop",
  11405. "font_class": "loop",
  11406. "unicode": "e633",
  11407. "unicode_decimal": 58931
  11408. }, {
  11409. "icon_id": "24839866",
  11410. "name": "pulldown",
  11411. "font_class": "pulldown",
  11412. "unicode": "e632",
  11413. "unicode_decimal": 58930
  11414. }, {
  11415. "icon_id": "24813798",
  11416. "name": "scan",
  11417. "font_class": "scan",
  11418. "unicode": "e62a",
  11419. "unicode_decimal": 58922
  11420. }, {
  11421. "icon_id": "24813786",
  11422. "name": "bars",
  11423. "font_class": "bars",
  11424. "unicode": "e627",
  11425. "unicode_decimal": 58919
  11426. }, {
  11427. "icon_id": "24813788",
  11428. "name": "cart-filled",
  11429. "font_class": "cart-filled",
  11430. "unicode": "e629",
  11431. "unicode_decimal": 58921
  11432. }, {
  11433. "icon_id": "24813790",
  11434. "name": "checkbox",
  11435. "font_class": "checkbox",
  11436. "unicode": "e62b",
  11437. "unicode_decimal": 58923
  11438. }, {
  11439. "icon_id": "24813791",
  11440. "name": "checkbox-filled",
  11441. "font_class": "checkbox-filled",
  11442. "unicode": "e62c",
  11443. "unicode_decimal": 58924
  11444. }, {
  11445. "icon_id": "24813794",
  11446. "name": "shop",
  11447. "font_class": "shop",
  11448. "unicode": "e62f",
  11449. "unicode_decimal": 58927
  11450. }, {
  11451. "icon_id": "24813795",
  11452. "name": "headphones",
  11453. "font_class": "headphones",
  11454. "unicode": "e630",
  11455. "unicode_decimal": 58928
  11456. }, {
  11457. "icon_id": "24813796",
  11458. "name": "cart",
  11459. "font_class": "cart",
  11460. "unicode": "e631",
  11461. "unicode_decimal": 58929
  11462. }]
  11463. };
  11464. exports.default = _default;
  11465. /***/ }),
  11466. /***/ 477:
  11467. /*!**************************************************************************************!*\
  11468. !*** D:/hongxing/storage-wechat/uni_modules/uni-popup/components/uni-popup/popup.js ***!
  11469. \**************************************************************************************/
  11470. /*! no static exports found */
  11471. /***/ (function(module, exports, __webpack_require__) {
  11472. "use strict";
  11473. Object.defineProperty(exports, "__esModule", {
  11474. value: true
  11475. });
  11476. exports.default = void 0;
  11477. var _default = {
  11478. data: function data() {
  11479. return {};
  11480. },
  11481. created: function created() {
  11482. this.popup = this.getParent();
  11483. },
  11484. methods: {
  11485. /**
  11486. * 获取父元素实例
  11487. */
  11488. getParent: function getParent() {
  11489. var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'uniPopup';
  11490. var parent = this.$parent;
  11491. var parentName = parent.$options.name;
  11492. while (parentName !== name) {
  11493. parent = parent.$parent;
  11494. if (!parent) return false;
  11495. parentName = parent.$options.name;
  11496. }
  11497. return parent;
  11498. }
  11499. }
  11500. };
  11501. exports.default = _default;
  11502. /***/ }),
  11503. /***/ 492:
  11504. /*!************************************************************************************!*\
  11505. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js ***!
  11506. \************************************************************************************/
  11507. /*! no static exports found */
  11508. /***/ (function(module, exports, __webpack_require__) {
  11509. "use strict";
  11510. /* WEBPACK VAR INJECTION */(function(global, uni) {
  11511. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 3);
  11512. Object.defineProperty(exports, "__esModule", {
  11513. value: true
  11514. });
  11515. exports.default = void 0;
  11516. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 408));
  11517. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 4));
  11518. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 12));
  11519. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 17));
  11520. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 410));
  11521. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 10));
  11522. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 22));
  11523. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 23));
  11524. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 412));
  11525. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 413));
  11526. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 415));
  11527. var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ 493));
  11528. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 21);
  11529. var _pages = _interopRequireDefault(__webpack_require__(/*! @/pages.json */ 495));
  11530. function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e33) { throw _e33; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e34) { didErr = true; err = _e34; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
  11531. 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); }
  11532. 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; }
  11533. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  11534. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  11535. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
  11536. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  11537. "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self;
  11538. function n(e) {
  11539. return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
  11540. }
  11541. function s(e, t, n) {
  11542. return e(n = {
  11543. path: t,
  11544. exports: {},
  11545. require: function require(e, t) {
  11546. return function () {
  11547. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  11548. }(null == t && n.path);
  11549. }
  11550. }, n.exports), n.exports;
  11551. }
  11552. var r = s(function (e, t) {
  11553. var n;
  11554. e.exports = (n = n || function (e, t) {
  11555. var n = Object.create || function () {
  11556. function e() {}
  11557. return function (t) {
  11558. var n;
  11559. return e.prototype = t, n = new e(), e.prototype = null, n;
  11560. };
  11561. }(),
  11562. s = {},
  11563. r = s.lib = {},
  11564. i = r.Base = {
  11565. extend: function extend(e) {
  11566. var t = n(this);
  11567. return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () {
  11568. t.$super.init.apply(this, arguments);
  11569. }), t.init.prototype = t, t.$super = this, t;
  11570. },
  11571. create: function create() {
  11572. var e = this.extend();
  11573. return e.init.apply(e, arguments), e;
  11574. },
  11575. init: function init() {},
  11576. mixIn: function mixIn(e) {
  11577. for (var t in e) {
  11578. e.hasOwnProperty(t) && (this[t] = e[t]);
  11579. }
  11580. e.hasOwnProperty("toString") && (this.toString = e.toString);
  11581. },
  11582. clone: function clone() {
  11583. return this.init.prototype.extend(this);
  11584. }
  11585. },
  11586. o = r.WordArray = i.extend({
  11587. init: function init(e, n) {
  11588. e = this.words = e || [], this.sigBytes = n != t ? n : 4 * e.length;
  11589. },
  11590. toString: function toString(e) {
  11591. return (e || c).stringify(this);
  11592. },
  11593. concat: function concat(e) {
  11594. var t = this.words,
  11595. n = e.words,
  11596. s = this.sigBytes,
  11597. r = e.sigBytes;
  11598. if (this.clamp(), s % 4) for (var i = 0; i < r; i++) {
  11599. var o = n[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  11600. t[s + i >>> 2] |= o << 24 - (s + i) % 4 * 8;
  11601. } else for (i = 0; i < r; i += 4) {
  11602. t[s + i >>> 2] = n[i >>> 2];
  11603. }
  11604. return this.sigBytes += r, this;
  11605. },
  11606. clamp: function clamp() {
  11607. var t = this.words,
  11608. n = this.sigBytes;
  11609. t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4);
  11610. },
  11611. clone: function clone() {
  11612. var e = i.clone.call(this);
  11613. return e.words = this.words.slice(0), e;
  11614. },
  11615. random: function random(t) {
  11616. for (var n, s = [], r = function r(t) {
  11617. t = t;
  11618. var n = 987654321,
  11619. s = 4294967295;
  11620. return function () {
  11621. var r = ((n = 36969 * (65535 & n) + (n >> 16) & s) << 16) + (t = 18e3 * (65535 & t) + (t >> 16) & s) & s;
  11622. return r /= 4294967296, (r += .5) * (e.random() > .5 ? 1 : -1);
  11623. };
  11624. }, i = 0; i < t; i += 4) {
  11625. var a = r(4294967296 * (n || e.random()));
  11626. n = 987654071 * a(), s.push(4294967296 * a() | 0);
  11627. }
  11628. return new o.init(s, t);
  11629. }
  11630. }),
  11631. a = s.enc = {},
  11632. c = a.Hex = {
  11633. stringify: function stringify(e) {
  11634. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  11635. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  11636. s.push((i >>> 4).toString(16)), s.push((15 & i).toString(16));
  11637. }
  11638. return s.join("");
  11639. },
  11640. parse: function parse(e) {
  11641. for (var t = e.length, n = [], s = 0; s < t; s += 2) {
  11642. n[s >>> 3] |= parseInt(e.substr(s, 2), 16) << 24 - s % 8 * 4;
  11643. }
  11644. return new o.init(n, t / 2);
  11645. }
  11646. },
  11647. u = a.Latin1 = {
  11648. stringify: function stringify(e) {
  11649. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  11650. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  11651. s.push(String.fromCharCode(i));
  11652. }
  11653. return s.join("");
  11654. },
  11655. parse: function parse(e) {
  11656. for (var t = e.length, n = [], s = 0; s < t; s++) {
  11657. n[s >>> 2] |= (255 & e.charCodeAt(s)) << 24 - s % 4 * 8;
  11658. }
  11659. return new o.init(n, t);
  11660. }
  11661. },
  11662. l = a.Utf8 = {
  11663. stringify: function stringify(e) {
  11664. try {
  11665. return decodeURIComponent(escape(u.stringify(e)));
  11666. } catch (e) {
  11667. throw new Error("Malformed UTF-8 data");
  11668. }
  11669. },
  11670. parse: function parse(e) {
  11671. return u.parse(unescape(encodeURIComponent(e)));
  11672. }
  11673. },
  11674. h = r.BufferedBlockAlgorithm = i.extend({
  11675. reset: function reset() {
  11676. this._data = new o.init(), this._nDataBytes = 0;
  11677. },
  11678. _append: function _append(e) {
  11679. "string" == typeof e && (e = l.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
  11680. },
  11681. _process: function _process(t) {
  11682. var n = this._data,
  11683. s = n.words,
  11684. r = n.sigBytes,
  11685. i = this.blockSize,
  11686. a = r / (4 * i),
  11687. c = (a = t ? e.ceil(a) : e.max((0 | a) - this._minBufferSize, 0)) * i,
  11688. u = e.min(4 * c, r);
  11689. if (c) {
  11690. for (var l = 0; l < c; l += i) {
  11691. this._doProcessBlock(s, l);
  11692. }
  11693. var h = s.splice(0, c);
  11694. n.sigBytes -= u;
  11695. }
  11696. return new o.init(h, u);
  11697. },
  11698. clone: function clone() {
  11699. var e = i.clone.call(this);
  11700. return e._data = this._data.clone(), e;
  11701. },
  11702. _minBufferSize: 0
  11703. });
  11704. r.Hasher = h.extend({
  11705. cfg: i.extend(),
  11706. init: function init(e) {
  11707. this.cfg = this.cfg.extend(e), this.reset();
  11708. },
  11709. reset: function reset() {
  11710. h.reset.call(this), this._doReset();
  11711. },
  11712. update: function update(e) {
  11713. return this._append(e), this._process(), this;
  11714. },
  11715. finalize: function finalize(e) {
  11716. return e && this._append(e), this._doFinalize();
  11717. },
  11718. blockSize: 16,
  11719. _createHelper: function _createHelper(e) {
  11720. return function (t, n) {
  11721. return new e.init(n).finalize(t);
  11722. };
  11723. },
  11724. _createHmacHelper: function _createHmacHelper(e) {
  11725. return function (t, n) {
  11726. return new d.HMAC.init(e, n).finalize(t);
  11727. };
  11728. }
  11729. });
  11730. var d = s.algo = {};
  11731. return s;
  11732. }(Math), n);
  11733. }),
  11734. i = r,
  11735. o = (s(function (e, t) {
  11736. var n;
  11737. e.exports = (n = i, function (e) {
  11738. var t = n,
  11739. s = t.lib,
  11740. r = s.WordArray,
  11741. i = s.Hasher,
  11742. o = t.algo,
  11743. a = [];
  11744. !function () {
  11745. for (var t = 0; t < 64; t++) {
  11746. a[t] = 4294967296 * e.abs(e.sin(t + 1)) | 0;
  11747. }
  11748. }();
  11749. var c = o.MD5 = i.extend({
  11750. _doReset: function _doReset() {
  11751. this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878]);
  11752. },
  11753. _doProcessBlock: function _doProcessBlock(e, t) {
  11754. for (var n = 0; n < 16; n++) {
  11755. var s = t + n,
  11756. r = e[s];
  11757. e[s] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8);
  11758. }
  11759. var i = this._hash.words,
  11760. o = e[t + 0],
  11761. c = e[t + 1],
  11762. f = e[t + 2],
  11763. p = e[t + 3],
  11764. g = e[t + 4],
  11765. m = e[t + 5],
  11766. y = e[t + 6],
  11767. _ = e[t + 7],
  11768. w = e[t + 8],
  11769. v = e[t + 9],
  11770. S = e[t + 10],
  11771. k = e[t + 11],
  11772. I = e[t + 12],
  11773. b = e[t + 13],
  11774. T = e[t + 14],
  11775. A = e[t + 15],
  11776. C = i[0],
  11777. P = i[1],
  11778. E = i[2],
  11779. O = i[3];
  11780. C = u(C, P, E, O, o, 7, a[0]), O = u(O, C, P, E, c, 12, a[1]), E = u(E, O, C, P, f, 17, a[2]), P = u(P, E, O, C, p, 22, a[3]), C = u(C, P, E, O, g, 7, a[4]), O = u(O, C, P, E, m, 12, a[5]), E = u(E, O, C, P, y, 17, a[6]), P = u(P, E, O, C, _, 22, a[7]), C = u(C, P, E, O, w, 7, a[8]), O = u(O, C, P, E, v, 12, a[9]), E = u(E, O, C, P, S, 17, a[10]), P = u(P, E, O, C, k, 22, a[11]), C = u(C, P, E, O, I, 7, a[12]), O = u(O, C, P, E, b, 12, a[13]), E = u(E, O, C, P, T, 17, a[14]), C = l(C, P = u(P, E, O, C, A, 22, a[15]), E, O, c, 5, a[16]), O = l(O, C, P, E, y, 9, a[17]), E = l(E, O, C, P, k, 14, a[18]), P = l(P, E, O, C, o, 20, a[19]), C = l(C, P, E, O, m, 5, a[20]), O = l(O, C, P, E, S, 9, a[21]), E = l(E, O, C, P, A, 14, a[22]), P = l(P, E, O, C, g, 20, a[23]), C = l(C, P, E, O, v, 5, a[24]), O = l(O, C, P, E, T, 9, a[25]), E = l(E, O, C, P, p, 14, a[26]), P = l(P, E, O, C, w, 20, a[27]), C = l(C, P, E, O, b, 5, a[28]), O = l(O, C, P, E, f, 9, a[29]), E = l(E, O, C, P, _, 14, a[30]), C = h(C, P = l(P, E, O, C, I, 20, a[31]), E, O, m, 4, a[32]), O = h(O, C, P, E, w, 11, a[33]), E = h(E, O, C, P, k, 16, a[34]), P = h(P, E, O, C, T, 23, a[35]), C = h(C, P, E, O, c, 4, a[36]), O = h(O, C, P, E, g, 11, a[37]), E = h(E, O, C, P, _, 16, a[38]), P = h(P, E, O, C, S, 23, a[39]), C = h(C, P, E, O, b, 4, a[40]), O = h(O, C, P, E, o, 11, a[41]), E = h(E, O, C, P, p, 16, a[42]), P = h(P, E, O, C, y, 23, a[43]), C = h(C, P, E, O, v, 4, a[44]), O = h(O, C, P, E, I, 11, a[45]), E = h(E, O, C, P, A, 16, a[46]), C = d(C, P = h(P, E, O, C, f, 23, a[47]), E, O, o, 6, a[48]), O = d(O, C, P, E, _, 10, a[49]), E = d(E, O, C, P, T, 15, a[50]), P = d(P, E, O, C, m, 21, a[51]), C = d(C, P, E, O, I, 6, a[52]), O = d(O, C, P, E, p, 10, a[53]), E = d(E, O, C, P, S, 15, a[54]), P = d(P, E, O, C, c, 21, a[55]), C = d(C, P, E, O, w, 6, a[56]), O = d(O, C, P, E, A, 10, a[57]), E = d(E, O, C, P, y, 15, a[58]), P = d(P, E, O, C, b, 21, a[59]), C = d(C, P, E, O, g, 6, a[60]), O = d(O, C, P, E, k, 10, a[61]), E = d(E, O, C, P, f, 15, a[62]), P = d(P, E, O, C, v, 21, a[63]), i[0] = i[0] + C | 0, i[1] = i[1] + P | 0, i[2] = i[2] + E | 0, i[3] = i[3] + O | 0;
  11781. },
  11782. _doFinalize: function _doFinalize() {
  11783. var t = this._data,
  11784. n = t.words,
  11785. s = 8 * this._nDataBytes,
  11786. r = 8 * t.sigBytes;
  11787. n[r >>> 5] |= 128 << 24 - r % 32;
  11788. var i = e.floor(s / 4294967296),
  11789. o = s;
  11790. n[15 + (r + 64 >>> 9 << 4)] = 16711935 & (i << 8 | i >>> 24) | 4278255360 & (i << 24 | i >>> 8), n[14 + (r + 64 >>> 9 << 4)] = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8), t.sigBytes = 4 * (n.length + 1), this._process();
  11791. for (var a = this._hash, c = a.words, u = 0; u < 4; u++) {
  11792. var l = c[u];
  11793. c[u] = 16711935 & (l << 8 | l >>> 24) | 4278255360 & (l << 24 | l >>> 8);
  11794. }
  11795. return a;
  11796. },
  11797. clone: function clone() {
  11798. var e = i.clone.call(this);
  11799. return e._hash = this._hash.clone(), e;
  11800. }
  11801. });
  11802. function u(e, t, n, s, r, i, o) {
  11803. var a = e + (t & n | ~t & s) + r + o;
  11804. return (a << i | a >>> 32 - i) + t;
  11805. }
  11806. function l(e, t, n, s, r, i, o) {
  11807. var a = e + (t & s | n & ~s) + r + o;
  11808. return (a << i | a >>> 32 - i) + t;
  11809. }
  11810. function h(e, t, n, s, r, i, o) {
  11811. var a = e + (t ^ n ^ s) + r + o;
  11812. return (a << i | a >>> 32 - i) + t;
  11813. }
  11814. function d(e, t, n, s, r, i, o) {
  11815. var a = e + (n ^ (t | ~s)) + r + o;
  11816. return (a << i | a >>> 32 - i) + t;
  11817. }
  11818. t.MD5 = i._createHelper(c), t.HmacMD5 = i._createHmacHelper(c);
  11819. }(Math), n.MD5);
  11820. }), s(function (e, t) {
  11821. var n;
  11822. e.exports = (n = i, void function () {
  11823. var e = n,
  11824. t = e.lib.Base,
  11825. s = e.enc.Utf8;
  11826. e.algo.HMAC = t.extend({
  11827. init: function init(e, t) {
  11828. e = this._hasher = new e.init(), "string" == typeof t && (t = s.parse(t));
  11829. var n = e.blockSize,
  11830. r = 4 * n;
  11831. t.sigBytes > r && (t = e.finalize(t)), t.clamp();
  11832. for (var i = this._oKey = t.clone(), o = this._iKey = t.clone(), a = i.words, c = o.words, u = 0; u < n; u++) {
  11833. a[u] ^= 1549556828, c[u] ^= 909522486;
  11834. }
  11835. i.sigBytes = o.sigBytes = r, this.reset();
  11836. },
  11837. reset: function reset() {
  11838. var e = this._hasher;
  11839. e.reset(), e.update(this._iKey);
  11840. },
  11841. update: function update(e) {
  11842. return this._hasher.update(e), this;
  11843. },
  11844. finalize: function finalize(e) {
  11845. var t = this._hasher,
  11846. n = t.finalize(e);
  11847. return t.reset(), t.finalize(this._oKey.clone().concat(n));
  11848. }
  11849. });
  11850. }());
  11851. }), s(function (e, t) {
  11852. e.exports = i.HmacMD5;
  11853. })),
  11854. a = s(function (e, t) {
  11855. e.exports = i.enc.Utf8;
  11856. }),
  11857. c = s(function (e, t) {
  11858. var n;
  11859. e.exports = (n = i, function () {
  11860. var e = n,
  11861. t = e.lib.WordArray;
  11862. function s(e, n, s) {
  11863. for (var r = [], i = 0, o = 0; o < n; o++) {
  11864. if (o % 4) {
  11865. var a = s[e.charCodeAt(o - 1)] << o % 4 * 2,
  11866. c = s[e.charCodeAt(o)] >>> 6 - o % 4 * 2;
  11867. r[i >>> 2] |= (a | c) << 24 - i % 4 * 8, i++;
  11868. }
  11869. }
  11870. return t.create(r, i);
  11871. }
  11872. e.enc.Base64 = {
  11873. stringify: function stringify(e) {
  11874. var t = e.words,
  11875. n = e.sigBytes,
  11876. s = this._map;
  11877. e.clamp();
  11878. for (var r = [], i = 0; i < n; i += 3) {
  11879. for (var o = (t[i >>> 2] >>> 24 - i % 4 * 8 & 255) << 16 | (t[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 255) << 8 | t[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 255, a = 0; a < 4 && i + .75 * a < n; a++) {
  11880. r.push(s.charAt(o >>> 6 * (3 - a) & 63));
  11881. }
  11882. }
  11883. var c = s.charAt(64);
  11884. if (c) for (; r.length % 4;) {
  11885. r.push(c);
  11886. }
  11887. return r.join("");
  11888. },
  11889. parse: function parse(e) {
  11890. var t = e.length,
  11891. n = this._map,
  11892. r = this._reverseMap;
  11893. if (!r) {
  11894. r = this._reverseMap = [];
  11895. for (var i = 0; i < n.length; i++) {
  11896. r[n.charCodeAt(i)] = i;
  11897. }
  11898. }
  11899. var o = n.charAt(64);
  11900. if (o) {
  11901. var a = e.indexOf(o);
  11902. -1 !== a && (t = a);
  11903. }
  11904. return s(e, t, r);
  11905. },
  11906. _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
  11907. };
  11908. }(), n.enc.Base64);
  11909. });
  11910. var u = "FUNCTION",
  11911. l = "OBJECT",
  11912. h = "CLIENT_DB";
  11913. function d(e) {
  11914. return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();
  11915. }
  11916. function f(e) {
  11917. return "object" === d(e);
  11918. }
  11919. function p(e) {
  11920. return "function" == typeof e;
  11921. }
  11922. function g(e) {
  11923. return function () {
  11924. try {
  11925. return e.apply(e, arguments);
  11926. } catch (e) {
  11927. console.error(e);
  11928. }
  11929. };
  11930. }
  11931. function m(e) {
  11932. return e && "string" == typeof e ? JSON.parse(e) : e;
  11933. }
  11934. var y = "development" === "development",
  11935. _ = "mp-weixin",
  11936. w = "true" === undefined || !0 === undefined,
  11937. v = m([]);
  11938. var S;
  11939. S = "h5" === _ ? "web" : "app-plus" === _ ? "app" : _;
  11940. var k = m(undefined),
  11941. I = m(undefined) || [],
  11942. b = true;
  11943. var T = "";
  11944. try {
  11945. {
  11946. var _e2 = __webpack_require__(/*! uni-stat-config */ 496).default || __webpack_require__(/*! uni-stat-config */ 496);
  11947. T = _e2.appid;
  11948. }
  11949. } catch (e) {}
  11950. var A = {};
  11951. function C(e) {
  11952. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11953. var n, s;
  11954. return n = A, s = e, Object.prototype.hasOwnProperty.call(n, s) || (A[e] = t), A[e];
  11955. }
  11956. "app" === S && (A = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {});
  11957. var P = ["invoke", "success", "fail", "complete"],
  11958. E = C("_globalUniCloudInterceptor");
  11959. function O(e, t) {
  11960. E[e] || (E[e] = {}), f(t) && Object.keys(t).forEach(function (n) {
  11961. P.indexOf(n) > -1 && function (e, t, n) {
  11962. var s = E[e][t];
  11963. s || (s = E[e][t] = []), -1 === s.indexOf(n) && p(n) && s.push(n);
  11964. }(e, n, t[n]);
  11965. });
  11966. }
  11967. function x(e, t) {
  11968. E[e] || (E[e] = {}), f(t) ? Object.keys(t).forEach(function (n) {
  11969. P.indexOf(n) > -1 && function (e, t, n) {
  11970. var s = E[e][t];
  11971. if (!s) return;
  11972. var r = s.indexOf(n);
  11973. r > -1 && s.splice(r, 1);
  11974. }(e, n, t[n]);
  11975. }) : delete E[e];
  11976. }
  11977. function U(e, t) {
  11978. return e && 0 !== e.length ? e.reduce(function (e, n) {
  11979. return e.then(function () {
  11980. return n(t);
  11981. });
  11982. }, Promise.resolve()) : Promise.resolve();
  11983. }
  11984. function R(e, t) {
  11985. return E[e] && E[e][t] || [];
  11986. }
  11987. function L(e) {
  11988. O("callObject", e);
  11989. }
  11990. var N = C("_globalUniCloudListener"),
  11991. D = "response",
  11992. F = "needLogin",
  11993. q = "refreshToken",
  11994. K = "clientdb",
  11995. M = "cloudfunction",
  11996. j = "cloudobject";
  11997. function B(e) {
  11998. return N[e] || (N[e] = []), N[e];
  11999. }
  12000. function $(e, t) {
  12001. var n = B(e);
  12002. n.includes(t) || n.push(t);
  12003. }
  12004. function W(e, t) {
  12005. var n = B(e),
  12006. s = n.indexOf(t);
  12007. -1 !== s && n.splice(s, 1);
  12008. }
  12009. function z(e, t) {
  12010. var n = B(e);
  12011. for (var _e3 = 0; _e3 < n.length; _e3++) {
  12012. (0, n[_e3])(t);
  12013. }
  12014. }
  12015. var J,
  12016. H = !1;
  12017. function G() {
  12018. return J || (J = new Promise(function (e) {
  12019. H && e(), function t() {
  12020. if ("function" == typeof getCurrentPages) {
  12021. var _t2 = getCurrentPages();
  12022. _t2 && _t2[0] && (H = !0, e());
  12023. }
  12024. H || setTimeout(function () {
  12025. t();
  12026. }, 30);
  12027. }();
  12028. }), J);
  12029. }
  12030. function V(e) {
  12031. var t = {};
  12032. for (var _n2 in e) {
  12033. var _s2 = e[_n2];
  12034. p(_s2) && (t[_n2] = g(_s2));
  12035. }
  12036. return t;
  12037. }
  12038. function Y(e, t) {
  12039. return t ? function (n) {
  12040. var _this = this;
  12041. var s = !1;
  12042. if ("callFunction" === t) {
  12043. var _e4 = n && n.type || u;
  12044. s = _e4 !== u;
  12045. }
  12046. var r = "callFunction" === t && !s;
  12047. var i;
  12048. i = this.isReady ? Promise.resolve() : this.initUniCloud, n = n || {};
  12049. var _V = V(n),
  12050. o = _V.success,
  12051. a = _V.fail,
  12052. c = _V.complete,
  12053. l = i.then(function () {
  12054. return s ? Promise.resolve() : U(R(t, "invoke"), n);
  12055. }).then(function () {
  12056. return e.call(_this, n);
  12057. }).then(function (e) {
  12058. return s ? Promise.resolve(e) : U(R(t, "success"), e).then(function () {
  12059. return U(R(t, "complete"), e);
  12060. }).then(function () {
  12061. return r && z(D, {
  12062. type: M,
  12063. content: e
  12064. }), Promise.resolve(e);
  12065. });
  12066. }, function (e) {
  12067. return s ? Promise.reject(e) : U(R(t, "fail"), e).then(function () {
  12068. return U(R(t, "complete"), e);
  12069. }).then(function () {
  12070. return z(D, {
  12071. type: M,
  12072. content: e
  12073. }), Promise.reject(e);
  12074. });
  12075. });
  12076. if (!(o || a || c)) return l;
  12077. l.then(function (e) {
  12078. o && o(e), c && c(e), r && z(D, {
  12079. type: M,
  12080. content: e
  12081. });
  12082. }, function (e) {
  12083. a && a(e), c && c(e), r && z(D, {
  12084. type: M,
  12085. content: e
  12086. });
  12087. });
  12088. } : function (t) {
  12089. t = t || {};
  12090. var _V2 = V(t),
  12091. n = _V2.success,
  12092. s = _V2.fail,
  12093. r = _V2.complete;
  12094. if (!(n || s || r)) return e.call(this, t);
  12095. e.call(this, t).then(function (e) {
  12096. n && n(e), r && r(e);
  12097. }, function (e) {
  12098. s && s(e), r && r(e);
  12099. });
  12100. };
  12101. }
  12102. var Q = /*#__PURE__*/function (_Error) {
  12103. (0, _inherits2.default)(Q, _Error);
  12104. var _super = _createSuper(Q);
  12105. function Q(e) {
  12106. var _this2;
  12107. (0, _classCallCheck2.default)(this, Q);
  12108. _this2 = _super.call(this, e.message), _this2.errMsg = e.message || e.errMsg || "unknown system error", _this2.code = _this2.errCode = e.code || e.errCode || "SYSTEM_ERROR", _this2.errSubject = _this2.subject = e.subject || e.errSubject, _this2.cause = e.cause, _this2.requestId = e.requestId;
  12109. return _this2;
  12110. }
  12111. (0, _createClass2.default)(Q, [{
  12112. key: "toJson",
  12113. value: function toJson() {
  12114. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  12115. if (!(e >= 10)) return e++, {
  12116. errCode: this.errCode,
  12117. errMsg: this.errMsg,
  12118. errSubject: this.errSubject,
  12119. cause: this.cause && this.cause.toJson ? this.cause.toJson(e) : this.cause
  12120. };
  12121. }
  12122. }]);
  12123. return Q;
  12124. }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
  12125. var X = {
  12126. request: function request(e) {
  12127. return uni.request(e);
  12128. },
  12129. uploadFile: function uploadFile(e) {
  12130. return uni.uploadFile(e);
  12131. },
  12132. setStorageSync: function setStorageSync(e, t) {
  12133. return uni.setStorageSync(e, t);
  12134. },
  12135. getStorageSync: function getStorageSync(e) {
  12136. return uni.getStorageSync(e);
  12137. },
  12138. removeStorageSync: function removeStorageSync(e) {
  12139. return uni.removeStorageSync(e);
  12140. },
  12141. clearStorageSync: function clearStorageSync() {
  12142. return uni.clearStorageSync();
  12143. }
  12144. };
  12145. function Z() {
  12146. return {
  12147. token: X.getStorageSync("uni_id_token") || X.getStorageSync("uniIdToken"),
  12148. tokenExpired: X.getStorageSync("uni_id_token_expired")
  12149. };
  12150. }
  12151. function ee() {
  12152. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  12153. e = _ref.token,
  12154. t = _ref.tokenExpired;
  12155. e && X.setStorageSync("uni_id_token", e), t && X.setStorageSync("uni_id_token_expired", t);
  12156. }
  12157. function te() {
  12158. if (!y || "web" !== S) return;
  12159. uni.getStorageSync("__LAST_DCLOUD_APPID") !== T && (uni.setStorageSync("__LAST_DCLOUD_APPID", T), console.warn("检测到当前项目与上次运行到此端口的项目不一致,自动清理uni-id保存的token信息(仅开发调试时生效)"), X.removeStorageSync("uni_id_token"), X.removeStorageSync("uniIdToken"), X.removeStorageSync("uni_id_token_expired"));
  12160. }
  12161. var ne, se;
  12162. function re() {
  12163. return ne || (ne = uni.getSystemInfoSync()), ne;
  12164. }
  12165. function ie() {
  12166. var e, t;
  12167. try {
  12168. if (uni.getLaunchOptionsSync) {
  12169. if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1) return;
  12170. var _uni$getLaunchOptions = uni.getLaunchOptionsSync(),
  12171. _n3 = _uni$getLaunchOptions.scene,
  12172. _s3 = _uni$getLaunchOptions.channel;
  12173. e = _s3, t = _n3;
  12174. }
  12175. } catch (e) {}
  12176. return {
  12177. channel: e,
  12178. scene: t
  12179. };
  12180. }
  12181. function oe() {
  12182. var e = uni.getLocale && uni.getLocale() || "en";
  12183. if (se) return _objectSpread(_objectSpread({}, se), {}, {
  12184. locale: e,
  12185. LOCALE: e
  12186. });
  12187. var t = re(),
  12188. n = t.deviceId,
  12189. s = t.osName,
  12190. r = t.uniPlatform,
  12191. i = t.appId,
  12192. o = ["pixelRatio", "brand", "model", "system", "language", "version", "platform", "host", "SDKVersion", "swanNativeVersion", "app", "AppPlatform", "fontSizeSetting"];
  12193. for (var _e5 = 0; _e5 < o.length; _e5++) {
  12194. delete t[o[_e5]];
  12195. }
  12196. return se = _objectSpread(_objectSpread({
  12197. PLATFORM: r,
  12198. OS: s,
  12199. APPID: i,
  12200. DEVICEID: n
  12201. }, ie()), t), _objectSpread(_objectSpread({}, se), {}, {
  12202. locale: e,
  12203. LOCALE: e
  12204. });
  12205. }
  12206. var ae = {
  12207. sign: function sign(e, t) {
  12208. var n = "";
  12209. return Object.keys(e).sort().forEach(function (t) {
  12210. e[t] && (n = n + "&" + t + "=" + e[t]);
  12211. }), n = n.slice(1), o(n, t).toString();
  12212. },
  12213. wrappedRequest: function wrappedRequest(e, t) {
  12214. return new Promise(function (n, s) {
  12215. t(Object.assign(e, {
  12216. complete: function complete(e) {
  12217. e || (e = {}), y && "web" === S && e.errMsg && 0 === e.errMsg.indexOf("request:fail") && console.warn("发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5");
  12218. var t = e.data && e.data.header && e.data.header["x-serverless-request-id"] || e.header && e.header["request-id"];
  12219. if (!e.statusCode || e.statusCode >= 400) return s(new Q({
  12220. code: "SYS_ERR",
  12221. message: e.errMsg || "request:fail",
  12222. requestId: t
  12223. }));
  12224. var r = e.data;
  12225. if (r.error) return s(new Q({
  12226. code: r.error.code,
  12227. message: r.error.message,
  12228. requestId: t
  12229. }));
  12230. r.result = r.data, r.requestId = t, delete r.data, n(r);
  12231. }
  12232. }));
  12233. });
  12234. },
  12235. toBase64: function toBase64(e) {
  12236. return c.stringify(a.parse(e));
  12237. }
  12238. },
  12239. ce = {
  12240. "uniCloud.init.paramRequired": "{param} required",
  12241. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  12242. };
  12243. var _e6 = (0, _uniI18n.initVueI18n)({
  12244. "zh-Hans": {
  12245. "uniCloud.init.paramRequired": "缺少参数:{param}",
  12246. "uniCloud.uploadFile.fileError": "filePath应为File对象"
  12247. },
  12248. "zh-Hant": {
  12249. "uniCloud.init.paramRequired": "缺少参数:{param}",
  12250. "uniCloud.uploadFile.fileError": "filePath应为File对象"
  12251. },
  12252. en: ce,
  12253. fr: {
  12254. "uniCloud.init.paramRequired": "{param} required",
  12255. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  12256. },
  12257. es: {
  12258. "uniCloud.init.paramRequired": "{param} required",
  12259. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  12260. },
  12261. ja: ce
  12262. }, "zh-Hans"),
  12263. ue = _e6.t;
  12264. var le = /*#__PURE__*/function () {
  12265. function le(e) {
  12266. (0, _classCallCheck2.default)(this, le);
  12267. ["spaceId", "clientSecret"].forEach(function (t) {
  12268. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error(ue("uniCloud.init.paramRequired", {
  12269. param: t
  12270. }));
  12271. }), this.config = Object.assign({}, {
  12272. endpoint: "https://api.bspapp.com"
  12273. }, e), this.config.provider = "aliyun", this.config.requestUrl = this.config.endpoint + "/client", this.config.envType = this.config.envType || "public", this.config.accessTokenKey = "access_token_" + this.config.spaceId, this.adapter = X, this._getAccessTokenPromise = null, this._getAccessTokenPromiseStatus = null;
  12274. }
  12275. (0, _createClass2.default)(le, [{
  12276. key: "hasAccessToken",
  12277. get: function get() {
  12278. return !!this.accessToken;
  12279. }
  12280. }, {
  12281. key: "setAccessToken",
  12282. value: function setAccessToken(e) {
  12283. this.accessToken = e;
  12284. }
  12285. }, {
  12286. key: "requestWrapped",
  12287. value: function requestWrapped(e) {
  12288. return ae.wrappedRequest(e, this.adapter.request);
  12289. }
  12290. }, {
  12291. key: "requestAuth",
  12292. value: function requestAuth(e) {
  12293. return this.requestWrapped(e);
  12294. }
  12295. }, {
  12296. key: "request",
  12297. value: function request(e, t) {
  12298. var _this3 = this;
  12299. return Promise.resolve().then(function () {
  12300. return _this3.hasAccessToken ? t ? _this3.requestWrapped(e) : _this3.requestWrapped(e).catch(function (t) {
  12301. return new Promise(function (e, n) {
  12302. !t || "GATEWAY_INVALID_TOKEN" !== t.code && "InvalidParameter.InvalidToken" !== t.code ? n(t) : e();
  12303. }).then(function () {
  12304. return _this3.getAccessToken();
  12305. }).then(function () {
  12306. var t = _this3.rebuildRequest(e);
  12307. return _this3.request(t, !0);
  12308. });
  12309. }) : _this3.getAccessToken().then(function () {
  12310. var t = _this3.rebuildRequest(e);
  12311. return _this3.request(t, !0);
  12312. });
  12313. });
  12314. }
  12315. }, {
  12316. key: "rebuildRequest",
  12317. value: function rebuildRequest(e) {
  12318. var t = Object.assign({}, e);
  12319. return t.data.token = this.accessToken, t.header["x-basement-token"] = this.accessToken, t.header["x-serverless-sign"] = ae.sign(t.data, this.config.clientSecret), t;
  12320. }
  12321. }, {
  12322. key: "setupRequest",
  12323. value: function setupRequest(e, t) {
  12324. var n = Object.assign({}, e, {
  12325. spaceId: this.config.spaceId,
  12326. timestamp: Date.now()
  12327. }),
  12328. s = {
  12329. "Content-Type": "application/json"
  12330. };
  12331. return "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = ae.sign(n, this.config.clientSecret), {
  12332. url: this.config.requestUrl,
  12333. method: "POST",
  12334. data: n,
  12335. dataType: "json",
  12336. header: s
  12337. };
  12338. }
  12339. }, {
  12340. key: "getAccessToken",
  12341. value: function getAccessToken() {
  12342. var _this4 = this;
  12343. if ("pending" === this._getAccessTokenPromiseStatus) return this._getAccessTokenPromise;
  12344. this._getAccessTokenPromiseStatus = "pending";
  12345. return this._getAccessTokenPromise = this.requestAuth(this.setupRequest({
  12346. method: "serverless.auth.user.anonymousAuthorize",
  12347. params: "{}"
  12348. }, "auth")).then(function (e) {
  12349. return new Promise(function (t, n) {
  12350. e.result && e.result.accessToken ? (_this4.setAccessToken(e.result.accessToken), _this4._getAccessTokenPromiseStatus = "fulfilled", t(_this4.accessToken)) : (_this4._getAccessTokenPromiseStatus = "rejected", n(new Q({
  12351. code: "AUTH_FAILED",
  12352. message: "获取accessToken失败"
  12353. })));
  12354. });
  12355. }, function (e) {
  12356. return _this4._getAccessTokenPromiseStatus = "rejected", Promise.reject(e);
  12357. }), this._getAccessTokenPromise;
  12358. }
  12359. }, {
  12360. key: "authorize",
  12361. value: function authorize() {
  12362. this.getAccessToken();
  12363. }
  12364. }, {
  12365. key: "callFunction",
  12366. value: function callFunction(e) {
  12367. var t = {
  12368. method: "serverless.function.runtime.invoke",
  12369. params: JSON.stringify({
  12370. functionTarget: e.name,
  12371. functionArgs: e.data || {}
  12372. })
  12373. };
  12374. return this.request(this.setupRequest(t));
  12375. }
  12376. }, {
  12377. key: "getOSSUploadOptionsFromPath",
  12378. value: function getOSSUploadOptionsFromPath(e) {
  12379. var t = {
  12380. method: "serverless.file.resource.generateProximalSign",
  12381. params: JSON.stringify(e)
  12382. };
  12383. return this.request(this.setupRequest(t));
  12384. }
  12385. }, {
  12386. key: "uploadFileToOSS",
  12387. value: function uploadFileToOSS(_ref2) {
  12388. var _this5 = this;
  12389. var e = _ref2.url,
  12390. t = _ref2.formData,
  12391. n = _ref2.name,
  12392. s = _ref2.filePath,
  12393. r = _ref2.fileType,
  12394. i = _ref2.onUploadProgress;
  12395. return new Promise(function (o, a) {
  12396. var c = _this5.adapter.uploadFile({
  12397. url: e,
  12398. formData: t,
  12399. name: n,
  12400. filePath: s,
  12401. fileType: r,
  12402. header: {
  12403. "X-OSS-server-side-encrpytion": "AES256"
  12404. },
  12405. success: function success(e) {
  12406. e && e.statusCode < 400 ? o(e) : a(new Q({
  12407. code: "UPLOAD_FAILED",
  12408. message: "文件上传失败"
  12409. }));
  12410. },
  12411. fail: function fail(e) {
  12412. a(new Q({
  12413. code: e.code || "UPLOAD_FAILED",
  12414. message: e.message || e.errMsg || "文件上传失败"
  12415. }));
  12416. }
  12417. });
  12418. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  12419. i({
  12420. loaded: e.totalBytesSent,
  12421. total: e.totalBytesExpectedToSend
  12422. });
  12423. });
  12424. });
  12425. }
  12426. }, {
  12427. key: "reportOSSUpload",
  12428. value: function reportOSSUpload(e) {
  12429. var t = {
  12430. method: "serverless.file.resource.report",
  12431. params: JSON.stringify(e)
  12432. };
  12433. return this.request(this.setupRequest(t));
  12434. }
  12435. }, {
  12436. key: "uploadFile",
  12437. value: function () {
  12438. var _uploadFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref3) {
  12439. var e, t, _ref3$fileType, n, s, r, i, o, a, c, u, l, h, f, p, g, m, y, _e7, _;
  12440. return _regenerator.default.wrap(function _callee$(_context) {
  12441. while (1) {
  12442. switch (_context.prev = _context.next) {
  12443. case 0:
  12444. e = _ref3.filePath, t = _ref3.cloudPath, _ref3$fileType = _ref3.fileType, n = _ref3$fileType === void 0 ? "image" : _ref3$fileType, s = _ref3.onUploadProgress, r = _ref3.config;
  12445. if (!("string" !== d(t))) {
  12446. _context.next = 3;
  12447. break;
  12448. }
  12449. throw new Q({
  12450. code: "INVALID_PARAM",
  12451. message: "cloudPath必须为字符串类型"
  12452. });
  12453. case 3:
  12454. if (t = t.trim()) {
  12455. _context.next = 5;
  12456. break;
  12457. }
  12458. throw new Q({
  12459. code: "CLOUDPATH_REQUIRED",
  12460. message: "cloudPath不可为空"
  12461. });
  12462. case 5:
  12463. if (!/:\/\//.test(t)) {
  12464. _context.next = 7;
  12465. break;
  12466. }
  12467. throw new Q({
  12468. code: "INVALID_PARAM",
  12469. message: "cloudPath不合法"
  12470. });
  12471. case 7:
  12472. i = r && r.envType || this.config.envType;
  12473. _context.next = 10;
  12474. return this.getOSSUploadOptionsFromPath({
  12475. env: i,
  12476. filename: t
  12477. });
  12478. case 10:
  12479. o = _context.sent.result;
  12480. a = "https://" + o.cdnDomain + "/" + o.ossPath;
  12481. c = o.securityToken;
  12482. u = o.accessKeyId;
  12483. l = o.signature;
  12484. h = o.host;
  12485. f = o.ossPath;
  12486. p = o.id;
  12487. g = o.policy;
  12488. m = o.ossCallbackUrl;
  12489. y = {
  12490. "Cache-Control": "max-age=2592000",
  12491. "Content-Disposition": "attachment",
  12492. OSSAccessKeyId: u,
  12493. Signature: l,
  12494. host: h,
  12495. id: p,
  12496. key: f,
  12497. policy: g,
  12498. success_action_status: 200
  12499. };
  12500. if (c && (y["x-oss-security-token"] = c), m) {
  12501. _e7 = JSON.stringify({
  12502. callbackUrl: m,
  12503. callbackBody: JSON.stringify({
  12504. fileId: p,
  12505. spaceId: this.config.spaceId
  12506. }),
  12507. callbackBodyType: "application/json"
  12508. });
  12509. y.callback = ae.toBase64(_e7);
  12510. }
  12511. _ = {
  12512. url: "https://" + o.host,
  12513. formData: y,
  12514. fileName: "file",
  12515. name: "file",
  12516. filePath: e,
  12517. fileType: n
  12518. };
  12519. _context.next = 25;
  12520. return this.uploadFileToOSS(Object.assign({}, _, {
  12521. onUploadProgress: s
  12522. }));
  12523. case 25:
  12524. if (!m) {
  12525. _context.next = 27;
  12526. break;
  12527. }
  12528. return _context.abrupt("return", {
  12529. success: !0,
  12530. filePath: e,
  12531. fileID: a
  12532. });
  12533. case 27:
  12534. _context.next = 29;
  12535. return this.reportOSSUpload({
  12536. id: p
  12537. });
  12538. case 29:
  12539. if (!_context.sent.success) {
  12540. _context.next = 31;
  12541. break;
  12542. }
  12543. return _context.abrupt("return", {
  12544. success: !0,
  12545. filePath: e,
  12546. fileID: a
  12547. });
  12548. case 31:
  12549. throw new Q({
  12550. code: "UPLOAD_FAILED",
  12551. message: "文件上传失败"
  12552. });
  12553. case 32:
  12554. case "end":
  12555. return _context.stop();
  12556. }
  12557. }
  12558. }, _callee, this);
  12559. }));
  12560. function uploadFile(_x) {
  12561. return _uploadFile.apply(this, arguments);
  12562. }
  12563. return uploadFile;
  12564. }()
  12565. }, {
  12566. key: "getTempFileURL",
  12567. value: function getTempFileURL() {
  12568. var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  12569. e = _ref4.fileList;
  12570. return new Promise(function (t, n) {
  12571. Array.isArray(e) && 0 !== e.length || n(new Q({
  12572. code: "INVALID_PARAM",
  12573. message: "fileList的元素必须是非空的字符串"
  12574. })), t({
  12575. fileList: e.map(function (e) {
  12576. return {
  12577. fileID: e,
  12578. tempFileURL: e
  12579. };
  12580. })
  12581. });
  12582. });
  12583. }
  12584. }, {
  12585. key: "getFileInfo",
  12586. value: function () {
  12587. var _getFileInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
  12588. var _ref5,
  12589. e,
  12590. t,
  12591. _args2 = arguments;
  12592. return _regenerator.default.wrap(function _callee2$(_context2) {
  12593. while (1) {
  12594. switch (_context2.prev = _context2.next) {
  12595. case 0:
  12596. _ref5 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, e = _ref5.fileList;
  12597. if (!(!Array.isArray(e) || 0 === e.length)) {
  12598. _context2.next = 3;
  12599. break;
  12600. }
  12601. throw new Q({
  12602. code: "INVALID_PARAM",
  12603. message: "fileList的元素必须是非空的字符串"
  12604. });
  12605. case 3:
  12606. t = {
  12607. method: "serverless.file.resource.info",
  12608. params: JSON.stringify({
  12609. id: e.map(function (e) {
  12610. return e.split("?")[0];
  12611. }).join(",")
  12612. })
  12613. };
  12614. _context2.next = 6;
  12615. return this.request(this.setupRequest(t));
  12616. case 6:
  12617. _context2.t0 = _context2.sent.result;
  12618. return _context2.abrupt("return", {
  12619. fileList: _context2.t0
  12620. });
  12621. case 8:
  12622. case "end":
  12623. return _context2.stop();
  12624. }
  12625. }
  12626. }, _callee2, this);
  12627. }));
  12628. function getFileInfo() {
  12629. return _getFileInfo.apply(this, arguments);
  12630. }
  12631. return getFileInfo;
  12632. }()
  12633. }]);
  12634. return le;
  12635. }();
  12636. var he = {
  12637. init: function init(e) {
  12638. var t = new le(e),
  12639. n = {
  12640. signInAnonymously: function signInAnonymously() {
  12641. return t.authorize();
  12642. },
  12643. getLoginState: function getLoginState() {
  12644. return Promise.resolve(!1);
  12645. }
  12646. };
  12647. return t.auth = function () {
  12648. return n;
  12649. }, t.customAuth = t.auth, t;
  12650. }
  12651. };
  12652. var de = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
  12653. var fe;
  12654. !function (e) {
  12655. e.local = "local", e.none = "none", e.session = "session";
  12656. }(fe || (fe = {}));
  12657. var pe = function pe() {};
  12658. var ge = function ge() {
  12659. var e;
  12660. if (!Promise) {
  12661. e = function e() {}, e.promise = {};
  12662. var _t3 = function _t3() {
  12663. throw new Q({
  12664. message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'
  12665. });
  12666. };
  12667. return Object.defineProperty(e.promise, "then", {
  12668. get: _t3
  12669. }), Object.defineProperty(e.promise, "catch", {
  12670. get: _t3
  12671. }), e;
  12672. }
  12673. var t = new Promise(function (t, n) {
  12674. e = function e(_e8, s) {
  12675. return _e8 ? n(_e8) : t(s);
  12676. };
  12677. });
  12678. return e.promise = t, e;
  12679. };
  12680. function me(e) {
  12681. return void 0 === e;
  12682. }
  12683. function ye(e) {
  12684. return "[object Null]" === Object.prototype.toString.call(e);
  12685. }
  12686. var _e;
  12687. function we(e) {
  12688. var t = (n = e, "[object Array]" === Object.prototype.toString.call(n) ? e : [e]);
  12689. var n;
  12690. var _iterator = _createForOfIteratorHelper(t),
  12691. _step;
  12692. try {
  12693. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  12694. var _e9 = _step.value;
  12695. var _t4 = _e9.isMatch,
  12696. _n4 = _e9.genAdapter,
  12697. _s4 = _e9.runtime;
  12698. if (_t4()) return {
  12699. adapter: _n4(),
  12700. runtime: _s4
  12701. };
  12702. }
  12703. } catch (err) {
  12704. _iterator.e(err);
  12705. } finally {
  12706. _iterator.f();
  12707. }
  12708. }
  12709. !function (e) {
  12710. e.WEB = "web", e.WX_MP = "wx_mp";
  12711. }(_e || (_e = {}));
  12712. var ve = {
  12713. adapter: null,
  12714. runtime: void 0
  12715. },
  12716. Se = ["anonymousUuidKey"];
  12717. var ke = /*#__PURE__*/function (_pe) {
  12718. (0, _inherits2.default)(ke, _pe);
  12719. var _super2 = _createSuper(ke);
  12720. function ke() {
  12721. var _this6;
  12722. (0, _classCallCheck2.default)(this, ke);
  12723. _this6 = _super2.call(this), ve.adapter.root.tcbObject || (ve.adapter.root.tcbObject = {});
  12724. return _this6;
  12725. }
  12726. (0, _createClass2.default)(ke, [{
  12727. key: "setItem",
  12728. value: function setItem(e, t) {
  12729. ve.adapter.root.tcbObject[e] = t;
  12730. }
  12731. }, {
  12732. key: "getItem",
  12733. value: function getItem(e) {
  12734. return ve.adapter.root.tcbObject[e];
  12735. }
  12736. }, {
  12737. key: "removeItem",
  12738. value: function removeItem(e) {
  12739. delete ve.adapter.root.tcbObject[e];
  12740. }
  12741. }, {
  12742. key: "clear",
  12743. value: function clear() {
  12744. delete ve.adapter.root.tcbObject;
  12745. }
  12746. }]);
  12747. return ke;
  12748. }(pe);
  12749. function Ie(e, t) {
  12750. switch (e) {
  12751. case "local":
  12752. return t.localStorage || new ke();
  12753. case "none":
  12754. return new ke();
  12755. default:
  12756. return t.sessionStorage || new ke();
  12757. }
  12758. }
  12759. var be = /*#__PURE__*/function () {
  12760. function be(e) {
  12761. (0, _classCallCheck2.default)(this, be);
  12762. if (!this._storage) {
  12763. this._persistence = ve.adapter.primaryStorage || e.persistence, this._storage = Ie(this._persistence, ve.adapter);
  12764. var _t5 = "access_token_".concat(e.env),
  12765. _n5 = "access_token_expire_".concat(e.env),
  12766. _s5 = "refresh_token_".concat(e.env),
  12767. _r = "anonymous_uuid_".concat(e.env),
  12768. _i = "login_type_".concat(e.env),
  12769. _o = "user_info_".concat(e.env);
  12770. this.keys = {
  12771. accessTokenKey: _t5,
  12772. accessTokenExpireKey: _n5,
  12773. refreshTokenKey: _s5,
  12774. anonymousUuidKey: _r,
  12775. loginTypeKey: _i,
  12776. userInfoKey: _o
  12777. };
  12778. }
  12779. }
  12780. (0, _createClass2.default)(be, [{
  12781. key: "updatePersistence",
  12782. value: function updatePersistence(e) {
  12783. if (e === this._persistence) return;
  12784. var t = "local" === this._persistence;
  12785. this._persistence = e;
  12786. var n = Ie(e, ve.adapter);
  12787. for (var _e10 in this.keys) {
  12788. var _s6 = this.keys[_e10];
  12789. if (t && Se.includes(_e10)) continue;
  12790. var _r2 = this._storage.getItem(_s6);
  12791. me(_r2) || ye(_r2) || (n.setItem(_s6, _r2), this._storage.removeItem(_s6));
  12792. }
  12793. this._storage = n;
  12794. }
  12795. }, {
  12796. key: "setStore",
  12797. value: function setStore(e, t, n) {
  12798. if (!this._storage) return;
  12799. var s = {
  12800. version: n || "localCachev1",
  12801. content: t
  12802. },
  12803. r = JSON.stringify(s);
  12804. try {
  12805. this._storage.setItem(e, r);
  12806. } catch (e) {
  12807. throw e;
  12808. }
  12809. }
  12810. }, {
  12811. key: "getStore",
  12812. value: function getStore(e, t) {
  12813. try {
  12814. if (!this._storage) return;
  12815. } catch (e) {
  12816. return "";
  12817. }
  12818. t = t || "localCachev1";
  12819. var n = this._storage.getItem(e);
  12820. if (!n) return "";
  12821. if (n.indexOf(t) >= 0) {
  12822. return JSON.parse(n).content;
  12823. }
  12824. return "";
  12825. }
  12826. }, {
  12827. key: "removeStore",
  12828. value: function removeStore(e) {
  12829. this._storage.removeItem(e);
  12830. }
  12831. }]);
  12832. return be;
  12833. }();
  12834. var Te = {},
  12835. Ae = {};
  12836. function Ce(e) {
  12837. return Te[e];
  12838. }
  12839. var Pe = /*#__PURE__*/(0, _createClass2.default)(function Pe(e, t) {
  12840. (0, _classCallCheck2.default)(this, Pe);
  12841. this.data = t || null, this.name = e;
  12842. });
  12843. var Ee = /*#__PURE__*/function (_Pe) {
  12844. (0, _inherits2.default)(Ee, _Pe);
  12845. var _super3 = _createSuper(Ee);
  12846. function Ee(e, t) {
  12847. var _this7;
  12848. (0, _classCallCheck2.default)(this, Ee);
  12849. _this7 = _super3.call(this, "error", {
  12850. error: e,
  12851. data: t
  12852. }), _this7.error = e;
  12853. return _this7;
  12854. }
  12855. return (0, _createClass2.default)(Ee);
  12856. }(Pe);
  12857. var Oe = new ( /*#__PURE__*/function () {
  12858. function _class() {
  12859. (0, _classCallCheck2.default)(this, _class);
  12860. this._listeners = {};
  12861. }
  12862. (0, _createClass2.default)(_class, [{
  12863. key: "on",
  12864. value: function on(e, t) {
  12865. return function (e, t, n) {
  12866. n[e] = n[e] || [], n[e].push(t);
  12867. }(e, t, this._listeners), this;
  12868. }
  12869. }, {
  12870. key: "off",
  12871. value: function off(e, t) {
  12872. return function (e, t, n) {
  12873. if (n && n[e]) {
  12874. var _s7 = n[e].indexOf(t);
  12875. -1 !== _s7 && n[e].splice(_s7, 1);
  12876. }
  12877. }(e, t, this._listeners), this;
  12878. }
  12879. }, {
  12880. key: "fire",
  12881. value: function fire(e, t) {
  12882. if (e instanceof Ee) return console.error(e.error), this;
  12883. var n = "string" == typeof e ? new Pe(e, t || {}) : e;
  12884. var s = n.name;
  12885. if (this._listens(s)) {
  12886. n.target = this;
  12887. var _e11 = this._listeners[s] ? (0, _toConsumableArray2.default)(this._listeners[s]) : [];
  12888. var _iterator2 = _createForOfIteratorHelper(_e11),
  12889. _step2;
  12890. try {
  12891. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  12892. var _t6 = _step2.value;
  12893. _t6.call(this, n);
  12894. }
  12895. } catch (err) {
  12896. _iterator2.e(err);
  12897. } finally {
  12898. _iterator2.f();
  12899. }
  12900. }
  12901. return this;
  12902. }
  12903. }, {
  12904. key: "_listens",
  12905. value: function _listens(e) {
  12906. return this._listeners[e] && this._listeners[e].length > 0;
  12907. }
  12908. }]);
  12909. return _class;
  12910. }())();
  12911. function xe(e, t) {
  12912. Oe.on(e, t);
  12913. }
  12914. function Ue(e) {
  12915. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  12916. Oe.fire(e, t);
  12917. }
  12918. function Re(e, t) {
  12919. Oe.off(e, t);
  12920. }
  12921. var Le = "loginStateChanged",
  12922. Ne = "loginStateExpire",
  12923. De = "loginTypeChanged",
  12924. Fe = "anonymousConverted",
  12925. qe = "refreshAccessToken";
  12926. var Ke;
  12927. !function (e) {
  12928. e.ANONYMOUS = "ANONYMOUS", e.WECHAT = "WECHAT", e.WECHAT_PUBLIC = "WECHAT-PUBLIC", e.WECHAT_OPEN = "WECHAT-OPEN", e.CUSTOM = "CUSTOM", e.EMAIL = "EMAIL", e.USERNAME = "USERNAME", e.NULL = "NULL";
  12929. }(Ke || (Ke = {}));
  12930. var Me = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"],
  12931. je = {
  12932. "X-SDK-Version": "1.3.5"
  12933. };
  12934. function Be(e, t, n) {
  12935. var s = e[t];
  12936. e[t] = function (t) {
  12937. var r = {},
  12938. i = {};
  12939. n.forEach(function (n) {
  12940. var _n$call = n.call(e, t),
  12941. s = _n$call.data,
  12942. o = _n$call.headers;
  12943. Object.assign(r, s), Object.assign(i, o);
  12944. });
  12945. var o = t.data;
  12946. return o && function () {
  12947. var e;
  12948. if (e = o, "[object FormData]" !== Object.prototype.toString.call(e)) t.data = _objectSpread(_objectSpread({}, o), r);else for (var _e12 in r) {
  12949. o.append(_e12, r[_e12]);
  12950. }
  12951. }(), t.headers = _objectSpread(_objectSpread({}, t.headers || {}), i), s.call(e, t);
  12952. };
  12953. }
  12954. function $e() {
  12955. var e = Math.random().toString(16).slice(2);
  12956. return {
  12957. data: {
  12958. seqId: e
  12959. },
  12960. headers: _objectSpread(_objectSpread({}, je), {}, {
  12961. "x-seqid": e
  12962. })
  12963. };
  12964. }
  12965. var We = /*#__PURE__*/function () {
  12966. function We() {
  12967. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  12968. (0, _classCallCheck2.default)(this, We);
  12969. var t;
  12970. this.config = e, this._reqClass = new ve.adapter.reqClass({
  12971. timeout: this.config.timeout,
  12972. timeoutMsg: "\u8BF7\u6C42\u5728".concat(this.config.timeout / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD"),
  12973. restrictedMethods: ["post"]
  12974. }), this._cache = Ce(this.config.env), this._localCache = (t = this.config.env, Ae[t]), Be(this._reqClass, "post", [$e]), Be(this._reqClass, "upload", [$e]), Be(this._reqClass, "download", [$e]);
  12975. }
  12976. (0, _createClass2.default)(We, [{
  12977. key: "post",
  12978. value: function () {
  12979. var _post = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(e) {
  12980. return _regenerator.default.wrap(function _callee3$(_context3) {
  12981. while (1) {
  12982. switch (_context3.prev = _context3.next) {
  12983. case 0:
  12984. _context3.next = 2;
  12985. return this._reqClass.post(e);
  12986. case 2:
  12987. return _context3.abrupt("return", _context3.sent);
  12988. case 3:
  12989. case "end":
  12990. return _context3.stop();
  12991. }
  12992. }
  12993. }, _callee3, this);
  12994. }));
  12995. function post(_x2) {
  12996. return _post.apply(this, arguments);
  12997. }
  12998. return post;
  12999. }()
  13000. }, {
  13001. key: "upload",
  13002. value: function () {
  13003. var _upload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(e) {
  13004. return _regenerator.default.wrap(function _callee4$(_context4) {
  13005. while (1) {
  13006. switch (_context4.prev = _context4.next) {
  13007. case 0:
  13008. _context4.next = 2;
  13009. return this._reqClass.upload(e);
  13010. case 2:
  13011. return _context4.abrupt("return", _context4.sent);
  13012. case 3:
  13013. case "end":
  13014. return _context4.stop();
  13015. }
  13016. }
  13017. }, _callee4, this);
  13018. }));
  13019. function upload(_x3) {
  13020. return _upload.apply(this, arguments);
  13021. }
  13022. return upload;
  13023. }()
  13024. }, {
  13025. key: "download",
  13026. value: function () {
  13027. var _download = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(e) {
  13028. return _regenerator.default.wrap(function _callee5$(_context5) {
  13029. while (1) {
  13030. switch (_context5.prev = _context5.next) {
  13031. case 0:
  13032. _context5.next = 2;
  13033. return this._reqClass.download(e);
  13034. case 2:
  13035. return _context5.abrupt("return", _context5.sent);
  13036. case 3:
  13037. case "end":
  13038. return _context5.stop();
  13039. }
  13040. }
  13041. }, _callee5, this);
  13042. }));
  13043. function download(_x4) {
  13044. return _download.apply(this, arguments);
  13045. }
  13046. return download;
  13047. }()
  13048. }, {
  13049. key: "refreshAccessToken",
  13050. value: function () {
  13051. var _refreshAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
  13052. var e, t;
  13053. return _regenerator.default.wrap(function _callee6$(_context6) {
  13054. while (1) {
  13055. switch (_context6.prev = _context6.next) {
  13056. case 0:
  13057. this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
  13058. _context6.prev = 1;
  13059. _context6.next = 4;
  13060. return this._refreshAccessTokenPromise;
  13061. case 4:
  13062. e = _context6.sent;
  13063. _context6.next = 10;
  13064. break;
  13065. case 7:
  13066. _context6.prev = 7;
  13067. _context6.t0 = _context6["catch"](1);
  13068. t = _context6.t0;
  13069. case 10:
  13070. if (!(this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t)) {
  13071. _context6.next = 12;
  13072. break;
  13073. }
  13074. throw t;
  13075. case 12:
  13076. return _context6.abrupt("return", e);
  13077. case 13:
  13078. case "end":
  13079. return _context6.stop();
  13080. }
  13081. }
  13082. }, _callee6, this, [[1, 7]]);
  13083. }));
  13084. function refreshAccessToken() {
  13085. return _refreshAccessToken2.apply(this, arguments);
  13086. }
  13087. return refreshAccessToken;
  13088. }()
  13089. }, {
  13090. key: "_refreshAccessToken",
  13091. value: function () {
  13092. var _refreshAccessToken3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
  13093. var _this$_cache$keys, e, t, n, s, r, i, o, a, _e13, _e14, _t7, _s8;
  13094. return _regenerator.default.wrap(function _callee7$(_context7) {
  13095. while (1) {
  13096. switch (_context7.prev = _context7.next) {
  13097. case 0:
  13098. _this$_cache$keys = this._cache.keys, e = _this$_cache$keys.accessTokenKey, t = _this$_cache$keys.accessTokenExpireKey, n = _this$_cache$keys.refreshTokenKey, s = _this$_cache$keys.loginTypeKey, r = _this$_cache$keys.anonymousUuidKey;
  13099. this._cache.removeStore(e), this._cache.removeStore(t);
  13100. i = this._cache.getStore(n);
  13101. if (i) {
  13102. _context7.next = 5;
  13103. break;
  13104. }
  13105. throw new Q({
  13106. message: "未登录CloudBase"
  13107. });
  13108. case 5:
  13109. o = {
  13110. refresh_token: i
  13111. };
  13112. _context7.next = 8;
  13113. return this.request("auth.fetchAccessTokenWithRefreshToken", o);
  13114. case 8:
  13115. a = _context7.sent;
  13116. if (!a.data.code) {
  13117. _context7.next = 21;
  13118. break;
  13119. }
  13120. _e13 = a.data.code;
  13121. if (!("SIGN_PARAM_INVALID" === _e13 || "REFRESH_TOKEN_EXPIRED" === _e13 || "INVALID_REFRESH_TOKEN" === _e13)) {
  13122. _context7.next = 20;
  13123. break;
  13124. }
  13125. if (!(this._cache.getStore(s) === Ke.ANONYMOUS && "INVALID_REFRESH_TOKEN" === _e13)) {
  13126. _context7.next = 19;
  13127. break;
  13128. }
  13129. _e14 = this._cache.getStore(r);
  13130. _t7 = this._cache.getStore(n);
  13131. _context7.next = 17;
  13132. return this.send("auth.signInAnonymously", {
  13133. anonymous_uuid: _e14,
  13134. refresh_token: _t7
  13135. });
  13136. case 17:
  13137. _s8 = _context7.sent;
  13138. return _context7.abrupt("return", (this.setRefreshToken(_s8.refresh_token), this._refreshAccessToken()));
  13139. case 19:
  13140. Ue(Ne), this._cache.removeStore(n);
  13141. case 20:
  13142. throw new Q({
  13143. code: a.data.code,
  13144. message: "\u5237\u65B0access token\u5931\u8D25\uFF1A".concat(a.data.code)
  13145. });
  13146. case 21:
  13147. if (!a.data.access_token) {
  13148. _context7.next = 23;
  13149. break;
  13150. }
  13151. return _context7.abrupt("return", (Ue(qe), this._cache.setStore(e, a.data.access_token), this._cache.setStore(t, a.data.access_token_expire + Date.now()), {
  13152. accessToken: a.data.access_token,
  13153. accessTokenExpire: a.data.access_token_expire
  13154. }));
  13155. case 23:
  13156. a.data.refresh_token && (this._cache.removeStore(n), this._cache.setStore(n, a.data.refresh_token), this._refreshAccessToken());
  13157. case 24:
  13158. case "end":
  13159. return _context7.stop();
  13160. }
  13161. }
  13162. }, _callee7, this);
  13163. }));
  13164. function _refreshAccessToken() {
  13165. return _refreshAccessToken3.apply(this, arguments);
  13166. }
  13167. return _refreshAccessToken;
  13168. }()
  13169. }, {
  13170. key: "getAccessToken",
  13171. value: function () {
  13172. var _getAccessToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
  13173. var _this$_cache$keys2, e, t, n, s, r, i;
  13174. return _regenerator.default.wrap(function _callee8$(_context8) {
  13175. while (1) {
  13176. switch (_context8.prev = _context8.next) {
  13177. case 0:
  13178. _this$_cache$keys2 = this._cache.keys, e = _this$_cache$keys2.accessTokenKey, t = _this$_cache$keys2.accessTokenExpireKey, n = _this$_cache$keys2.refreshTokenKey;
  13179. if (this._cache.getStore(n)) {
  13180. _context8.next = 3;
  13181. break;
  13182. }
  13183. throw new Q({
  13184. message: "refresh token不存在,登录状态异常"
  13185. });
  13186. case 3:
  13187. s = this._cache.getStore(e), r = this._cache.getStore(t), i = !0;
  13188. _context8.t0 = this._shouldRefreshAccessTokenHook;
  13189. if (!_context8.t0) {
  13190. _context8.next = 9;
  13191. break;
  13192. }
  13193. _context8.next = 8;
  13194. return this._shouldRefreshAccessTokenHook(s, r);
  13195. case 8:
  13196. _context8.t0 = !_context8.sent;
  13197. case 9:
  13198. _context8.t1 = _context8.t0;
  13199. if (!_context8.t1) {
  13200. _context8.next = 12;
  13201. break;
  13202. }
  13203. i = !1;
  13204. case 12:
  13205. return _context8.abrupt("return", (!s || !r || r < Date.now()) && i ? this.refreshAccessToken() : {
  13206. accessToken: s,
  13207. accessTokenExpire: r
  13208. });
  13209. case 13:
  13210. case "end":
  13211. return _context8.stop();
  13212. }
  13213. }
  13214. }, _callee8, this);
  13215. }));
  13216. function getAccessToken() {
  13217. return _getAccessToken.apply(this, arguments);
  13218. }
  13219. return getAccessToken;
  13220. }()
  13221. }, {
  13222. key: "request",
  13223. value: function () {
  13224. var _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(e, t, n) {
  13225. var s, r, i, _e15, o, _e16, _e17, a, c, u, l, h, d, f, p, g;
  13226. return _regenerator.default.wrap(function _callee9$(_context9) {
  13227. while (1) {
  13228. switch (_context9.prev = _context9.next) {
  13229. case 0:
  13230. s = "x-tcb-trace_".concat(this.config.env);
  13231. r = "application/x-www-form-urlencoded";
  13232. i = _objectSpread({
  13233. action: e,
  13234. env: this.config.env,
  13235. dataVersion: "2019-08-16"
  13236. }, t);
  13237. if (!(-1 === Me.indexOf(e))) {
  13238. _context9.next = 10;
  13239. break;
  13240. }
  13241. _e15 = this._cache.keys.refreshTokenKey;
  13242. _context9.t0 = this._cache.getStore(_e15);
  13243. if (!_context9.t0) {
  13244. _context9.next = 10;
  13245. break;
  13246. }
  13247. _context9.next = 9;
  13248. return this.getAccessToken();
  13249. case 9:
  13250. i.access_token = _context9.sent.accessToken;
  13251. case 10:
  13252. if ("storage.uploadFile" === e) {
  13253. o = new FormData();
  13254. for (_e16 in o) {
  13255. o.hasOwnProperty(_e16) && void 0 !== o[_e16] && o.append(_e16, i[_e16]);
  13256. }
  13257. r = "multipart/form-data";
  13258. } else {
  13259. r = "application/json", o = {};
  13260. for (_e17 in i) {
  13261. void 0 !== i[_e17] && (o[_e17] = i[_e17]);
  13262. }
  13263. }
  13264. a = {
  13265. headers: {
  13266. "content-type": r
  13267. }
  13268. };
  13269. n && n.onUploadProgress && (a.onUploadProgress = n.onUploadProgress);
  13270. c = this._localCache.getStore(s);
  13271. c && (a.headers["X-TCB-Trace"] = c);
  13272. u = t.parse, l = t.inQuery, h = t.search;
  13273. d = {
  13274. env: this.config.env
  13275. };
  13276. u && (d.parse = !0), l && (d = _objectSpread(_objectSpread({}, l), d));
  13277. f = function (e, t) {
  13278. var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  13279. var s = /\?/.test(t);
  13280. var r = "";
  13281. for (var _e18 in n) {
  13282. "" === r ? !s && (t += "?") : r += "&", r += "".concat(_e18, "=").concat(encodeURIComponent(n[_e18]));
  13283. }
  13284. return /^http(s)?\:\/\//.test(t += r) ? t : "".concat(e).concat(t);
  13285. }(de, "//tcb-api.tencentcloudapi.com/web", d);
  13286. h && (f += h);
  13287. _context9.next = 22;
  13288. return this.post(_objectSpread({
  13289. url: f,
  13290. data: o
  13291. }, a));
  13292. case 22:
  13293. p = _context9.sent;
  13294. g = p.header && p.header["x-tcb-trace"];
  13295. if (!(g && this._localCache.setStore(s, g), 200 !== Number(p.status) && 200 !== Number(p.statusCode) || !p.data)) {
  13296. _context9.next = 26;
  13297. break;
  13298. }
  13299. throw new Q({
  13300. code: "NETWORK_ERROR",
  13301. message: "network request error"
  13302. });
  13303. case 26:
  13304. return _context9.abrupt("return", p);
  13305. case 27:
  13306. case "end":
  13307. return _context9.stop();
  13308. }
  13309. }
  13310. }, _callee9, this);
  13311. }));
  13312. function request(_x5, _x6, _x7) {
  13313. return _request.apply(this, arguments);
  13314. }
  13315. return request;
  13316. }()
  13317. }, {
  13318. key: "send",
  13319. value: function () {
  13320. var _send = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(e) {
  13321. var t,
  13322. n,
  13323. _n6,
  13324. _args10 = arguments;
  13325. return _regenerator.default.wrap(function _callee10$(_context10) {
  13326. while (1) {
  13327. switch (_context10.prev = _context10.next) {
  13328. case 0:
  13329. t = _args10.length > 1 && _args10[1] !== undefined ? _args10[1] : {};
  13330. _context10.next = 3;
  13331. return this.request(e, t, {
  13332. onUploadProgress: t.onUploadProgress
  13333. });
  13334. case 3:
  13335. n = _context10.sent;
  13336. if (!("ACCESS_TOKEN_EXPIRED" === n.data.code && -1 === Me.indexOf(e))) {
  13337. _context10.next = 13;
  13338. break;
  13339. }
  13340. _context10.next = 7;
  13341. return this.refreshAccessToken();
  13342. case 7:
  13343. _context10.next = 9;
  13344. return this.request(e, t, {
  13345. onUploadProgress: t.onUploadProgress
  13346. });
  13347. case 9:
  13348. _n6 = _context10.sent;
  13349. if (!_n6.data.code) {
  13350. _context10.next = 12;
  13351. break;
  13352. }
  13353. throw new Q({
  13354. code: _n6.data.code,
  13355. message: _n6.data.message
  13356. });
  13357. case 12:
  13358. return _context10.abrupt("return", _n6.data);
  13359. case 13:
  13360. if (!n.data.code) {
  13361. _context10.next = 15;
  13362. break;
  13363. }
  13364. throw new Q({
  13365. code: n.data.code,
  13366. message: n.data.message
  13367. });
  13368. case 15:
  13369. return _context10.abrupt("return", n.data);
  13370. case 16:
  13371. case "end":
  13372. return _context10.stop();
  13373. }
  13374. }
  13375. }, _callee10, this);
  13376. }));
  13377. function send(_x8) {
  13378. return _send.apply(this, arguments);
  13379. }
  13380. return send;
  13381. }()
  13382. }, {
  13383. key: "setRefreshToken",
  13384. value: function setRefreshToken(e) {
  13385. var _this$_cache$keys3 = this._cache.keys,
  13386. t = _this$_cache$keys3.accessTokenKey,
  13387. n = _this$_cache$keys3.accessTokenExpireKey,
  13388. s = _this$_cache$keys3.refreshTokenKey;
  13389. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  13390. }
  13391. }]);
  13392. return We;
  13393. }();
  13394. var ze = {};
  13395. function Je(e) {
  13396. return ze[e];
  13397. }
  13398. var He = /*#__PURE__*/function () {
  13399. function He(e) {
  13400. (0, _classCallCheck2.default)(this, He);
  13401. this.config = e, this._cache = Ce(e.env), this._request = Je(e.env);
  13402. }
  13403. (0, _createClass2.default)(He, [{
  13404. key: "setRefreshToken",
  13405. value: function setRefreshToken(e) {
  13406. var _this$_cache$keys4 = this._cache.keys,
  13407. t = _this$_cache$keys4.accessTokenKey,
  13408. n = _this$_cache$keys4.accessTokenExpireKey,
  13409. s = _this$_cache$keys4.refreshTokenKey;
  13410. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  13411. }
  13412. }, {
  13413. key: "setAccessToken",
  13414. value: function setAccessToken(e, t) {
  13415. var _this$_cache$keys5 = this._cache.keys,
  13416. n = _this$_cache$keys5.accessTokenKey,
  13417. s = _this$_cache$keys5.accessTokenExpireKey;
  13418. this._cache.setStore(n, e), this._cache.setStore(s, t);
  13419. }
  13420. }, {
  13421. key: "refreshUserInfo",
  13422. value: function () {
  13423. var _refreshUserInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
  13424. var _yield$this$_request$, e;
  13425. return _regenerator.default.wrap(function _callee11$(_context11) {
  13426. while (1) {
  13427. switch (_context11.prev = _context11.next) {
  13428. case 0:
  13429. _context11.next = 2;
  13430. return this._request.send("auth.getUserInfo", {});
  13431. case 2:
  13432. _yield$this$_request$ = _context11.sent;
  13433. e = _yield$this$_request$.data;
  13434. return _context11.abrupt("return", (this.setLocalUserInfo(e), e));
  13435. case 5:
  13436. case "end":
  13437. return _context11.stop();
  13438. }
  13439. }
  13440. }, _callee11, this);
  13441. }));
  13442. function refreshUserInfo() {
  13443. return _refreshUserInfo.apply(this, arguments);
  13444. }
  13445. return refreshUserInfo;
  13446. }()
  13447. }, {
  13448. key: "setLocalUserInfo",
  13449. value: function setLocalUserInfo(e) {
  13450. var t = this._cache.keys.userInfoKey;
  13451. this._cache.setStore(t, e);
  13452. }
  13453. }]);
  13454. return He;
  13455. }();
  13456. var Ge = /*#__PURE__*/function () {
  13457. function Ge(e) {
  13458. (0, _classCallCheck2.default)(this, Ge);
  13459. if (!e) throw new Q({
  13460. code: "PARAM_ERROR",
  13461. message: "envId is not defined"
  13462. });
  13463. this._envId = e, this._cache = Ce(this._envId), this._request = Je(this._envId), this.setUserInfo();
  13464. }
  13465. (0, _createClass2.default)(Ge, [{
  13466. key: "linkWithTicket",
  13467. value: function linkWithTicket(e) {
  13468. if ("string" != typeof e) throw new Q({
  13469. code: "PARAM_ERROR",
  13470. message: "ticket must be string"
  13471. });
  13472. return this._request.send("auth.linkWithTicket", {
  13473. ticket: e
  13474. });
  13475. }
  13476. }, {
  13477. key: "linkWithRedirect",
  13478. value: function linkWithRedirect(e) {
  13479. e.signInWithRedirect();
  13480. }
  13481. }, {
  13482. key: "updatePassword",
  13483. value: function updatePassword(e, t) {
  13484. return this._request.send("auth.updatePassword", {
  13485. oldPassword: t,
  13486. newPassword: e
  13487. });
  13488. }
  13489. }, {
  13490. key: "updateEmail",
  13491. value: function updateEmail(e) {
  13492. return this._request.send("auth.updateEmail", {
  13493. newEmail: e
  13494. });
  13495. }
  13496. }, {
  13497. key: "updateUsername",
  13498. value: function updateUsername(e) {
  13499. if ("string" != typeof e) throw new Q({
  13500. code: "PARAM_ERROR",
  13501. message: "username must be a string"
  13502. });
  13503. return this._request.send("auth.updateUsername", {
  13504. username: e
  13505. });
  13506. }
  13507. }, {
  13508. key: "getLinkedUidList",
  13509. value: function () {
  13510. var _getLinkedUidList = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
  13511. var _yield$this$_request$2, e, t, n;
  13512. return _regenerator.default.wrap(function _callee12$(_context12) {
  13513. while (1) {
  13514. switch (_context12.prev = _context12.next) {
  13515. case 0:
  13516. _context12.next = 2;
  13517. return this._request.send("auth.getLinkedUidList", {});
  13518. case 2:
  13519. _yield$this$_request$2 = _context12.sent;
  13520. e = _yield$this$_request$2.data;
  13521. t = !1;
  13522. n = e.users;
  13523. return _context12.abrupt("return", (n.forEach(function (e) {
  13524. e.wxOpenId && e.wxPublicId && (t = !0);
  13525. }), {
  13526. users: n,
  13527. hasPrimaryUid: t
  13528. }));
  13529. case 7:
  13530. case "end":
  13531. return _context12.stop();
  13532. }
  13533. }
  13534. }, _callee12, this);
  13535. }));
  13536. function getLinkedUidList() {
  13537. return _getLinkedUidList.apply(this, arguments);
  13538. }
  13539. return getLinkedUidList;
  13540. }()
  13541. }, {
  13542. key: "setPrimaryUid",
  13543. value: function setPrimaryUid(e) {
  13544. return this._request.send("auth.setPrimaryUid", {
  13545. uid: e
  13546. });
  13547. }
  13548. }, {
  13549. key: "unlink",
  13550. value: function unlink(e) {
  13551. return this._request.send("auth.unlink", {
  13552. platform: e
  13553. });
  13554. }
  13555. }, {
  13556. key: "update",
  13557. value: function () {
  13558. var _update = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(e) {
  13559. var t, n, s, r, i, o, _yield$this$_request$3, a;
  13560. return _regenerator.default.wrap(function _callee13$(_context13) {
  13561. while (1) {
  13562. switch (_context13.prev = _context13.next) {
  13563. case 0:
  13564. t = e.nickName;
  13565. n = e.gender;
  13566. s = e.avatarUrl;
  13567. r = e.province;
  13568. i = e.country;
  13569. o = e.city;
  13570. _context13.next = 8;
  13571. return this._request.send("auth.updateUserInfo", {
  13572. nickName: t,
  13573. gender: n,
  13574. avatarUrl: s,
  13575. province: r,
  13576. country: i,
  13577. city: o
  13578. });
  13579. case 8:
  13580. _yield$this$_request$3 = _context13.sent;
  13581. a = _yield$this$_request$3.data;
  13582. this.setLocalUserInfo(a);
  13583. case 11:
  13584. case "end":
  13585. return _context13.stop();
  13586. }
  13587. }
  13588. }, _callee13, this);
  13589. }));
  13590. function update(_x9) {
  13591. return _update.apply(this, arguments);
  13592. }
  13593. return update;
  13594. }()
  13595. }, {
  13596. key: "refresh",
  13597. value: function () {
  13598. var _refresh = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
  13599. var _yield$this$_request$4, e;
  13600. return _regenerator.default.wrap(function _callee14$(_context14) {
  13601. while (1) {
  13602. switch (_context14.prev = _context14.next) {
  13603. case 0:
  13604. _context14.next = 2;
  13605. return this._request.send("auth.getUserInfo", {});
  13606. case 2:
  13607. _yield$this$_request$4 = _context14.sent;
  13608. e = _yield$this$_request$4.data;
  13609. return _context14.abrupt("return", (this.setLocalUserInfo(e), e));
  13610. case 5:
  13611. case "end":
  13612. return _context14.stop();
  13613. }
  13614. }
  13615. }, _callee14, this);
  13616. }));
  13617. function refresh() {
  13618. return _refresh.apply(this, arguments);
  13619. }
  13620. return refresh;
  13621. }()
  13622. }, {
  13623. key: "setUserInfo",
  13624. value: function setUserInfo() {
  13625. var _this8 = this;
  13626. var e = this._cache.keys.userInfoKey,
  13627. t = this._cache.getStore(e);
  13628. ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach(function (e) {
  13629. _this8[e] = t[e];
  13630. }), this.location = {
  13631. country: t.country,
  13632. province: t.province,
  13633. city: t.city
  13634. };
  13635. }
  13636. }, {
  13637. key: "setLocalUserInfo",
  13638. value: function setLocalUserInfo(e) {
  13639. var t = this._cache.keys.userInfoKey;
  13640. this._cache.setStore(t, e), this.setUserInfo();
  13641. }
  13642. }]);
  13643. return Ge;
  13644. }();
  13645. var Ve = /*#__PURE__*/function () {
  13646. function Ve(e) {
  13647. (0, _classCallCheck2.default)(this, Ve);
  13648. if (!e) throw new Q({
  13649. code: "PARAM_ERROR",
  13650. message: "envId is not defined"
  13651. });
  13652. this._cache = Ce(e);
  13653. var _this$_cache$keys6 = this._cache.keys,
  13654. t = _this$_cache$keys6.refreshTokenKey,
  13655. n = _this$_cache$keys6.accessTokenKey,
  13656. s = _this$_cache$keys6.accessTokenExpireKey,
  13657. r = this._cache.getStore(t),
  13658. i = this._cache.getStore(n),
  13659. o = this._cache.getStore(s);
  13660. this.credential = {
  13661. refreshToken: r,
  13662. accessToken: i,
  13663. accessTokenExpire: o
  13664. }, this.user = new Ge(e);
  13665. }
  13666. (0, _createClass2.default)(Ve, [{
  13667. key: "isAnonymousAuth",
  13668. get: function get() {
  13669. return this.loginType === Ke.ANONYMOUS;
  13670. }
  13671. }, {
  13672. key: "isCustomAuth",
  13673. get: function get() {
  13674. return this.loginType === Ke.CUSTOM;
  13675. }
  13676. }, {
  13677. key: "isWeixinAuth",
  13678. get: function get() {
  13679. return this.loginType === Ke.WECHAT || this.loginType === Ke.WECHAT_OPEN || this.loginType === Ke.WECHAT_PUBLIC;
  13680. }
  13681. }, {
  13682. key: "loginType",
  13683. get: function get() {
  13684. return this._cache.getStore(this._cache.keys.loginTypeKey);
  13685. }
  13686. }]);
  13687. return Ve;
  13688. }();
  13689. var Ye = /*#__PURE__*/function (_He) {
  13690. (0, _inherits2.default)(Ye, _He);
  13691. var _super4 = _createSuper(Ye);
  13692. function Ye() {
  13693. (0, _classCallCheck2.default)(this, Ye);
  13694. return _super4.apply(this, arguments);
  13695. }
  13696. (0, _createClass2.default)(Ye, [{
  13697. key: "signIn",
  13698. value: function () {
  13699. var _signIn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
  13700. var _this$_cache$keys7, e, t, n, s, r, _e19;
  13701. return _regenerator.default.wrap(function _callee15$(_context15) {
  13702. while (1) {
  13703. switch (_context15.prev = _context15.next) {
  13704. case 0:
  13705. this._cache.updatePersistence("local");
  13706. _this$_cache$keys7 = this._cache.keys;
  13707. e = _this$_cache$keys7.anonymousUuidKey;
  13708. t = _this$_cache$keys7.refreshTokenKey;
  13709. n = this._cache.getStore(e) || void 0;
  13710. s = this._cache.getStore(t) || void 0;
  13711. _context15.next = 8;
  13712. return this._request.send("auth.signInAnonymously", {
  13713. anonymous_uuid: n,
  13714. refresh_token: s
  13715. });
  13716. case 8:
  13717. r = _context15.sent;
  13718. if (!(r.uuid && r.refresh_token)) {
  13719. _context15.next = 20;
  13720. break;
  13721. }
  13722. this._setAnonymousUUID(r.uuid);
  13723. this.setRefreshToken(r.refresh_token);
  13724. _context15.next = 14;
  13725. return this._request.refreshAccessToken();
  13726. case 14:
  13727. Ue(Le);
  13728. Ue(De, {
  13729. env: this.config.env,
  13730. loginType: Ke.ANONYMOUS,
  13731. persistence: "local"
  13732. });
  13733. _e19 = new Ve(this.config.env);
  13734. _context15.next = 19;
  13735. return _e19.user.refresh();
  13736. case 19:
  13737. return _context15.abrupt("return", _e19);
  13738. case 20:
  13739. throw new Q({
  13740. message: "匿名登录失败"
  13741. });
  13742. case 21:
  13743. case "end":
  13744. return _context15.stop();
  13745. }
  13746. }
  13747. }, _callee15, this);
  13748. }));
  13749. function signIn() {
  13750. return _signIn.apply(this, arguments);
  13751. }
  13752. return signIn;
  13753. }()
  13754. }, {
  13755. key: "linkAndRetrieveDataWithTicket",
  13756. value: function () {
  13757. var _linkAndRetrieveDataWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16(e) {
  13758. var _this$_cache$keys8, t, n, s, r, i;
  13759. return _regenerator.default.wrap(function _callee16$(_context16) {
  13760. while (1) {
  13761. switch (_context16.prev = _context16.next) {
  13762. case 0:
  13763. _this$_cache$keys8 = this._cache.keys;
  13764. t = _this$_cache$keys8.anonymousUuidKey;
  13765. n = _this$_cache$keys8.refreshTokenKey;
  13766. s = this._cache.getStore(t);
  13767. r = this._cache.getStore(n);
  13768. _context16.next = 7;
  13769. return this._request.send("auth.linkAndRetrieveDataWithTicket", {
  13770. anonymous_uuid: s,
  13771. refresh_token: r,
  13772. ticket: e
  13773. });
  13774. case 7:
  13775. i = _context16.sent;
  13776. if (!i.refresh_token) {
  13777. _context16.next = 16;
  13778. break;
  13779. }
  13780. this._clearAnonymousUUID();
  13781. this.setRefreshToken(i.refresh_token);
  13782. _context16.next = 13;
  13783. return this._request.refreshAccessToken();
  13784. case 13:
  13785. Ue(Fe, {
  13786. env: this.config.env
  13787. });
  13788. Ue(De, {
  13789. loginType: Ke.CUSTOM,
  13790. persistence: "local"
  13791. });
  13792. return _context16.abrupt("return", {
  13793. credential: {
  13794. refreshToken: i.refresh_token
  13795. }
  13796. });
  13797. case 16:
  13798. throw new Q({
  13799. message: "匿名转化失败"
  13800. });
  13801. case 17:
  13802. case "end":
  13803. return _context16.stop();
  13804. }
  13805. }
  13806. }, _callee16, this);
  13807. }));
  13808. function linkAndRetrieveDataWithTicket(_x10) {
  13809. return _linkAndRetrieveDataWithTicket.apply(this, arguments);
  13810. }
  13811. return linkAndRetrieveDataWithTicket;
  13812. }()
  13813. }, {
  13814. key: "_setAnonymousUUID",
  13815. value: function _setAnonymousUUID(e) {
  13816. var _this$_cache$keys9 = this._cache.keys,
  13817. t = _this$_cache$keys9.anonymousUuidKey,
  13818. n = _this$_cache$keys9.loginTypeKey;
  13819. this._cache.removeStore(t), this._cache.setStore(t, e), this._cache.setStore(n, Ke.ANONYMOUS);
  13820. }
  13821. }, {
  13822. key: "_clearAnonymousUUID",
  13823. value: function _clearAnonymousUUID() {
  13824. this._cache.removeStore(this._cache.keys.anonymousUuidKey);
  13825. }
  13826. }]);
  13827. return Ye;
  13828. }(He);
  13829. var Qe = /*#__PURE__*/function (_He2) {
  13830. (0, _inherits2.default)(Qe, _He2);
  13831. var _super5 = _createSuper(Qe);
  13832. function Qe() {
  13833. (0, _classCallCheck2.default)(this, Qe);
  13834. return _super5.apply(this, arguments);
  13835. }
  13836. (0, _createClass2.default)(Qe, [{
  13837. key: "signIn",
  13838. value: function () {
  13839. var _signIn2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(e) {
  13840. var t, n;
  13841. return _regenerator.default.wrap(function _callee17$(_context17) {
  13842. while (1) {
  13843. switch (_context17.prev = _context17.next) {
  13844. case 0:
  13845. if (!("string" != typeof e)) {
  13846. _context17.next = 2;
  13847. break;
  13848. }
  13849. throw new Q({
  13850. code: "PARAM_ERROR",
  13851. message: "ticket must be a string"
  13852. });
  13853. case 2:
  13854. t = this._cache.keys.refreshTokenKey;
  13855. _context17.next = 5;
  13856. return this._request.send("auth.signInWithTicket", {
  13857. ticket: e,
  13858. refresh_token: this._cache.getStore(t) || ""
  13859. });
  13860. case 5:
  13861. n = _context17.sent;
  13862. if (!n.refresh_token) {
  13863. _context17.next = 15;
  13864. break;
  13865. }
  13866. this.setRefreshToken(n.refresh_token);
  13867. _context17.next = 10;
  13868. return this._request.refreshAccessToken();
  13869. case 10:
  13870. Ue(Le);
  13871. Ue(De, {
  13872. env: this.config.env,
  13873. loginType: Ke.CUSTOM,
  13874. persistence: this.config.persistence
  13875. });
  13876. _context17.next = 14;
  13877. return this.refreshUserInfo();
  13878. case 14:
  13879. return _context17.abrupt("return", new Ve(this.config.env));
  13880. case 15:
  13881. throw new Q({
  13882. message: "自定义登录失败"
  13883. });
  13884. case 16:
  13885. case "end":
  13886. return _context17.stop();
  13887. }
  13888. }
  13889. }, _callee17, this);
  13890. }));
  13891. function signIn(_x11) {
  13892. return _signIn2.apply(this, arguments);
  13893. }
  13894. return signIn;
  13895. }()
  13896. }]);
  13897. return Qe;
  13898. }(He);
  13899. var Xe = /*#__PURE__*/function (_He3) {
  13900. (0, _inherits2.default)(Xe, _He3);
  13901. var _super6 = _createSuper(Xe);
  13902. function Xe() {
  13903. (0, _classCallCheck2.default)(this, Xe);
  13904. return _super6.apply(this, arguments);
  13905. }
  13906. (0, _createClass2.default)(Xe, [{
  13907. key: "signIn",
  13908. value: function () {
  13909. var _signIn3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(e, t) {
  13910. var n, s, r, i, o;
  13911. return _regenerator.default.wrap(function _callee18$(_context18) {
  13912. while (1) {
  13913. switch (_context18.prev = _context18.next) {
  13914. case 0:
  13915. if (!("string" != typeof e)) {
  13916. _context18.next = 2;
  13917. break;
  13918. }
  13919. throw new Q({
  13920. code: "PARAM_ERROR",
  13921. message: "email must be a string"
  13922. });
  13923. case 2:
  13924. n = this._cache.keys.refreshTokenKey;
  13925. _context18.next = 5;
  13926. return this._request.send("auth.signIn", {
  13927. loginType: "EMAIL",
  13928. email: e,
  13929. password: t,
  13930. refresh_token: this._cache.getStore(n) || ""
  13931. });
  13932. case 5:
  13933. s = _context18.sent;
  13934. r = s.refresh_token;
  13935. i = s.access_token;
  13936. o = s.access_token_expire;
  13937. if (!r) {
  13938. _context18.next = 22;
  13939. break;
  13940. }
  13941. this.setRefreshToken(r);
  13942. if (!(i && o)) {
  13943. _context18.next = 15;
  13944. break;
  13945. }
  13946. this.setAccessToken(i, o);
  13947. _context18.next = 17;
  13948. break;
  13949. case 15:
  13950. _context18.next = 17;
  13951. return this._request.refreshAccessToken();
  13952. case 17:
  13953. _context18.next = 19;
  13954. return this.refreshUserInfo();
  13955. case 19:
  13956. Ue(Le);
  13957. Ue(De, {
  13958. env: this.config.env,
  13959. loginType: Ke.EMAIL,
  13960. persistence: this.config.persistence
  13961. });
  13962. return _context18.abrupt("return", new Ve(this.config.env));
  13963. case 22:
  13964. throw s.code ? new Q({
  13965. code: s.code,
  13966. message: "\u90AE\u7BB1\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  13967. }) : new Q({
  13968. message: "邮箱登录失败"
  13969. });
  13970. case 23:
  13971. case "end":
  13972. return _context18.stop();
  13973. }
  13974. }
  13975. }, _callee18, this);
  13976. }));
  13977. function signIn(_x12, _x13) {
  13978. return _signIn3.apply(this, arguments);
  13979. }
  13980. return signIn;
  13981. }()
  13982. }, {
  13983. key: "activate",
  13984. value: function () {
  13985. var _activate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(e) {
  13986. return _regenerator.default.wrap(function _callee19$(_context19) {
  13987. while (1) {
  13988. switch (_context19.prev = _context19.next) {
  13989. case 0:
  13990. return _context19.abrupt("return", this._request.send("auth.activateEndUserMail", {
  13991. token: e
  13992. }));
  13993. case 1:
  13994. case "end":
  13995. return _context19.stop();
  13996. }
  13997. }
  13998. }, _callee19, this);
  13999. }));
  14000. function activate(_x14) {
  14001. return _activate.apply(this, arguments);
  14002. }
  14003. return activate;
  14004. }()
  14005. }, {
  14006. key: "resetPasswordWithToken",
  14007. value: function () {
  14008. var _resetPasswordWithToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(e, t) {
  14009. return _regenerator.default.wrap(function _callee20$(_context20) {
  14010. while (1) {
  14011. switch (_context20.prev = _context20.next) {
  14012. case 0:
  14013. return _context20.abrupt("return", this._request.send("auth.resetPasswordWithToken", {
  14014. token: e,
  14015. newPassword: t
  14016. }));
  14017. case 1:
  14018. case "end":
  14019. return _context20.stop();
  14020. }
  14021. }
  14022. }, _callee20, this);
  14023. }));
  14024. function resetPasswordWithToken(_x15, _x16) {
  14025. return _resetPasswordWithToken.apply(this, arguments);
  14026. }
  14027. return resetPasswordWithToken;
  14028. }()
  14029. }]);
  14030. return Xe;
  14031. }(He);
  14032. var Ze = /*#__PURE__*/function (_He4) {
  14033. (0, _inherits2.default)(Ze, _He4);
  14034. var _super7 = _createSuper(Ze);
  14035. function Ze() {
  14036. (0, _classCallCheck2.default)(this, Ze);
  14037. return _super7.apply(this, arguments);
  14038. }
  14039. (0, _createClass2.default)(Ze, [{
  14040. key: "signIn",
  14041. value: function () {
  14042. var _signIn4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(e, t) {
  14043. var n, s, r, i, o;
  14044. return _regenerator.default.wrap(function _callee21$(_context21) {
  14045. while (1) {
  14046. switch (_context21.prev = _context21.next) {
  14047. case 0:
  14048. if (!("string" != typeof e)) {
  14049. _context21.next = 2;
  14050. break;
  14051. }
  14052. throw new Q({
  14053. code: "PARAM_ERROR",
  14054. message: "username must be a string"
  14055. });
  14056. case 2:
  14057. "string" != typeof t && (t = "", console.warn("password is empty"));
  14058. n = this._cache.keys.refreshTokenKey;
  14059. _context21.next = 6;
  14060. return this._request.send("auth.signIn", {
  14061. loginType: Ke.USERNAME,
  14062. username: e,
  14063. password: t,
  14064. refresh_token: this._cache.getStore(n) || ""
  14065. });
  14066. case 6:
  14067. s = _context21.sent;
  14068. r = s.refresh_token;
  14069. i = s.access_token_expire;
  14070. o = s.access_token;
  14071. if (!r) {
  14072. _context21.next = 23;
  14073. break;
  14074. }
  14075. this.setRefreshToken(r);
  14076. if (!(o && i)) {
  14077. _context21.next = 16;
  14078. break;
  14079. }
  14080. this.setAccessToken(o, i);
  14081. _context21.next = 18;
  14082. break;
  14083. case 16:
  14084. _context21.next = 18;
  14085. return this._request.refreshAccessToken();
  14086. case 18:
  14087. _context21.next = 20;
  14088. return this.refreshUserInfo();
  14089. case 20:
  14090. Ue(Le);
  14091. Ue(De, {
  14092. env: this.config.env,
  14093. loginType: Ke.USERNAME,
  14094. persistence: this.config.persistence
  14095. });
  14096. return _context21.abrupt("return", new Ve(this.config.env));
  14097. case 23:
  14098. throw s.code ? new Q({
  14099. code: s.code,
  14100. message: "\u7528\u6237\u540D\u5BC6\u7801\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  14101. }) : new Q({
  14102. message: "用户名密码登录失败"
  14103. });
  14104. case 24:
  14105. case "end":
  14106. return _context21.stop();
  14107. }
  14108. }
  14109. }, _callee21, this);
  14110. }));
  14111. function signIn(_x17, _x18) {
  14112. return _signIn4.apply(this, arguments);
  14113. }
  14114. return signIn;
  14115. }()
  14116. }]);
  14117. return Ze;
  14118. }(He);
  14119. var et = /*#__PURE__*/function () {
  14120. function et(e) {
  14121. (0, _classCallCheck2.default)(this, et);
  14122. this.config = e, this._cache = Ce(e.env), this._request = Je(e.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), xe(De, this._onLoginTypeChanged);
  14123. }
  14124. (0, _createClass2.default)(et, [{
  14125. key: "currentUser",
  14126. get: function get() {
  14127. var e = this.hasLoginState();
  14128. return e && e.user || null;
  14129. }
  14130. }, {
  14131. key: "loginType",
  14132. get: function get() {
  14133. return this._cache.getStore(this._cache.keys.loginTypeKey);
  14134. }
  14135. }, {
  14136. key: "anonymousAuthProvider",
  14137. value: function anonymousAuthProvider() {
  14138. return new Ye(this.config);
  14139. }
  14140. }, {
  14141. key: "customAuthProvider",
  14142. value: function customAuthProvider() {
  14143. return new Qe(this.config);
  14144. }
  14145. }, {
  14146. key: "emailAuthProvider",
  14147. value: function emailAuthProvider() {
  14148. return new Xe(this.config);
  14149. }
  14150. }, {
  14151. key: "usernameAuthProvider",
  14152. value: function usernameAuthProvider() {
  14153. return new Ze(this.config);
  14154. }
  14155. }, {
  14156. key: "signInAnonymously",
  14157. value: function () {
  14158. var _signInAnonymously = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() {
  14159. return _regenerator.default.wrap(function _callee22$(_context22) {
  14160. while (1) {
  14161. switch (_context22.prev = _context22.next) {
  14162. case 0:
  14163. return _context22.abrupt("return", new Ye(this.config).signIn());
  14164. case 1:
  14165. case "end":
  14166. return _context22.stop();
  14167. }
  14168. }
  14169. }, _callee22, this);
  14170. }));
  14171. function signInAnonymously() {
  14172. return _signInAnonymously.apply(this, arguments);
  14173. }
  14174. return signInAnonymously;
  14175. }()
  14176. }, {
  14177. key: "signInWithEmailAndPassword",
  14178. value: function () {
  14179. var _signInWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23(e, t) {
  14180. return _regenerator.default.wrap(function _callee23$(_context23) {
  14181. while (1) {
  14182. switch (_context23.prev = _context23.next) {
  14183. case 0:
  14184. return _context23.abrupt("return", new Xe(this.config).signIn(e, t));
  14185. case 1:
  14186. case "end":
  14187. return _context23.stop();
  14188. }
  14189. }
  14190. }, _callee23, this);
  14191. }));
  14192. function signInWithEmailAndPassword(_x19, _x20) {
  14193. return _signInWithEmailAndPassword.apply(this, arguments);
  14194. }
  14195. return signInWithEmailAndPassword;
  14196. }()
  14197. }, {
  14198. key: "signInWithUsernameAndPassword",
  14199. value: function signInWithUsernameAndPassword(e, t) {
  14200. return new Ze(this.config).signIn(e, t);
  14201. }
  14202. }, {
  14203. key: "linkAndRetrieveDataWithTicket",
  14204. value: function () {
  14205. var _linkAndRetrieveDataWithTicket2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(e) {
  14206. return _regenerator.default.wrap(function _callee24$(_context24) {
  14207. while (1) {
  14208. switch (_context24.prev = _context24.next) {
  14209. case 0:
  14210. this._anonymousAuthProvider || (this._anonymousAuthProvider = new Ye(this.config)), xe(Fe, this._onAnonymousConverted);
  14211. _context24.next = 3;
  14212. return this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e);
  14213. case 3:
  14214. return _context24.abrupt("return", _context24.sent);
  14215. case 4:
  14216. case "end":
  14217. return _context24.stop();
  14218. }
  14219. }
  14220. }, _callee24, this);
  14221. }));
  14222. function linkAndRetrieveDataWithTicket(_x21) {
  14223. return _linkAndRetrieveDataWithTicket2.apply(this, arguments);
  14224. }
  14225. return linkAndRetrieveDataWithTicket;
  14226. }()
  14227. }, {
  14228. key: "signOut",
  14229. value: function () {
  14230. var _signOut = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25() {
  14231. var _this$_cache$keys10, e, t, n, s, r;
  14232. return _regenerator.default.wrap(function _callee25$(_context25) {
  14233. while (1) {
  14234. switch (_context25.prev = _context25.next) {
  14235. case 0:
  14236. if (!(this.loginType === Ke.ANONYMOUS)) {
  14237. _context25.next = 2;
  14238. break;
  14239. }
  14240. throw new Q({
  14241. message: "匿名用户不支持登出操作"
  14242. });
  14243. case 2:
  14244. _this$_cache$keys10 = this._cache.keys, e = _this$_cache$keys10.refreshTokenKey, t = _this$_cache$keys10.accessTokenKey, n = _this$_cache$keys10.accessTokenExpireKey, s = this._cache.getStore(e);
  14245. if (s) {
  14246. _context25.next = 5;
  14247. break;
  14248. }
  14249. return _context25.abrupt("return");
  14250. case 5:
  14251. _context25.next = 7;
  14252. return this._request.send("auth.logout", {
  14253. refresh_token: s
  14254. });
  14255. case 7:
  14256. r = _context25.sent;
  14257. return _context25.abrupt("return", (this._cache.removeStore(e), this._cache.removeStore(t), this._cache.removeStore(n), Ue(Le), Ue(De, {
  14258. env: this.config.env,
  14259. loginType: Ke.NULL,
  14260. persistence: this.config.persistence
  14261. }), r));
  14262. case 9:
  14263. case "end":
  14264. return _context25.stop();
  14265. }
  14266. }
  14267. }, _callee25, this);
  14268. }));
  14269. function signOut() {
  14270. return _signOut.apply(this, arguments);
  14271. }
  14272. return signOut;
  14273. }()
  14274. }, {
  14275. key: "signUpWithEmailAndPassword",
  14276. value: function () {
  14277. var _signUpWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26(e, t) {
  14278. return _regenerator.default.wrap(function _callee26$(_context26) {
  14279. while (1) {
  14280. switch (_context26.prev = _context26.next) {
  14281. case 0:
  14282. return _context26.abrupt("return", this._request.send("auth.signUpWithEmailAndPassword", {
  14283. email: e,
  14284. password: t
  14285. }));
  14286. case 1:
  14287. case "end":
  14288. return _context26.stop();
  14289. }
  14290. }
  14291. }, _callee26, this);
  14292. }));
  14293. function signUpWithEmailAndPassword(_x22, _x23) {
  14294. return _signUpWithEmailAndPassword.apply(this, arguments);
  14295. }
  14296. return signUpWithEmailAndPassword;
  14297. }()
  14298. }, {
  14299. key: "sendPasswordResetEmail",
  14300. value: function () {
  14301. var _sendPasswordResetEmail = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27(e) {
  14302. return _regenerator.default.wrap(function _callee27$(_context27) {
  14303. while (1) {
  14304. switch (_context27.prev = _context27.next) {
  14305. case 0:
  14306. return _context27.abrupt("return", this._request.send("auth.sendPasswordResetEmail", {
  14307. email: e
  14308. }));
  14309. case 1:
  14310. case "end":
  14311. return _context27.stop();
  14312. }
  14313. }
  14314. }, _callee27, this);
  14315. }));
  14316. function sendPasswordResetEmail(_x24) {
  14317. return _sendPasswordResetEmail.apply(this, arguments);
  14318. }
  14319. return sendPasswordResetEmail;
  14320. }()
  14321. }, {
  14322. key: "onLoginStateChanged",
  14323. value: function onLoginStateChanged(e) {
  14324. var _this9 = this;
  14325. xe(Le, function () {
  14326. var t = _this9.hasLoginState();
  14327. e.call(_this9, t);
  14328. });
  14329. var t = this.hasLoginState();
  14330. e.call(this, t);
  14331. }
  14332. }, {
  14333. key: "onLoginStateExpired",
  14334. value: function onLoginStateExpired(e) {
  14335. xe(Ne, e.bind(this));
  14336. }
  14337. }, {
  14338. key: "onAccessTokenRefreshed",
  14339. value: function onAccessTokenRefreshed(e) {
  14340. xe(qe, e.bind(this));
  14341. }
  14342. }, {
  14343. key: "onAnonymousConverted",
  14344. value: function onAnonymousConverted(e) {
  14345. xe(Fe, e.bind(this));
  14346. }
  14347. }, {
  14348. key: "onLoginTypeChanged",
  14349. value: function onLoginTypeChanged(e) {
  14350. var _this10 = this;
  14351. xe(De, function () {
  14352. var t = _this10.hasLoginState();
  14353. e.call(_this10, t);
  14354. });
  14355. }
  14356. }, {
  14357. key: "getAccessToken",
  14358. value: function () {
  14359. var _getAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28() {
  14360. return _regenerator.default.wrap(function _callee28$(_context28) {
  14361. while (1) {
  14362. switch (_context28.prev = _context28.next) {
  14363. case 0:
  14364. _context28.next = 2;
  14365. return this._request.getAccessToken();
  14366. case 2:
  14367. _context28.t0 = _context28.sent.accessToken;
  14368. _context28.t1 = this.config.env;
  14369. return _context28.abrupt("return", {
  14370. accessToken: _context28.t0,
  14371. env: _context28.t1
  14372. });
  14373. case 5:
  14374. case "end":
  14375. return _context28.stop();
  14376. }
  14377. }
  14378. }, _callee28, this);
  14379. }));
  14380. function getAccessToken() {
  14381. return _getAccessToken2.apply(this, arguments);
  14382. }
  14383. return getAccessToken;
  14384. }()
  14385. }, {
  14386. key: "hasLoginState",
  14387. value: function hasLoginState() {
  14388. var e = this._cache.keys.refreshTokenKey;
  14389. return this._cache.getStore(e) ? new Ve(this.config.env) : null;
  14390. }
  14391. }, {
  14392. key: "isUsernameRegistered",
  14393. value: function () {
  14394. var _isUsernameRegistered = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29(e) {
  14395. var _yield$this$_request$5, t;
  14396. return _regenerator.default.wrap(function _callee29$(_context29) {
  14397. while (1) {
  14398. switch (_context29.prev = _context29.next) {
  14399. case 0:
  14400. if (!("string" != typeof e)) {
  14401. _context29.next = 2;
  14402. break;
  14403. }
  14404. throw new Q({
  14405. code: "PARAM_ERROR",
  14406. message: "username must be a string"
  14407. });
  14408. case 2:
  14409. _context29.next = 4;
  14410. return this._request.send("auth.isUsernameRegistered", {
  14411. username: e
  14412. });
  14413. case 4:
  14414. _yield$this$_request$5 = _context29.sent;
  14415. t = _yield$this$_request$5.data;
  14416. return _context29.abrupt("return", t && t.isRegistered);
  14417. case 7:
  14418. case "end":
  14419. return _context29.stop();
  14420. }
  14421. }
  14422. }, _callee29, this);
  14423. }));
  14424. function isUsernameRegistered(_x25) {
  14425. return _isUsernameRegistered.apply(this, arguments);
  14426. }
  14427. return isUsernameRegistered;
  14428. }()
  14429. }, {
  14430. key: "getLoginState",
  14431. value: function getLoginState() {
  14432. return Promise.resolve(this.hasLoginState());
  14433. }
  14434. }, {
  14435. key: "signInWithTicket",
  14436. value: function () {
  14437. var _signInWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(e) {
  14438. return _regenerator.default.wrap(function _callee30$(_context30) {
  14439. while (1) {
  14440. switch (_context30.prev = _context30.next) {
  14441. case 0:
  14442. return _context30.abrupt("return", new Qe(this.config).signIn(e));
  14443. case 1:
  14444. case "end":
  14445. return _context30.stop();
  14446. }
  14447. }
  14448. }, _callee30, this);
  14449. }));
  14450. function signInWithTicket(_x26) {
  14451. return _signInWithTicket.apply(this, arguments);
  14452. }
  14453. return signInWithTicket;
  14454. }()
  14455. }, {
  14456. key: "shouldRefreshAccessToken",
  14457. value: function shouldRefreshAccessToken(e) {
  14458. this._request._shouldRefreshAccessTokenHook = e.bind(this);
  14459. }
  14460. }, {
  14461. key: "getUserInfo",
  14462. value: function getUserInfo() {
  14463. return this._request.send("auth.getUserInfo", {}).then(function (e) {
  14464. return e.code ? e : _objectSpread(_objectSpread({}, e.data), {}, {
  14465. requestId: e.seqId
  14466. });
  14467. });
  14468. }
  14469. }, {
  14470. key: "getAuthHeader",
  14471. value: function getAuthHeader() {
  14472. var _this$_cache$keys11 = this._cache.keys,
  14473. e = _this$_cache$keys11.refreshTokenKey,
  14474. t = _this$_cache$keys11.accessTokenKey,
  14475. n = this._cache.getStore(e);
  14476. return {
  14477. "x-cloudbase-credentials": this._cache.getStore(t) + "/@@/" + n
  14478. };
  14479. }
  14480. }, {
  14481. key: "_onAnonymousConverted",
  14482. value: function _onAnonymousConverted(e) {
  14483. var t = e.data.env;
  14484. t === this.config.env && this._cache.updatePersistence(this.config.persistence);
  14485. }
  14486. }, {
  14487. key: "_onLoginTypeChanged",
  14488. value: function _onLoginTypeChanged(e) {
  14489. var _e$data = e.data,
  14490. t = _e$data.loginType,
  14491. n = _e$data.persistence,
  14492. s = _e$data.env;
  14493. s === this.config.env && (this._cache.updatePersistence(n), this._cache.setStore(this._cache.keys.loginTypeKey, t));
  14494. }
  14495. }]);
  14496. return et;
  14497. }();
  14498. var tt = function tt(e, t) {
  14499. t = t || ge();
  14500. var n = Je(this.config.env),
  14501. s = e.cloudPath,
  14502. r = e.filePath,
  14503. i = e.onUploadProgress,
  14504. _e$fileType = e.fileType,
  14505. o = _e$fileType === void 0 ? "image" : _e$fileType;
  14506. return n.send("storage.getUploadMetadata", {
  14507. path: s
  14508. }).then(function (e) {
  14509. var _e$data2 = e.data,
  14510. a = _e$data2.url,
  14511. c = _e$data2.authorization,
  14512. u = _e$data2.token,
  14513. l = _e$data2.fileId,
  14514. h = _e$data2.cosFileId,
  14515. d = e.requestId,
  14516. f = {
  14517. key: s,
  14518. signature: c,
  14519. "x-cos-meta-fileid": h,
  14520. success_action_status: "201",
  14521. "x-cos-security-token": u
  14522. };
  14523. n.upload({
  14524. url: a,
  14525. data: f,
  14526. file: r,
  14527. name: s,
  14528. fileType: o,
  14529. onUploadProgress: i
  14530. }).then(function (e) {
  14531. 201 === e.statusCode ? t(null, {
  14532. fileID: l,
  14533. requestId: d
  14534. }) : t(new Q({
  14535. code: "STORAGE_REQUEST_FAIL",
  14536. message: "STORAGE_REQUEST_FAIL: ".concat(e.data)
  14537. }));
  14538. }).catch(function (e) {
  14539. t(e);
  14540. });
  14541. }).catch(function (e) {
  14542. t(e);
  14543. }), t.promise;
  14544. },
  14545. nt = function nt(e, t) {
  14546. t = t || ge();
  14547. var n = Je(this.config.env),
  14548. s = e.cloudPath;
  14549. return n.send("storage.getUploadMetadata", {
  14550. path: s
  14551. }).then(function (e) {
  14552. t(null, e);
  14553. }).catch(function (e) {
  14554. t(e);
  14555. }), t.promise;
  14556. },
  14557. st = function st(_ref6, t) {
  14558. var e = _ref6.fileList;
  14559. if (t = t || ge(), !e || !Array.isArray(e)) return {
  14560. code: "INVALID_PARAM",
  14561. message: "fileList必须是非空的数组"
  14562. };
  14563. var _iterator3 = _createForOfIteratorHelper(e),
  14564. _step3;
  14565. try {
  14566. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  14567. var _t8 = _step3.value;
  14568. if (!_t8 || "string" != typeof _t8) return {
  14569. code: "INVALID_PARAM",
  14570. message: "fileList的元素必须是非空的字符串"
  14571. };
  14572. }
  14573. } catch (err) {
  14574. _iterator3.e(err);
  14575. } finally {
  14576. _iterator3.f();
  14577. }
  14578. var n = {
  14579. fileid_list: e
  14580. };
  14581. return Je(this.config.env).send("storage.batchDeleteFile", n).then(function (e) {
  14582. e.code ? t(null, e) : t(null, {
  14583. fileList: e.data.delete_list,
  14584. requestId: e.requestId
  14585. });
  14586. }).catch(function (e) {
  14587. t(e);
  14588. }), t.promise;
  14589. },
  14590. rt = function rt(_ref7, t) {
  14591. var e = _ref7.fileList;
  14592. t = t || ge(), e && Array.isArray(e) || t(null, {
  14593. code: "INVALID_PARAM",
  14594. message: "fileList必须是非空的数组"
  14595. });
  14596. var n = [];
  14597. var _iterator4 = _createForOfIteratorHelper(e),
  14598. _step4;
  14599. try {
  14600. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  14601. var _s9 = _step4.value;
  14602. "object" == (0, _typeof2.default)(_s9) ? (_s9.hasOwnProperty("fileID") && _s9.hasOwnProperty("maxAge") || t(null, {
  14603. code: "INVALID_PARAM",
  14604. message: "fileList的元素必须是包含fileID和maxAge的对象"
  14605. }), n.push({
  14606. fileid: _s9.fileID,
  14607. max_age: _s9.maxAge
  14608. })) : "string" == typeof _s9 ? n.push({
  14609. fileid: _s9
  14610. }) : t(null, {
  14611. code: "INVALID_PARAM",
  14612. message: "fileList的元素必须是字符串"
  14613. });
  14614. }
  14615. } catch (err) {
  14616. _iterator4.e(err);
  14617. } finally {
  14618. _iterator4.f();
  14619. }
  14620. var s = {
  14621. file_list: n
  14622. };
  14623. return Je(this.config.env).send("storage.batchGetDownloadUrl", s).then(function (e) {
  14624. e.code ? t(null, e) : t(null, {
  14625. fileList: e.data.download_list,
  14626. requestId: e.requestId
  14627. });
  14628. }).catch(function (e) {
  14629. t(e);
  14630. }), t.promise;
  14631. },
  14632. it = /*#__PURE__*/function () {
  14633. var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(_ref8, t) {
  14634. var e, n, s, r;
  14635. return _regenerator.default.wrap(function _callee31$(_context31) {
  14636. while (1) {
  14637. switch (_context31.prev = _context31.next) {
  14638. case 0:
  14639. e = _ref8.fileID;
  14640. _context31.next = 3;
  14641. return rt.call(this, {
  14642. fileList: [{
  14643. fileID: e,
  14644. maxAge: 600
  14645. }]
  14646. });
  14647. case 3:
  14648. n = _context31.sent.fileList[0];
  14649. if (!("SUCCESS" !== n.code)) {
  14650. _context31.next = 6;
  14651. break;
  14652. }
  14653. return _context31.abrupt("return", t ? t(n) : new Promise(function (e) {
  14654. e(n);
  14655. }));
  14656. case 6:
  14657. s = Je(this.config.env);
  14658. r = n.download_url;
  14659. if (!(r = encodeURI(r), !t)) {
  14660. _context31.next = 10;
  14661. break;
  14662. }
  14663. return _context31.abrupt("return", s.download({
  14664. url: r
  14665. }));
  14666. case 10:
  14667. _context31.t0 = t;
  14668. _context31.next = 13;
  14669. return s.download({
  14670. url: r
  14671. });
  14672. case 13:
  14673. _context31.t1 = _context31.sent;
  14674. (0, _context31.t0)(_context31.t1);
  14675. case 15:
  14676. case "end":
  14677. return _context31.stop();
  14678. }
  14679. }
  14680. }, _callee31, this);
  14681. }));
  14682. return function it(_x27, _x28) {
  14683. return _ref9.apply(this, arguments);
  14684. };
  14685. }(),
  14686. ot = function ot(_ref10, i) {
  14687. var e = _ref10.name,
  14688. t = _ref10.data,
  14689. n = _ref10.query,
  14690. s = _ref10.parse,
  14691. r = _ref10.search;
  14692. var o = i || ge();
  14693. var a;
  14694. try {
  14695. a = t ? JSON.stringify(t) : "";
  14696. } catch (e) {
  14697. return Promise.reject(e);
  14698. }
  14699. if (!e) return Promise.reject(new Q({
  14700. code: "PARAM_ERROR",
  14701. message: "函数名不能为空"
  14702. }));
  14703. var c = {
  14704. inQuery: n,
  14705. parse: s,
  14706. search: r,
  14707. function_name: e,
  14708. request_data: a
  14709. };
  14710. return Je(this.config.env).send("functions.invokeFunction", c).then(function (e) {
  14711. if (e.code) o(null, e);else {
  14712. var _t9 = e.data.response_data;
  14713. if (s) o(null, {
  14714. result: _t9,
  14715. requestId: e.requestId
  14716. });else try {
  14717. _t9 = JSON.parse(e.data.response_data), o(null, {
  14718. result: _t9,
  14719. requestId: e.requestId
  14720. });
  14721. } catch (e) {
  14722. o(new Q({
  14723. message: "response data must be json"
  14724. }));
  14725. }
  14726. }
  14727. return o.promise;
  14728. }).catch(function (e) {
  14729. o(e);
  14730. }), o.promise;
  14731. },
  14732. at = {
  14733. timeout: 15e3,
  14734. persistence: "session"
  14735. },
  14736. ct = {};
  14737. var ut = /*#__PURE__*/function () {
  14738. function ut(e) {
  14739. (0, _classCallCheck2.default)(this, ut);
  14740. this.config = e || this.config, this.authObj = void 0;
  14741. }
  14742. (0, _createClass2.default)(ut, [{
  14743. key: "init",
  14744. value: function init(e) {
  14745. switch (ve.adapter || (this.requestClient = new ve.adapter.reqClass({
  14746. timeout: e.timeout || 5e3,
  14747. timeoutMsg: "\u8BF7\u6C42\u5728".concat((e.timeout || 5e3) / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD")
  14748. })), this.config = _objectSpread(_objectSpread({}, at), e), !0) {
  14749. case this.config.timeout > 6e5:
  14750. console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
  14751. break;
  14752. case this.config.timeout < 100:
  14753. console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
  14754. }
  14755. return new ut(this.config);
  14756. }
  14757. }, {
  14758. key: "auth",
  14759. value: function auth() {
  14760. var _ref11 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14761. e = _ref11.persistence;
  14762. if (this.authObj) return this.authObj;
  14763. var t = e || ve.adapter.primaryStorage || at.persistence;
  14764. var n;
  14765. return t !== this.config.persistence && (this.config.persistence = t), function (e) {
  14766. var t = e.env;
  14767. Te[t] = new be(e), Ae[t] = new be(_objectSpread(_objectSpread({}, e), {}, {
  14768. persistence: "local"
  14769. }));
  14770. }(this.config), n = this.config, ze[n.env] = new We(n), this.authObj = new et(this.config), this.authObj;
  14771. }
  14772. }, {
  14773. key: "on",
  14774. value: function on(e, t) {
  14775. return xe.apply(this, [e, t]);
  14776. }
  14777. }, {
  14778. key: "off",
  14779. value: function off(e, t) {
  14780. return Re.apply(this, [e, t]);
  14781. }
  14782. }, {
  14783. key: "callFunction",
  14784. value: function callFunction(e, t) {
  14785. return ot.apply(this, [e, t]);
  14786. }
  14787. }, {
  14788. key: "deleteFile",
  14789. value: function deleteFile(e, t) {
  14790. return st.apply(this, [e, t]);
  14791. }
  14792. }, {
  14793. key: "getTempFileURL",
  14794. value: function getTempFileURL(e, t) {
  14795. return rt.apply(this, [e, t]);
  14796. }
  14797. }, {
  14798. key: "downloadFile",
  14799. value: function downloadFile(e, t) {
  14800. return it.apply(this, [e, t]);
  14801. }
  14802. }, {
  14803. key: "uploadFile",
  14804. value: function uploadFile(e, t) {
  14805. return tt.apply(this, [e, t]);
  14806. }
  14807. }, {
  14808. key: "getUploadMetadata",
  14809. value: function getUploadMetadata(e, t) {
  14810. return nt.apply(this, [e, t]);
  14811. }
  14812. }, {
  14813. key: "registerExtension",
  14814. value: function registerExtension(e) {
  14815. ct[e.name] = e;
  14816. }
  14817. }, {
  14818. key: "invokeExtension",
  14819. value: function () {
  14820. var _invokeExtension = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(e, t) {
  14821. var n;
  14822. return _regenerator.default.wrap(function _callee32$(_context32) {
  14823. while (1) {
  14824. switch (_context32.prev = _context32.next) {
  14825. case 0:
  14826. n = ct[e];
  14827. if (n) {
  14828. _context32.next = 3;
  14829. break;
  14830. }
  14831. throw new Q({
  14832. message: "\u6269\u5C55".concat(e, " \u5FC5\u987B\u5148\u6CE8\u518C")
  14833. });
  14834. case 3:
  14835. _context32.next = 5;
  14836. return n.invoke(t, this);
  14837. case 5:
  14838. return _context32.abrupt("return", _context32.sent);
  14839. case 6:
  14840. case "end":
  14841. return _context32.stop();
  14842. }
  14843. }
  14844. }, _callee32, this);
  14845. }));
  14846. function invokeExtension(_x29, _x30) {
  14847. return _invokeExtension.apply(this, arguments);
  14848. }
  14849. return invokeExtension;
  14850. }()
  14851. }, {
  14852. key: "useAdapters",
  14853. value: function useAdapters(e) {
  14854. var _ref12 = we(e) || {},
  14855. t = _ref12.adapter,
  14856. n = _ref12.runtime;
  14857. t && (ve.adapter = t), n && (ve.runtime = n);
  14858. }
  14859. }]);
  14860. return ut;
  14861. }();
  14862. var lt = new ut();
  14863. function ht(e, t, n) {
  14864. void 0 === n && (n = {});
  14865. var s = /\?/.test(t),
  14866. r = "";
  14867. for (var i in n) {
  14868. "" === r ? !s && (t += "?") : r += "&", r += i + "=" + encodeURIComponent(n[i]);
  14869. }
  14870. return /^http(s)?:\/\//.test(t += r) ? t : "" + e + t;
  14871. }
  14872. var dt = /*#__PURE__*/function () {
  14873. function dt() {
  14874. (0, _classCallCheck2.default)(this, dt);
  14875. }
  14876. (0, _createClass2.default)(dt, [{
  14877. key: "post",
  14878. value: function post(e) {
  14879. var t = e.url,
  14880. n = e.data,
  14881. s = e.headers;
  14882. return new Promise(function (e, r) {
  14883. X.request({
  14884. url: ht("https:", t),
  14885. data: n,
  14886. method: "POST",
  14887. header: s,
  14888. success: function success(t) {
  14889. e(t);
  14890. },
  14891. fail: function fail(e) {
  14892. r(e);
  14893. }
  14894. });
  14895. });
  14896. }
  14897. }, {
  14898. key: "upload",
  14899. value: function upload(e) {
  14900. return new Promise(function (t, n) {
  14901. var s = e.url,
  14902. r = e.file,
  14903. i = e.data,
  14904. o = e.headers,
  14905. a = e.fileType,
  14906. c = X.uploadFile({
  14907. url: ht("https:", s),
  14908. name: "file",
  14909. formData: Object.assign({}, i),
  14910. filePath: r,
  14911. fileType: a,
  14912. header: o,
  14913. success: function success(e) {
  14914. var n = {
  14915. statusCode: e.statusCode,
  14916. data: e.data || {}
  14917. };
  14918. 200 === e.statusCode && i.success_action_status && (n.statusCode = parseInt(i.success_action_status, 10)), t(n);
  14919. },
  14920. fail: function fail(e) {
  14921. n(new Error(e.errMsg || "uploadFile:fail"));
  14922. }
  14923. });
  14924. "function" == typeof e.onUploadProgress && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (t) {
  14925. e.onUploadProgress({
  14926. loaded: t.totalBytesSent,
  14927. total: t.totalBytesExpectedToSend
  14928. });
  14929. });
  14930. });
  14931. }
  14932. }]);
  14933. return dt;
  14934. }();
  14935. var ft = {
  14936. setItem: function setItem(e, t) {
  14937. X.setStorageSync(e, t);
  14938. },
  14939. getItem: function getItem(e) {
  14940. return X.getStorageSync(e);
  14941. },
  14942. removeItem: function removeItem(e) {
  14943. X.removeStorageSync(e);
  14944. },
  14945. clear: function clear() {
  14946. X.clearStorageSync();
  14947. }
  14948. };
  14949. var pt = {
  14950. genAdapter: function genAdapter() {
  14951. return {
  14952. root: {},
  14953. reqClass: dt,
  14954. localStorage: ft,
  14955. primaryStorage: "local"
  14956. };
  14957. },
  14958. isMatch: function isMatch() {
  14959. return !0;
  14960. },
  14961. runtime: "uni_app"
  14962. };
  14963. lt.useAdapters(pt);
  14964. var gt = lt,
  14965. mt = gt.init;
  14966. gt.init = function (e) {
  14967. e.env = e.spaceId;
  14968. var t = mt.call(this, e);
  14969. t.config.provider = "tencent", t.config.spaceId = e.spaceId;
  14970. var n = t.auth;
  14971. return t.auth = function (e) {
  14972. var t = n.call(this, e);
  14973. return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach(function (e) {
  14974. t[e] = Y(t[e]).bind(t);
  14975. }), t;
  14976. }, t.customAuth = t.auth, t;
  14977. };
  14978. var yt = gt;
  14979. var _t = /*#__PURE__*/function (_le) {
  14980. (0, _inherits2.default)(_t, _le);
  14981. var _super8 = _createSuper(_t);
  14982. function _t() {
  14983. (0, _classCallCheck2.default)(this, _t);
  14984. return _super8.apply(this, arguments);
  14985. }
  14986. (0, _createClass2.default)(_t, [{
  14987. key: "getAccessToken",
  14988. value: function getAccessToken() {
  14989. var _this11 = this;
  14990. return new Promise(function (e, t) {
  14991. var n = "Anonymous_Access_token";
  14992. _this11.setAccessToken(n), e(n);
  14993. });
  14994. }
  14995. }, {
  14996. key: "setupRequest",
  14997. value: function setupRequest(e, t) {
  14998. var n = Object.assign({}, e, {
  14999. spaceId: this.config.spaceId,
  15000. timestamp: Date.now()
  15001. }),
  15002. s = {
  15003. "Content-Type": "application/json"
  15004. };
  15005. "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = ae.sign(n, this.config.clientSecret);
  15006. var r = oe();
  15007. s["x-client-info"] = encodeURIComponent(JSON.stringify(r));
  15008. var _Z = Z(),
  15009. i = _Z.token;
  15010. return s["x-client-token"] = i, {
  15011. url: this.config.requestUrl,
  15012. method: "POST",
  15013. data: n,
  15014. dataType: "json",
  15015. header: JSON.parse(JSON.stringify(s))
  15016. };
  15017. }
  15018. }, {
  15019. key: "uploadFileToOSS",
  15020. value: function uploadFileToOSS(_ref13) {
  15021. var _this12 = this;
  15022. var e = _ref13.url,
  15023. t = _ref13.formData,
  15024. n = _ref13.name,
  15025. s = _ref13.filePath,
  15026. r = _ref13.fileType,
  15027. i = _ref13.onUploadProgress;
  15028. return new Promise(function (o, a) {
  15029. var c = _this12.adapter.uploadFile({
  15030. url: e,
  15031. formData: t,
  15032. name: n,
  15033. filePath: s,
  15034. fileType: r,
  15035. success: function success(e) {
  15036. e && e.statusCode < 400 ? o(e) : a(new Q({
  15037. code: "UPLOAD_FAILED",
  15038. message: "文件上传失败"
  15039. }));
  15040. },
  15041. fail: function fail(e) {
  15042. a(new Q({
  15043. code: e.code || "UPLOAD_FAILED",
  15044. message: e.message || e.errMsg || "文件上传失败"
  15045. }));
  15046. }
  15047. });
  15048. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  15049. i({
  15050. loaded: e.totalBytesSent,
  15051. total: e.totalBytesExpectedToSend
  15052. });
  15053. });
  15054. });
  15055. }
  15056. }, {
  15057. key: "uploadFile",
  15058. value: function uploadFile(_ref14) {
  15059. var _this13 = this;
  15060. var e = _ref14.filePath,
  15061. t = _ref14.cloudPath,
  15062. _ref14$fileType = _ref14.fileType,
  15063. n = _ref14$fileType === void 0 ? "image" : _ref14$fileType,
  15064. s = _ref14.onUploadProgress;
  15065. if (!t) throw new Q({
  15066. code: "CLOUDPATH_REQUIRED",
  15067. message: "cloudPath不可为空"
  15068. });
  15069. var r;
  15070. return this.getOSSUploadOptionsFromPath({
  15071. cloudPath: t
  15072. }).then(function (t) {
  15073. var _t$result = t.result,
  15074. i = _t$result.url,
  15075. o = _t$result.formData,
  15076. a = _t$result.name;
  15077. r = t.result.fileUrl;
  15078. var c = {
  15079. url: i,
  15080. formData: o,
  15081. name: a,
  15082. filePath: e,
  15083. fileType: n
  15084. };
  15085. return _this13.uploadFileToOSS(Object.assign({}, c, {
  15086. onUploadProgress: s
  15087. }));
  15088. }).then(function () {
  15089. return _this13.reportOSSUpload({
  15090. cloudPath: t
  15091. });
  15092. }).then(function (t) {
  15093. return new Promise(function (n, s) {
  15094. t.success ? n({
  15095. success: !0,
  15096. filePath: e,
  15097. fileID: r
  15098. }) : s(new Q({
  15099. code: "UPLOAD_FAILED",
  15100. message: "文件上传失败"
  15101. }));
  15102. });
  15103. });
  15104. }
  15105. }, {
  15106. key: "deleteFile",
  15107. value: function deleteFile(_ref15) {
  15108. var e = _ref15.fileList;
  15109. var t = {
  15110. method: "serverless.file.resource.delete",
  15111. params: JSON.stringify({
  15112. fileList: e
  15113. })
  15114. };
  15115. return this.request(this.setupRequest(t)).then(function (e) {
  15116. if (e.success) return e.result;
  15117. throw new Q({
  15118. code: "DELETE_FILE_FAILED",
  15119. message: "删除文件失败"
  15120. });
  15121. });
  15122. }
  15123. }, {
  15124. key: "getTempFileURL",
  15125. value: function getTempFileURL() {
  15126. var _ref16 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15127. e = _ref16.fileList;
  15128. if (!Array.isArray(e) || 0 === e.length) throw new Q({
  15129. code: "INVALID_PARAM",
  15130. message: "fileList的元素必须是非空的字符串"
  15131. });
  15132. var t = {
  15133. method: "serverless.file.resource.getTempFileURL",
  15134. params: JSON.stringify({
  15135. fileList: e
  15136. })
  15137. };
  15138. return this.request(this.setupRequest(t)).then(function (e) {
  15139. if (e.success) return {
  15140. fileList: e.result.fileList.map(function (e) {
  15141. return {
  15142. fileID: e.fileID,
  15143. tempFileURL: e.tempFileURL
  15144. };
  15145. })
  15146. };
  15147. throw new Q({
  15148. code: "GET_TEMP_FILE_URL_FAILED",
  15149. message: "获取临时文件链接失败"
  15150. });
  15151. });
  15152. }
  15153. }]);
  15154. return _t;
  15155. }(le);
  15156. var wt = {
  15157. init: function init(e) {
  15158. var t = new _t(e),
  15159. n = {
  15160. signInAnonymously: function signInAnonymously() {
  15161. return t.authorize();
  15162. },
  15163. getLoginState: function getLoginState() {
  15164. return Promise.resolve(!1);
  15165. }
  15166. };
  15167. return t.auth = function () {
  15168. return n;
  15169. }, t.customAuth = t.auth, t;
  15170. }
  15171. };
  15172. function vt(_ref17) {
  15173. var e = _ref17.data;
  15174. var t;
  15175. t = oe();
  15176. var n = JSON.parse(JSON.stringify(e || {}));
  15177. if (Object.assign(n, {
  15178. clientInfo: t
  15179. }), !n.uniIdToken) {
  15180. var _Z2 = Z(),
  15181. _e20 = _Z2.token;
  15182. _e20 && (n.uniIdToken = _e20);
  15183. }
  15184. return n;
  15185. }
  15186. function St() {
  15187. var _this14 = this;
  15188. var _ref18 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15189. e = _ref18.name,
  15190. t = _ref18.data;
  15191. var _this$__dev__ = this.__dev__,
  15192. n = _this$__dev__.localAddress,
  15193. s = _this$__dev__.localPort,
  15194. r = {
  15195. aliyun: "aliyun",
  15196. tencent: "tcb"
  15197. }[this.config.provider],
  15198. i = this.config.spaceId,
  15199. o = "http://".concat(n, ":").concat(s, "/system/check-function"),
  15200. a = "http://".concat(n, ":").concat(s, "/cloudfunctions/").concat(e);
  15201. return new Promise(function (t, n) {
  15202. X.request({
  15203. method: "POST",
  15204. url: o,
  15205. data: {
  15206. name: e,
  15207. platform: S,
  15208. provider: r,
  15209. spaceId: i
  15210. },
  15211. timeout: 3e3,
  15212. success: function success(e) {
  15213. t(e);
  15214. },
  15215. fail: function fail() {
  15216. t({
  15217. data: {
  15218. code: "NETWORK_ERROR",
  15219. message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。"
  15220. }
  15221. });
  15222. }
  15223. });
  15224. }).then(function () {
  15225. var _ref19 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15226. e = _ref19.data;
  15227. var _ref20 = e || {},
  15228. t = _ref20.code,
  15229. n = _ref20.message;
  15230. return {
  15231. code: 0 === t ? 0 : t || "SYS_ERR",
  15232. message: n || "SYS_ERR"
  15233. };
  15234. }).then(function (_ref21) {
  15235. var n = _ref21.code,
  15236. s = _ref21.message;
  15237. if (0 !== n) {
  15238. switch (n) {
  15239. case "MODULE_ENCRYPTED":
  15240. console.error("\u6B64\u4E91\u51FD\u6570\uFF08".concat(e, "\uFF09\u4F9D\u8D56\u52A0\u5BC6\u516C\u5171\u6A21\u5757\u4E0D\u53EF\u672C\u5730\u8C03\u8BD5\uFF0C\u81EA\u52A8\u5207\u6362\u4E3A\u4E91\u7AEF\u5DF2\u90E8\u7F72\u7684\u4E91\u51FD\u6570"));
  15241. break;
  15242. case "FUNCTION_ENCRYPTED":
  15243. console.error("\u6B64\u4E91\u51FD\u6570\uFF08".concat(e, "\uFF09\u5DF2\u52A0\u5BC6\u4E0D\u53EF\u672C\u5730\u8C03\u8BD5\uFF0C\u81EA\u52A8\u5207\u6362\u4E3A\u4E91\u7AEF\u5DF2\u90E8\u7F72\u7684\u4E91\u51FD\u6570"));
  15244. break;
  15245. case "ACTION_ENCRYPTED":
  15246. console.error(s || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
  15247. break;
  15248. case "NETWORK_ERROR":
  15249. {
  15250. var _e21 = "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下";
  15251. throw console.error(_e21), new Error(_e21);
  15252. }
  15253. case "SWITCH_TO_CLOUD":
  15254. break;
  15255. default:
  15256. {
  15257. var _e22 = "\u68C0\u6D4B\u672C\u5730\u8C03\u8BD5\u670D\u52A1\u51FA\u73B0\u9519\u8BEF\uFF1A".concat(s, "\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u73AF\u5883\u6216\u91CD\u542F\u5BA2\u6237\u7AEF\u518D\u8BD5");
  15258. throw console.error(_e22), new Error(_e22);
  15259. }
  15260. }
  15261. return _this14._callCloudFunction({
  15262. name: e,
  15263. data: t
  15264. });
  15265. }
  15266. return new Promise(function (e, n) {
  15267. var s = vt.call(_this14, {
  15268. data: t
  15269. });
  15270. X.request({
  15271. method: "POST",
  15272. url: a,
  15273. data: {
  15274. provider: r,
  15275. platform: S,
  15276. param: s
  15277. },
  15278. success: function success() {
  15279. var _ref22 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15280. t = _ref22.statusCode,
  15281. s = _ref22.data;
  15282. return !t || t >= 400 ? n(new Q({
  15283. code: s.code || "SYS_ERR",
  15284. message: s.message || "request:fail"
  15285. })) : e({
  15286. result: s
  15287. });
  15288. },
  15289. fail: function fail(e) {
  15290. n(new Q({
  15291. code: e.code || e.errCode || "SYS_ERR",
  15292. message: e.message || e.errMsg || "request:fail"
  15293. }));
  15294. }
  15295. });
  15296. });
  15297. });
  15298. }
  15299. var kt = [{
  15300. rule: /fc_function_not_found|FUNCTION_NOT_FOUND/,
  15301. content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",
  15302. mode: "append"
  15303. }];
  15304. var It = /[\\^$.*+?()[\]{}|]/g,
  15305. bt = RegExp(It.source);
  15306. function Tt(e, t, n) {
  15307. return e.replace(new RegExp((s = t) && bt.test(s) ? s.replace(It, "\\$&") : s, "g"), n);
  15308. var s;
  15309. }
  15310. var At = "none",
  15311. Ct = "request",
  15312. Pt = "response",
  15313. Et = "both";
  15314. var Ot = /*#__PURE__*/function () {
  15315. function Ot() {
  15316. var _ref23 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15317. e = _ref23.secretType,
  15318. t = _ref23.uniCloudIns;
  15319. (0, _classCallCheck2.default)(this, Ot);
  15320. this.secretType = e || At, this.uniCloudIns = t;
  15321. var _this$uniCloudIns$con = this.uniCloudIns.config,
  15322. n = _this$uniCloudIns$con.provider,
  15323. s = _this$uniCloudIns$con.spaceId;
  15324. var r;
  15325. this.provider = n, this.spaceId = s, this.scopedGlobalCache = (r = this.uniCloudIns, C("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", r.config.spaceId)));
  15326. }
  15327. (0, _createClass2.default)(Ot, [{
  15328. key: "getSystemInfo",
  15329. value: function getSystemInfo() {
  15330. return this._systemInfo || (this._systemInfo = re()), this._systemInfo;
  15331. }
  15332. }, {
  15333. key: "appId",
  15334. get: function get() {
  15335. return this.getSystemInfo().appId;
  15336. }
  15337. }, {
  15338. key: "deviceId",
  15339. get: function get() {
  15340. return this.getSystemInfo().deviceId;
  15341. }
  15342. }, {
  15343. key: "encryptData",
  15344. value: function () {
  15345. var _encryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(e) {
  15346. return _regenerator.default.wrap(function _callee33$(_context33) {
  15347. while (1) {
  15348. switch (_context33.prev = _context33.next) {
  15349. case 0:
  15350. return _context33.abrupt("return", this.secretType === At || this.secretType === At ? e : this.platformEncryptData(e));
  15351. case 1:
  15352. case "end":
  15353. return _context33.stop();
  15354. }
  15355. }
  15356. }, _callee33, this);
  15357. }));
  15358. function encryptData(_x31) {
  15359. return _encryptData.apply(this, arguments);
  15360. }
  15361. return encryptData;
  15362. }()
  15363. }, {
  15364. key: "decryptResult",
  15365. value: function () {
  15366. var _decryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(e) {
  15367. var t;
  15368. return _regenerator.default.wrap(function _callee34$(_context34) {
  15369. while (1) {
  15370. switch (_context34.prev = _context34.next) {
  15371. case 0:
  15372. if (!(this.secretType === At)) {
  15373. _context34.next = 2;
  15374. break;
  15375. }
  15376. return _context34.abrupt("return", e);
  15377. case 2:
  15378. t = e.content;
  15379. return _context34.abrupt("return", t ? this.secretType === Ct ? t : this.platformDecryptResult(e) : e);
  15380. case 4:
  15381. case "end":
  15382. return _context34.stop();
  15383. }
  15384. }
  15385. }, _callee34, this);
  15386. }));
  15387. function decryptResult(_x32) {
  15388. return _decryptResult.apply(this, arguments);
  15389. }
  15390. return decryptResult;
  15391. }()
  15392. }, {
  15393. key: "wrapVerifyClientCallFunction",
  15394. value: function wrapVerifyClientCallFunction(e) {
  15395. var t = this;
  15396. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35() {
  15397. var _ref25,
  15398. n,
  15399. _ref25$data,
  15400. s,
  15401. _args35 = arguments;
  15402. return _regenerator.default.wrap(function _callee35$(_context35) {
  15403. while (1) {
  15404. switch (_context35.prev = _context35.next) {
  15405. case 0:
  15406. _ref25 = _args35.length > 0 && _args35[0] !== undefined ? _args35[0] : {}, n = _ref25.name, _ref25$data = _ref25.data, s = _ref25$data === void 0 ? {} : _ref25$data;
  15407. _context35.next = 3;
  15408. return t.prepare();
  15409. case 3:
  15410. _context35.next = 5;
  15411. return t.platformGetSignOption();
  15412. case 5:
  15413. (s = JSON.parse(JSON.stringify(s)))._uniCloudOptions = _context35.sent;
  15414. _context35.next = 8;
  15415. return e({
  15416. name: n,
  15417. data: s
  15418. });
  15419. case 8:
  15420. return _context35.abrupt("return", _context35.sent);
  15421. case 9:
  15422. case "end":
  15423. return _context35.stop();
  15424. }
  15425. }
  15426. }, _callee35);
  15427. }));
  15428. }
  15429. }, {
  15430. key: "wrapEncryptDataCallFunction",
  15431. value: function wrapEncryptDataCallFunction(e) {
  15432. var t = this;
  15433. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36() {
  15434. var _ref27,
  15435. n,
  15436. _ref27$data,
  15437. s,
  15438. r,
  15439. i,
  15440. _args36 = arguments;
  15441. return _regenerator.default.wrap(function _callee36$(_context36) {
  15442. while (1) {
  15443. switch (_context36.prev = _context36.next) {
  15444. case 0:
  15445. _ref27 = _args36.length > 0 && _args36[0] !== undefined ? _args36[0] : {}, n = _ref27.name, _ref27$data = _ref27.data, s = _ref27$data === void 0 ? {} : _ref27$data;
  15446. _context36.next = 3;
  15447. return t.prepare();
  15448. case 3:
  15449. _context36.next = 5;
  15450. return t.encryptData(s);
  15451. case 5:
  15452. r = _context36.sent;
  15453. _context36.next = 8;
  15454. return e({
  15455. name: n,
  15456. data: r
  15457. });
  15458. case 8:
  15459. i = _context36.sent;
  15460. _context36.next = 11;
  15461. return t.decryptResult(i.result);
  15462. case 11:
  15463. i.result = _context36.sent;
  15464. return _context36.abrupt("return", i);
  15465. case 13:
  15466. case "end":
  15467. return _context36.stop();
  15468. }
  15469. }
  15470. }, _callee36);
  15471. }));
  15472. }
  15473. }]);
  15474. return Ot;
  15475. }();
  15476. /*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */
  15477. function xt(e) {
  15478. return parseInt(e) === e;
  15479. }
  15480. function Ut(e) {
  15481. if (!xt(e.length)) return !1;
  15482. for (var t = 0; t < e.length; t++) {
  15483. if (!xt(e[t]) || e[t] < 0 || e[t] > 255) return !1;
  15484. }
  15485. return !0;
  15486. }
  15487. function Rt(e, t) {
  15488. if (e.buffer && "Uint8Array" === e.name) return t && (e = e.slice ? e.slice() : Array.prototype.slice.call(e)), e;
  15489. if (Array.isArray(e)) {
  15490. if (!Ut(e)) throw new Error("Array contains invalid value: " + e);
  15491. return new Uint8Array(e);
  15492. }
  15493. if (xt(e.length) && Ut(e)) return new Uint8Array(e);
  15494. throw new Error("unsupported array-like object");
  15495. }
  15496. function Lt(e) {
  15497. return new Uint8Array(e);
  15498. }
  15499. function Nt(e, t, n, s, r) {
  15500. null == s && null == r || (e = e.slice ? e.slice(s, r) : Array.prototype.slice.call(e, s, r)), t.set(e, n);
  15501. }
  15502. var Dt,
  15503. Ft = {
  15504. toBytes: function toBytes(e) {
  15505. var t = [],
  15506. n = 0;
  15507. for (e = encodeURI(e); n < e.length;) {
  15508. var s = e.charCodeAt(n++);
  15509. 37 === s ? (t.push(parseInt(e.substr(n, 2), 16)), n += 2) : t.push(s);
  15510. }
  15511. return Rt(t);
  15512. },
  15513. fromBytes: function fromBytes(e) {
  15514. for (var t = [], n = 0; n < e.length;) {
  15515. var s = e[n];
  15516. s < 128 ? (t.push(String.fromCharCode(s)), n++) : s > 191 && s < 224 ? (t.push(String.fromCharCode((31 & s) << 6 | 63 & e[n + 1])), n += 2) : (t.push(String.fromCharCode((15 & s) << 12 | (63 & e[n + 1]) << 6 | 63 & e[n + 2])), n += 3);
  15517. }
  15518. return t.join("");
  15519. }
  15520. },
  15521. qt = (Dt = "0123456789abcdef", {
  15522. toBytes: function toBytes(e) {
  15523. for (var t = [], n = 0; n < e.length; n += 2) {
  15524. t.push(parseInt(e.substr(n, 2), 16));
  15525. }
  15526. return t;
  15527. },
  15528. fromBytes: function fromBytes(e) {
  15529. for (var t = [], n = 0; n < e.length; n++) {
  15530. var s = e[n];
  15531. t.push(Dt[(240 & s) >> 4] + Dt[15 & s]);
  15532. }
  15533. return t.join("");
  15534. }
  15535. }),
  15536. Kt = {
  15537. 16: 10,
  15538. 24: 12,
  15539. 32: 14
  15540. },
  15541. Mt = [1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145],
  15542. jt = [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22],
  15543. Bt = [82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125],
  15544. $t = [3328402341, 4168907908, 4000806809, 4135287693, 4294111757, 3597364157, 3731845041, 2445657428, 1613770832, 33620227, 3462883241, 1445669757, 3892248089, 3050821474, 1303096294, 3967186586, 2412431941, 528646813, 2311702848, 4202528135, 4026202645, 2992200171, 2387036105, 4226871307, 1101901292, 3017069671, 1604494077, 1169141738, 597466303, 1403299063, 3832705686, 2613100635, 1974974402, 3791519004, 1033081774, 1277568618, 1815492186, 2118074177, 4126668546, 2211236943, 1748251740, 1369810420, 3521504564, 4193382664, 3799085459, 2883115123, 1647391059, 706024767, 134480908, 2512897874, 1176707941, 2646852446, 806885416, 932615841, 168101135, 798661301, 235341577, 605164086, 461406363, 3756188221, 3454790438, 1311188841, 2142417613, 3933566367, 302582043, 495158174, 1479289972, 874125870, 907746093, 3698224818, 3025820398, 1537253627, 2756858614, 1983593293, 3084310113, 2108928974, 1378429307, 3722699582, 1580150641, 327451799, 2790478837, 3117535592, 0, 3253595436, 1075847264, 3825007647, 2041688520, 3059440621, 3563743934, 2378943302, 1740553945, 1916352843, 2487896798, 2555137236, 2958579944, 2244988746, 3151024235, 3320835882, 1336584933, 3992714006, 2252555205, 2588757463, 1714631509, 293963156, 2319795663, 3925473552, 67240454, 4269768577, 2689618160, 2017213508, 631218106, 1269344483, 2723238387, 1571005438, 2151694528, 93294474, 1066570413, 563977660, 1882732616, 4059428100, 1673313503, 2008463041, 2950355573, 1109467491, 537923632, 3858759450, 4260623118, 3218264685, 2177748300, 403442708, 638784309, 3287084079, 3193921505, 899127202, 2286175436, 773265209, 2479146071, 1437050866, 4236148354, 2050833735, 3362022572, 3126681063, 840505643, 3866325909, 3227541664, 427917720, 2655997905, 2749160575, 1143087718, 1412049534, 999329963, 193497219, 2353415882, 3354324521, 1807268051, 672404540, 2816401017, 3160301282, 369822493, 2916866934, 3688947771, 1681011286, 1949973070, 336202270, 2454276571, 201721354, 1210328172, 3093060836, 2680341085, 3184776046, 1135389935, 3294782118, 965841320, 831886756, 3554993207, 4068047243, 3588745010, 2345191491, 1849112409, 3664604599, 26054028, 2983581028, 2622377682, 1235855840, 3630984372, 2891339514, 4092916743, 3488279077, 3395642799, 4101667470, 1202630377, 268961816, 1874508501, 4034427016, 1243948399, 1546530418, 941366308, 1470539505, 1941222599, 2546386513, 3421038627, 2715671932, 3899946140, 1042226977, 2521517021, 1639824860, 227249030, 260737669, 3765465232, 2084453954, 1907733956, 3429263018, 2420656344, 100860677, 4160157185, 470683154, 3261161891, 1781871967, 2924959737, 1773779408, 394692241, 2579611992, 974986535, 664706745, 3655459128, 3958962195, 731420851, 571543859, 3530123707, 2849626480, 126783113, 865375399, 765172662, 1008606754, 361203602, 3387549984, 2278477385, 2857719295, 1344809080, 2782912378, 59542671, 1503764984, 160008576, 437062935, 1707065306, 3622233649, 2218934982, 3496503480, 2185314755, 697932208, 1512910199, 504303377, 2075177163, 2824099068, 1841019862, 739644986],
  15545. Wt = [2781242211, 2230877308, 2582542199, 2381740923, 234877682, 3184946027, 2984144751, 1418839493, 1348481072, 50462977, 2848876391, 2102799147, 434634494, 1656084439, 3863849899, 2599188086, 1167051466, 2636087938, 1082771913, 2281340285, 368048890, 3954334041, 3381544775, 201060592, 3963727277, 1739838676, 4250903202, 3930435503, 3206782108, 4149453988, 2531553906, 1536934080, 3262494647, 484572669, 2923271059, 1783375398, 1517041206, 1098792767, 49674231, 1334037708, 1550332980, 4098991525, 886171109, 150598129, 2481090929, 1940642008, 1398944049, 1059722517, 201851908, 1385547719, 1699095331, 1587397571, 674240536, 2704774806, 252314885, 3039795866, 151914247, 908333586, 2602270848, 1038082786, 651029483, 1766729511, 3447698098, 2682942837, 454166793, 2652734339, 1951935532, 775166490, 758520603, 3000790638, 4004797018, 4217086112, 4137964114, 1299594043, 1639438038, 3464344499, 2068982057, 1054729187, 1901997871, 2534638724, 4121318227, 1757008337, 0, 750906861, 1614815264, 535035132, 3363418545, 3988151131, 3201591914, 1183697867, 3647454910, 1265776953, 3734260298, 3566750796, 3903871064, 1250283471, 1807470800, 717615087, 3847203498, 384695291, 3313910595, 3617213773, 1432761139, 2484176261, 3481945413, 283769337, 100925954, 2180939647, 4037038160, 1148730428, 3123027871, 3813386408, 4087501137, 4267549603, 3229630528, 2315620239, 2906624658, 3156319645, 1215313976, 82966005, 3747855548, 3245848246, 1974459098, 1665278241, 807407632, 451280895, 251524083, 1841287890, 1283575245, 337120268, 891687699, 801369324, 3787349855, 2721421207, 3431482436, 959321879, 1469301956, 4065699751, 2197585534, 1199193405, 2898814052, 3887750493, 724703513, 2514908019, 2696962144, 2551808385, 3516813135, 2141445340, 1715741218, 2119445034, 2872807568, 2198571144, 3398190662, 700968686, 3547052216, 1009259540, 2041044702, 3803995742, 487983883, 1991105499, 1004265696, 1449407026, 1316239930, 504629770, 3683797321, 168560134, 1816667172, 3837287516, 1570751170, 1857934291, 4014189740, 2797888098, 2822345105, 2754712981, 936633572, 2347923833, 852879335, 1133234376, 1500395319, 3084545389, 2348912013, 1689376213, 3533459022, 3762923945, 3034082412, 4205598294, 133428468, 634383082, 2949277029, 2398386810, 3913789102, 403703816, 3580869306, 2297460856, 1867130149, 1918643758, 607656988, 4049053350, 3346248884, 1368901318, 600565992, 2090982877, 2632479860, 557719327, 3717614411, 3697393085, 2249034635, 2232388234, 2430627952, 1115438654, 3295786421, 2865522278, 3633334344, 84280067, 33027830, 303828494, 2747425121, 1600795957, 4188952407, 3496589753, 2434238086, 1486471617, 658119965, 3106381470, 953803233, 334231800, 3005978776, 857870609, 3151128937, 1890179545, 2298973838, 2805175444, 3056442267, 574365214, 2450884487, 550103529, 1233637070, 4289353045, 2018519080, 2057691103, 2399374476, 4166623649, 2148108681, 387583245, 3664101311, 836232934, 3330556482, 3100665960, 3280093505, 2955516313, 2002398509, 287182607, 3413881008, 4238890068, 3597515707, 975967766],
  15546. zt = [1671808611, 2089089148, 2006576759, 2072901243, 4061003762, 1807603307, 1873927791, 3310653893, 810573872, 16974337, 1739181671, 729634347, 4263110654, 3613570519, 2883997099, 1989864566, 3393556426, 2191335298, 3376449993, 2106063485, 4195741690, 1508618841, 1204391495, 4027317232, 2917941677, 3563566036, 2734514082, 2951366063, 2629772188, 2767672228, 1922491506, 3227229120, 3082974647, 4246528509, 2477669779, 644500518, 911895606, 1061256767, 4144166391, 3427763148, 878471220, 2784252325, 3845444069, 4043897329, 1905517169, 3631459288, 827548209, 356461077, 67897348, 3344078279, 593839651, 3277757891, 405286936, 2527147926, 84871685, 2595565466, 118033927, 305538066, 2157648768, 3795705826, 3945188843, 661212711, 2999812018, 1973414517, 152769033, 2208177539, 745822252, 439235610, 455947803, 1857215598, 1525593178, 2700827552, 1391895634, 994932283, 3596728278, 3016654259, 695947817, 3812548067, 795958831, 2224493444, 1408607827, 3513301457, 0, 3979133421, 543178784, 4229948412, 2982705585, 1542305371, 1790891114, 3410398667, 3201918910, 961245753, 1256100938, 1289001036, 1491644504, 3477767631, 3496721360, 4012557807, 2867154858, 4212583931, 1137018435, 1305975373, 861234739, 2241073541, 1171229253, 4178635257, 33948674, 2139225727, 1357946960, 1011120188, 2679776671, 2833468328, 1374921297, 2751356323, 1086357568, 2408187279, 2460827538, 2646352285, 944271416, 4110742005, 3168756668, 3066132406, 3665145818, 560153121, 271589392, 4279952895, 4077846003, 3530407890, 3444343245, 202643468, 322250259, 3962553324, 1608629855, 2543990167, 1154254916, 389623319, 3294073796, 2817676711, 2122513534, 1028094525, 1689045092, 1575467613, 422261273, 1939203699, 1621147744, 2174228865, 1339137615, 3699352540, 577127458, 712922154, 2427141008, 2290289544, 1187679302, 3995715566, 3100863416, 339486740, 3732514782, 1591917662, 186455563, 3681988059, 3762019296, 844522546, 978220090, 169743370, 1239126601, 101321734, 611076132, 1558493276, 3260915650, 3547250131, 2901361580, 1655096418, 2443721105, 2510565781, 3828863972, 2039214713, 3878868455, 3359869896, 928607799, 1840765549, 2374762893, 3580146133, 1322425422, 2850048425, 1823791212, 1459268694, 4094161908, 3928346602, 1706019429, 2056189050, 2934523822, 135794696, 3134549946, 2022240376, 628050469, 779246638, 472135708, 2800834470, 3032970164, 3327236038, 3894660072, 3715932637, 1956440180, 522272287, 1272813131, 3185336765, 2340818315, 2323976074, 1888542832, 1044544574, 3049550261, 1722469478, 1222152264, 50660867, 4127324150, 236067854, 1638122081, 895445557, 1475980887, 3117443513, 2257655686, 3243809217, 489110045, 2662934430, 3778599393, 4162055160, 2561878936, 288563729, 1773916777, 3648039385, 2391345038, 2493985684, 2612407707, 505560094, 2274497927, 3911240169, 3460925390, 1442818645, 678973480, 3749357023, 2358182796, 2717407649, 2306869641, 219617805, 3218761151, 3862026214, 1120306242, 1756942440, 1103331905, 2578459033, 762796589, 252780047, 2966125488, 1425844308, 3151392187, 372911126],
  15547. Jt = [1667474886, 2088535288, 2004326894, 2071694838, 4075949567, 1802223062, 1869591006, 3318043793, 808472672, 16843522, 1734846926, 724270422, 4278065639, 3621216949, 2880169549, 1987484396, 3402253711, 2189597983, 3385409673, 2105378810, 4210693615, 1499065266, 1195886990, 4042263547, 2913856577, 3570689971, 2728590687, 2947541573, 2627518243, 2762274643, 1920112356, 3233831835, 3082273397, 4261223649, 2475929149, 640051788, 909531756, 1061110142, 4160160501, 3435941763, 875846760, 2779116625, 3857003729, 4059105529, 1903268834, 3638064043, 825316194, 353713962, 67374088, 3351728789, 589522246, 3284360861, 404236336, 2526454071, 84217610, 2593830191, 117901582, 303183396, 2155911963, 3806477791, 3958056653, 656894286, 2998062463, 1970642922, 151591698, 2206440989, 741110872, 437923380, 454765878, 1852748508, 1515908788, 2694904667, 1381168804, 993742198, 3604373943, 3014905469, 690584402, 3823320797, 791638366, 2223281939, 1398011302, 3520161977, 0, 3991743681, 538992704, 4244381667, 2981218425, 1532751286, 1785380564, 3419096717, 3200178535, 960056178, 1246420628, 1280103576, 1482221744, 3486468741, 3503319995, 4025428677, 2863326543, 4227536621, 1128514950, 1296947098, 859002214, 2240123921, 1162203018, 4193849577, 33687044, 2139062782, 1347481760, 1010582648, 2678045221, 2829640523, 1364325282, 2745433693, 1077985408, 2408548869, 2459086143, 2644360225, 943212656, 4126475505, 3166494563, 3065430391, 3671750063, 555836226, 269496352, 4294908645, 4092792573, 3537006015, 3452783745, 202118168, 320025894, 3974901699, 1600119230, 2543297077, 1145359496, 387397934, 3301201811, 2812801621, 2122220284, 1027426170, 1684319432, 1566435258, 421079858, 1936954854, 1616945344, 2172753945, 1330631070, 3705438115, 572679748, 707427924, 2425400123, 2290647819, 1179044492, 4008585671, 3099120491, 336870440, 3739122087, 1583276732, 185277718, 3688593069, 3772791771, 842159716, 976899700, 168435220, 1229577106, 101059084, 606366792, 1549591736, 3267517855, 3553849021, 2897014595, 1650632388, 2442242105, 2509612081, 3840161747, 2038008818, 3890688725, 3368567691, 926374254, 1835907034, 2374863873, 3587531953, 1313788572, 2846482505, 1819063512, 1448540844, 4109633523, 3941213647, 1701162954, 2054852340, 2930698567, 134748176, 3132806511, 2021165296, 623210314, 774795868, 471606328, 2795958615, 3031746419, 3334885783, 3907527627, 3722280097, 1953799400, 522133822, 1263263126, 3183336545, 2341176845, 2324333839, 1886425312, 1044267644, 3048588401, 1718004428, 1212733584, 50529542, 4143317495, 235803164, 1633788866, 892690282, 1465383342, 3115962473, 2256965911, 3250673817, 488449850, 2661202215, 3789633753, 4177007595, 2560144171, 286339874, 1768537042, 3654906025, 2391705863, 2492770099, 2610673197, 505291324, 2273808917, 3924369609, 3469625735, 1431699370, 673740880, 3755965093, 2358021891, 2711746649, 2307489801, 218961690, 3217021541, 3873845719, 1111672452, 1751693520, 1094828930, 2576986153, 757954394, 252645662, 2964376443, 1414855848, 3149649517, 370555436],
  15548. Ht = [1374988112, 2118214995, 437757123, 975658646, 1001089995, 530400753, 2902087851, 1273168787, 540080725, 2910219766, 2295101073, 4110568485, 1340463100, 3307916247, 641025152, 3043140495, 3736164937, 632953703, 1172967064, 1576976609, 3274667266, 2169303058, 2370213795, 1809054150, 59727847, 361929877, 3211623147, 2505202138, 3569255213, 1484005843, 1239443753, 2395588676, 1975683434, 4102977912, 2572697195, 666464733, 3202437046, 4035489047, 3374361702, 2110667444, 1675577880, 3843699074, 2538681184, 1649639237, 2976151520, 3144396420, 4269907996, 4178062228, 1883793496, 2403728665, 2497604743, 1383856311, 2876494627, 1917518562, 3810496343, 1716890410, 3001755655, 800440835, 2261089178, 3543599269, 807962610, 599762354, 33778362, 3977675356, 2328828971, 2809771154, 4077384432, 1315562145, 1708848333, 101039829, 3509871135, 3299278474, 875451293, 2733856160, 92987698, 2767645557, 193195065, 1080094634, 1584504582, 3178106961, 1042385657, 2531067453, 3711829422, 1306967366, 2438237621, 1908694277, 67556463, 1615861247, 429456164, 3602770327, 2302690252, 1742315127, 2968011453, 126454664, 3877198648, 2043211483, 2709260871, 2084704233, 4169408201, 0, 159417987, 841739592, 504459436, 1817866830, 4245618683, 260388950, 1034867998, 908933415, 168810852, 1750902305, 2606453969, 607530554, 202008497, 2472011535, 3035535058, 463180190, 2160117071, 1641816226, 1517767529, 470948374, 3801332234, 3231722213, 1008918595, 303765277, 235474187, 4069246893, 766945465, 337553864, 1475418501, 2943682380, 4003061179, 2743034109, 4144047775, 1551037884, 1147550661, 1543208500, 2336434550, 3408119516, 3069049960, 3102011747, 3610369226, 1113818384, 328671808, 2227573024, 2236228733, 3535486456, 2935566865, 3341394285, 496906059, 3702665459, 226906860, 2009195472, 733156972, 2842737049, 294930682, 1206477858, 2835123396, 2700099354, 1451044056, 573804783, 2269728455, 3644379585, 2362090238, 2564033334, 2801107407, 2776292904, 3669462566, 1068351396, 742039012, 1350078989, 1784663195, 1417561698, 4136440770, 2430122216, 775550814, 2193862645, 2673705150, 1775276924, 1876241833, 3475313331, 3366754619, 270040487, 3902563182, 3678124923, 3441850377, 1851332852, 3969562369, 2203032232, 3868552805, 2868897406, 566021896, 4011190502, 3135740889, 1248802510, 3936291284, 699432150, 832877231, 708780849, 3332740144, 899835584, 1951317047, 4236429990, 3767586992, 866637845, 4043610186, 1106041591, 2144161806, 395441711, 1984812685, 1139781709, 3433712980, 3835036895, 2664543715, 1282050075, 3240894392, 1181045119, 2640243204, 25965917, 4203181171, 4211818798, 3009879386, 2463879762, 3910161971, 1842759443, 2597806476, 933301370, 1509430414, 3943906441, 3467192302, 3076639029, 3776767469, 2051518780, 2631065433, 1441952575, 404016761, 1942435775, 1408749034, 1610459739, 3745345300, 2017778566, 3400528769, 3110650942, 941896748, 3265478751, 371049330, 3168937228, 675039627, 4279080257, 967311729, 135050206, 3635733660, 1683407248, 2076935265, 3576870512, 1215061108, 3501741890],
  15549. Gt = [1347548327, 1400783205, 3273267108, 2520393566, 3409685355, 4045380933, 2880240216, 2471224067, 1428173050, 4138563181, 2441661558, 636813900, 4233094615, 3620022987, 2149987652, 2411029155, 1239331162, 1730525723, 2554718734, 3781033664, 46346101, 310463728, 2743944855, 3328955385, 3875770207, 2501218972, 3955191162, 3667219033, 768917123, 3545789473, 692707433, 1150208456, 1786102409, 2029293177, 1805211710, 3710368113, 3065962831, 401639597, 1724457132, 3028143674, 409198410, 2196052529, 1620529459, 1164071807, 3769721975, 2226875310, 486441376, 2499348523, 1483753576, 428819965, 2274680428, 3075636216, 598438867, 3799141122, 1474502543, 711349675, 129166120, 53458370, 2592523643, 2782082824, 4063242375, 2988687269, 3120694122, 1559041666, 730517276, 2460449204, 4042459122, 2706270690, 3446004468, 3573941694, 533804130, 2328143614, 2637442643, 2695033685, 839224033, 1973745387, 957055980, 2856345839, 106852767, 1371368976, 4181598602, 1033297158, 2933734917, 1179510461, 3046200461, 91341917, 1862534868, 4284502037, 605657339, 2547432937, 3431546947, 2003294622, 3182487618, 2282195339, 954669403, 3682191598, 1201765386, 3917234703, 3388507166, 0, 2198438022, 1211247597, 2887651696, 1315723890, 4227665663, 1443857720, 507358933, 657861945, 1678381017, 560487590, 3516619604, 975451694, 2970356327, 261314535, 3535072918, 2652609425, 1333838021, 2724322336, 1767536459, 370938394, 182621114, 3854606378, 1128014560, 487725847, 185469197, 2918353863, 3106780840, 3356761769, 2237133081, 1286567175, 3152976349, 4255350624, 2683765030, 3160175349, 3309594171, 878443390, 1988838185, 3704300486, 1756818940, 1673061617, 3403100636, 272786309, 1075025698, 545572369, 2105887268, 4174560061, 296679730, 1841768865, 1260232239, 4091327024, 3960309330, 3497509347, 1814803222, 2578018489, 4195456072, 575138148, 3299409036, 446754879, 3629546796, 4011996048, 3347532110, 3252238545, 4270639778, 915985419, 3483825537, 681933534, 651868046, 2755636671, 3828103837, 223377554, 2607439820, 1649704518, 3270937875, 3901806776, 1580087799, 4118987695, 3198115200, 2087309459, 2842678573, 3016697106, 1003007129, 2802849917, 1860738147, 2077965243, 164439672, 4100872472, 32283319, 2827177882, 1709610350, 2125135846, 136428751, 3874428392, 3652904859, 3460984630, 3572145929, 3593056380, 2939266226, 824852259, 818324884, 3224740454, 930369212, 2801566410, 2967507152, 355706840, 1257309336, 4148292826, 243256656, 790073846, 2373340630, 1296297904, 1422699085, 3756299780, 3818836405, 457992840, 3099667487, 2135319889, 77422314, 1560382517, 1945798516, 788204353, 1521706781, 1385356242, 870912086, 325965383, 2358957921, 2050466060, 2388260884, 2313884476, 4006521127, 901210569, 3990953189, 1014646705, 1503449823, 1062597235, 2031621326, 3212035895, 3931371469, 1533017514, 350174575, 2256028891, 2177544179, 1052338372, 741876788, 1606591296, 1914052035, 213705253, 2334669897, 1107234197, 1899603969, 3725069491, 2631447780, 2422494913, 1635502980, 1893020342, 1950903388, 1120974935],
  15550. Vt = [2807058932, 1699970625, 2764249623, 1586903591, 1808481195, 1173430173, 1487645946, 59984867, 4199882800, 1844882806, 1989249228, 1277555970, 3623636965, 3419915562, 1149249077, 2744104290, 1514790577, 459744698, 244860394, 3235995134, 1963115311, 4027744588, 2544078150, 4190530515, 1608975247, 2627016082, 2062270317, 1507497298, 2200818878, 567498868, 1764313568, 3359936201, 2305455554, 2037970062, 1047239e3, 1910319033, 1337376481, 2904027272, 2892417312, 984907214, 1243112415, 830661914, 861968209, 2135253587, 2011214180, 2927934315, 2686254721, 731183368, 1750626376, 4246310725, 1820824798, 4172763771, 3542330227, 48394827, 2404901663, 2871682645, 671593195, 3254988725, 2073724613, 145085239, 2280796200, 2779915199, 1790575107, 2187128086, 472615631, 3029510009, 4075877127, 3802222185, 4107101658, 3201631749, 1646252340, 4270507174, 1402811438, 1436590835, 3778151818, 3950355702, 3963161475, 4020912224, 2667994737, 273792366, 2331590177, 104699613, 95345982, 3175501286, 2377486676, 1560637892, 3564045318, 369057872, 4213447064, 3919042237, 1137477952, 2658625497, 1119727848, 2340947849, 1530455833, 4007360968, 172466556, 266959938, 516552836, 0, 2256734592, 3980931627, 1890328081, 1917742170, 4294704398, 945164165, 3575528878, 958871085, 3647212047, 2787207260, 1423022939, 775562294, 1739656202, 3876557655, 2530391278, 2443058075, 3310321856, 547512796, 1265195639, 437656594, 3121275539, 719700128, 3762502690, 387781147, 218828297, 3350065803, 2830708150, 2848461854, 428169201, 122466165, 3720081049, 1627235199, 648017665, 4122762354, 1002783846, 2117360635, 695634755, 3336358691, 4234721005, 4049844452, 3704280881, 2232435299, 574624663, 287343814, 612205898, 1039717051, 840019705, 2708326185, 793451934, 821288114, 1391201670, 3822090177, 376187827, 3113855344, 1224348052, 1679968233, 2361698556, 1058709744, 752375421, 2431590963, 1321699145, 3519142200, 2734591178, 188127444, 2177869557, 3727205754, 2384911031, 3215212461, 2648976442, 2450346104, 3432737375, 1180849278, 331544205, 3102249176, 4150144569, 2952102595, 2159976285, 2474404304, 766078933, 313773861, 2570832044, 2108100632, 1668212892, 3145456443, 2013908262, 418672217, 3070356634, 2594734927, 1852171925, 3867060991, 3473416636, 3907448597, 2614737639, 919489135, 164948639, 2094410160, 2997825956, 590424639, 2486224549, 1723872674, 3157750862, 3399941250, 3501252752, 3625268135, 2555048196, 3673637356, 1343127501, 4130281361, 3599595085, 2957853679, 1297403050, 81781910, 3051593425, 2283490410, 532201772, 1367295589, 3926170974, 895287692, 1953757831, 1093597963, 492483431, 3528626907, 1446242576, 1192455638, 1636604631, 209336225, 344873464, 1015671571, 669961897, 3375740769, 3857572124, 2973530695, 3747192018, 1933530610, 3464042516, 935293895, 3454686199, 2858115069, 1863638845, 3683022916, 4085369519, 3292445032, 875313188, 1080017571, 3279033885, 621591778, 1233856572, 2504130317, 24197544, 3017672716, 3835484340, 3247465558, 2220981195, 3060847922, 1551124588, 1463996600],
  15551. Yt = [4104605777, 1097159550, 396673818, 660510266, 2875968315, 2638606623, 4200115116, 3808662347, 821712160, 1986918061, 3430322568, 38544885, 3856137295, 718002117, 893681702, 1654886325, 2975484382, 3122358053, 3926825029, 4274053469, 796197571, 1290801793, 1184342925, 3556361835, 2405426947, 2459735317, 1836772287, 1381620373, 3196267988, 1948373848, 3764988233, 3385345166, 3263785589, 2390325492, 1480485785, 3111247143, 3780097726, 2293045232, 548169417, 3459953789, 3746175075, 439452389, 1362321559, 1400849762, 1685577905, 1806599355, 2174754046, 137073913, 1214797936, 1174215055, 3731654548, 2079897426, 1943217067, 1258480242, 529487843, 1437280870, 3945269170, 3049390895, 3313212038, 923313619, 679998e3, 3215307299, 57326082, 377642221, 3474729866, 2041877159, 133361907, 1776460110, 3673476453, 96392454, 878845905, 2801699524, 777231668, 4082475170, 2330014213, 4142626212, 2213296395, 1626319424, 1906247262, 1846563261, 562755902, 3708173718, 1040559837, 3871163981, 1418573201, 3294430577, 114585348, 1343618912, 2566595609, 3186202582, 1078185097, 3651041127, 3896688048, 2307622919, 425408743, 3371096953, 2081048481, 1108339068, 2216610296, 0, 2156299017, 736970802, 292596766, 1517440620, 251657213, 2235061775, 2933202493, 758720310, 265905162, 1554391400, 1532285339, 908999204, 174567692, 1474760595, 4002861748, 2610011675, 3234156416, 3693126241, 2001430874, 303699484, 2478443234, 2687165888, 585122620, 454499602, 151849742, 2345119218, 3064510765, 514443284, 4044981591, 1963412655, 2581445614, 2137062819, 19308535, 1928707164, 1715193156, 4219352155, 1126790795, 600235211, 3992742070, 3841024952, 836553431, 1669664834, 2535604243, 3323011204, 1243905413, 3141400786, 4180808110, 698445255, 2653899549, 2989552604, 2253581325, 3252932727, 3004591147, 1891211689, 2487810577, 3915653703, 4237083816, 4030667424, 2100090966, 865136418, 1229899655, 953270745, 3399679628, 3557504664, 4118925222, 2061379749, 3079546586, 2915017791, 983426092, 2022837584, 1607244650, 2118541908, 2366882550, 3635996816, 972512814, 3283088770, 1568718495, 3499326569, 3576539503, 621982671, 2895723464, 410887952, 2623762152, 1002142683, 645401037, 1494807662, 2595684844, 1335535747, 2507040230, 4293295786, 3167684641, 367585007, 3885750714, 1865862730, 2668221674, 2960971305, 2763173681, 1059270954, 2777952454, 2724642869, 1320957812, 2194319100, 2429595872, 2815956275, 77089521, 3973773121, 3444575871, 2448830231, 1305906550, 4021308739, 2857194700, 2516901860, 3518358430, 1787304780, 740276417, 1699839814, 1592394909, 2352307457, 2272556026, 188821243, 1729977011, 3687994002, 274084841, 3594982253, 3613494426, 2701949495, 4162096729, 322734571, 2837966542, 1640576439, 484830689, 1202797690, 3537852828, 4067639125, 349075736, 3342319475, 4157467219, 4255800159, 1030690015, 1155237496, 2951971274, 1757691577, 607398968, 2738905026, 499347990, 3794078908, 1011452712, 227885567, 2818666809, 213114376, 3034881240, 1455525988, 3414450555, 850817237, 1817998408, 3092726480],
  15552. Qt = [0, 235474187, 470948374, 303765277, 941896748, 908933415, 607530554, 708780849, 1883793496, 2118214995, 1817866830, 1649639237, 1215061108, 1181045119, 1417561698, 1517767529, 3767586992, 4003061179, 4236429990, 4069246893, 3635733660, 3602770327, 3299278474, 3400528769, 2430122216, 2664543715, 2362090238, 2193862645, 2835123396, 2801107407, 3035535058, 3135740889, 3678124923, 3576870512, 3341394285, 3374361702, 3810496343, 3977675356, 4279080257, 4043610186, 2876494627, 2776292904, 3076639029, 3110650942, 2472011535, 2640243204, 2403728665, 2169303058, 1001089995, 899835584, 666464733, 699432150, 59727847, 226906860, 530400753, 294930682, 1273168787, 1172967064, 1475418501, 1509430414, 1942435775, 2110667444, 1876241833, 1641816226, 2910219766, 2743034109, 2976151520, 3211623147, 2505202138, 2606453969, 2302690252, 2269728455, 3711829422, 3543599269, 3240894392, 3475313331, 3843699074, 3943906441, 4178062228, 4144047775, 1306967366, 1139781709, 1374988112, 1610459739, 1975683434, 2076935265, 1775276924, 1742315127, 1034867998, 866637845, 566021896, 800440835, 92987698, 193195065, 429456164, 395441711, 1984812685, 2017778566, 1784663195, 1683407248, 1315562145, 1080094634, 1383856311, 1551037884, 101039829, 135050206, 437757123, 337553864, 1042385657, 807962610, 573804783, 742039012, 2531067453, 2564033334, 2328828971, 2227573024, 2935566865, 2700099354, 3001755655, 3168937228, 3868552805, 3902563182, 4203181171, 4102977912, 3736164937, 3501741890, 3265478751, 3433712980, 1106041591, 1340463100, 1576976609, 1408749034, 2043211483, 2009195472, 1708848333, 1809054150, 832877231, 1068351396, 766945465, 599762354, 159417987, 126454664, 361929877, 463180190, 2709260871, 2943682380, 3178106961, 3009879386, 2572697195, 2538681184, 2236228733, 2336434550, 3509871135, 3745345300, 3441850377, 3274667266, 3910161971, 3877198648, 4110568485, 4211818798, 2597806476, 2497604743, 2261089178, 2295101073, 2733856160, 2902087851, 3202437046, 2968011453, 3936291284, 3835036895, 4136440770, 4169408201, 3535486456, 3702665459, 3467192302, 3231722213, 2051518780, 1951317047, 1716890410, 1750902305, 1113818384, 1282050075, 1584504582, 1350078989, 168810852, 67556463, 371049330, 404016761, 841739592, 1008918595, 775550814, 540080725, 3969562369, 3801332234, 4035489047, 4269907996, 3569255213, 3669462566, 3366754619, 3332740144, 2631065433, 2463879762, 2160117071, 2395588676, 2767645557, 2868897406, 3102011747, 3069049960, 202008497, 33778362, 270040487, 504459436, 875451293, 975658646, 675039627, 641025152, 2084704233, 1917518562, 1615861247, 1851332852, 1147550661, 1248802510, 1484005843, 1451044056, 933301370, 967311729, 733156972, 632953703, 260388950, 25965917, 328671808, 496906059, 1206477858, 1239443753, 1543208500, 1441952575, 2144161806, 1908694277, 1675577880, 1842759443, 3610369226, 3644379585, 3408119516, 3307916247, 4011190502, 3776767469, 4077384432, 4245618683, 2809771154, 2842737049, 3144396420, 3043140495, 2673705150, 2438237621, 2203032232, 2370213795],
  15553. Xt = [0, 185469197, 370938394, 487725847, 741876788, 657861945, 975451694, 824852259, 1483753576, 1400783205, 1315723890, 1164071807, 1950903388, 2135319889, 1649704518, 1767536459, 2967507152, 3152976349, 2801566410, 2918353863, 2631447780, 2547432937, 2328143614, 2177544179, 3901806776, 3818836405, 4270639778, 4118987695, 3299409036, 3483825537, 3535072918, 3652904859, 2077965243, 1893020342, 1841768865, 1724457132, 1474502543, 1559041666, 1107234197, 1257309336, 598438867, 681933534, 901210569, 1052338372, 261314535, 77422314, 428819965, 310463728, 3409685355, 3224740454, 3710368113, 3593056380, 3875770207, 3960309330, 4045380933, 4195456072, 2471224067, 2554718734, 2237133081, 2388260884, 3212035895, 3028143674, 2842678573, 2724322336, 4138563181, 4255350624, 3769721975, 3955191162, 3667219033, 3516619604, 3431546947, 3347532110, 2933734917, 2782082824, 3099667487, 3016697106, 2196052529, 2313884476, 2499348523, 2683765030, 1179510461, 1296297904, 1347548327, 1533017514, 1786102409, 1635502980, 2087309459, 2003294622, 507358933, 355706840, 136428751, 53458370, 839224033, 957055980, 605657339, 790073846, 2373340630, 2256028891, 2607439820, 2422494913, 2706270690, 2856345839, 3075636216, 3160175349, 3573941694, 3725069491, 3273267108, 3356761769, 4181598602, 4063242375, 4011996048, 3828103837, 1033297158, 915985419, 730517276, 545572369, 296679730, 446754879, 129166120, 213705253, 1709610350, 1860738147, 1945798516, 2029293177, 1239331162, 1120974935, 1606591296, 1422699085, 4148292826, 4233094615, 3781033664, 3931371469, 3682191598, 3497509347, 3446004468, 3328955385, 2939266226, 2755636671, 3106780840, 2988687269, 2198438022, 2282195339, 2501218972, 2652609425, 1201765386, 1286567175, 1371368976, 1521706781, 1805211710, 1620529459, 2105887268, 1988838185, 533804130, 350174575, 164439672, 46346101, 870912086, 954669403, 636813900, 788204353, 2358957921, 2274680428, 2592523643, 2441661558, 2695033685, 2880240216, 3065962831, 3182487618, 3572145929, 3756299780, 3270937875, 3388507166, 4174560061, 4091327024, 4006521127, 3854606378, 1014646705, 930369212, 711349675, 560487590, 272786309, 457992840, 106852767, 223377554, 1678381017, 1862534868, 1914052035, 2031621326, 1211247597, 1128014560, 1580087799, 1428173050, 32283319, 182621114, 401639597, 486441376, 768917123, 651868046, 1003007129, 818324884, 1503449823, 1385356242, 1333838021, 1150208456, 1973745387, 2125135846, 1673061617, 1756818940, 2970356327, 3120694122, 2802849917, 2887651696, 2637442643, 2520393566, 2334669897, 2149987652, 3917234703, 3799141122, 4284502037, 4100872472, 3309594171, 3460984630, 3545789473, 3629546796, 2050466060, 1899603969, 1814803222, 1730525723, 1443857720, 1560382517, 1075025698, 1260232239, 575138148, 692707433, 878443390, 1062597235, 243256656, 91341917, 409198410, 325965383, 3403100636, 3252238545, 3704300486, 3620022987, 3874428392, 3990953189, 4042459122, 4227665663, 2460449204, 2578018489, 2226875310, 2411029155, 3198115200, 3046200461, 2827177882, 2743944855],
  15554. Zt = [0, 218828297, 437656594, 387781147, 875313188, 958871085, 775562294, 590424639, 1750626376, 1699970625, 1917742170, 2135253587, 1551124588, 1367295589, 1180849278, 1265195639, 3501252752, 3720081049, 3399941250, 3350065803, 3835484340, 3919042237, 4270507174, 4085369519, 3102249176, 3051593425, 2734591178, 2952102595, 2361698556, 2177869557, 2530391278, 2614737639, 3145456443, 3060847922, 2708326185, 2892417312, 2404901663, 2187128086, 2504130317, 2555048196, 3542330227, 3727205754, 3375740769, 3292445032, 3876557655, 3926170974, 4246310725, 4027744588, 1808481195, 1723872674, 1910319033, 2094410160, 1608975247, 1391201670, 1173430173, 1224348052, 59984867, 244860394, 428169201, 344873464, 935293895, 984907214, 766078933, 547512796, 1844882806, 1627235199, 2011214180, 2062270317, 1507497298, 1423022939, 1137477952, 1321699145, 95345982, 145085239, 532201772, 313773861, 830661914, 1015671571, 731183368, 648017665, 3175501286, 2957853679, 2807058932, 2858115069, 2305455554, 2220981195, 2474404304, 2658625497, 3575528878, 3625268135, 3473416636, 3254988725, 3778151818, 3963161475, 4213447064, 4130281361, 3599595085, 3683022916, 3432737375, 3247465558, 3802222185, 4020912224, 4172763771, 4122762354, 3201631749, 3017672716, 2764249623, 2848461854, 2331590177, 2280796200, 2431590963, 2648976442, 104699613, 188127444, 472615631, 287343814, 840019705, 1058709744, 671593195, 621591778, 1852171925, 1668212892, 1953757831, 2037970062, 1514790577, 1463996600, 1080017571, 1297403050, 3673637356, 3623636965, 3235995134, 3454686199, 4007360968, 3822090177, 4107101658, 4190530515, 2997825956, 3215212461, 2830708150, 2779915199, 2256734592, 2340947849, 2627016082, 2443058075, 172466556, 122466165, 273792366, 492483431, 1047239e3, 861968209, 612205898, 695634755, 1646252340, 1863638845, 2013908262, 1963115311, 1446242576, 1530455833, 1277555970, 1093597963, 1636604631, 1820824798, 2073724613, 1989249228, 1436590835, 1487645946, 1337376481, 1119727848, 164948639, 81781910, 331544205, 516552836, 1039717051, 821288114, 669961897, 719700128, 2973530695, 3157750862, 2871682645, 2787207260, 2232435299, 2283490410, 2667994737, 2450346104, 3647212047, 3564045318, 3279033885, 3464042516, 3980931627, 3762502690, 4150144569, 4199882800, 3070356634, 3121275539, 2904027272, 2686254721, 2200818878, 2384911031, 2570832044, 2486224549, 3747192018, 3528626907, 3310321856, 3359936201, 3950355702, 3867060991, 4049844452, 4234721005, 1739656202, 1790575107, 2108100632, 1890328081, 1402811438, 1586903591, 1233856572, 1149249077, 266959938, 48394827, 369057872, 418672217, 1002783846, 919489135, 567498868, 752375421, 209336225, 24197544, 376187827, 459744698, 945164165, 895287692, 574624663, 793451934, 1679968233, 1764313568, 2117360635, 1933530610, 1343127501, 1560637892, 1243112415, 1192455638, 3704280881, 3519142200, 3336358691, 3419915562, 3907448597, 3857572124, 4075877127, 4294704398, 3029510009, 3113855344, 2927934315, 2744104290, 2159976285, 2377486676, 2594734927, 2544078150],
  15555. en = [0, 151849742, 303699484, 454499602, 607398968, 758720310, 908999204, 1059270954, 1214797936, 1097159550, 1517440620, 1400849762, 1817998408, 1699839814, 2118541908, 2001430874, 2429595872, 2581445614, 2194319100, 2345119218, 3034881240, 3186202582, 2801699524, 2951971274, 3635996816, 3518358430, 3399679628, 3283088770, 4237083816, 4118925222, 4002861748, 3885750714, 1002142683, 850817237, 698445255, 548169417, 529487843, 377642221, 227885567, 77089521, 1943217067, 2061379749, 1640576439, 1757691577, 1474760595, 1592394909, 1174215055, 1290801793, 2875968315, 2724642869, 3111247143, 2960971305, 2405426947, 2253581325, 2638606623, 2487810577, 3808662347, 3926825029, 4044981591, 4162096729, 3342319475, 3459953789, 3576539503, 3693126241, 1986918061, 2137062819, 1685577905, 1836772287, 1381620373, 1532285339, 1078185097, 1229899655, 1040559837, 923313619, 740276417, 621982671, 439452389, 322734571, 137073913, 19308535, 3871163981, 4021308739, 4104605777, 4255800159, 3263785589, 3414450555, 3499326569, 3651041127, 2933202493, 2815956275, 3167684641, 3049390895, 2330014213, 2213296395, 2566595609, 2448830231, 1305906550, 1155237496, 1607244650, 1455525988, 1776460110, 1626319424, 2079897426, 1928707164, 96392454, 213114376, 396673818, 514443284, 562755902, 679998e3, 865136418, 983426092, 3708173718, 3557504664, 3474729866, 3323011204, 4180808110, 4030667424, 3945269170, 3794078908, 2507040230, 2623762152, 2272556026, 2390325492, 2975484382, 3092726480, 2738905026, 2857194700, 3973773121, 3856137295, 4274053469, 4157467219, 3371096953, 3252932727, 3673476453, 3556361835, 2763173681, 2915017791, 3064510765, 3215307299, 2156299017, 2307622919, 2459735317, 2610011675, 2081048481, 1963412655, 1846563261, 1729977011, 1480485785, 1362321559, 1243905413, 1126790795, 878845905, 1030690015, 645401037, 796197571, 274084841, 425408743, 38544885, 188821243, 3613494426, 3731654548, 3313212038, 3430322568, 4082475170, 4200115116, 3780097726, 3896688048, 2668221674, 2516901860, 2366882550, 2216610296, 3141400786, 2989552604, 2837966542, 2687165888, 1202797690, 1320957812, 1437280870, 1554391400, 1669664834, 1787304780, 1906247262, 2022837584, 265905162, 114585348, 499347990, 349075736, 736970802, 585122620, 972512814, 821712160, 2595684844, 2478443234, 2293045232, 2174754046, 3196267988, 3079546586, 2895723464, 2777952454, 3537852828, 3687994002, 3234156416, 3385345166, 4142626212, 4293295786, 3841024952, 3992742070, 174567692, 57326082, 410887952, 292596766, 777231668, 660510266, 1011452712, 893681702, 1108339068, 1258480242, 1343618912, 1494807662, 1715193156, 1865862730, 1948373848, 2100090966, 2701949495, 2818666809, 3004591147, 3122358053, 2235061775, 2352307457, 2535604243, 2653899549, 3915653703, 3764988233, 4219352155, 4067639125, 3444575871, 3294430577, 3746175075, 3594982253, 836553431, 953270745, 600235211, 718002117, 367585007, 484830689, 133361907, 251657213, 2041877159, 1891211689, 1806599355, 1654886325, 1568718495, 1418573201, 1335535747, 1184342925];
  15556. function tn(e) {
  15557. for (var t = [], n = 0; n < e.length; n += 4) {
  15558. t.push(e[n] << 24 | e[n + 1] << 16 | e[n + 2] << 8 | e[n + 3]);
  15559. }
  15560. return t;
  15561. }
  15562. var nn = /*#__PURE__*/function () {
  15563. function nn(e) {
  15564. (0, _classCallCheck2.default)(this, nn);
  15565. if (!(this instanceof nn)) throw Error("AES must be instanitated with `new`");
  15566. Object.defineProperty(this, "key", {
  15567. value: Rt(e, !0)
  15568. }), this._prepare();
  15569. }
  15570. (0, _createClass2.default)(nn, [{
  15571. key: "_prepare",
  15572. value: function _prepare() {
  15573. var e = Kt[this.key.length];
  15574. if (null == e) throw new Error("invalid key size (must be 16, 24 or 32 bytes)");
  15575. this._Ke = [], this._Kd = [];
  15576. for (var t = 0; t <= e; t++) {
  15577. this._Ke.push([0, 0, 0, 0]), this._Kd.push([0, 0, 0, 0]);
  15578. }
  15579. var n,
  15580. s = 4 * (e + 1),
  15581. r = this.key.length / 4,
  15582. i = tn(this.key);
  15583. for (t = 0; t < r; t++) {
  15584. n = t >> 2, this._Ke[n][t % 4] = i[t], this._Kd[e - n][t % 4] = i[t];
  15585. }
  15586. for (var o, a = 0, c = r; c < s;) {
  15587. if (o = i[r - 1], i[0] ^= jt[o >> 16 & 255] << 24 ^ jt[o >> 8 & 255] << 16 ^ jt[255 & o] << 8 ^ jt[o >> 24 & 255] ^ Mt[a] << 24, a += 1, 8 != r) for (t = 1; t < r; t++) {
  15588. i[t] ^= i[t - 1];
  15589. } else {
  15590. for (t = 1; t < r / 2; t++) {
  15591. i[t] ^= i[t - 1];
  15592. }
  15593. o = i[r / 2 - 1], i[r / 2] ^= jt[255 & o] ^ jt[o >> 8 & 255] << 8 ^ jt[o >> 16 & 255] << 16 ^ jt[o >> 24 & 255] << 24;
  15594. for (t = r / 2 + 1; t < r; t++) {
  15595. i[t] ^= i[t - 1];
  15596. }
  15597. }
  15598. for (t = 0; t < r && c < s;) {
  15599. u = c >> 2, l = c % 4, this._Ke[u][l] = i[t], this._Kd[e - u][l] = i[t++], c++;
  15600. }
  15601. }
  15602. for (var u = 1; u < e; u++) {
  15603. for (var l = 0; l < 4; l++) {
  15604. o = this._Kd[u][l], this._Kd[u][l] = Qt[o >> 24 & 255] ^ Xt[o >> 16 & 255] ^ Zt[o >> 8 & 255] ^ en[255 & o];
  15605. }
  15606. }
  15607. }
  15608. }, {
  15609. key: "encrypt",
  15610. value: function encrypt(e) {
  15611. if (16 != e.length) throw new Error("invalid plaintext size (must be 16 bytes)");
  15612. for (var t = this._Ke.length - 1, n = [0, 0, 0, 0], s = tn(e), r = 0; r < 4; r++) {
  15613. s[r] ^= this._Ke[0][r];
  15614. }
  15615. for (var i = 1; i < t; i++) {
  15616. for (r = 0; r < 4; r++) {
  15617. n[r] = $t[s[r] >> 24 & 255] ^ Wt[s[(r + 1) % 4] >> 16 & 255] ^ zt[s[(r + 2) % 4] >> 8 & 255] ^ Jt[255 & s[(r + 3) % 4]] ^ this._Ke[i][r];
  15618. }
  15619. s = n.slice();
  15620. }
  15621. var o,
  15622. a = Lt(16);
  15623. for (r = 0; r < 4; r++) {
  15624. o = this._Ke[t][r], a[4 * r] = 255 & (jt[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (jt[s[(r + 1) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (jt[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (jt[255 & s[(r + 3) % 4]] ^ o);
  15625. }
  15626. return a;
  15627. }
  15628. }, {
  15629. key: "decrypt",
  15630. value: function decrypt(e) {
  15631. if (16 != e.length) throw new Error("invalid ciphertext size (must be 16 bytes)");
  15632. for (var t = this._Kd.length - 1, n = [0, 0, 0, 0], s = tn(e), r = 0; r < 4; r++) {
  15633. s[r] ^= this._Kd[0][r];
  15634. }
  15635. for (var i = 1; i < t; i++) {
  15636. for (r = 0; r < 4; r++) {
  15637. n[r] = Ht[s[r] >> 24 & 255] ^ Gt[s[(r + 3) % 4] >> 16 & 255] ^ Vt[s[(r + 2) % 4] >> 8 & 255] ^ Yt[255 & s[(r + 1) % 4]] ^ this._Kd[i][r];
  15638. }
  15639. s = n.slice();
  15640. }
  15641. var o,
  15642. a = Lt(16);
  15643. for (r = 0; r < 4; r++) {
  15644. o = this._Kd[t][r], a[4 * r] = 255 & (Bt[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (Bt[s[(r + 3) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (Bt[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (Bt[255 & s[(r + 1) % 4]] ^ o);
  15645. }
  15646. return a;
  15647. }
  15648. }]);
  15649. return nn;
  15650. }();
  15651. var sn = /*#__PURE__*/function () {
  15652. function sn(e) {
  15653. (0, _classCallCheck2.default)(this, sn);
  15654. if (!(this instanceof sn)) throw Error("AES must be instanitated with `new`");
  15655. this.description = "Electronic Code Block", this.name = "ecb", this._aes = new nn(e);
  15656. }
  15657. (0, _createClass2.default)(sn, [{
  15658. key: "encrypt",
  15659. value: function encrypt(e) {
  15660. if ((e = Rt(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  15661. for (var t = Lt(e.length), n = Lt(16), s = 0; s < e.length; s += 16) {
  15662. Nt(e, n, 0, s, s + 16), Nt(n = this._aes.encrypt(n), t, s);
  15663. }
  15664. return t;
  15665. }
  15666. }, {
  15667. key: "decrypt",
  15668. value: function decrypt(e) {
  15669. if ((e = Rt(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  15670. for (var t = Lt(e.length), n = Lt(16), s = 0; s < e.length; s += 16) {
  15671. Nt(e, n, 0, s, s + 16), Nt(n = this._aes.decrypt(n), t, s);
  15672. }
  15673. return t;
  15674. }
  15675. }]);
  15676. return sn;
  15677. }();
  15678. var rn = /*#__PURE__*/function () {
  15679. function rn(e, t) {
  15680. (0, _classCallCheck2.default)(this, rn);
  15681. if (!(this instanceof rn)) throw Error("AES must be instanitated with `new`");
  15682. if (this.description = "Cipher Block Chaining", this.name = "cbc", t) {
  15683. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  15684. } else t = Lt(16);
  15685. this._lastCipherblock = Rt(t, !0), this._aes = new nn(e);
  15686. }
  15687. (0, _createClass2.default)(rn, [{
  15688. key: "encrypt",
  15689. value: function encrypt(e) {
  15690. if ((e = Rt(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  15691. for (var t = Lt(e.length), n = Lt(16), s = 0; s < e.length; s += 16) {
  15692. Nt(e, n, 0, s, s + 16);
  15693. for (var r = 0; r < 16; r++) {
  15694. n[r] ^= this._lastCipherblock[r];
  15695. }
  15696. this._lastCipherblock = this._aes.encrypt(n), Nt(this._lastCipherblock, t, s);
  15697. }
  15698. return t;
  15699. }
  15700. }, {
  15701. key: "decrypt",
  15702. value: function decrypt(e) {
  15703. if ((e = Rt(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  15704. for (var t = Lt(e.length), n = Lt(16), s = 0; s < e.length; s += 16) {
  15705. Nt(e, n, 0, s, s + 16), n = this._aes.decrypt(n);
  15706. for (var r = 0; r < 16; r++) {
  15707. t[s + r] = n[r] ^ this._lastCipherblock[r];
  15708. }
  15709. Nt(e, this._lastCipherblock, 0, s, s + 16);
  15710. }
  15711. return t;
  15712. }
  15713. }]);
  15714. return rn;
  15715. }();
  15716. var on = /*#__PURE__*/function () {
  15717. function on(e, t, n) {
  15718. (0, _classCallCheck2.default)(this, on);
  15719. if (!(this instanceof on)) throw Error("AES must be instanitated with `new`");
  15720. if (this.description = "Cipher Feedback", this.name = "cfb", t) {
  15721. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 size)");
  15722. } else t = Lt(16);
  15723. n || (n = 1), this.segmentSize = n, this._shiftRegister = Rt(t, !0), this._aes = new nn(e);
  15724. }
  15725. (0, _createClass2.default)(on, [{
  15726. key: "encrypt",
  15727. value: function encrypt(e) {
  15728. if (e.length % this.segmentSize != 0) throw new Error("invalid plaintext size (must be segmentSize bytes)");
  15729. for (var t, n = Rt(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  15730. t = this._aes.encrypt(this._shiftRegister);
  15731. for (var r = 0; r < this.segmentSize; r++) {
  15732. n[s + r] ^= t[r];
  15733. }
  15734. Nt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Nt(n, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  15735. }
  15736. return n;
  15737. }
  15738. }, {
  15739. key: "decrypt",
  15740. value: function decrypt(e) {
  15741. if (e.length % this.segmentSize != 0) throw new Error("invalid ciphertext size (must be segmentSize bytes)");
  15742. for (var t, n = Rt(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  15743. t = this._aes.encrypt(this._shiftRegister);
  15744. for (var r = 0; r < this.segmentSize; r++) {
  15745. n[s + r] ^= t[r];
  15746. }
  15747. Nt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Nt(e, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  15748. }
  15749. return n;
  15750. }
  15751. }]);
  15752. return on;
  15753. }();
  15754. var an = /*#__PURE__*/function () {
  15755. function an(e, t) {
  15756. (0, _classCallCheck2.default)(this, an);
  15757. if (!(this instanceof an)) throw Error("AES must be instanitated with `new`");
  15758. if (this.description = "Output Feedback", this.name = "ofb", t) {
  15759. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  15760. } else t = Lt(16);
  15761. this._lastPrecipher = Rt(t, !0), this._lastPrecipherIndex = 16, this._aes = new nn(e);
  15762. }
  15763. (0, _createClass2.default)(an, [{
  15764. key: "encrypt",
  15765. value: function encrypt(e) {
  15766. for (var t = Rt(e, !0), n = 0; n < t.length; n++) {
  15767. 16 === this._lastPrecipherIndex && (this._lastPrecipher = this._aes.encrypt(this._lastPrecipher), this._lastPrecipherIndex = 0), t[n] ^= this._lastPrecipher[this._lastPrecipherIndex++];
  15768. }
  15769. return t;
  15770. }
  15771. }, {
  15772. key: "decrypt",
  15773. value: function decrypt(e) {
  15774. return this.encrypt(e);
  15775. }
  15776. }]);
  15777. return an;
  15778. }();
  15779. var cn = /*#__PURE__*/function () {
  15780. function cn(e) {
  15781. (0, _classCallCheck2.default)(this, cn);
  15782. if (!(this instanceof cn)) throw Error("Counter must be instanitated with `new`");
  15783. 0 === e || e || (e = 1), "number" == typeof e ? (this._counter = Lt(16), this.setValue(e)) : this.setBytes(e);
  15784. }
  15785. (0, _createClass2.default)(cn, [{
  15786. key: "setValue",
  15787. value: function setValue(e) {
  15788. if ("number" != typeof e || parseInt(e) != e) throw new Error("invalid counter value (must be an integer)");
  15789. if (e > Number.MAX_SAFE_INTEGER) throw new Error("integer value out of safe range");
  15790. for (var t = 15; t >= 0; --t) {
  15791. this._counter[t] = e % 256, e = parseInt(e / 256);
  15792. }
  15793. }
  15794. }, {
  15795. key: "setBytes",
  15796. value: function setBytes(e) {
  15797. if (16 != (e = Rt(e, !0)).length) throw new Error("invalid counter bytes size (must be 16 bytes)");
  15798. this._counter = e;
  15799. }
  15800. }, {
  15801. key: "increment",
  15802. value: function increment() {
  15803. for (var e = 15; e >= 0; e--) {
  15804. if (255 !== this._counter[e]) {
  15805. this._counter[e]++;
  15806. break;
  15807. }
  15808. this._counter[e] = 0;
  15809. }
  15810. }
  15811. }]);
  15812. return cn;
  15813. }();
  15814. var un = /*#__PURE__*/function () {
  15815. function un(e, t) {
  15816. (0, _classCallCheck2.default)(this, un);
  15817. if (!(this instanceof un)) throw Error("AES must be instanitated with `new`");
  15818. this.description = "Counter", this.name = "ctr", t instanceof cn || (t = new cn(t)), this._counter = t, this._remainingCounter = null, this._remainingCounterIndex = 16, this._aes = new nn(e);
  15819. }
  15820. (0, _createClass2.default)(un, [{
  15821. key: "encrypt",
  15822. value: function encrypt(e) {
  15823. for (var t = Rt(e, !0), n = 0; n < t.length; n++) {
  15824. 16 === this._remainingCounterIndex && (this._remainingCounter = this._aes.encrypt(this._counter._counter), this._remainingCounterIndex = 0, this._counter.increment()), t[n] ^= this._remainingCounter[this._remainingCounterIndex++];
  15825. }
  15826. return t;
  15827. }
  15828. }, {
  15829. key: "decrypt",
  15830. value: function decrypt(e) {
  15831. return this.encrypt(e);
  15832. }
  15833. }]);
  15834. return un;
  15835. }();
  15836. var ln = {
  15837. AES: nn,
  15838. Counter: cn,
  15839. ModeOfOperation: {
  15840. ecb: sn,
  15841. cbc: rn,
  15842. cfb: on,
  15843. ofb: an,
  15844. ctr: un
  15845. },
  15846. utils: {
  15847. hex: qt,
  15848. utf8: Ft
  15849. },
  15850. padding: {
  15851. pkcs7: {
  15852. pad: function pad(e) {
  15853. var t = 16 - (e = Rt(e, !0)).length % 16,
  15854. n = Lt(e.length + t);
  15855. Nt(e, n);
  15856. for (var s = e.length; s < n.length; s++) {
  15857. n[s] = t;
  15858. }
  15859. return n;
  15860. },
  15861. strip: function strip(e) {
  15862. if ((e = Rt(e, !0)).length < 16) throw new Error("PKCS#7 invalid length");
  15863. var t = e[e.length - 1];
  15864. if (t > 16) throw new Error("PKCS#7 padding byte out of range");
  15865. for (var n = e.length - t, s = 0; s < t; s++) {
  15866. if (e[n + s] !== t) throw new Error("PKCS#7 invalid padding byte");
  15867. }
  15868. var r = Lt(n);
  15869. return Nt(e, r, 0, 0, n), r;
  15870. }
  15871. }
  15872. },
  15873. _arrayTest: {
  15874. coerceArray: Rt,
  15875. createArray: Lt,
  15876. copyArray: Nt
  15877. }
  15878. };
  15879. function hn(e, t, n) {
  15880. var s = new Uint8Array(uni.base64ToArrayBuffer(t)),
  15881. r = ln.utils.utf8.toBytes(n),
  15882. i = ln.utils.utf8.toBytes(e),
  15883. o = new ln.ModeOfOperation.cbc(s, r),
  15884. a = ln.padding.pkcs7.pad(i),
  15885. c = o.encrypt(a);
  15886. return uni.arrayBufferToBase64(c);
  15887. }
  15888. var dn = {
  15889. code: 2e4,
  15890. message: "System error"
  15891. },
  15892. fn = {
  15893. code: 20101,
  15894. message: "Invalid client"
  15895. },
  15896. pn = {
  15897. code: 20102,
  15898. message: "Get encrypt key failed"
  15899. },
  15900. gn = {
  15901. 10001: "Secure network is not supported on current playground or unimpsdk",
  15902. 10003: "Config missing in current app. If the problem pesist, please contact DCloud.",
  15903. 10009: "Encrypt payload failed",
  15904. 10010: "Decrypt response failed"
  15905. };
  15906. function mn(e) {
  15907. var _ref28 = e || {},
  15908. t = _ref28.errSubject,
  15909. n = _ref28.subject,
  15910. s = _ref28.errCode,
  15911. r = _ref28.errMsg,
  15912. i = _ref28.code,
  15913. o = _ref28.message,
  15914. a = _ref28.cause;
  15915. return new Q({
  15916. subject: t || n || "uni-secure-network",
  15917. code: s || i || dn.code,
  15918. message: r || o,
  15919. cause: a
  15920. });
  15921. }
  15922. var yn,
  15923. _n,
  15924. wn = null;
  15925. var vn = /*#__PURE__*/function (_Ot) {
  15926. (0, _inherits2.default)(vn, _Ot);
  15927. var _super9 = _createSuper(vn);
  15928. function vn(e) {
  15929. var _this15;
  15930. (0, _classCallCheck2.default)(this, vn);
  15931. _this15 = _super9.call(this, e), _this15.userEncryptKey = null;
  15932. return _this15;
  15933. }
  15934. (0, _createClass2.default)(vn, [{
  15935. key: "isLogin",
  15936. value: function isLogin() {
  15937. return !!this.scopedGlobalCache.mpWeixinCode;
  15938. }
  15939. }, {
  15940. key: "prepare",
  15941. value: function () {
  15942. var _prepare2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37() {
  15943. return _regenerator.default.wrap(function _callee37$(_context37) {
  15944. while (1) {
  15945. switch (_context37.prev = _context37.next) {
  15946. case 0:
  15947. if (this.isLogin()) {
  15948. _context37.next = 7;
  15949. break;
  15950. }
  15951. if (this.scopedGlobalCache.initPromise) {
  15952. _context37.next = 3;
  15953. break;
  15954. }
  15955. throw new Error("`uniCloud.initSecureNetworkByWeixin` has not yet been called");
  15956. case 3:
  15957. _context37.next = 5;
  15958. return this.scopedGlobalCache.initPromise;
  15959. case 5:
  15960. if (this.scopedGlobalCache.mpWeixinCode) {
  15961. _context37.next = 7;
  15962. break;
  15963. }
  15964. throw new Error("uniCloud.initSecureNetworkByWeixin` has not yet been called or successfully excuted");
  15965. case 7:
  15966. case "end":
  15967. return _context37.stop();
  15968. }
  15969. }
  15970. }, _callee37, this);
  15971. }));
  15972. function prepare() {
  15973. return _prepare2.apply(this, arguments);
  15974. }
  15975. return prepare;
  15976. }()
  15977. }, {
  15978. key: "getUserEncryptKey",
  15979. value: function () {
  15980. var _getUserEncryptKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38() {
  15981. var _this16 = this;
  15982. var e;
  15983. return _regenerator.default.wrap(function _callee38$(_context38) {
  15984. while (1) {
  15985. switch (_context38.prev = _context38.next) {
  15986. case 0:
  15987. if (!this.userEncryptKey) {
  15988. _context38.next = 2;
  15989. break;
  15990. }
  15991. return _context38.abrupt("return", this.userEncryptKey);
  15992. case 2:
  15993. if (!(wn && wn.expireTime)) {
  15994. _context38.next = 6;
  15995. break;
  15996. }
  15997. e = Date.now();
  15998. if (!(wn.expireTime - e > 0)) {
  15999. _context38.next = 6;
  16000. break;
  16001. }
  16002. return _context38.abrupt("return", (this.userEncryptKey = wn, this.userEncryptKey));
  16003. case 6:
  16004. return _context38.abrupt("return", new Promise(function (e, t) {
  16005. uni.getUserCryptoManager().getLatestUserKey({
  16006. success: function success(t) {
  16007. wn = t, _this16.userEncryptKey = t, e(_this16.userEncryptKey);
  16008. },
  16009. fail: function fail(e) {
  16010. t(mn(_objectSpread(_objectSpread({}, pn), {}, {
  16011. cause: e
  16012. })));
  16013. }
  16014. });
  16015. }));
  16016. case 7:
  16017. case "end":
  16018. return _context38.stop();
  16019. }
  16020. }
  16021. }, _callee38, this);
  16022. }));
  16023. function getUserEncryptKey() {
  16024. return _getUserEncryptKey.apply(this, arguments);
  16025. }
  16026. return getUserEncryptKey;
  16027. }()
  16028. }, {
  16029. key: "getWxAppId",
  16030. value: function getWxAppId() {
  16031. return wx.getAccountInfoSync().miniProgram.appId;
  16032. }
  16033. }, {
  16034. key: "platformGetSignOption",
  16035. value: function () {
  16036. var _platformGetSignOption = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39() {
  16037. var _yield$this$getUserEn, e, t, n;
  16038. return _regenerator.default.wrap(function _callee39$(_context39) {
  16039. while (1) {
  16040. switch (_context39.prev = _context39.next) {
  16041. case 0:
  16042. _context39.next = 2;
  16043. return this.getUserEncryptKey();
  16044. case 2:
  16045. _yield$this$getUserEn = _context39.sent;
  16046. e = _yield$this$getUserEn.encryptKey;
  16047. t = _yield$this$getUserEn.iv;
  16048. n = _yield$this$getUserEn.version;
  16049. return _context39.abrupt("return", {
  16050. verifyClientSign: hn(JSON.stringify({
  16051. data: JSON.stringify({}),
  16052. appId: this.appId,
  16053. deviceId: this.deviceId,
  16054. wxAppId: this.getWxAppId(),
  16055. simulator: "devtools" === re().platform,
  16056. timestamp: Date.now()
  16057. }), e, t),
  16058. encryptKeyId: n,
  16059. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode
  16060. });
  16061. case 7:
  16062. case "end":
  16063. return _context39.stop();
  16064. }
  16065. }
  16066. }, _callee39, this);
  16067. }));
  16068. function platformGetSignOption() {
  16069. return _platformGetSignOption.apply(this, arguments);
  16070. }
  16071. return platformGetSignOption;
  16072. }()
  16073. }, {
  16074. key: "platformEncryptData",
  16075. value: function () {
  16076. var _platformEncryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40(e) {
  16077. var _yield$this$getUserEn2, t, n, s, r;
  16078. return _regenerator.default.wrap(function _callee40$(_context40) {
  16079. while (1) {
  16080. switch (_context40.prev = _context40.next) {
  16081. case 0:
  16082. _context40.next = 2;
  16083. return this.getUserEncryptKey();
  16084. case 2:
  16085. _yield$this$getUserEn2 = _context40.sent;
  16086. t = _yield$this$getUserEn2.encryptKey;
  16087. n = _yield$this$getUserEn2.iv;
  16088. s = _yield$this$getUserEn2.version;
  16089. r = {
  16090. secretType: this.secretType,
  16091. encryptKeyId: s,
  16092. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode
  16093. };
  16094. return _context40.abrupt("return", this.secretType === Pt ? {
  16095. content: e,
  16096. _uniCloudOptions: r
  16097. } : {
  16098. content: hn(JSON.stringify({
  16099. data: JSON.stringify(e),
  16100. appId: this.appId,
  16101. deviceId: this.deviceId,
  16102. wxAppId: this.getWxAppId(),
  16103. simulator: "devtools" === re().platform,
  16104. timestamp: Date.now()
  16105. }), t, n),
  16106. _uniCloudOptions: r
  16107. });
  16108. case 8:
  16109. case "end":
  16110. return _context40.stop();
  16111. }
  16112. }
  16113. }, _callee40, this);
  16114. }));
  16115. function platformEncryptData(_x33) {
  16116. return _platformEncryptData.apply(this, arguments);
  16117. }
  16118. return platformEncryptData;
  16119. }()
  16120. }, {
  16121. key: "platformDecryptResult",
  16122. value: function () {
  16123. var _platformDecryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41(e) {
  16124. var t, _yield$this$getUserEn3, n, s;
  16125. return _regenerator.default.wrap(function _callee41$(_context41) {
  16126. while (1) {
  16127. switch (_context41.prev = _context41.next) {
  16128. case 0:
  16129. t = e.content;
  16130. _context41.next = 3;
  16131. return this.getUserEncryptKey();
  16132. case 3:
  16133. _yield$this$getUserEn3 = _context41.sent;
  16134. n = _yield$this$getUserEn3.encryptKey;
  16135. s = _yield$this$getUserEn3.iv;
  16136. return _context41.abrupt("return", JSON.parse(function (e, t, n) {
  16137. var s = new Uint8Array(uni.base64ToArrayBuffer(e)),
  16138. r = new Uint8Array(uni.base64ToArrayBuffer(t)),
  16139. i = ln.utils.utf8.toBytes(n),
  16140. o = new ln.ModeOfOperation.cbc(r, i),
  16141. a = ln.padding.pkcs7.strip(o.decrypt(s));
  16142. return ln.utils.utf8.fromBytes(a);
  16143. }(t, n, s)));
  16144. case 7:
  16145. case "end":
  16146. return _context41.stop();
  16147. }
  16148. }
  16149. }, _callee41, this);
  16150. }));
  16151. function platformDecryptResult(_x34) {
  16152. return _platformDecryptResult.apply(this, arguments);
  16153. }
  16154. return platformDecryptResult;
  16155. }()
  16156. }]);
  16157. return vn;
  16158. }(Ot);
  16159. function Sn(e) {
  16160. var t = ["hasClientKey", "encryptGetClientKeyPayload", "setClientKey", "encrypt", "decrypt"],
  16161. n = {};
  16162. var _loop = function _loop(_s10) {
  16163. var r = t[_s10];
  16164. n[r] = function () {
  16165. for (var _len = arguments.length, t = new Array(_len), _key = 0; _key < _len; _key++) {
  16166. t[_key] = arguments[_key];
  16167. }
  16168. return new Promise(function (n, s) {
  16169. "function" == typeof e[r] ? e[r].apply(e, t.concat([function () {
  16170. var _ref29 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16171. e = _ref29.type,
  16172. t = _ref29.data,
  16173. r = _ref29.errCode,
  16174. i = _ref29.errMsg,
  16175. o = _ref29.errSubject,
  16176. a = _ref29.message;
  16177. "success" === e ? n(t) : s(mn({
  16178. errCode: r,
  16179. errMsg: gn[r] || i || a,
  16180. errSubject: o
  16181. }));
  16182. }])) : s(mn({
  16183. message: "请检查manifest.json内是否开启安全网络模块,另外注意标准基座不支持安全网络模块"
  16184. }));
  16185. });
  16186. };
  16187. };
  16188. for (var _s10 = 0; _s10 < t.length; _s10++) {
  16189. _loop(_s10);
  16190. }
  16191. return n;
  16192. }
  16193. var kn = /*#__PURE__*/function (_Ot2) {
  16194. (0, _inherits2.default)(kn, _Ot2);
  16195. var _super10 = _createSuper(kn);
  16196. function kn(e) {
  16197. var _this17;
  16198. (0, _classCallCheck2.default)(this, kn);
  16199. _this17 = _super10.call(this, e), _this17.appUtils = _objectSpread({}, Sn(uni.requireNativePlugin("plus"))), _this17.systemInfo = yn || (yn = re());
  16200. return _this17;
  16201. }
  16202. (0, _createClass2.default)(kn, [{
  16203. key: "hasClientKey",
  16204. value: function () {
  16205. var _hasClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42() {
  16206. return _regenerator.default.wrap(function _callee42$(_context42) {
  16207. while (1) {
  16208. switch (_context42.prev = _context42.next) {
  16209. case 0:
  16210. _context42.next = 2;
  16211. return this.appUtils.hasClientKey({
  16212. provider: this.provider,
  16213. spaceId: this.spaceId
  16214. });
  16215. case 2:
  16216. this._hasClientKey = _context42.sent;
  16217. return _context42.abrupt("return", this._hasClientKey);
  16218. case 4:
  16219. case "end":
  16220. return _context42.stop();
  16221. }
  16222. }
  16223. }, _callee42, this);
  16224. }));
  16225. function hasClientKey() {
  16226. return _hasClientKey.apply(this, arguments);
  16227. }
  16228. return hasClientKey;
  16229. }()
  16230. }, {
  16231. key: "getAppClientKey",
  16232. value: function () {
  16233. var _getAppClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43() {
  16234. var _yield$this$appUtils$, e, t, n, s, r;
  16235. return _regenerator.default.wrap(function _callee43$(_context43) {
  16236. while (1) {
  16237. switch (_context43.prev = _context43.next) {
  16238. case 0:
  16239. _context43.next = 2;
  16240. return this.appUtils.encryptGetClientKeyPayload({
  16241. data: JSON.stringify({})
  16242. });
  16243. case 2:
  16244. _yield$this$appUtils$ = _context43.sent;
  16245. e = _yield$this$appUtils$.data;
  16246. t = _yield$this$appUtils$.key;
  16247. _context43.next = 7;
  16248. return this.uniCloudIns.callFunction({
  16249. name: "DCloud-clientDB",
  16250. data: {
  16251. redirectTo: "encryption",
  16252. action: "getAppClientKey",
  16253. data: e,
  16254. key: t
  16255. }
  16256. });
  16257. case 7:
  16258. _context43.t0 = _context43.sent.result;
  16259. if (_context43.t0) {
  16260. _context43.next = 10;
  16261. break;
  16262. }
  16263. _context43.t0 = {};
  16264. case 10:
  16265. n = _context43.t0;
  16266. if (!(0 !== n.errCode)) {
  16267. _context43.next = 13;
  16268. break;
  16269. }
  16270. throw function (e) {
  16271. return new Q({
  16272. subject: e.errSubject || "uni-secure-network",
  16273. code: e.errCode || e.code || dn.code,
  16274. message: e.errMsg || e.message
  16275. });
  16276. }(n);
  16277. case 13:
  16278. s = n.clientKey, r = n.key;
  16279. _context43.next = 16;
  16280. return this.appUtils.setClientKey({
  16281. provider: this.provider,
  16282. spaceId: this.spaceId,
  16283. clientKey: s,
  16284. key: r
  16285. });
  16286. case 16:
  16287. case "end":
  16288. return _context43.stop();
  16289. }
  16290. }
  16291. }, _callee43, this);
  16292. }));
  16293. function getAppClientKey() {
  16294. return _getAppClientKey.apply(this, arguments);
  16295. }
  16296. return getAppClientKey;
  16297. }()
  16298. }, {
  16299. key: "ensureClientKey",
  16300. value: function () {
  16301. var _ensureClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44() {
  16302. var _this18 = this;
  16303. return _regenerator.default.wrap(function _callee44$(_context44) {
  16304. while (1) {
  16305. switch (_context44.prev = _context44.next) {
  16306. case 0:
  16307. _context44.t0 = !0;
  16308. _context44.next = 3;
  16309. return this.hasClientKey();
  16310. case 3:
  16311. _context44.t1 = _context44.sent;
  16312. if (!(_context44.t0 !== _context44.t1)) {
  16313. _context44.next = 6;
  16314. break;
  16315. }
  16316. return _context44.abrupt("return", (this.scopedGlobalCache.initPromise && "rejected" !== this.scopedGlobalCache.initStatus || (this.scopedGlobalCache.initPromise = this.getAppClientKey(), this.scopedGlobalCache.initPromise.then(function (e) {
  16317. _this18.scopedGlobalCache.initStatus = "fullfilled";
  16318. }).catch(function (e) {
  16319. throw _this18.scopedGlobalCache.initStatus = "rejected", e;
  16320. })), this.scopedGlobalCache.initPromise));
  16321. case 6:
  16322. case "end":
  16323. return _context44.stop();
  16324. }
  16325. }
  16326. }, _callee44, this);
  16327. }));
  16328. function ensureClientKey() {
  16329. return _ensureClientKey.apply(this, arguments);
  16330. }
  16331. return ensureClientKey;
  16332. }()
  16333. }, {
  16334. key: "prepare",
  16335. value: function () {
  16336. var _prepare3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45() {
  16337. return _regenerator.default.wrap(function _callee45$(_context45) {
  16338. while (1) {
  16339. switch (_context45.prev = _context45.next) {
  16340. case 0:
  16341. _context45.next = 2;
  16342. return this.ensureClientKey();
  16343. case 2:
  16344. case "end":
  16345. return _context45.stop();
  16346. }
  16347. }
  16348. }, _callee45, this);
  16349. }));
  16350. function prepare() {
  16351. return _prepare3.apply(this, arguments);
  16352. }
  16353. return prepare;
  16354. }()
  16355. }, {
  16356. key: "platformGetSignOption",
  16357. value: function () {
  16358. var _platformGetSignOption2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46() {
  16359. var _yield$this$appUtils$2, e, t;
  16360. return _regenerator.default.wrap(function _callee46$(_context46) {
  16361. while (1) {
  16362. switch (_context46.prev = _context46.next) {
  16363. case 0:
  16364. _context46.next = 2;
  16365. return this.appUtils.encrypt({
  16366. provider: this.provider,
  16367. spaceId: this.spaceId,
  16368. data: JSON.stringify({})
  16369. });
  16370. case 2:
  16371. _yield$this$appUtils$2 = _context46.sent;
  16372. e = _yield$this$appUtils$2.data;
  16373. t = _yield$this$appUtils$2.key;
  16374. return _context46.abrupt("return", {
  16375. verifyClientSign: e,
  16376. encryptKeyId: t
  16377. });
  16378. case 6:
  16379. case "end":
  16380. return _context46.stop();
  16381. }
  16382. }
  16383. }, _callee46, this);
  16384. }));
  16385. function platformGetSignOption() {
  16386. return _platformGetSignOption2.apply(this, arguments);
  16387. }
  16388. return platformGetSignOption;
  16389. }()
  16390. }, {
  16391. key: "platformEncryptData",
  16392. value: function () {
  16393. var _platformEncryptData2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47(e) {
  16394. var _yield$this$appUtils$3, t, n, s;
  16395. return _regenerator.default.wrap(function _callee47$(_context47) {
  16396. while (1) {
  16397. switch (_context47.prev = _context47.next) {
  16398. case 0:
  16399. _context47.next = 2;
  16400. return this.appUtils.encrypt({
  16401. provider: this.provider,
  16402. spaceId: this.spaceId,
  16403. data: JSON.stringify(e)
  16404. });
  16405. case 2:
  16406. _yield$this$appUtils$3 = _context47.sent;
  16407. t = _yield$this$appUtils$3.data;
  16408. n = _yield$this$appUtils$3.key;
  16409. s = {
  16410. secretType: this.secretType,
  16411. encryptKeyId: n
  16412. };
  16413. return _context47.abrupt("return", this.secretType === Pt ? {
  16414. content: e,
  16415. _uniCloudOptions: s
  16416. } : {
  16417. content: t,
  16418. _uniCloudOptions: s
  16419. });
  16420. case 7:
  16421. case "end":
  16422. return _context47.stop();
  16423. }
  16424. }
  16425. }, _callee47, this);
  16426. }));
  16427. function platformEncryptData(_x35) {
  16428. return _platformEncryptData2.apply(this, arguments);
  16429. }
  16430. return platformEncryptData;
  16431. }()
  16432. }, {
  16433. key: "platformDecryptResult",
  16434. value: function () {
  16435. var _platformDecryptResult2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48(e) {
  16436. var t, _e$_uniCloudOptions, n, s, r;
  16437. return _regenerator.default.wrap(function _callee48$(_context48) {
  16438. while (1) {
  16439. switch (_context48.prev = _context48.next) {
  16440. case 0:
  16441. t = e.content;
  16442. _e$_uniCloudOptions = e._uniCloudOptions;
  16443. n = _e$_uniCloudOptions === void 0 ? {} : _e$_uniCloudOptions;
  16444. s = n.encryptKeyId;
  16445. _context48.next = 6;
  16446. return this.appUtils.decrypt({
  16447. provider: this.provider,
  16448. spaceId: this.spaceId,
  16449. data: t,
  16450. key: s
  16451. });
  16452. case 6:
  16453. r = _context48.sent;
  16454. return _context48.abrupt("return", JSON.parse(r.data));
  16455. case 8:
  16456. case "end":
  16457. return _context48.stop();
  16458. }
  16459. }
  16460. }, _callee48, this);
  16461. }));
  16462. function platformDecryptResult(_x36) {
  16463. return _platformDecryptResult2.apply(this, arguments);
  16464. }
  16465. return platformDecryptResult;
  16466. }()
  16467. }]);
  16468. return kn;
  16469. }(Ot);
  16470. function In() {
  16471. var _ref30 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16472. e = _ref30.secretType;
  16473. return e === Ct || e === Pt || e === Et;
  16474. }
  16475. function bn() {
  16476. var _ref31 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16477. e = _ref31.name,
  16478. _ref31$data = _ref31.data,
  16479. t = _ref31$data === void 0 ? {} : _ref31$data;
  16480. return "app" === S && "DCloud-clientDB" === e && "encryption" === t.redirectTo && "getAppClientKey" === t.action;
  16481. }
  16482. function Tn() {
  16483. var _ref32 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16484. e = _ref32.provider,
  16485. t = _ref32.spaceId,
  16486. n = _ref32.functionName;
  16487. var _re = re(),
  16488. s = _re.appId,
  16489. r = _re.uniPlatform,
  16490. i = _re.osName;
  16491. var o = r;
  16492. "app" === r && (o = i);
  16493. var a = function () {
  16494. var _ref33 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16495. e = _ref33.provider,
  16496. t = _ref33.spaceId;
  16497. var n = v;
  16498. if (!n) return {};
  16499. e = function (e) {
  16500. return "tencent" === e ? "tcb" : e;
  16501. }(e);
  16502. var s = n.find(function (n) {
  16503. return n.provider === e && n.spaceId === t;
  16504. });
  16505. return s && s.config;
  16506. }({
  16507. provider: e,
  16508. spaceId: t
  16509. });
  16510. if (!a || !a.accessControl || !a.accessControl.enable) return !1;
  16511. var c = a.accessControl.function || {},
  16512. u = Object.keys(c);
  16513. if (0 === u.length) return !0;
  16514. var l = function (e, t) {
  16515. var n, s, r;
  16516. for (var _i2 = 0; _i2 < e.length; _i2++) {
  16517. var _o2 = e[_i2];
  16518. _o2 !== t ? "*" !== _o2 ? _o2.split(",").map(function (e) {
  16519. return e.trim();
  16520. }).indexOf(t) > -1 && (s = _o2) : r = _o2 : n = _o2;
  16521. }
  16522. return n || s || r;
  16523. }(u, n);
  16524. if (!l) return !1;
  16525. if ((c[l] || []).find(function () {
  16526. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  16527. return e.appId === s && (e.platform || "").toLowerCase() === o.toLowerCase();
  16528. })) return !0;
  16529. throw console.error("\u6B64\u5E94\u7528[appId: ".concat(s, ", platform: ").concat(o, "]\u4E0D\u5728\u4E91\u7AEF\u914D\u7F6E\u7684\u5141\u8BB8\u8BBF\u95EE\u7684\u5E94\u7528\u5217\u8868\u5185\uFF0C\u53C2\u8003\uFF1Ahttps://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client")), mn(fn);
  16530. }
  16531. function An(_ref34) {
  16532. var e = _ref34.functionName,
  16533. t = _ref34.result,
  16534. n = _ref34.logPvd;
  16535. if (this.__dev__.debugLog && t && t.requestId) {
  16536. var _s11 = JSON.stringify({
  16537. spaceId: this.config.spaceId,
  16538. functionName: e,
  16539. requestId: t.requestId
  16540. });
  16541. console.log("[".concat(n, "-request]").concat(_s11, "[/").concat(n, "-request]"));
  16542. }
  16543. }
  16544. function Cn(e) {
  16545. var t = e.callFunction,
  16546. n = function n(_n7) {
  16547. var _this19 = this;
  16548. var s = _n7.name;
  16549. _n7.data = vt.call(e, {
  16550. data: _n7.data
  16551. });
  16552. var r = {
  16553. aliyun: "aliyun",
  16554. tencent: "tcb",
  16555. tcb: "tcb"
  16556. }[this.config.provider],
  16557. i = In(_n7),
  16558. o = bn(_n7),
  16559. a = i || o;
  16560. return t.call(this, _n7).then(function (e) {
  16561. return e.errCode = 0, !a && An.call(_this19, {
  16562. functionName: s,
  16563. result: e,
  16564. logPvd: r
  16565. }), Promise.resolve(e);
  16566. }, function (e) {
  16567. return !a && An.call(_this19, {
  16568. functionName: s,
  16569. result: e,
  16570. logPvd: r
  16571. }), e && e.message && (e.message = function () {
  16572. var _ref35 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16573. _ref35$message = _ref35.message,
  16574. e = _ref35$message === void 0 ? "" : _ref35$message,
  16575. _ref35$extraInfo = _ref35.extraInfo,
  16576. t = _ref35$extraInfo === void 0 ? {} : _ref35$extraInfo,
  16577. _ref35$formatter = _ref35.formatter,
  16578. n = _ref35$formatter === void 0 ? [] : _ref35$formatter;
  16579. for (var _s12 = 0; _s12 < n.length; _s12++) {
  16580. var _n$_s = n[_s12],
  16581. _r3 = _n$_s.rule,
  16582. _i3 = _n$_s.content,
  16583. _o3 = _n$_s.mode,
  16584. _a = e.match(_r3);
  16585. if (!_a) continue;
  16586. var _c = _i3;
  16587. for (var _e23 = 1; _e23 < _a.length; _e23++) {
  16588. _c = Tt(_c, "{$".concat(_e23, "}"), _a[_e23]);
  16589. }
  16590. for (var _e24 in t) {
  16591. _c = Tt(_c, "{".concat(_e24, "}"), t[_e24]);
  16592. }
  16593. return "replace" === _o3 ? _c : e + _c;
  16594. }
  16595. return e;
  16596. }({
  16597. message: "[".concat(_n7.name, "]: ").concat(e.message),
  16598. formatter: kt,
  16599. extraInfo: {
  16600. functionName: s
  16601. }
  16602. })), Promise.reject(e);
  16603. });
  16604. };
  16605. e.callFunction = function (t) {
  16606. var _e$config = e.config,
  16607. s = _e$config.provider,
  16608. r = _e$config.spaceId,
  16609. i = t.name;
  16610. var o, a;
  16611. if (t.data = t.data || {}, y && e.__dev__.debugInfo && !e.__dev__.debugInfo.forceRemote && I ? (e._callCloudFunction || (e._callCloudFunction = n, e._callLocalFunction = St), o = St) : o = n, o = o.bind(e), bn(t)) a = n.call(e, t);else if (function (_ref36) {
  16612. var e = _ref36.name,
  16613. _ref36$data = _ref36.data,
  16614. t = _ref36$data === void 0 ? {} : _ref36$data;
  16615. return "mp-weixin" === S && "uni-id-co" === e && "secureNetworkHandshakeByWeixin" === t.method;
  16616. }(t)) a = o.call(e, t);else if (In(t)) {
  16617. a = new _n({
  16618. secretType: t.secretType,
  16619. uniCloudIns: e
  16620. }).wrapEncryptDataCallFunction(n.bind(e))(t);
  16621. } else if (Tn({
  16622. provider: s,
  16623. spaceId: r,
  16624. functionName: i
  16625. })) {
  16626. a = new _n({
  16627. secretType: t.secretType,
  16628. uniCloudIns: e
  16629. }).wrapVerifyClientCallFunction(n.bind(e))(t);
  16630. } else a = o(t);
  16631. return Object.defineProperty(a, "result", {
  16632. get: function get() {
  16633. return console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {};
  16634. }
  16635. }), a;
  16636. };
  16637. }
  16638. _n = "mp-weixin" !== S && "app" !== S ? /*#__PURE__*/function () {
  16639. function _class2() {
  16640. (0, _classCallCheck2.default)(this, _class2);
  16641. throw mn({
  16642. message: "Platform ".concat(S, " is not supported by secure network")
  16643. });
  16644. }
  16645. return (0, _createClass2.default)(_class2);
  16646. }() : w ? "mp-weixin" === S ? vn : kn : /*#__PURE__*/function () {
  16647. function _class3() {
  16648. (0, _classCallCheck2.default)(this, _class3);
  16649. throw mn({
  16650. message: "Platform ".concat(S, " is not enabled, please check whether secure network module is enabled in your manifest.json")
  16651. });
  16652. }
  16653. return (0, _createClass2.default)(_class3);
  16654. }();
  16655. var Pn = Symbol("CLIENT_DB_INTERNAL");
  16656. function En(e, t) {
  16657. return e.then = "DoNotReturnProxyWithAFunctionNamedThen", e._internalType = Pn, e.inspect = null, e.__ob__ = void 0, new Proxy(e, {
  16658. get: function get(e, n, s) {
  16659. if ("_uniClient" === n) return null;
  16660. if ("symbol" == (0, _typeof2.default)(n)) return e[n];
  16661. if (n in e || "string" != typeof n) {
  16662. var _t10 = e[n];
  16663. return "function" == typeof _t10 ? _t10.bind(e) : _t10;
  16664. }
  16665. return t.get(e, n, s);
  16666. }
  16667. });
  16668. }
  16669. function On(e) {
  16670. return {
  16671. on: function on(t, n) {
  16672. e[t] = e[t] || [], e[t].indexOf(n) > -1 || e[t].push(n);
  16673. },
  16674. off: function off(t, n) {
  16675. e[t] = e[t] || [];
  16676. var s = e[t].indexOf(n);
  16677. -1 !== s && e[t].splice(s, 1);
  16678. }
  16679. };
  16680. }
  16681. var xn = ["db.Geo", "db.command", "command.aggregate"];
  16682. function Un(e, t) {
  16683. return xn.indexOf("".concat(e, ".").concat(t)) > -1;
  16684. }
  16685. function Rn(e) {
  16686. switch (d(e)) {
  16687. case "array":
  16688. return e.map(function (e) {
  16689. return Rn(e);
  16690. });
  16691. case "object":
  16692. return e._internalType === Pn || Object.keys(e).forEach(function (t) {
  16693. e[t] = Rn(e[t]);
  16694. }), e;
  16695. case "regexp":
  16696. return {
  16697. $regexp: {
  16698. source: e.source,
  16699. flags: e.flags
  16700. }
  16701. };
  16702. case "date":
  16703. return {
  16704. $date: e.toISOString()
  16705. };
  16706. default:
  16707. return e;
  16708. }
  16709. }
  16710. function Ln(e) {
  16711. return e && e.content && e.content.$method;
  16712. }
  16713. var Nn = /*#__PURE__*/function () {
  16714. function Nn(e, t, n) {
  16715. (0, _classCallCheck2.default)(this, Nn);
  16716. this.content = e, this.prevStage = t || null, this.udb = null, this._database = n;
  16717. }
  16718. (0, _createClass2.default)(Nn, [{
  16719. key: "toJSON",
  16720. value: function toJSON() {
  16721. var e = this;
  16722. var t = [e.content];
  16723. for (; e.prevStage;) {
  16724. e = e.prevStage, t.push(e.content);
  16725. }
  16726. return {
  16727. $db: t.reverse().map(function (e) {
  16728. return {
  16729. $method: e.$method,
  16730. $param: Rn(e.$param)
  16731. };
  16732. })
  16733. };
  16734. }
  16735. }, {
  16736. key: "getAction",
  16737. value: function getAction() {
  16738. var e = this.toJSON().$db.find(function (e) {
  16739. return "action" === e.$method;
  16740. });
  16741. return e && e.$param && e.$param[0];
  16742. }
  16743. }, {
  16744. key: "getCommand",
  16745. value: function getCommand() {
  16746. return {
  16747. $db: this.toJSON().$db.filter(function (e) {
  16748. return "action" !== e.$method;
  16749. })
  16750. };
  16751. }
  16752. }, {
  16753. key: "isAggregate",
  16754. get: function get() {
  16755. var e = this;
  16756. for (; e;) {
  16757. var t = Ln(e),
  16758. _n8 = Ln(e.prevStage);
  16759. if ("aggregate" === t && "collection" === _n8 || "pipeline" === t) return !0;
  16760. e = e.prevStage;
  16761. }
  16762. return !1;
  16763. }
  16764. }, {
  16765. key: "isCommand",
  16766. get: function get() {
  16767. var e = this;
  16768. for (; e;) {
  16769. if ("command" === Ln(e)) return !0;
  16770. e = e.prevStage;
  16771. }
  16772. return !1;
  16773. }
  16774. }, {
  16775. key: "isAggregateCommand",
  16776. get: function get() {
  16777. var e = this;
  16778. for (; e;) {
  16779. var t = Ln(e),
  16780. _n9 = Ln(e.prevStage);
  16781. if ("aggregate" === t && "command" === _n9) return !0;
  16782. e = e.prevStage;
  16783. }
  16784. return !1;
  16785. }
  16786. }, {
  16787. key: "getNextStageFn",
  16788. value: function getNextStageFn(e) {
  16789. var t = this;
  16790. return function () {
  16791. return Dn({
  16792. $method: e,
  16793. $param: Rn(Array.from(arguments))
  16794. }, t, t._database);
  16795. };
  16796. }
  16797. }, {
  16798. key: "count",
  16799. get: function get() {
  16800. return this.isAggregate ? this.getNextStageFn("count") : function () {
  16801. return this._send("count", Array.from(arguments));
  16802. };
  16803. }
  16804. }, {
  16805. key: "remove",
  16806. get: function get() {
  16807. return this.isCommand ? this.getNextStageFn("remove") : function () {
  16808. return this._send("remove", Array.from(arguments));
  16809. };
  16810. }
  16811. }, {
  16812. key: "get",
  16813. value: function get() {
  16814. return this._send("get", Array.from(arguments));
  16815. }
  16816. }, {
  16817. key: "add",
  16818. get: function get() {
  16819. return this.isCommand ? this.getNextStageFn("add") : function () {
  16820. return this._send("add", Array.from(arguments));
  16821. };
  16822. }
  16823. }, {
  16824. key: "update",
  16825. value: function update() {
  16826. return this._send("update", Array.from(arguments));
  16827. }
  16828. }, {
  16829. key: "end",
  16830. value: function end() {
  16831. return this._send("end", Array.from(arguments));
  16832. }
  16833. }, {
  16834. key: "set",
  16835. get: function get() {
  16836. return this.isCommand ? this.getNextStageFn("set") : function () {
  16837. throw new Error("JQL禁止使用set方法");
  16838. };
  16839. }
  16840. }, {
  16841. key: "_send",
  16842. value: function _send(e, t) {
  16843. var n = this.getAction(),
  16844. s = this.getCommand();
  16845. if (s.$db.push({
  16846. $method: e,
  16847. $param: Rn(t)
  16848. }), y) {
  16849. var _e25 = s.$db.find(function (e) {
  16850. return "collection" === e.$method;
  16851. }),
  16852. _t11 = _e25 && _e25.$param;
  16853. _t11 && 1 === _t11.length && "string" == typeof _e25.$param[0] && _e25.$param[0].indexOf(",") > -1 && console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
  16854. }
  16855. return this._database._callCloudFunction({
  16856. action: n,
  16857. command: s
  16858. });
  16859. }
  16860. }]);
  16861. return Nn;
  16862. }();
  16863. function Dn(e, t, n) {
  16864. return En(new Nn(e, t, n), {
  16865. get: function get(e, t) {
  16866. var s = "db";
  16867. return e && e.content && (s = e.content.$method), Un(s, t) ? Dn({
  16868. $method: t
  16869. }, e, n) : function () {
  16870. return Dn({
  16871. $method: t,
  16872. $param: Rn(Array.from(arguments))
  16873. }, e, n);
  16874. };
  16875. }
  16876. });
  16877. }
  16878. function Fn(_ref37) {
  16879. var e = _ref37.path,
  16880. t = _ref37.method;
  16881. return /*#__PURE__*/function () {
  16882. function _class4() {
  16883. (0, _classCallCheck2.default)(this, _class4);
  16884. this.param = Array.from(arguments);
  16885. }
  16886. (0, _createClass2.default)(_class4, [{
  16887. key: "toJSON",
  16888. value: function toJSON() {
  16889. return {
  16890. $newDb: [].concat((0, _toConsumableArray2.default)(e.map(function (e) {
  16891. return {
  16892. $method: e
  16893. };
  16894. })), [{
  16895. $method: t,
  16896. $param: this.param
  16897. }])
  16898. };
  16899. }
  16900. }]);
  16901. return _class4;
  16902. }();
  16903. }
  16904. function qn(e) {
  16905. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16906. return En(new e(t), {
  16907. get: function get(e, t) {
  16908. return Un("db", t) ? Dn({
  16909. $method: t
  16910. }, null, e) : function () {
  16911. return Dn({
  16912. $method: t,
  16913. $param: Rn(Array.from(arguments))
  16914. }, null, e);
  16915. };
  16916. }
  16917. });
  16918. }
  16919. var Kn = /*#__PURE__*/function (_ref38) {
  16920. (0, _inherits2.default)(Kn, _ref38);
  16921. var _super11 = _createSuper(Kn);
  16922. function Kn() {
  16923. (0, _classCallCheck2.default)(this, Kn);
  16924. return _super11.apply(this, arguments);
  16925. }
  16926. (0, _createClass2.default)(Kn, [{
  16927. key: "_parseResult",
  16928. value: function _parseResult(e) {
  16929. return this._isJQL ? e.result : e;
  16930. }
  16931. }, {
  16932. key: "_callCloudFunction",
  16933. value: function _callCloudFunction(_ref39) {
  16934. var _this20 = this;
  16935. var e = _ref39.action,
  16936. t = _ref39.command,
  16937. n = _ref39.multiCommand,
  16938. s = _ref39.queryList;
  16939. function r(e, t) {
  16940. if (n && s) for (var _n10 = 0; _n10 < s.length; _n10++) {
  16941. var _r4 = s[_n10];
  16942. _r4.udb && "function" == typeof _r4.udb.setResult && (t ? _r4.udb.setResult(t) : _r4.udb.setResult(e.result.dataList[_n10]));
  16943. }
  16944. }
  16945. var i = this,
  16946. o = this._isJQL ? "databaseForJQL" : "database";
  16947. function a(e) {
  16948. return i._callback("error", [e]), U(R(o, "fail"), e).then(function () {
  16949. return U(R(o, "complete"), e);
  16950. }).then(function () {
  16951. return r(null, e), z(D, {
  16952. type: K,
  16953. content: e
  16954. }), Promise.reject(e);
  16955. });
  16956. }
  16957. var c = U(R(o, "invoke")),
  16958. u = this._uniClient;
  16959. return c.then(function () {
  16960. return u.callFunction({
  16961. name: "DCloud-clientDB",
  16962. type: h,
  16963. data: {
  16964. action: e,
  16965. command: t,
  16966. multiCommand: n
  16967. }
  16968. });
  16969. }).then(function (e) {
  16970. var _e$result = e.result,
  16971. t = _e$result.code,
  16972. n = _e$result.message,
  16973. s = _e$result.token,
  16974. c = _e$result.tokenExpired,
  16975. _e$result$systemInfo = _e$result.systemInfo,
  16976. u = _e$result$systemInfo === void 0 ? [] : _e$result$systemInfo;
  16977. if (u) for (var _e26 = 0; _e26 < u.length; _e26++) {
  16978. var _u$_e = u[_e26],
  16979. _t12 = _u$_e.level,
  16980. _n11 = _u$_e.message,
  16981. _s13 = _u$_e.detail,
  16982. _r5 = console["app" === S && "warn" === _t12 ? "error" : _t12] || console.log;
  16983. var _i4 = "[System Info]" + _n11;
  16984. _s13 && (_i4 = "".concat(_i4, "\n\u8BE6\u7EC6\u4FE1\u606F\uFF1A").concat(_s13)), _r5(_i4);
  16985. }
  16986. if (t) {
  16987. return a(new Q({
  16988. code: t,
  16989. message: n,
  16990. requestId: e.requestId
  16991. }));
  16992. }
  16993. e.result.errCode = e.result.errCode || e.result.code, e.result.errMsg = e.result.errMsg || e.result.message, s && c && (ee({
  16994. token: s,
  16995. tokenExpired: c
  16996. }), _this20._callbackAuth("refreshToken", [{
  16997. token: s,
  16998. tokenExpired: c
  16999. }]), _this20._callback("refreshToken", [{
  17000. token: s,
  17001. tokenExpired: c
  17002. }]), z(q, {
  17003. token: s,
  17004. tokenExpired: c
  17005. }));
  17006. var l = [{
  17007. prop: "affectedDocs",
  17008. tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"
  17009. }, {
  17010. prop: "code",
  17011. tips: "code不再推荐使用,请使用errCode替代"
  17012. }, {
  17013. prop: "message",
  17014. tips: "message不再推荐使用,请使用errMsg替代"
  17015. }];
  17016. var _loop2 = function _loop2(_t13) {
  17017. var _l$_t = l[_t13],
  17018. n = _l$_t.prop,
  17019. s = _l$_t.tips;
  17020. if (n in e.result) {
  17021. var _t14 = e.result[n];
  17022. Object.defineProperty(e.result, n, {
  17023. get: function get() {
  17024. return console.warn(s), _t14;
  17025. }
  17026. });
  17027. }
  17028. };
  17029. for (var _t13 = 0; _t13 < l.length; _t13++) {
  17030. _loop2(_t13);
  17031. }
  17032. return function (e) {
  17033. return U(R(o, "success"), e).then(function () {
  17034. return U(R(o, "complete"), e);
  17035. }).then(function () {
  17036. r(e, null);
  17037. var t = i._parseResult(e);
  17038. return z(D, {
  17039. type: K,
  17040. content: t
  17041. }), Promise.resolve(t);
  17042. });
  17043. }(e);
  17044. }, function (e) {
  17045. /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
  17046. return a(new Q({
  17047. code: e.code || "SYSTEM_ERROR",
  17048. message: e.message,
  17049. requestId: e.requestId
  17050. }));
  17051. });
  17052. }
  17053. }]);
  17054. return Kn;
  17055. }( /*#__PURE__*/function () {
  17056. function _class5() {
  17057. var _ref40 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17058. _ref40$uniClient = _ref40.uniClient,
  17059. e = _ref40$uniClient === void 0 ? {} : _ref40$uniClient,
  17060. _ref40$isJQL = _ref40.isJQL,
  17061. t = _ref40$isJQL === void 0 ? !1 : _ref40$isJQL;
  17062. (0, _classCallCheck2.default)(this, _class5);
  17063. this._uniClient = e, this._authCallBacks = {}, this._dbCallBacks = {}, e.isDefault && (this._dbCallBacks = C("_globalUniCloudDatabaseCallback")), t || (this.auth = On(this._authCallBacks)), this._isJQL = t, Object.assign(this, On(this._dbCallBacks)), this.env = En({}, {
  17064. get: function get(e, t) {
  17065. return {
  17066. $env: t
  17067. };
  17068. }
  17069. }), this.Geo = En({}, {
  17070. get: function get(e, t) {
  17071. return Fn({
  17072. path: ["Geo"],
  17073. method: t
  17074. });
  17075. }
  17076. }), this.serverDate = Fn({
  17077. path: [],
  17078. method: "serverDate"
  17079. }), this.RegExp = Fn({
  17080. path: [],
  17081. method: "RegExp"
  17082. });
  17083. }
  17084. (0, _createClass2.default)(_class5, [{
  17085. key: "getCloudEnv",
  17086. value: function getCloudEnv(e) {
  17087. if ("string" != typeof e || !e.trim()) throw new Error("getCloudEnv参数错误");
  17088. return {
  17089. $env: e.replace("$cloudEnv_", "")
  17090. };
  17091. }
  17092. }, {
  17093. key: "_callback",
  17094. value: function _callback(e, t) {
  17095. var n = this._dbCallBacks;
  17096. n[e] && n[e].forEach(function (e) {
  17097. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  17098. });
  17099. }
  17100. }, {
  17101. key: "_callbackAuth",
  17102. value: function _callbackAuth(e, t) {
  17103. var n = this._authCallBacks;
  17104. n[e] && n[e].forEach(function (e) {
  17105. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  17106. });
  17107. }
  17108. }, {
  17109. key: "multiSend",
  17110. value: function multiSend() {
  17111. var e = Array.from(arguments),
  17112. t = e.map(function (e) {
  17113. var t = e.getAction(),
  17114. n = e.getCommand();
  17115. if ("getTemp" !== n.$db[n.$db.length - 1].$method) throw new Error("multiSend只支持子命令内使用getTemp");
  17116. return {
  17117. action: t,
  17118. command: n
  17119. };
  17120. });
  17121. return this._callCloudFunction({
  17122. multiCommand: t,
  17123. queryList: e
  17124. });
  17125. }
  17126. }]);
  17127. return _class5;
  17128. }());
  17129. var Mn = "token无效,跳转登录页面",
  17130. jn = "token过期,跳转登录页面",
  17131. Bn = {
  17132. TOKEN_INVALID_TOKEN_EXPIRED: jn,
  17133. TOKEN_INVALID_INVALID_CLIENTID: Mn,
  17134. TOKEN_INVALID: Mn,
  17135. TOKEN_INVALID_WRONG_TOKEN: Mn,
  17136. TOKEN_INVALID_ANONYMOUS_USER: Mn
  17137. },
  17138. $n = {
  17139. "uni-id-token-expired": jn,
  17140. "uni-id-check-token-failed": Mn,
  17141. "uni-id-token-not-exist": Mn,
  17142. "uni-id-check-device-feature-failed": Mn
  17143. };
  17144. function Wn(e, t) {
  17145. var n = "";
  17146. return n = e ? "".concat(e, "/").concat(t) : t, n.replace(/^\//, "");
  17147. }
  17148. function zn() {
  17149. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  17150. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
  17151. var n = [],
  17152. s = [];
  17153. return e.forEach(function (e) {
  17154. !0 === e.needLogin ? n.push(Wn(t, e.path)) : !1 === e.needLogin && s.push(Wn(t, e.path));
  17155. }), {
  17156. needLoginPage: n,
  17157. notNeedLoginPage: s
  17158. };
  17159. }
  17160. function Jn(e) {
  17161. return e.split("?")[0].replace(/^\//, "");
  17162. }
  17163. function Hn() {
  17164. return function (e) {
  17165. var t = e && e.$page && e.$page.fullPath || "";
  17166. return t ? ("/" !== t.charAt(0) && (t = "/" + t), t) : t;
  17167. }(function () {
  17168. var e = getCurrentPages();
  17169. return e[e.length - 1];
  17170. }());
  17171. }
  17172. function Gn() {
  17173. return Jn(Hn());
  17174. }
  17175. function Vn() {
  17176. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  17177. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17178. if (!e) return !1;
  17179. if (!(t && t.list && t.list.length)) return !1;
  17180. var n = t.list,
  17181. s = Jn(e);
  17182. return n.some(function (e) {
  17183. return e.pagePath === s;
  17184. });
  17185. }
  17186. var Yn = !!_pages.default.uniIdRouter;
  17187. var _ref41 = function () {
  17188. var _ref24 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _pages.default,
  17189. _ref24$pages = _ref24.pages,
  17190. e = _ref24$pages === void 0 ? [] : _ref24$pages,
  17191. _ref24$subPackages = _ref24.subPackages,
  17192. n = _ref24$subPackages === void 0 ? [] : _ref24$subPackages,
  17193. _ref24$uniIdRouter = _ref24.uniIdRouter,
  17194. s = _ref24$uniIdRouter === void 0 ? {} : _ref24$uniIdRouter,
  17195. _ref24$tabBar = _ref24.tabBar,
  17196. r = _ref24$tabBar === void 0 ? {} : _ref24$tabBar;
  17197. var i = s.loginPage,
  17198. _s$needLogin = s.needLogin,
  17199. o = _s$needLogin === void 0 ? [] : _s$needLogin,
  17200. _s$resToLogin = s.resToLogin,
  17201. a = _s$resToLogin === void 0 ? !0 : _s$resToLogin,
  17202. _zn = zn(e),
  17203. c = _zn.needLoginPage,
  17204. u = _zn.notNeedLoginPage,
  17205. _ref26 = function () {
  17206. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  17207. var t = [],
  17208. n = [];
  17209. return e.forEach(function (e) {
  17210. var s = e.root,
  17211. _e$pages = e.pages,
  17212. r = _e$pages === void 0 ? [] : _e$pages,
  17213. _zn2 = zn(r, s),
  17214. i = _zn2.needLoginPage,
  17215. o = _zn2.notNeedLoginPage;
  17216. t.push.apply(t, (0, _toConsumableArray2.default)(i)), n.push.apply(n, (0, _toConsumableArray2.default)(o));
  17217. }), {
  17218. needLoginPage: t,
  17219. notNeedLoginPage: n
  17220. };
  17221. }(n),
  17222. l = _ref26.needLoginPage,
  17223. h = _ref26.notNeedLoginPage;
  17224. return {
  17225. loginPage: i,
  17226. routerNeedLogin: o,
  17227. resToLogin: a,
  17228. needLoginPage: [].concat((0, _toConsumableArray2.default)(c), (0, _toConsumableArray2.default)(l)),
  17229. notNeedLoginPage: [].concat((0, _toConsumableArray2.default)(u), (0, _toConsumableArray2.default)(h)),
  17230. loginPageInTabBar: Vn(i, r)
  17231. };
  17232. }(),
  17233. Qn = _ref41.loginPage,
  17234. Xn = _ref41.routerNeedLogin,
  17235. Zn = _ref41.resToLogin,
  17236. es = _ref41.needLoginPage,
  17237. ts = _ref41.notNeedLoginPage,
  17238. ns = _ref41.loginPageInTabBar;
  17239. if (es.indexOf(Qn) > -1) throw new Error("Login page [".concat(Qn, "] should not be \"needLogin\", please check your pages.json"));
  17240. function ss(e) {
  17241. var t = Gn();
  17242. if ("/" === e.charAt(0)) return e;
  17243. var _e$split = e.split("?"),
  17244. _e$split2 = (0, _slicedToArray2.default)(_e$split, 2),
  17245. n = _e$split2[0],
  17246. s = _e$split2[1],
  17247. r = n.replace(/^\//, "").split("/"),
  17248. i = t.split("/");
  17249. i.pop();
  17250. for (var _e27 = 0; _e27 < r.length; _e27++) {
  17251. var _t15 = r[_e27];
  17252. ".." === _t15 ? i.pop() : "." !== _t15 && i.push(_t15);
  17253. }
  17254. return "" === i[0] && i.shift(), "/" + i.join("/") + (s ? "?" + s : "");
  17255. }
  17256. function rs(e) {
  17257. var t = Jn(ss(e));
  17258. return !(ts.indexOf(t) > -1) && (es.indexOf(t) > -1 || Xn.some(function (t) {
  17259. return function (e, t) {
  17260. return new RegExp(t).test(e);
  17261. }(e, t);
  17262. }));
  17263. }
  17264. function is(_ref42) {
  17265. var e = _ref42.redirect;
  17266. var t = Jn(e),
  17267. n = Jn(Qn);
  17268. return Gn() !== n && t !== n;
  17269. }
  17270. function os() {
  17271. var _ref43 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17272. e = _ref43.api,
  17273. t = _ref43.redirect;
  17274. if (!t || !is({
  17275. redirect: t
  17276. })) return;
  17277. var n = function (e, t) {
  17278. return "/" !== e.charAt(0) && (e = "/" + e), t ? e.indexOf("?") > -1 ? e + "&uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e + "?uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e;
  17279. }(Qn, t);
  17280. ns ? "navigateTo" !== e && "redirectTo" !== e || (e = "switchTab") : "switchTab" === e && (e = "navigateTo");
  17281. var s = {
  17282. navigateTo: uni.navigateTo,
  17283. redirectTo: uni.redirectTo,
  17284. switchTab: uni.switchTab,
  17285. reLaunch: uni.reLaunch
  17286. };
  17287. setTimeout(function () {
  17288. s[e]({
  17289. url: n
  17290. });
  17291. });
  17292. }
  17293. function as() {
  17294. var _ref44 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17295. e = _ref44.url;
  17296. var t = {
  17297. abortLoginPageJump: !1,
  17298. autoToLoginPage: !1
  17299. },
  17300. n = function () {
  17301. var _Z3 = Z(),
  17302. e = _Z3.token,
  17303. t = _Z3.tokenExpired;
  17304. var n;
  17305. if (e) {
  17306. if (t < Date.now()) {
  17307. var _e28 = "uni-id-token-expired";
  17308. n = {
  17309. errCode: _e28,
  17310. errMsg: $n[_e28]
  17311. };
  17312. }
  17313. } else {
  17314. var _e29 = "uni-id-check-token-failed";
  17315. n = {
  17316. errCode: _e29,
  17317. errMsg: $n[_e29]
  17318. };
  17319. }
  17320. return n;
  17321. }();
  17322. if (rs(e) && n) {
  17323. n.uniIdRedirectUrl = e;
  17324. if (B(F).length > 0) return setTimeout(function () {
  17325. z(F, n);
  17326. }, 0), t.abortLoginPageJump = !0, t;
  17327. t.autoToLoginPage = !0;
  17328. }
  17329. return t;
  17330. }
  17331. function cs() {
  17332. !function () {
  17333. var e = Hn(),
  17334. _as = as({
  17335. url: e
  17336. }),
  17337. t = _as.abortLoginPageJump,
  17338. n = _as.autoToLoginPage;
  17339. t || n && os({
  17340. api: "redirectTo",
  17341. redirect: e
  17342. });
  17343. }();
  17344. var e = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
  17345. var _loop3 = function _loop3(_t16) {
  17346. var n = e[_t16];
  17347. uni.addInterceptor(n, {
  17348. invoke: function invoke(e) {
  17349. var _as2 = as({
  17350. url: e.url
  17351. }),
  17352. t = _as2.abortLoginPageJump,
  17353. s = _as2.autoToLoginPage;
  17354. return t ? e : s ? (os({
  17355. api: n,
  17356. redirect: ss(e.url)
  17357. }), !1) : e;
  17358. }
  17359. });
  17360. };
  17361. for (var _t16 = 0; _t16 < e.length; _t16++) {
  17362. _loop3(_t16);
  17363. }
  17364. }
  17365. function us() {
  17366. this.onResponse(function (e) {
  17367. var t = e.type,
  17368. n = e.content;
  17369. var s = !1;
  17370. switch (t) {
  17371. case "cloudobject":
  17372. s = function (e) {
  17373. var t = e.errCode;
  17374. return t in $n;
  17375. }(n);
  17376. break;
  17377. case "clientdb":
  17378. s = function (e) {
  17379. var t = e.errCode;
  17380. return t in Bn;
  17381. }(n);
  17382. }
  17383. s && function () {
  17384. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  17385. var t = B(F);
  17386. G().then(function () {
  17387. var n = Hn();
  17388. if (n && is({
  17389. redirect: n
  17390. })) return t.length > 0 ? z(F, Object.assign({
  17391. uniIdRedirectUrl: n
  17392. }, e)) : void (Qn && os({
  17393. api: "navigateTo",
  17394. redirect: n
  17395. }));
  17396. });
  17397. }(n);
  17398. });
  17399. }
  17400. function ls(e) {
  17401. !function (e) {
  17402. e.onResponse = function (e) {
  17403. $(D, e);
  17404. }, e.offResponse = function (e) {
  17405. W(D, e);
  17406. };
  17407. }(e), function (e) {
  17408. e.onNeedLogin = function (e) {
  17409. $(F, e);
  17410. }, e.offNeedLogin = function (e) {
  17411. W(F, e);
  17412. }, Yn && (C("_globalUniCloudStatus").needLoginInit || (C("_globalUniCloudStatus").needLoginInit = !0, G().then(function () {
  17413. cs.call(e);
  17414. }), Zn && us.call(e)));
  17415. }(e), function (e) {
  17416. e.onRefreshToken = function (e) {
  17417. $(q, e);
  17418. }, e.offRefreshToken = function (e) {
  17419. W(q, e);
  17420. };
  17421. }(e);
  17422. }
  17423. var hs;
  17424. var ds = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  17425. fs = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  17426. function ps() {
  17427. var e = Z().token || "",
  17428. t = e.split(".");
  17429. if (!e || 3 !== t.length) return {
  17430. uid: null,
  17431. role: [],
  17432. permission: [],
  17433. tokenExpired: 0
  17434. };
  17435. var n;
  17436. try {
  17437. n = JSON.parse((s = t[1], decodeURIComponent(hs(s).split("").map(function (e) {
  17438. return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2);
  17439. }).join(""))));
  17440. } catch (e) {
  17441. throw new Error("获取当前用户信息出错,详细错误信息为:" + e.message);
  17442. }
  17443. var s;
  17444. return n.tokenExpired = 1e3 * n.exp, delete n.exp, delete n.iat, n;
  17445. }
  17446. hs = "function" != typeof atob ? function (e) {
  17447. if (e = String(e).replace(/[\t\n\f\r ]+/g, ""), !fs.test(e)) throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  17448. var t;
  17449. e += "==".slice(2 - (3 & e.length));
  17450. for (var n, s, r = "", i = 0; i < e.length;) {
  17451. t = ds.indexOf(e.charAt(i++)) << 18 | ds.indexOf(e.charAt(i++)) << 12 | (n = ds.indexOf(e.charAt(i++))) << 6 | (s = ds.indexOf(e.charAt(i++))), r += 64 === n ? String.fromCharCode(t >> 16 & 255) : 64 === s ? String.fromCharCode(t >> 16 & 255, t >> 8 & 255) : String.fromCharCode(t >> 16 & 255, t >> 8 & 255, 255 & t);
  17452. }
  17453. return r;
  17454. } : atob;
  17455. var gs = s(function (e, t) {
  17456. Object.defineProperty(t, "__esModule", {
  17457. value: !0
  17458. });
  17459. var n = "chooseAndUploadFile:ok",
  17460. s = "chooseAndUploadFile:fail";
  17461. function r(e, t) {
  17462. return e.tempFiles.forEach(function (e, n) {
  17463. e.name || (e.name = e.path.substring(e.path.lastIndexOf("/") + 1)), t && (e.fileType = t), e.cloudPath = Date.now() + "_" + n + e.name.substring(e.name.lastIndexOf("."));
  17464. }), e.tempFilePaths || (e.tempFilePaths = e.tempFiles.map(function (e) {
  17465. return e.path;
  17466. })), e;
  17467. }
  17468. function i(e, t, _ref45) {
  17469. var s = _ref45.onChooseFile,
  17470. r = _ref45.onUploadProgress;
  17471. return t.then(function (e) {
  17472. if (s) {
  17473. var _t17 = s(e);
  17474. if (void 0 !== _t17) return Promise.resolve(_t17).then(function (t) {
  17475. return void 0 === t ? e : t;
  17476. });
  17477. }
  17478. return e;
  17479. }).then(function (t) {
  17480. return !1 === t ? {
  17481. errMsg: n,
  17482. tempFilePaths: [],
  17483. tempFiles: []
  17484. } : function (e, t) {
  17485. var s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;
  17486. var r = arguments.length > 3 ? arguments[3] : undefined;
  17487. (t = Object.assign({}, t)).errMsg = n;
  17488. var i = t.tempFiles,
  17489. o = i.length;
  17490. var a = 0;
  17491. return new Promise(function (n) {
  17492. for (; a < s;) {
  17493. c();
  17494. }
  17495. function c() {
  17496. var s = a++;
  17497. if (s >= o) return void (!i.find(function (e) {
  17498. return !e.url && !e.errMsg;
  17499. }) && n(t));
  17500. var u = i[s];
  17501. e.uploadFile({
  17502. filePath: u.path,
  17503. cloudPath: u.cloudPath,
  17504. fileType: u.fileType,
  17505. onUploadProgress: function onUploadProgress(e) {
  17506. e.index = s, e.tempFile = u, e.tempFilePath = u.path, r && r(e);
  17507. }
  17508. }).then(function (e) {
  17509. u.url = e.fileID, s < o && c();
  17510. }).catch(function (e) {
  17511. u.errMsg = e.errMsg || e.message, s < o && c();
  17512. });
  17513. }
  17514. });
  17515. }(e, t, 5, r);
  17516. });
  17517. }
  17518. t.initChooseAndUploadFile = function (e) {
  17519. return function () {
  17520. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  17521. type: "all"
  17522. };
  17523. return "image" === t.type ? i(e, function (e) {
  17524. var t = e.count,
  17525. n = e.sizeType,
  17526. _e$sourceType = e.sourceType,
  17527. i = _e$sourceType === void 0 ? ["album", "camera"] : _e$sourceType,
  17528. o = e.extension;
  17529. return new Promise(function (e, a) {
  17530. uni.chooseImage({
  17531. count: t,
  17532. sizeType: n,
  17533. sourceType: i,
  17534. extension: o,
  17535. success: function success(t) {
  17536. e(r(t, "image"));
  17537. },
  17538. fail: function fail(e) {
  17539. a({
  17540. errMsg: e.errMsg.replace("chooseImage:fail", s)
  17541. });
  17542. }
  17543. });
  17544. });
  17545. }(t), t) : "video" === t.type ? i(e, function (e) {
  17546. var t = e.camera,
  17547. n = e.compressed,
  17548. i = e.maxDuration,
  17549. _e$sourceType2 = e.sourceType,
  17550. o = _e$sourceType2 === void 0 ? ["album", "camera"] : _e$sourceType2,
  17551. a = e.extension;
  17552. return new Promise(function (e, c) {
  17553. uni.chooseVideo({
  17554. camera: t,
  17555. compressed: n,
  17556. maxDuration: i,
  17557. sourceType: o,
  17558. extension: a,
  17559. success: function success(t) {
  17560. var n = t.tempFilePath,
  17561. s = t.duration,
  17562. i = t.size,
  17563. o = t.height,
  17564. a = t.width;
  17565. e(r({
  17566. errMsg: "chooseVideo:ok",
  17567. tempFilePaths: [n],
  17568. tempFiles: [{
  17569. name: t.tempFile && t.tempFile.name || "",
  17570. path: n,
  17571. size: i,
  17572. type: t.tempFile && t.tempFile.type || "",
  17573. width: a,
  17574. height: o,
  17575. duration: s,
  17576. fileType: "video",
  17577. cloudPath: ""
  17578. }]
  17579. }, "video"));
  17580. },
  17581. fail: function fail(e) {
  17582. c({
  17583. errMsg: e.errMsg.replace("chooseVideo:fail", s)
  17584. });
  17585. }
  17586. });
  17587. });
  17588. }(t), t) : i(e, function (e) {
  17589. var t = e.count,
  17590. n = e.extension;
  17591. return new Promise(function (e, i) {
  17592. var o = uni.chooseFile;
  17593. if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (o = wx.chooseMessageFile), "function" != typeof o) return i({
  17594. errMsg: s + " 请指定 type 类型,该平台仅支持选择 image 或 video。"
  17595. });
  17596. o({
  17597. type: "all",
  17598. count: t,
  17599. extension: n,
  17600. success: function success(t) {
  17601. e(r(t));
  17602. },
  17603. fail: function fail(e) {
  17604. i({
  17605. errMsg: e.errMsg.replace("chooseFile:fail", s)
  17606. });
  17607. }
  17608. });
  17609. });
  17610. }(t), t);
  17611. };
  17612. };
  17613. }),
  17614. ms = n(gs);
  17615. var ys = "manual";
  17616. function _s(e) {
  17617. return {
  17618. props: {
  17619. localdata: {
  17620. type: Array,
  17621. default: function _default() {
  17622. return [];
  17623. }
  17624. },
  17625. options: {
  17626. type: [Object, Array],
  17627. default: function _default() {
  17628. return {};
  17629. }
  17630. },
  17631. spaceInfo: {
  17632. type: Object,
  17633. default: function _default() {
  17634. return {};
  17635. }
  17636. },
  17637. collection: {
  17638. type: [String, Array],
  17639. default: ""
  17640. },
  17641. action: {
  17642. type: String,
  17643. default: ""
  17644. },
  17645. field: {
  17646. type: String,
  17647. default: ""
  17648. },
  17649. orderby: {
  17650. type: String,
  17651. default: ""
  17652. },
  17653. where: {
  17654. type: [String, Object],
  17655. default: ""
  17656. },
  17657. pageData: {
  17658. type: String,
  17659. default: "add"
  17660. },
  17661. pageCurrent: {
  17662. type: Number,
  17663. default: 1
  17664. },
  17665. pageSize: {
  17666. type: Number,
  17667. default: 20
  17668. },
  17669. getcount: {
  17670. type: [Boolean, String],
  17671. default: !1
  17672. },
  17673. gettree: {
  17674. type: [Boolean, String],
  17675. default: !1
  17676. },
  17677. gettreepath: {
  17678. type: [Boolean, String],
  17679. default: !1
  17680. },
  17681. startwith: {
  17682. type: String,
  17683. default: ""
  17684. },
  17685. limitlevel: {
  17686. type: Number,
  17687. default: 10
  17688. },
  17689. groupby: {
  17690. type: String,
  17691. default: ""
  17692. },
  17693. groupField: {
  17694. type: String,
  17695. default: ""
  17696. },
  17697. distinct: {
  17698. type: [Boolean, String],
  17699. default: !1
  17700. },
  17701. foreignKey: {
  17702. type: String,
  17703. default: ""
  17704. },
  17705. loadtime: {
  17706. type: String,
  17707. default: "auto"
  17708. },
  17709. manual: {
  17710. type: Boolean,
  17711. default: !1
  17712. }
  17713. },
  17714. data: function data() {
  17715. return {
  17716. mixinDatacomLoading: !1,
  17717. mixinDatacomHasMore: !1,
  17718. mixinDatacomResData: [],
  17719. mixinDatacomErrorMessage: "",
  17720. mixinDatacomPage: {}
  17721. };
  17722. },
  17723. created: function created() {
  17724. var _this21 = this;
  17725. this.mixinDatacomPage = {
  17726. current: this.pageCurrent,
  17727. size: this.pageSize,
  17728. count: 0
  17729. }, this.$watch(function () {
  17730. var e = [];
  17731. return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach(function (t) {
  17732. e.push(_this21[t]);
  17733. }), e;
  17734. }, function (e, t) {
  17735. if (_this21.loadtime === ys) return;
  17736. var n = !1;
  17737. var s = [];
  17738. for (var _r6 = 2; _r6 < e.length; _r6++) {
  17739. e[_r6] !== t[_r6] && (s.push(e[_r6]), n = !0);
  17740. }
  17741. e[0] !== t[0] && (_this21.mixinDatacomPage.current = _this21.pageCurrent), _this21.mixinDatacomPage.size = _this21.pageSize, _this21.onMixinDatacomPropsChange(n, s);
  17742. });
  17743. },
  17744. methods: {
  17745. onMixinDatacomPropsChange: function onMixinDatacomPropsChange(e, t) {},
  17746. mixinDatacomEasyGet: function mixinDatacomEasyGet() {
  17747. var _this22 = this;
  17748. var _ref46 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17749. _ref46$getone = _ref46.getone,
  17750. e = _ref46$getone === void 0 ? !1 : _ref46$getone,
  17751. t = _ref46.success,
  17752. n = _ref46.fail;
  17753. this.mixinDatacomLoading || (this.mixinDatacomLoading = !0, this.mixinDatacomErrorMessage = "", this.mixinDatacomGet().then(function (n) {
  17754. _this22.mixinDatacomLoading = !1;
  17755. var _n$result = n.result,
  17756. s = _n$result.data,
  17757. r = _n$result.count;
  17758. _this22.getcount && (_this22.mixinDatacomPage.count = r), _this22.mixinDatacomHasMore = s.length < _this22.pageSize;
  17759. var i = e ? s.length ? s[0] : void 0 : s;
  17760. _this22.mixinDatacomResData = i, t && t(i);
  17761. }).catch(function (e) {
  17762. _this22.mixinDatacomLoading = !1, _this22.mixinDatacomErrorMessage = e, n && n(e);
  17763. }));
  17764. },
  17765. mixinDatacomGet: function mixinDatacomGet() {
  17766. var _n12;
  17767. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  17768. var n = e.database(this.spaceInfo);
  17769. var s = t.action || this.action;
  17770. s && (n = n.action(s));
  17771. var r = t.collection || this.collection;
  17772. n = Array.isArray(r) ? (_n12 = n).collection.apply(_n12, (0, _toConsumableArray2.default)(r)) : n.collection(r);
  17773. var i = t.where || this.where;
  17774. i && Object.keys(i).length && (n = n.where(i));
  17775. var o = t.field || this.field;
  17776. o && (n = n.field(o));
  17777. var a = t.foreignKey || this.foreignKey;
  17778. a && (n = n.foreignKey(a));
  17779. var c = t.groupby || this.groupby;
  17780. c && (n = n.groupBy(c));
  17781. var u = t.groupField || this.groupField;
  17782. u && (n = n.groupField(u));
  17783. !0 === (void 0 !== t.distinct ? t.distinct : this.distinct) && (n = n.distinct());
  17784. var l = t.orderby || this.orderby;
  17785. l && (n = n.orderBy(l));
  17786. var h = void 0 !== t.pageCurrent ? t.pageCurrent : this.mixinDatacomPage.current,
  17787. d = void 0 !== t.pageSize ? t.pageSize : this.mixinDatacomPage.size,
  17788. f = void 0 !== t.getcount ? t.getcount : this.getcount,
  17789. p = void 0 !== t.gettree ? t.gettree : this.gettree,
  17790. g = void 0 !== t.gettreepath ? t.gettreepath : this.gettreepath,
  17791. m = {
  17792. getCount: f
  17793. },
  17794. y = {
  17795. limitLevel: void 0 !== t.limitlevel ? t.limitlevel : this.limitlevel,
  17796. startWith: void 0 !== t.startwith ? t.startwith : this.startwith
  17797. };
  17798. return p && (m.getTree = y), g && (m.getTreePath = y), n = n.skip(d * (h - 1)).limit(d).get(m), n;
  17799. }
  17800. }
  17801. };
  17802. }
  17803. function ws(e) {
  17804. return function (t) {
  17805. var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17806. n = function (e) {
  17807. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17808. return e.customUI = t.customUI || e.customUI, e.parseSystemError = t.parseSystemError || e.parseSystemError, Object.assign(e.loadingOptions, t.loadingOptions), Object.assign(e.errorOptions, t.errorOptions), "object" == (0, _typeof2.default)(t.secretMethods) && (e.secretMethods = t.secretMethods), e;
  17809. }({
  17810. customUI: !1,
  17811. loadingOptions: {
  17812. title: "加载中...",
  17813. mask: !0
  17814. },
  17815. errorOptions: {
  17816. type: "modal",
  17817. retry: !1
  17818. }
  17819. }, n);
  17820. var _n13 = n,
  17821. s = _n13.customUI,
  17822. r = _n13.loadingOptions,
  17823. i = _n13.errorOptions,
  17824. o = _n13.parseSystemError,
  17825. a = !s;
  17826. return new Proxy({}, {
  17827. get: function get(s, c) {
  17828. return function () {
  17829. var _ref47 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17830. e = _ref47.fn,
  17831. t = _ref47.interceptorName,
  17832. n = _ref47.getCallbackArgs;
  17833. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49() {
  17834. var _len2,
  17835. s,
  17836. _key2,
  17837. r,
  17838. i,
  17839. o,
  17840. _args = arguments;
  17841. return _regenerator.default.wrap(function _callee49$(_context49) {
  17842. while (1) {
  17843. switch (_context49.prev = _context49.next) {
  17844. case 0:
  17845. for (_len2 = _args.length, s = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  17846. s[_key2] = _args[_key2];
  17847. }
  17848. r = n ? n({
  17849. params: s
  17850. }) : {};
  17851. _context49.prev = 2;
  17852. _context49.next = 5;
  17853. return U(R(t, "invoke"), _objectSpread({}, r));
  17854. case 5:
  17855. _context49.next = 7;
  17856. return e.apply(void 0, s);
  17857. case 7:
  17858. i = _context49.sent;
  17859. _context49.next = 10;
  17860. return U(R(t, "success"), _objectSpread(_objectSpread({}, r), {}, {
  17861. result: i
  17862. }));
  17863. case 10:
  17864. return _context49.abrupt("return", i);
  17865. case 13:
  17866. _context49.prev = 13;
  17867. _context49.t0 = _context49["catch"](2);
  17868. o = _context49.t0;
  17869. _context49.next = 18;
  17870. return U(R(t, "fail"), _objectSpread(_objectSpread({}, r), {}, {
  17871. error: o
  17872. }));
  17873. case 18:
  17874. throw o;
  17875. case 19:
  17876. _context49.prev = 19;
  17877. _context49.next = 22;
  17878. return U(R(t, "complete"), o ? _objectSpread(_objectSpread({}, r), {}, {
  17879. error: o
  17880. }) : _objectSpread(_objectSpread({}, r), {}, {
  17881. result: i
  17882. }));
  17883. case 22:
  17884. return _context49.finish(19);
  17885. case 23:
  17886. case "end":
  17887. return _context49.stop();
  17888. }
  17889. }
  17890. }, _callee49, null, [[2, 13, 19, 23]]);
  17891. }));
  17892. }({
  17893. fn: function () {
  17894. var _s14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51() {
  17895. var h,
  17896. _len3,
  17897. u,
  17898. _key3,
  17899. d,
  17900. f,
  17901. _ref49,
  17902. p,
  17903. g,
  17904. m,
  17905. y,
  17906. _e30,
  17907. _yield,
  17908. _t18,
  17909. _n14,
  17910. _args4 = arguments;
  17911. return _regenerator.default.wrap(function _callee51$(_context51) {
  17912. while (1) {
  17913. switch (_context51.prev = _context51.next) {
  17914. case 0:
  17915. a && uni.showLoading({
  17916. title: r.title,
  17917. mask: r.mask
  17918. });
  17919. for (_len3 = _args4.length, u = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  17920. u[_key3] = _args4[_key3];
  17921. }
  17922. d = {
  17923. name: t,
  17924. type: l,
  17925. data: {
  17926. method: c,
  17927. params: u
  17928. }
  17929. };
  17930. "object" == (0, _typeof2.default)(n.secretMethods) && function (e, t) {
  17931. var n = t.data.method,
  17932. s = e.secretMethods || {},
  17933. r = s[n] || s["*"];
  17934. r && (t.secretType = r);
  17935. }(n, d);
  17936. f = !1;
  17937. _context51.prev = 5;
  17938. _context51.next = 8;
  17939. return e.callFunction(d);
  17940. case 8:
  17941. h = _context51.sent;
  17942. _context51.next = 14;
  17943. break;
  17944. case 11:
  17945. _context51.prev = 11;
  17946. _context51.t0 = _context51["catch"](5);
  17947. f = !0, h = {
  17948. result: new Q(_context51.t0)
  17949. };
  17950. case 14:
  17951. _ref49 = h.result || {}, p = _ref49.errSubject, g = _ref49.errCode, m = _ref49.errMsg, y = _ref49.newToken;
  17952. if (!(a && uni.hideLoading(), y && y.token && y.tokenExpired && (ee(y), z(q, _objectSpread({}, y))), g)) {
  17953. _context51.next = 39;
  17954. break;
  17955. }
  17956. _e30 = m;
  17957. if (!(f && o)) {
  17958. _context51.next = 24;
  17959. break;
  17960. }
  17961. _context51.next = 20;
  17962. return o({
  17963. objectName: t,
  17964. methodName: c,
  17965. params: u,
  17966. errSubject: p,
  17967. errCode: g,
  17968. errMsg: m
  17969. });
  17970. case 20:
  17971. _context51.t1 = _context51.sent.errMsg;
  17972. if (_context51.t1) {
  17973. _context51.next = 23;
  17974. break;
  17975. }
  17976. _context51.t1 = m;
  17977. case 23:
  17978. _e30 = _context51.t1;
  17979. case 24:
  17980. if (!a) {
  17981. _context51.next = 37;
  17982. break;
  17983. }
  17984. if (!("toast" === i.type)) {
  17985. _context51.next = 29;
  17986. break;
  17987. }
  17988. uni.showToast({
  17989. title: _e30,
  17990. icon: "none"
  17991. });
  17992. _context51.next = 37;
  17993. break;
  17994. case 29:
  17995. if (!("modal" !== i.type)) {
  17996. _context51.next = 31;
  17997. break;
  17998. }
  17999. throw new Error("Invalid errorOptions.type: ".concat(i.type));
  18000. case 31:
  18001. _context51.next = 33;
  18002. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50() {
  18003. var _ref51,
  18004. e,
  18005. t,
  18006. n,
  18007. s,
  18008. r,
  18009. _args3 = arguments;
  18010. return _regenerator.default.wrap(function _callee50$(_context50) {
  18011. while (1) {
  18012. switch (_context50.prev = _context50.next) {
  18013. case 0:
  18014. _ref51 = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, e = _ref51.title, t = _ref51.content, n = _ref51.showCancel, s = _ref51.cancelText, r = _ref51.confirmText;
  18015. return _context50.abrupt("return", new Promise(function (i, o) {
  18016. uni.showModal({
  18017. title: e,
  18018. content: t,
  18019. showCancel: n,
  18020. cancelText: s,
  18021. confirmText: r,
  18022. success: function success(e) {
  18023. i(e);
  18024. },
  18025. fail: function fail() {
  18026. i({
  18027. confirm: !1,
  18028. cancel: !0
  18029. });
  18030. }
  18031. });
  18032. }));
  18033. case 2:
  18034. case "end":
  18035. return _context50.stop();
  18036. }
  18037. }
  18038. }, _callee50);
  18039. }))({
  18040. title: "提示",
  18041. content: _e30,
  18042. showCancel: i.retry,
  18043. cancelText: "取消",
  18044. confirmText: i.retry ? "重试" : "确定"
  18045. });
  18046. case 33:
  18047. _yield = _context51.sent;
  18048. _t18 = _yield.confirm;
  18049. if (!(i.retry && _t18)) {
  18050. _context51.next = 37;
  18051. break;
  18052. }
  18053. return _context51.abrupt("return", s.apply(void 0, u));
  18054. case 37:
  18055. _n14 = new Q({
  18056. subject: p,
  18057. code: g,
  18058. message: m,
  18059. requestId: h.requestId
  18060. });
  18061. throw _n14.detail = h.result, z(D, {
  18062. type: j,
  18063. content: _n14
  18064. }), _n14;
  18065. case 39:
  18066. return _context51.abrupt("return", (z(D, {
  18067. type: j,
  18068. content: h.result
  18069. }), h.result));
  18070. case 40:
  18071. case "end":
  18072. return _context51.stop();
  18073. }
  18074. }
  18075. }, _callee51, null, [[5, 11]]);
  18076. }));
  18077. function s() {
  18078. return _s14.apply(this, arguments);
  18079. }
  18080. return s;
  18081. }(),
  18082. interceptorName: "callObject",
  18083. getCallbackArgs: function getCallbackArgs() {
  18084. var _ref52 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18085. e = _ref52.params;
  18086. return {
  18087. objectName: t,
  18088. methodName: c,
  18089. params: e
  18090. };
  18091. }
  18092. });
  18093. }
  18094. });
  18095. };
  18096. }
  18097. function vs(e) {
  18098. return C("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e.config.spaceId));
  18099. }
  18100. function Ss() {
  18101. return _Ss.apply(this, arguments);
  18102. }
  18103. function _Ss() {
  18104. _Ss = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53() {
  18105. var _ref56,
  18106. _ref56$callLoginByWei,
  18107. e,
  18108. t,
  18109. n,
  18110. s,
  18111. _args6 = arguments;
  18112. return _regenerator.default.wrap(function _callee53$(_context53) {
  18113. while (1) {
  18114. switch (_context53.prev = _context53.next) {
  18115. case 0:
  18116. _ref56 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, _ref56$callLoginByWei = _ref56.callLoginByWeixin, e = _ref56$callLoginByWei === void 0 ? !1 : _ref56$callLoginByWei;
  18117. t = vs(this);
  18118. if (!("mp-weixin" !== S)) {
  18119. _context53.next = 4;
  18120. break;
  18121. }
  18122. throw new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `".concat(S, "`"));
  18123. case 4:
  18124. _context53.next = 6;
  18125. return new Promise(function (e, t) {
  18126. uni.login({
  18127. success: function success(t) {
  18128. e(t.code);
  18129. },
  18130. fail: function fail(e) {
  18131. t(new Error(e.errMsg));
  18132. }
  18133. });
  18134. });
  18135. case 6:
  18136. n = _context53.sent;
  18137. s = this.importObject("uni-id-co", {
  18138. customUI: !0
  18139. });
  18140. _context53.next = 10;
  18141. return s.secureNetworkHandshakeByWeixin({
  18142. code: n,
  18143. callLoginByWeixin: e
  18144. });
  18145. case 10:
  18146. t.mpWeixinCode = n;
  18147. return _context53.abrupt("return", {
  18148. code: n
  18149. });
  18150. case 12:
  18151. case "end":
  18152. return _context53.stop();
  18153. }
  18154. }
  18155. }, _callee53, this);
  18156. }));
  18157. return _Ss.apply(this, arguments);
  18158. }
  18159. function ks(_x37) {
  18160. return _ks.apply(this, arguments);
  18161. }
  18162. function _ks() {
  18163. _ks = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54(e) {
  18164. var t;
  18165. return _regenerator.default.wrap(function _callee54$(_context54) {
  18166. while (1) {
  18167. switch (_context54.prev = _context54.next) {
  18168. case 0:
  18169. t = vs(this);
  18170. return _context54.abrupt("return", (t.initPromise || (t.initPromise = Ss.call(this, e)), t.initPromise));
  18171. case 2:
  18172. case "end":
  18173. return _context54.stop();
  18174. }
  18175. }
  18176. }, _callee54, this);
  18177. }));
  18178. return _ks.apply(this, arguments);
  18179. }
  18180. function Is(e) {
  18181. return function () {
  18182. var _ref53 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18183. _ref53$callLoginByWei = _ref53.callLoginByWeixin,
  18184. t = _ref53$callLoginByWei === void 0 ? !1 : _ref53$callLoginByWei;
  18185. return ks.call(e, {
  18186. callLoginByWeixin: t
  18187. });
  18188. };
  18189. }
  18190. function bs(_x38, _x39) {
  18191. return _bs.apply(this, arguments);
  18192. }
  18193. function _bs() {
  18194. _bs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55(e, t) {
  18195. var n, _e32, s;
  18196. return _regenerator.default.wrap(function _callee55$(_context55) {
  18197. while (1) {
  18198. switch (_context55.prev = _context55.next) {
  18199. case 0:
  18200. n = "http://".concat(e, ":").concat(t, "/system/ping");
  18201. _context55.prev = 1;
  18202. _context55.next = 4;
  18203. return s = {
  18204. url: n,
  18205. timeout: 500
  18206. }, new Promise(function (e, t) {
  18207. X.request(_objectSpread(_objectSpread({}, s), {}, {
  18208. success: function success(t) {
  18209. e(t);
  18210. },
  18211. fail: function fail(e) {
  18212. t(e);
  18213. }
  18214. }));
  18215. });
  18216. case 4:
  18217. _e32 = _context55.sent;
  18218. return _context55.abrupt("return", !(!_e32.data || 0 !== _e32.data.code));
  18219. case 8:
  18220. _context55.prev = 8;
  18221. _context55.t0 = _context55["catch"](1);
  18222. return _context55.abrupt("return", !1);
  18223. case 11:
  18224. case "end":
  18225. return _context55.stop();
  18226. }
  18227. }
  18228. }, _callee55, null, [[1, 8]]);
  18229. }));
  18230. return _bs.apply(this, arguments);
  18231. }
  18232. function Ts(e) {
  18233. if (e.initUniCloudStatus && "rejected" !== e.initUniCloudStatus) return;
  18234. var t = Promise.resolve();
  18235. var n;
  18236. n = 1, t = new Promise(function (e) {
  18237. setTimeout(function () {
  18238. e();
  18239. }, n);
  18240. }), e.isReady = !1, e.isDefault = !1;
  18241. var s = e.auth();
  18242. e.initUniCloudStatus = "pending", e.initUniCloud = t.then(function () {
  18243. return s.getLoginState();
  18244. }).then(function (e) {
  18245. return e ? Promise.resolve() : s.signInAnonymously();
  18246. }).then(function () {
  18247. if (!y) return Promise.resolve();
  18248. if ("app" === S) {
  18249. var _re2 = re(),
  18250. _e31 = _re2.osName,
  18251. _t19 = _re2.osVersion;
  18252. "ios" === _e31 && function (e) {
  18253. if (!e || "string" != typeof e) return 0;
  18254. var t = e.match(/^(\d+)./);
  18255. return t && t[1] ? parseInt(t[1]) : 0;
  18256. }(_t19) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发模式生效,发行模式会连接uniCloud云端服务)");
  18257. }
  18258. if (y && e.__dev__.debugInfo) {
  18259. var _e$__dev__$debugInfo = e.__dev__.debugInfo,
  18260. _t20 = _e$__dev__$debugInfo.address,
  18261. _n15 = _e$__dev__$debugInfo.servePort;
  18262. return function () {
  18263. var _ref54 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52(e, t) {
  18264. var n, _s15, _r7;
  18265. return _regenerator.default.wrap(function _callee52$(_context52) {
  18266. while (1) {
  18267. switch (_context52.prev = _context52.next) {
  18268. case 0:
  18269. _s15 = 0;
  18270. case 1:
  18271. if (!(_s15 < e.length)) {
  18272. _context52.next = 11;
  18273. break;
  18274. }
  18275. _r7 = e[_s15];
  18276. _context52.next = 5;
  18277. return bs(_r7, t);
  18278. case 5:
  18279. if (!_context52.sent) {
  18280. _context52.next = 8;
  18281. break;
  18282. }
  18283. n = _r7;
  18284. return _context52.abrupt("break", 11);
  18285. case 8:
  18286. _s15++;
  18287. _context52.next = 1;
  18288. break;
  18289. case 11:
  18290. return _context52.abrupt("return", {
  18291. address: n,
  18292. port: t
  18293. });
  18294. case 12:
  18295. case "end":
  18296. return _context52.stop();
  18297. }
  18298. }
  18299. }, _callee52);
  18300. }));
  18301. return function (_x40, _x41) {
  18302. return _ref54.apply(this, arguments);
  18303. };
  18304. }()(_t20, _n15);
  18305. }
  18306. }).then(function () {
  18307. var _ref55 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18308. t = _ref55.address,
  18309. n = _ref55.port;
  18310. if (!y) return Promise.resolve();
  18311. var s = console["app" === S ? "error" : "warn"];
  18312. if (t) e.__dev__.localAddress = t, e.__dev__.localPort = n;else if (e.__dev__.debugInfo) {
  18313. var _t21 = "";
  18314. "remote" === e.__dev__.debugInfo.initialLaunchType ? (e.__dev__.debugInfo.forceRemote = !0, _t21 = "当前客户端和HBuilderX不在同一局域网下(或其他网络原因无法连接HBuilderX),uniCloud本地调试服务不对当前客户端生效。\n- 如果不使用uniCloud本地调试服务,请直接忽略此信息。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。") : _t21 = "无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。", _t21 += "\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs\n- 检查是否错误的使用拦截器修改uni.request方法的参数", "web" === S && (_t21 += "\n- 部分浏览器开启节流模式之后访问本地地址受限,请检查是否启用了节流模式"), 0 === S.indexOf("mp-") && (_t21 += "\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"), s(_t21);
  18315. }
  18316. }).then(function () {
  18317. te(), e.isReady = !0, e.initUniCloudStatus = "fulfilled";
  18318. }).catch(function (t) {
  18319. console.error(t), e.initUniCloudStatus = "rejected";
  18320. });
  18321. }
  18322. var As = {
  18323. tcb: yt,
  18324. tencent: yt,
  18325. aliyun: he,
  18326. private: wt
  18327. };
  18328. var Cs = new ( /*#__PURE__*/function () {
  18329. function _class6() {
  18330. (0, _classCallCheck2.default)(this, _class6);
  18331. }
  18332. (0, _createClass2.default)(_class6, [{
  18333. key: "init",
  18334. value: function init(e) {
  18335. var t = {};
  18336. var n = As[e.provider];
  18337. if (!n) throw new Error("未提供正确的provider参数");
  18338. t = n.init(e), t.__dev__ = {}, t.__dev__.debugLog = y && ("web" === S && navigator.userAgent.indexOf("HBuilderX") > 0 || "app" === S);
  18339. var s = k;
  18340. y && s && !s.code && (t.__dev__.debugInfo = s), Ts(t), t.reInit = function () {
  18341. Ts(this);
  18342. }, Cn(t), function (e) {
  18343. var t = e.uploadFile;
  18344. e.uploadFile = function (e) {
  18345. return t.call(this, e);
  18346. };
  18347. }(t), function (e) {
  18348. e.database = function (t) {
  18349. if (t && Object.keys(t).length > 0) return e.init(t).database();
  18350. if (this._database) return this._database;
  18351. var n = qn(Kn, {
  18352. uniClient: e
  18353. });
  18354. return this._database = n, n;
  18355. }, e.databaseForJQL = function (t) {
  18356. if (t && Object.keys(t).length > 0) return e.init(t).databaseForJQL();
  18357. if (this._databaseForJQL) return this._databaseForJQL;
  18358. var n = qn(Kn, {
  18359. uniClient: e,
  18360. isJQL: !0
  18361. });
  18362. return this._databaseForJQL = n, n;
  18363. };
  18364. }(t), function (e) {
  18365. e.getCurrentUserInfo = ps, e.chooseAndUploadFile = ms.initChooseAndUploadFile(e), Object.assign(e, {
  18366. get mixinDatacom() {
  18367. return _s(e);
  18368. }
  18369. }), e.importObject = ws(e), e.initSecureNetworkByWeixin = Is(e);
  18370. }(t);
  18371. return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach(function (e) {
  18372. if (!t[e]) return;
  18373. var n = t[e];
  18374. t[e] = function () {
  18375. return t.reInit(), n.apply(t, Array.from(arguments));
  18376. }, t[e] = Y(t[e], e).bind(t);
  18377. }), t.init = this.init, t;
  18378. }
  18379. }]);
  18380. return _class6;
  18381. }())();
  18382. (function () {
  18383. var e = I;
  18384. var t = {};
  18385. if (e && 1 === e.length) t = e[0], Cs = Cs.init(t), Cs.isDefault = !0;else {
  18386. var _t22 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
  18387. var _n16;
  18388. _n16 = e && e.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : b ? "应用未关联服务空间,请在uniCloud目录右键关联服务空间" : "uni-app cli项目内使用uniCloud需要使用HBuilderX的运行菜单运行项目,且需要在uniCloud目录关联服务空间", _t22.forEach(function (e) {
  18389. Cs[e] = function () {
  18390. return console.error(_n16), Promise.reject(new Q({
  18391. code: "SYS_ERR",
  18392. message: _n16
  18393. }));
  18394. };
  18395. });
  18396. }
  18397. Object.assign(Cs, {
  18398. get mixinDatacom() {
  18399. return _s(Cs);
  18400. }
  18401. }), ls(Cs), Cs.addInterceptor = O, Cs.removeInterceptor = x, Cs.interceptObject = L, y && "web" === S && (window.uniCloud = Cs);
  18402. })();
  18403. var Ps = Cs;
  18404. exports.default = Ps;
  18405. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2), __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  18406. /***/ }),
  18407. /***/ 493:
  18408. /*!****************************************************************!*\
  18409. !*** ./node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
  18410. \****************************************************************/
  18411. /*! no static exports found */
  18412. /***/ (function(module, exports, __webpack_require__) {
  18413. var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ 415);
  18414. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 15);
  18415. var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ 494);
  18416. var construct = __webpack_require__(/*! ./construct.js */ 14);
  18417. function _wrapNativeSuper(Class) {
  18418. var _cache = typeof Map === "function" ? new Map() : undefined;
  18419. module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
  18420. if (Class === null || !isNativeFunction(Class)) return Class;
  18421. if (typeof Class !== "function") {
  18422. throw new TypeError("Super expression must either be null or a function");
  18423. }
  18424. if (typeof _cache !== "undefined") {
  18425. if (_cache.has(Class)) return _cache.get(Class);
  18426. _cache.set(Class, Wrapper);
  18427. }
  18428. function Wrapper() {
  18429. return construct(Class, arguments, getPrototypeOf(this).constructor);
  18430. }
  18431. Wrapper.prototype = Object.create(Class.prototype, {
  18432. constructor: {
  18433. value: Wrapper,
  18434. enumerable: false,
  18435. writable: true,
  18436. configurable: true
  18437. }
  18438. });
  18439. return setPrototypeOf(Wrapper, Class);
  18440. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18441. return _wrapNativeSuper(Class);
  18442. }
  18443. module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18444. /***/ }),
  18445. /***/ 494:
  18446. /*!*****************************************************************!*\
  18447. !*** ./node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
  18448. \*****************************************************************/
  18449. /*! no static exports found */
  18450. /***/ (function(module, exports) {
  18451. function _isNativeFunction(fn) {
  18452. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  18453. }
  18454. module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18455. /***/ }),
  18456. /***/ 495:
  18457. /*!**************************************************************************!*\
  18458. !*** D:/hongxing/storage-wechat/pages.json?{"type":"origin-pages-json"} ***!
  18459. \**************************************************************************/
  18460. /*! no static exports found */
  18461. /***/ (function(module, exports, __webpack_require__) {
  18462. "use strict";
  18463. Object.defineProperty(exports, "__esModule", {
  18464. value: true
  18465. });
  18466. exports.default = void 0;
  18467. var _default = {
  18468. "pages": [{
  18469. "path": "pages/user/login",
  18470. "style": {
  18471. "navigationBarTitleText": "登录"
  18472. }
  18473. }, {
  18474. "path": "pages/index/index",
  18475. "style": {
  18476. "navigationBarTitleText": "uni-app"
  18477. }
  18478. }, {
  18479. "path": "pages/home",
  18480. "style": {
  18481. "navigationBarTitleText": "首页"
  18482. }
  18483. }, {
  18484. "path": "pages/addQrcode/addQrcode",
  18485. "style": {
  18486. "navigationBarTitleText": "添加二维码"
  18487. }
  18488. }, {
  18489. "path": "pages/addQrcode/selectQrcode",
  18490. "style": {
  18491. "navigationBarTitleText": "添加二维码"
  18492. }
  18493. }, {
  18494. "path": "pages/addQrcode/addBatch",
  18495. "style": {
  18496. "navigationBarTitleText": "添加二维码"
  18497. }
  18498. }, {
  18499. "path": "pages/manageQrcode/manageQrcode",
  18500. "style": {
  18501. "navigationBarTitleText": "二维码管理"
  18502. }
  18503. }, {
  18504. "path": "pages/goIn/goIn",
  18505. "style": {
  18506. "navigationBarTitleText": "扫码入库"
  18507. }
  18508. }, {
  18509. "path": "pages/goIn/withdrawal",
  18510. "style": {
  18511. "navigationBarTitleText": "退仓"
  18512. }
  18513. }, {
  18514. "path": "pages/goOut/goOut",
  18515. "style": {
  18516. "navigationBarTitleText": "出库"
  18517. }
  18518. }, {
  18519. "path": "pages/inOut/inOut",
  18520. "style": {
  18521. "navigationBarTitleText": "调仓"
  18522. }
  18523. }, {
  18524. "path": "pages/check/check",
  18525. "style": {
  18526. "navigationBarTitleText": "到货质检"
  18527. }
  18528. }, {
  18529. "path": "pages/check/checkDtl",
  18530. "style": {
  18531. "navigationBarTitleText": "到货质检"
  18532. }
  18533. }, {
  18534. "path": "pages/submit/xiuzheng",
  18535. "style": {
  18536. "navigationBarTitleText": "面料修正"
  18537. }
  18538. }, {
  18539. "path": "pages/check/checkSubmit",
  18540. "style": {
  18541. "navigationBarTitleText": "到货质检"
  18542. }
  18543. }, {
  18544. "path": "pages/weigh/weigh",
  18545. "style": {
  18546. "navigationBarTitleText": "称重质检"
  18547. }
  18548. }, {
  18549. "path": "pages/weigh/checkDtl",
  18550. "style": {
  18551. "navigationBarTitleText": "称重质检"
  18552. }
  18553. }, {
  18554. "path": "pages/weigh/checkSubmit",
  18555. "style": {
  18556. "navigationBarTitleText": "称重质检"
  18557. }
  18558. }, {
  18559. "path": "pages/Inventory/Inventory",
  18560. "style": {
  18561. "navigationBarTitleText": "库存盘点"
  18562. }
  18563. }, {
  18564. "path": "pages/Inventory/InventorySubmit",
  18565. "style": {
  18566. "navigationBarTitleText": "库存盘点"
  18567. }
  18568. }, {
  18569. "path": "pages/Inventory/InventoryDtl",
  18570. "style": {
  18571. "navigationBarTitleText": "库存盘点"
  18572. }
  18573. }, {
  18574. "path": "pages/select/select",
  18575. "style": {
  18576. "navigationBarTitleText": "库存查询"
  18577. }
  18578. }, {
  18579. "path": "pages/overCloth/overCloth",
  18580. "style": {
  18581. "navigationBarTitleText": "过布"
  18582. }
  18583. }, {
  18584. "path": "pages/shiftHandover/shiftHandover",
  18585. "style": {
  18586. "navigationBarTitleText": "现场交班"
  18587. }
  18588. }, {
  18589. "path": "pages/succession/succession",
  18590. "style": {
  18591. "navigationBarTitleText": "现场接班"
  18592. }
  18593. }, {
  18594. "path": "pages/total/total",
  18595. "style": {
  18596. "navigationBarTitleText": "统计"
  18597. }
  18598. }, {
  18599. "path": "pages/total/fabricsTotal",
  18600. "style": {
  18601. "navigationBarTitleText": "面料使用率"
  18602. }
  18603. }, {
  18604. "path": "pages/total/personalStat",
  18605. "style": {
  18606. "navigationBarTitleText": "个人面料概况"
  18607. }
  18608. }, {
  18609. "path": "pages/total/summary",
  18610. "style": {
  18611. "navigationBarTitleText": "面料库存详情"
  18612. }
  18613. }, {
  18614. "path": "pages/total/warehouseDtl",
  18615. "style": {
  18616. "navigationBarTitleText": "出库详情"
  18617. }
  18618. }, {
  18619. "path": "pages/total/warehousingDtl",
  18620. "style": {
  18621. "navigationBarTitleText": "面料入库详情"
  18622. }
  18623. }, {
  18624. "path": "pages/usedTotal/usedTotal",
  18625. "style": {
  18626. "navigationBarTitleText": "统计(rfid)"
  18627. }
  18628. }, {
  18629. "path": "pages/usedTotal/warehouse-list",
  18630. "style": {
  18631. "navigationBarTitleText": "物料接收"
  18632. }
  18633. }, {
  18634. "path": "pages/usedTotal/summary",
  18635. "style": {
  18636. "navigationBarTitleText": "面料库存详情(rfid)"
  18637. }
  18638. }, {
  18639. "path": "pages/usedTotal/warehouseDtl",
  18640. "style": {
  18641. "navigationBarTitleText": "出库详情(rfid)"
  18642. }
  18643. }, {
  18644. "path": "pages/usedTotal/warehousingDtl",
  18645. "style": {
  18646. "navigationBarTitleText": "面料入库详情(rfid)"
  18647. }
  18648. }, {
  18649. "path": "pages/usedTotal/materialReceiving",
  18650. "style": {
  18651. "navigationBarTitleText": "待物料接收"
  18652. }
  18653. }, {
  18654. "path": "pages/submit/submit",
  18655. "style": {
  18656. "navigationBarTitleText": "面料问题反馈"
  18657. }
  18658. }, {
  18659. "path": "pages/usedTotal/return-warehouse",
  18660. "style": {
  18661. "navigationBarTitleText": "物料退仓"
  18662. }
  18663. }, {
  18664. "path": "pages/usedTotal/return-warehouse-2",
  18665. "style": {
  18666. "navigationBarTitleText": "补退仓"
  18667. }
  18668. }, {
  18669. "path": "pages/usedTotal/fabric-correction",
  18670. "style": {
  18671. "navigationBarTitleText": "面料修正"
  18672. }
  18673. }, {
  18674. "path": "pages/usedTotal/fabric-correction2",
  18675. "style": {
  18676. "navigationBarTitleText": "面料修正(布头布尾)"
  18677. }
  18678. }, {
  18679. "path": "pages/materialTransfer/materialTransfer",
  18680. "style": {
  18681. "navigationBarTitleText": "面料转仓"
  18682. }
  18683. }, {
  18684. "path": "pages/materialTransfer/transferCompositeList",
  18685. "style": {
  18686. "navigationBarTitleText": "转仓复核"
  18687. }
  18688. }, {
  18689. "path": "pages/materialTransfer/transferComposite",
  18690. "style": {
  18691. "navigationBarTitleText": "转仓复核详情"
  18692. }
  18693. }],
  18694. "globalStyle": {
  18695. "navigationBarTextStyle": "black",
  18696. "navigationBarTitleText": "uni-app",
  18697. "navigationBarBackgroundColor": "#F8F8F8",
  18698. "backgroundColor": "#F8F8F8"
  18699. }
  18700. };
  18701. exports.default = _default;
  18702. /***/ }),
  18703. /***/ 496:
  18704. /*!*************************************************************!*\
  18705. !*** D:/hongxing/storage-wechat/pages.json?{"type":"stat"} ***!
  18706. \*************************************************************/
  18707. /*! no static exports found */
  18708. /***/ (function(module, exports, __webpack_require__) {
  18709. "use strict";
  18710. Object.defineProperty(exports, "__esModule", {
  18711. value: true
  18712. });
  18713. exports.default = void 0;
  18714. var _default = {
  18715. "appid": "__UNI__C76B472"
  18716. };
  18717. exports.default = _default;
  18718. /***/ }),
  18719. /***/ 5:
  18720. /*!***************************************************************!*\
  18721. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  18722. \***************************************************************/
  18723. /*! no static exports found */
  18724. /***/ (function(module, exports) {
  18725. function _arrayWithHoles(arr) {
  18726. if (Array.isArray(arr)) return arr;
  18727. }
  18728. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18729. /***/ }),
  18730. /***/ 560:
  18731. /*!***************************************************************************************************************!*\
  18732. !*** D:/hongxing/storage-wechat/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/index.js ***!
  18733. \***************************************************************************************************************/
  18734. /*! no static exports found */
  18735. /***/ (function(module, exports, __webpack_require__) {
  18736. "use strict";
  18737. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 3);
  18738. Object.defineProperty(exports, "__esModule", {
  18739. value: true
  18740. });
  18741. exports.default = void 0;
  18742. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 561));
  18743. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 562));
  18744. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 563));
  18745. var _default = {
  18746. en: _en.default,
  18747. 'zh-Hans': _zhHans.default,
  18748. 'zh-Hant': _zhHant.default
  18749. };
  18750. exports.default = _default;
  18751. /***/ }),
  18752. /***/ 561:
  18753. /*!**************************************************************************************************************!*\
  18754. !*** D:/hongxing/storage-wechat/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/en.json ***!
  18755. \**************************************************************************************************************/
  18756. /*! exports provided: uni-datetime-picker.selectDate, uni-datetime-picker.selectTime, uni-datetime-picker.selectDateTime, uni-datetime-picker.startDate, uni-datetime-picker.endDate, uni-datetime-picker.startTime, uni-datetime-picker.endTime, uni-datetime-picker.ok, uni-datetime-picker.clear, uni-datetime-picker.cancel, uni-calender.MON, uni-calender.TUE, uni-calender.WED, uni-calender.THU, uni-calender.FRI, uni-calender.SAT, uni-calender.SUN, default */
  18757. /***/ (function(module) {
  18758. module.exports = JSON.parse("{\"uni-datetime-picker.selectDate\":\"select date\",\"uni-datetime-picker.selectTime\":\"select time\",\"uni-datetime-picker.selectDateTime\":\"select datetime\",\"uni-datetime-picker.startDate\":\"start date\",\"uni-datetime-picker.endDate\":\"end date\",\"uni-datetime-picker.startTime\":\"start time\",\"uni-datetime-picker.endTime\":\"end time\",\"uni-datetime-picker.ok\":\"ok\",\"uni-datetime-picker.clear\":\"clear\",\"uni-datetime-picker.cancel\":\"cancel\",\"uni-calender.MON\":\"MON\",\"uni-calender.TUE\":\"TUE\",\"uni-calender.WED\":\"WED\",\"uni-calender.THU\":\"THU\",\"uni-calender.FRI\":\"FRI\",\"uni-calender.SAT\":\"SAT\",\"uni-calender.SUN\":\"SUN\"}");
  18759. /***/ }),
  18760. /***/ 562:
  18761. /*!*******************************************************************************************************************!*\
  18762. !*** D:/hongxing/storage-wechat/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hans.json ***!
  18763. \*******************************************************************************************************************/
  18764. /*! exports provided: uni-datetime-picker.selectDate, uni-datetime-picker.selectTime, uni-datetime-picker.selectDateTime, uni-datetime-picker.startDate, uni-datetime-picker.endDate, uni-datetime-picker.startTime, uni-datetime-picker.endTime, uni-datetime-picker.ok, uni-datetime-picker.clear, uni-datetime-picker.cancel, uni-calender.SUN, uni-calender.MON, uni-calender.TUE, uni-calender.WED, uni-calender.THU, uni-calender.FRI, uni-calender.SAT, default */
  18765. /***/ (function(module) {
  18766. module.exports = JSON.parse("{\"uni-datetime-picker.selectDate\":\"选择日期\",\"uni-datetime-picker.selectTime\":\"选择时间\",\"uni-datetime-picker.selectDateTime\":\"选择日期时间\",\"uni-datetime-picker.startDate\":\"开始日期\",\"uni-datetime-picker.endDate\":\"结束日期\",\"uni-datetime-picker.startTime\":\"开始时间\",\"uni-datetime-picker.endTime\":\"结束时间\",\"uni-datetime-picker.ok\":\"确定\",\"uni-datetime-picker.clear\":\"清除\",\"uni-datetime-picker.cancel\":\"取消\",\"uni-calender.SUN\":\"日\",\"uni-calender.MON\":\"一\",\"uni-calender.TUE\":\"二\",\"uni-calender.WED\":\"三\",\"uni-calender.THU\":\"四\",\"uni-calender.FRI\":\"五\",\"uni-calender.SAT\":\"六\"}");
  18767. /***/ }),
  18768. /***/ 563:
  18769. /*!*******************************************************************************************************************!*\
  18770. !*** D:/hongxing/storage-wechat/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hant.json ***!
  18771. \*******************************************************************************************************************/
  18772. /*! exports provided: uni-datetime-picker.selectDate, uni-datetime-picker.selectTime, uni-datetime-picker.selectDateTime, uni-datetime-picker.startDate, uni-datetime-picker.endDate, uni-datetime-picker.startTime, uni-datetime-picker.endTime, uni-datetime-picker.ok, uni-datetime-picker.clear, uni-datetime-picker.cancel, uni-calender.SUN, uni-calender.MON, uni-calender.TUE, uni-calender.WED, uni-calender.THU, uni-calender.FRI, uni-calender.SAT, default */
  18773. /***/ (function(module) {
  18774. module.exports = JSON.parse("{\"uni-datetime-picker.selectDate\":\"選擇日期\",\"uni-datetime-picker.selectTime\":\"選擇時間\",\"uni-datetime-picker.selectDateTime\":\"選擇日期時間\",\"uni-datetime-picker.startDate\":\"開始日期\",\"uni-datetime-picker.endDate\":\"結束日期\",\"uni-datetime-picker.startTime\":\"開始时间\",\"uni-datetime-picker.endTime\":\"結束时间\",\"uni-datetime-picker.ok\":\"確定\",\"uni-datetime-picker.clear\":\"清除\",\"uni-datetime-picker.cancel\":\"取消\",\"uni-calender.SUN\":\"日\",\"uni-calender.MON\":\"一\",\"uni-calender.TUE\":\"二\",\"uni-calender.WED\":\"三\",\"uni-calender.THU\":\"四\",\"uni-calender.FRI\":\"五\",\"uni-calender.SAT\":\"六\"}");
  18775. /***/ }),
  18776. /***/ 571:
  18777. /*!**********************************************************************************************************!*\
  18778. !*** D:/hongxing/storage-wechat/uni_modules/uni-transition/components/uni-transition/createAnimation.js ***!
  18779. \**********************************************************************************************************/
  18780. /*! no static exports found */
  18781. /***/ (function(module, exports, __webpack_require__) {
  18782. "use strict";
  18783. /* WEBPACK VAR INJECTION */(function(uni) {
  18784. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 3);
  18785. Object.defineProperty(exports, "__esModule", {
  18786. value: true
  18787. });
  18788. exports.createAnimation = createAnimation;
  18789. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 10));
  18790. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 22));
  18791. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 23));
  18792. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  18793. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  18794. // const defaultOption = {
  18795. // duration: 300,
  18796. // timingFunction: 'linear',
  18797. // delay: 0,
  18798. // transformOrigin: '50% 50% 0'
  18799. // }
  18800. var MPAnimation = /*#__PURE__*/function () {
  18801. function MPAnimation(options, _this) {
  18802. (0, _classCallCheck2.default)(this, MPAnimation);
  18803. this.options = options;
  18804. this.animation = uni.createAnimation(options);
  18805. this.currentStepAnimates = {};
  18806. this.next = 0;
  18807. this.$ = _this;
  18808. }
  18809. (0, _createClass2.default)(MPAnimation, [{
  18810. key: "_nvuePushAnimates",
  18811. value: function _nvuePushAnimates(type, args) {
  18812. var aniObj = this.currentStepAnimates[this.next];
  18813. var styles = {};
  18814. if (!aniObj) {
  18815. styles = {
  18816. styles: {},
  18817. config: {}
  18818. };
  18819. } else {
  18820. styles = aniObj;
  18821. }
  18822. if (animateTypes1.includes(type)) {
  18823. if (!styles.styles.transform) {
  18824. styles.styles.transform = '';
  18825. }
  18826. var unit = '';
  18827. if (type === 'rotate') {
  18828. unit = 'deg';
  18829. }
  18830. styles.styles.transform += "".concat(type, "(").concat(args + unit, ") ");
  18831. } else {
  18832. styles.styles[type] = "".concat(args);
  18833. }
  18834. this.currentStepAnimates[this.next] = styles;
  18835. }
  18836. }, {
  18837. key: "_animateRun",
  18838. value: function _animateRun() {
  18839. var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  18840. var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  18841. var ref = this.$.$refs['ani'].ref;
  18842. if (!ref) return;
  18843. return new Promise(function (resolve, reject) {
  18844. nvueAnimation.transition(ref, _objectSpread({
  18845. styles: styles
  18846. }, config), function (res) {
  18847. resolve();
  18848. });
  18849. });
  18850. }
  18851. }, {
  18852. key: "_nvueNextAnimate",
  18853. value: function _nvueNextAnimate(animates) {
  18854. var _this2 = this;
  18855. var step = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  18856. var fn = arguments.length > 2 ? arguments[2] : undefined;
  18857. var obj = animates[step];
  18858. if (obj) {
  18859. var styles = obj.styles,
  18860. config = obj.config;
  18861. this._animateRun(styles, config).then(function () {
  18862. step += 1;
  18863. _this2._nvueNextAnimate(animates, step, fn);
  18864. });
  18865. } else {
  18866. this.currentStepAnimates = {};
  18867. typeof fn === 'function' && fn();
  18868. this.isEnd = true;
  18869. }
  18870. }
  18871. }, {
  18872. key: "step",
  18873. value: function step() {
  18874. var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  18875. this.animation.step(config);
  18876. return this;
  18877. }
  18878. }, {
  18879. key: "run",
  18880. value: function run(fn) {
  18881. this.$.animationData = this.animation.export();
  18882. this.$.timer = setTimeout(function () {
  18883. typeof fn === 'function' && fn();
  18884. }, this.$.durationTime);
  18885. }
  18886. }]);
  18887. return MPAnimation;
  18888. }();
  18889. var animateTypes1 = ['matrix', 'matrix3d', 'rotate', 'rotate3d', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scale3d', 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'translate', 'translate3d', 'translateX', 'translateY', 'translateZ'];
  18890. var animateTypes2 = ['opacity', 'backgroundColor'];
  18891. var animateTypes3 = ['width', 'height', 'left', 'right', 'top', 'bottom'];
  18892. animateTypes1.concat(animateTypes2, animateTypes3).forEach(function (type) {
  18893. MPAnimation.prototype[type] = function () {
  18894. var _this$animation;
  18895. (_this$animation = this.animation)[type].apply(_this$animation, arguments);
  18896. return this;
  18897. };
  18898. });
  18899. function createAnimation(option, _this) {
  18900. if (!_this) return;
  18901. clearTimeout(_this.timer);
  18902. return new MPAnimation(option, _this);
  18903. }
  18904. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  18905. /***/ }),
  18906. /***/ 577:
  18907. /*!***************************************************************************************************!*\
  18908. !*** D:/hongxing/storage-wechat/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js ***!
  18909. \***************************************************************************************************/
  18910. /*! no static exports found */
  18911. /***/ (function(module, exports, __webpack_require__) {
  18912. "use strict";
  18913. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 3);
  18914. Object.defineProperty(exports, "__esModule", {
  18915. value: true
  18916. });
  18917. exports.default = void 0;
  18918. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 578));
  18919. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 579));
  18920. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 580));
  18921. var _default = {
  18922. en: _en.default,
  18923. 'zh-Hans': _zhHans.default,
  18924. 'zh-Hant': _zhHant.default
  18925. };
  18926. exports.default = _default;
  18927. /***/ }),
  18928. /***/ 578:
  18929. /*!**************************************************************************************************!*\
  18930. !*** D:/hongxing/storage-wechat/uni_modules/uni-load-more/components/uni-load-more/i18n/en.json ***!
  18931. \**************************************************************************************************/
  18932. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  18933. /***/ (function(module) {
  18934. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"Pull up to show more\",\"uni-load-more.contentrefresh\":\"loading...\",\"uni-load-more.contentnomore\":\"No more data\"}");
  18935. /***/ }),
  18936. /***/ 579:
  18937. /*!*******************************************************************************************************!*\
  18938. !*** D:/hongxing/storage-wechat/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json ***!
  18939. \*******************************************************************************************************/
  18940. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  18941. /***/ (function(module) {
  18942. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉显示更多\",\"uni-load-more.contentrefresh\":\"正在加载...\",\"uni-load-more.contentnomore\":\"没有更多数据了\"}");
  18943. /***/ }),
  18944. /***/ 580:
  18945. /*!*******************************************************************************************************!*\
  18946. !*** D:/hongxing/storage-wechat/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json ***!
  18947. \*******************************************************************************************************/
  18948. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  18949. /***/ (function(module) {
  18950. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉顯示更多\",\"uni-load-more.contentrefresh\":\"正在加載...\",\"uni-load-more.contentnomore\":\"沒有更多數據了\"}");
  18951. /***/ }),
  18952. /***/ 6:
  18953. /*!*********************************************************************!*\
  18954. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  18955. \*********************************************************************/
  18956. /*! no static exports found */
  18957. /***/ (function(module, exports) {
  18958. function _iterableToArrayLimit(arr, i) {
  18959. var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  18960. if (null != _i) {
  18961. var _s,
  18962. _e,
  18963. _x,
  18964. _r,
  18965. _arr = [],
  18966. _n = !0,
  18967. _d = !1;
  18968. try {
  18969. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  18970. if (Object(_i) !== _i) return;
  18971. _n = !1;
  18972. } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  18973. ;
  18974. }
  18975. } catch (err) {
  18976. _d = !0, _e = err;
  18977. } finally {
  18978. try {
  18979. if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
  18980. } finally {
  18981. if (_d) throw _e;
  18982. }
  18983. }
  18984. return _arr;
  18985. }
  18986. }
  18987. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18988. /***/ }),
  18989. /***/ 602:
  18990. /*!*********************************************************************************************************!*\
  18991. !*** D:/hongxing/storage-wechat/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js ***!
  18992. \*********************************************************************************************************/
  18993. /*! no static exports found */
  18994. /***/ (function(module, exports, __webpack_require__) {
  18995. "use strict";
  18996. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 3);
  18997. Object.defineProperty(exports, "__esModule", {
  18998. value: true
  18999. });
  19000. exports.default = void 0;
  19001. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 12));
  19002. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 22));
  19003. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 23));
  19004. var Calendar = /*#__PURE__*/function () {
  19005. function Calendar() {
  19006. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  19007. date = _ref.date,
  19008. selected = _ref.selected,
  19009. startDate = _ref.startDate,
  19010. endDate = _ref.endDate,
  19011. range = _ref.range;
  19012. (0, _classCallCheck2.default)(this, Calendar);
  19013. // 当前日期
  19014. this.date = this.getDate(new Date()); // 当前初入日期
  19015. // 打点信息
  19016. this.selected = selected || [];
  19017. // 范围开始
  19018. this.startDate = startDate;
  19019. // 范围结束
  19020. this.endDate = endDate;
  19021. this.range = range;
  19022. // 多选状态
  19023. this.cleanMultipleStatus();
  19024. // 每周日期
  19025. this.weeks = {};
  19026. // this._getWeek(this.date.fullDate)
  19027. // this.multipleStatus = multipleStatus
  19028. this.lastHover = false;
  19029. }
  19030. /**
  19031. * 设置日期
  19032. * @param {Object} date
  19033. */
  19034. (0, _createClass2.default)(Calendar, [{
  19035. key: "setDate",
  19036. value: function setDate(date) {
  19037. this.selectDate = this.getDate(date);
  19038. this._getWeek(this.selectDate.fullDate);
  19039. }
  19040. /**
  19041. * 清理多选状态
  19042. */
  19043. }, {
  19044. key: "cleanMultipleStatus",
  19045. value: function cleanMultipleStatus() {
  19046. this.multipleStatus = {
  19047. before: '',
  19048. after: '',
  19049. data: []
  19050. };
  19051. }
  19052. /**
  19053. * 重置开始日期
  19054. */
  19055. }, {
  19056. key: "resetSatrtDate",
  19057. value: function resetSatrtDate(startDate) {
  19058. // 范围开始
  19059. this.startDate = startDate;
  19060. }
  19061. /**
  19062. * 重置结束日期
  19063. */
  19064. }, {
  19065. key: "resetEndDate",
  19066. value: function resetEndDate(endDate) {
  19067. // 范围结束
  19068. this.endDate = endDate;
  19069. }
  19070. /**
  19071. * 获取任意时间
  19072. */
  19073. }, {
  19074. key: "getDate",
  19075. value: function getDate(date) {
  19076. var AddDayCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  19077. var str = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'day';
  19078. if (!date) {
  19079. date = new Date();
  19080. }
  19081. if ((0, _typeof2.default)(date) !== 'object') {
  19082. date = date.replace(/-/g, '/');
  19083. }
  19084. var dd = new Date(date);
  19085. switch (str) {
  19086. case 'day':
  19087. dd.setDate(dd.getDate() + AddDayCount); // 获取AddDayCount天后的日期
  19088. break;
  19089. case 'month':
  19090. if (dd.getDate() === 31) {
  19091. dd.setDate(dd.getDate() + AddDayCount);
  19092. } else {
  19093. dd.setMonth(dd.getMonth() + AddDayCount); // 获取AddDayCount天后的日期
  19094. }
  19095. break;
  19096. case 'year':
  19097. dd.setFullYear(dd.getFullYear() + AddDayCount); // 获取AddDayCount天后的日期
  19098. break;
  19099. }
  19100. var y = dd.getFullYear();
  19101. var m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1; // 获取当前月份的日期,不足10补0
  19102. var d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate(); // 获取当前几号,不足10补0
  19103. return {
  19104. fullDate: y + '-' + m + '-' + d,
  19105. year: y,
  19106. month: m,
  19107. date: d,
  19108. day: dd.getDay()
  19109. };
  19110. }
  19111. /**
  19112. * 获取上月剩余天数
  19113. */
  19114. }, {
  19115. key: "_getLastMonthDays",
  19116. value: function _getLastMonthDays(firstDay, full) {
  19117. var dateArr = [];
  19118. for (var i = firstDay; i > 0; i--) {
  19119. var beforeDate = new Date(full.year, full.month - 1, -i + 1).getDate();
  19120. dateArr.push({
  19121. date: beforeDate,
  19122. month: full.month - 1,
  19123. disable: true
  19124. });
  19125. }
  19126. return dateArr;
  19127. }
  19128. /**
  19129. * 获取本月天数
  19130. */
  19131. }, {
  19132. key: "_currentMonthDys",
  19133. value: function _currentMonthDys(dateData, full) {
  19134. var _this = this;
  19135. var dateArr = [];
  19136. var fullDate = this.date.fullDate;
  19137. var _loop = function _loop(i) {
  19138. var isinfo = false;
  19139. var nowDate = full.year + '-' + (full.month < 10 ? full.month : full.month) + '-' + (i < 10 ? '0' + i : i);
  19140. // 是否今天
  19141. var isDay = fullDate === nowDate;
  19142. // 获取打点信息
  19143. var info = _this.selected && _this.selected.find(function (item) {
  19144. if (_this.dateEqual(nowDate, item.date)) {
  19145. return item;
  19146. }
  19147. });
  19148. // 日期禁用
  19149. var disableBefore = true;
  19150. var disableAfter = true;
  19151. if (_this.startDate) {
  19152. // let dateCompBefore = this.dateCompare(this.startDate, fullDate)
  19153. // disableBefore = this.dateCompare(dateCompBefore ? this.startDate : fullDate, nowDate)
  19154. disableBefore = _this.dateCompare(_this.startDate, nowDate);
  19155. }
  19156. if (_this.endDate) {
  19157. // let dateCompAfter = this.dateCompare(fullDate, this.endDate)
  19158. // disableAfter = this.dateCompare(nowDate, dateCompAfter ? this.endDate : fullDate)
  19159. disableAfter = _this.dateCompare(nowDate, _this.endDate);
  19160. }
  19161. var multiples = _this.multipleStatus.data;
  19162. var checked = false;
  19163. var multiplesStatus = -1;
  19164. if (_this.range) {
  19165. if (multiples) {
  19166. multiplesStatus = multiples.findIndex(function (item) {
  19167. return _this.dateEqual(item, nowDate);
  19168. });
  19169. }
  19170. if (multiplesStatus !== -1) {
  19171. checked = true;
  19172. }
  19173. }
  19174. var data = {
  19175. fullDate: nowDate,
  19176. year: full.year,
  19177. date: i,
  19178. multiple: _this.range ? checked : false,
  19179. beforeMultiple: _this.isLogicBefore(nowDate, _this.multipleStatus.before, _this.multipleStatus.after),
  19180. afterMultiple: _this.isLogicAfter(nowDate, _this.multipleStatus.before, _this.multipleStatus.after),
  19181. month: full.month,
  19182. disable: !(disableBefore && disableAfter),
  19183. isDay: isDay,
  19184. userChecked: false
  19185. };
  19186. if (info) {
  19187. data.extraInfo = info;
  19188. }
  19189. dateArr.push(data);
  19190. };
  19191. for (var i = 1; i <= dateData; i++) {
  19192. _loop(i);
  19193. }
  19194. return dateArr;
  19195. }
  19196. /**
  19197. * 获取下月天数
  19198. */
  19199. }, {
  19200. key: "_getNextMonthDays",
  19201. value: function _getNextMonthDays(surplus, full) {
  19202. var dateArr = [];
  19203. for (var i = 1; i < surplus + 1; i++) {
  19204. dateArr.push({
  19205. date: i,
  19206. month: Number(full.month) + 1,
  19207. disable: true
  19208. });
  19209. }
  19210. return dateArr;
  19211. }
  19212. /**
  19213. * 获取当前日期详情
  19214. * @param {Object} date
  19215. */
  19216. }, {
  19217. key: "getInfo",
  19218. value: function getInfo(date) {
  19219. var _this2 = this;
  19220. if (!date) {
  19221. date = new Date();
  19222. }
  19223. var dateInfo = this.canlender.find(function (item) {
  19224. return item.fullDate === _this2.getDate(date).fullDate;
  19225. });
  19226. return dateInfo;
  19227. }
  19228. /**
  19229. * 比较时间大小
  19230. */
  19231. }, {
  19232. key: "dateCompare",
  19233. value: function dateCompare(startDate, endDate) {
  19234. // 计算截止时间
  19235. startDate = new Date(startDate.replace('-', '/').replace('-', '/'));
  19236. // 计算详细项的截止时间
  19237. endDate = new Date(endDate.replace('-', '/').replace('-', '/'));
  19238. if (startDate <= endDate) {
  19239. return true;
  19240. } else {
  19241. return false;
  19242. }
  19243. }
  19244. /**
  19245. * 比较时间是否相等
  19246. */
  19247. }, {
  19248. key: "dateEqual",
  19249. value: function dateEqual(before, after) {
  19250. // 计算截止时间
  19251. before = new Date(before.replace('-', '/').replace('-', '/'));
  19252. // 计算详细项的截止时间
  19253. after = new Date(after.replace('-', '/').replace('-', '/'));
  19254. if (before.getTime() - after.getTime() === 0) {
  19255. return true;
  19256. } else {
  19257. return false;
  19258. }
  19259. }
  19260. /**
  19261. * 比较真实起始日期
  19262. */
  19263. }, {
  19264. key: "isLogicBefore",
  19265. value: function isLogicBefore(currentDay, before, after) {
  19266. var logicBefore = before;
  19267. if (before && after) {
  19268. logicBefore = this.dateCompare(before, after) ? before : after;
  19269. }
  19270. return this.dateEqual(logicBefore, currentDay);
  19271. }
  19272. }, {
  19273. key: "isLogicAfter",
  19274. value: function isLogicAfter(currentDay, before, after) {
  19275. var logicAfter = after;
  19276. if (before && after) {
  19277. logicAfter = this.dateCompare(before, after) ? after : before;
  19278. }
  19279. return this.dateEqual(logicAfter, currentDay);
  19280. }
  19281. /**
  19282. * 获取日期范围内所有日期
  19283. * @param {Object} begin
  19284. * @param {Object} end
  19285. */
  19286. }, {
  19287. key: "geDateAll",
  19288. value: function geDateAll(begin, end) {
  19289. var arr = [];
  19290. var ab = begin.split('-');
  19291. var ae = end.split('-');
  19292. var db = new Date();
  19293. db.setFullYear(ab[0], ab[1] - 1, ab[2]);
  19294. var de = new Date();
  19295. de.setFullYear(ae[0], ae[1] - 1, ae[2]);
  19296. var unixDb = db.getTime() - 24 * 60 * 60 * 1000;
  19297. var unixDe = de.getTime() - 24 * 60 * 60 * 1000;
  19298. for (var k = unixDb; k <= unixDe;) {
  19299. k = k + 24 * 60 * 60 * 1000;
  19300. arr.push(this.getDate(new Date(parseInt(k))).fullDate);
  19301. }
  19302. return arr;
  19303. }
  19304. /**
  19305. * 获取多选状态
  19306. */
  19307. }, {
  19308. key: "setMultiple",
  19309. value: function setMultiple(fullDate) {
  19310. var _this$multipleStatus = this.multipleStatus,
  19311. before = _this$multipleStatus.before,
  19312. after = _this$multipleStatus.after;
  19313. if (!this.range) return;
  19314. if (before && after) {
  19315. if (!this.lastHover) {
  19316. this.lastHover = true;
  19317. return;
  19318. }
  19319. this.multipleStatus.before = fullDate;
  19320. this.multipleStatus.after = '';
  19321. this.multipleStatus.data = [];
  19322. this.multipleStatus.fulldate = '';
  19323. this.lastHover = false;
  19324. } else {
  19325. if (!before) {
  19326. this.multipleStatus.before = fullDate;
  19327. this.lastHover = false;
  19328. } else {
  19329. this.multipleStatus.after = fullDate;
  19330. if (this.dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
  19331. this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
  19332. } else {
  19333. this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
  19334. }
  19335. this.lastHover = true;
  19336. }
  19337. }
  19338. this._getWeek(fullDate);
  19339. }
  19340. /**
  19341. * 鼠标 hover 更新多选状态
  19342. */
  19343. }, {
  19344. key: "setHoverMultiple",
  19345. value: function setHoverMultiple(fullDate) {
  19346. var _this$multipleStatus2 = this.multipleStatus,
  19347. before = _this$multipleStatus2.before,
  19348. after = _this$multipleStatus2.after;
  19349. if (!this.range) return;
  19350. if (this.lastHover) return;
  19351. if (!before) {
  19352. this.multipleStatus.before = fullDate;
  19353. } else {
  19354. this.multipleStatus.after = fullDate;
  19355. if (this.dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
  19356. this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
  19357. } else {
  19358. this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
  19359. }
  19360. }
  19361. this._getWeek(fullDate);
  19362. }
  19363. /**
  19364. * 更新默认值多选状态
  19365. */
  19366. }, {
  19367. key: "setDefaultMultiple",
  19368. value: function setDefaultMultiple(before, after) {
  19369. this.multipleStatus.before = before;
  19370. this.multipleStatus.after = after;
  19371. if (before && after) {
  19372. if (this.dateCompare(before, after)) {
  19373. this.multipleStatus.data = this.geDateAll(before, after);
  19374. this._getWeek(after);
  19375. } else {
  19376. this.multipleStatus.data = this.geDateAll(after, before);
  19377. this._getWeek(before);
  19378. }
  19379. }
  19380. }
  19381. /**
  19382. * 获取每周数据
  19383. * @param {Object} dateData
  19384. */
  19385. }, {
  19386. key: "_getWeek",
  19387. value: function _getWeek(dateData) {
  19388. var _this$getDate = this.getDate(dateData),
  19389. fullDate = _this$getDate.fullDate,
  19390. year = _this$getDate.year,
  19391. month = _this$getDate.month,
  19392. date = _this$getDate.date,
  19393. day = _this$getDate.day;
  19394. var firstDay = new Date(year, month - 1, 1).getDay();
  19395. var currentDay = new Date(year, month, 0).getDate();
  19396. var dates = {
  19397. lastMonthDays: this._getLastMonthDays(firstDay, this.getDate(dateData)),
  19398. // 上个月末尾几天
  19399. currentMonthDys: this._currentMonthDys(currentDay, this.getDate(dateData)),
  19400. // 本月天数
  19401. nextMonthDays: [],
  19402. // 下个月开始几天
  19403. weeks: []
  19404. };
  19405. var canlender = [];
  19406. var surplus = 42 - (dates.lastMonthDays.length + dates.currentMonthDys.length);
  19407. dates.nextMonthDays = this._getNextMonthDays(surplus, this.getDate(dateData));
  19408. canlender = canlender.concat(dates.lastMonthDays, dates.currentMonthDys, dates.nextMonthDays);
  19409. var weeks = {};
  19410. // 拼接数组 上个月开始几天 + 本月天数+ 下个月开始几天
  19411. for (var i = 0; i < canlender.length; i++) {
  19412. if (i % 7 === 0) {
  19413. weeks[parseInt(i / 7)] = new Array(7);
  19414. }
  19415. weeks[parseInt(i / 7)][i % 7] = canlender[i];
  19416. }
  19417. this.canlender = canlender;
  19418. this.weeks = weeks;
  19419. }
  19420. //静态方法
  19421. // static init(date) {
  19422. // if (!this.instance) {
  19423. // this.instance = new Calendar(date);
  19424. // }
  19425. // return this.instance;
  19426. // }
  19427. }]);
  19428. return Calendar;
  19429. }();
  19430. var _default = Calendar;
  19431. exports.default = _default;
  19432. /***/ }),
  19433. /***/ 7:
  19434. /*!***************************************************************************!*\
  19435. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  19436. \***************************************************************************/
  19437. /*! no static exports found */
  19438. /***/ (function(module, exports, __webpack_require__) {
  19439. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 8);
  19440. function _unsupportedIterableToArray(o, minLen) {
  19441. if (!o) return;
  19442. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  19443. var n = Object.prototype.toString.call(o).slice(8, -1);
  19444. if (n === "Object" && o.constructor) n = o.constructor.name;
  19445. if (n === "Map" || n === "Set") return Array.from(o);
  19446. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  19447. }
  19448. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19449. /***/ }),
  19450. /***/ 8:
  19451. /*!*****************************************************************!*\
  19452. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  19453. \*****************************************************************/
  19454. /*! no static exports found */
  19455. /***/ (function(module, exports) {
  19456. function _arrayLikeToArray(arr, len) {
  19457. if (len == null || len > arr.length) len = arr.length;
  19458. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  19459. arr2[i] = arr[i];
  19460. }
  19461. return arr2;
  19462. }
  19463. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19464. /***/ }),
  19465. /***/ 9:
  19466. /*!****************************************************************!*\
  19467. !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
  19468. \****************************************************************/
  19469. /*! no static exports found */
  19470. /***/ (function(module, exports) {
  19471. function _nonIterableRest() {
  19472. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  19473. }
  19474. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19475. /***/ }),
  19476. /***/ 92:
  19477. /*!***********************************************!*\
  19478. !*** D:/hongxing/storage-wechat/util/uitl.js ***!
  19479. \***********************************************/
  19480. /*! no static exports found */
  19481. /***/ (function(module, exports, __webpack_require__) {
  19482. "use strict";
  19483. /* WEBPACK VAR INJECTION */(function(uni) {
  19484. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 3);
  19485. Object.defineProperty(exports, "__esModule", {
  19486. value: true
  19487. });
  19488. exports.showTitle = exports.setUserData = exports.routeEqual = exports.getUserData = exports.getTime = exports.genID = exports.format = exports.dateFormat = exports.commonsbinding = void 0;
  19489. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 24));
  19490. //时间戳转时间
  19491. var format = function format(timeStamp) {
  19492. var date = new Date();
  19493. date.setTime(timeStamp * 1);
  19494. var y = date.getFullYear();
  19495. var m = date.getMonth() + 1;
  19496. m = m < 10 ? '0' + m : m;
  19497. var d = date.getDate();
  19498. d = d < 10 ? '0' + d : d;
  19499. var h = date.getHours();
  19500. h = h < 10 ? '0' + h : h;
  19501. var minute = date.getMinutes();
  19502. var second = date.getSeconds();
  19503. minute = minute < 10 ? '0' + minute : minute;
  19504. second = second < 10 ? '0' + second : second;
  19505. return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second;
  19506. };
  19507. //前端生成id
  19508. exports.format = format;
  19509. var genID = function genID(lan, radix) {
  19510. var d = new Date().getTime();
  19511. var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  19512. var r = (d + Math.random() * 16) % 16 | 0;
  19513. d = Math.floor(d / 16);
  19514. return (c == 'x' ? r : r & 0x3 | 0x8).toString(16);
  19515. });
  19516. return uuid;
  19517. };
  19518. exports.genID = genID;
  19519. var showTitle = function showTitle(item, vm) {
  19520. var _item$meta = item.meta,
  19521. title = _item$meta.title,
  19522. __titleIsFunction__ = _item$meta.__titleIsFunction__;
  19523. if (!title) return;
  19524. if (useI18n) {
  19525. if (title.includes('{{') && title.includes('}}') && useI18n) title = title.replace(/({{[\s\S]+?}})/, function (m, str) {
  19526. return str.replace(/{{([\s\S]*)}}/, function (m, _) {
  19527. return vm.$t(_.trim());
  19528. });
  19529. });else if (__titleIsFunction__) title = item.meta.title;else title = vm.$t(item.name);
  19530. } else title = item.meta && item.meta.title || item.name;
  19531. return title;
  19532. };
  19533. exports.showTitle = showTitle;
  19534. var routeEqual = function routeEqual(route1, route2) {
  19535. var params1 = route1.params || {};
  19536. var params2 = route2.params || {};
  19537. var query1 = route1.query || {};
  19538. var query2 = route2.query || {};
  19539. return route1.name === route2.name && objEqual(params1, params2) && objEqual(query1, query2);
  19540. };
  19541. exports.routeEqual = routeEqual;
  19542. var setUserData = function setUserData(data) {
  19543. console.log(data);
  19544. uni.setStorage({
  19545. key: "userData",
  19546. data: data,
  19547. success: function success(res) {
  19548. _vue.default.prototype.$userData = res;
  19549. }
  19550. });
  19551. };
  19552. exports.setUserData = setUserData;
  19553. var getUserData = function getUserData() {
  19554. return new Promise(function (resolve, reject) {
  19555. uni.getStorage({
  19556. key: "userData",
  19557. success: function success(res) {
  19558. resolve(Object.assign({
  19559. code: 0
  19560. }, res.data));
  19561. },
  19562. fail: function fail(err) {
  19563. console.log(err);
  19564. resolve({
  19565. code: 999
  19566. });
  19567. }
  19568. });
  19569. });
  19570. };
  19571. exports.getUserData = getUserData;
  19572. var commonsbinding = function commonsbinding() {
  19573. console.log(_vue.default.prototype.$token);
  19574. };
  19575. exports.commonsbinding = commonsbinding;
  19576. var dateFormat = function dateFormat(date) {
  19577. var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "YYYY-MM-DD HH:mm:ss";
  19578. var now = new Date(date);
  19579. var config = {
  19580. YYYY: now.getFullYear(),
  19581. MM: (now.getMonth() + 1).toString().padStart(2, '0'),
  19582. DD: now.getDate().toString().padStart(2, '0'),
  19583. HH: now.getHours().toString().padStart(2, '0'),
  19584. mm: now.getMinutes().toString().padStart(2, '0'),
  19585. ss: now.getSeconds()
  19586. };
  19587. for (var key in config) {
  19588. format = format.replace(key, config[key]);
  19589. }
  19590. return format;
  19591. };
  19592. exports.dateFormat = dateFormat;
  19593. var getTime = function getTime() {
  19594. var date = new Date(),
  19595. year = date.getFullYear(),
  19596. month = date.getMonth() + 1,
  19597. day = date.getDate(),
  19598. hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(),
  19599. minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes(),
  19600. second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
  19601. month >= 1 && month <= 9 ? month = "0" + month : "";
  19602. day >= 0 && day <= 9 ? day = "0" + day : "";
  19603. var timer = year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second;
  19604. return timer;
  19605. };
  19606. exports.getTime = getTime;
  19607. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  19608. /***/ })
  19609. }]);
  19610. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map