vendor.js 665 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!*********************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js ***!
  5. \*********************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. Object.defineProperty(exports, "__esModule", {
  10. value: true
  11. });
  12. exports.default = void 0;
  13. var objectKeys = ['qy', 'env', 'error', 'version', 'lanDebug', 'cloud', 'serviceMarket', 'router', 'worklet', '__webpack_require_UNI_MP_PLUGIN__'];
  14. var singlePageDisableKey = ['lanDebug', 'router', 'worklet'];
  15. var target = typeof globalThis !== 'undefined' ? globalThis : function () {
  16. return this;
  17. }();
  18. var key = ['w', 'x'].join('');
  19. var oldWx = target[key];
  20. var launchOption = oldWx.getLaunchOptionsSync ? oldWx.getLaunchOptionsSync() : null;
  21. function isWxKey(key) {
  22. if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
  23. return false;
  24. }
  25. return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function';
  26. }
  27. function initWx() {
  28. var newWx = {};
  29. for (var _key in oldWx) {
  30. if (isWxKey(_key)) {
  31. // TODO wrapper function
  32. newWx[_key] = oldWx[_key];
  33. }
  34. }
  35. return newWx;
  36. }
  37. target[key] = initWx();
  38. var _default = target[key];
  39. exports.default = _default;
  40. /***/ }),
  41. /***/ 10:
  42. /*!****************************************************************!*\
  43. !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
  44. \****************************************************************/
  45. /*! no static exports found */
  46. /***/ (function(module, exports) {
  47. function _nonIterableRest() {
  48. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  49. }
  50. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  51. /***/ }),
  52. /***/ 11:
  53. /*!***************************************************************!*\
  54. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  55. \***************************************************************/
  56. /*! no static exports found */
  57. /***/ (function(module, exports, __webpack_require__) {
  58. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  59. function _defineProperty(obj, key, value) {
  60. key = toPropertyKey(key);
  61. if (key in obj) {
  62. Object.defineProperty(obj, key, {
  63. value: value,
  64. enumerable: true,
  65. configurable: true,
  66. writable: true
  67. });
  68. } else {
  69. obj[key] = value;
  70. }
  71. return obj;
  72. }
  73. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  74. /***/ }),
  75. /***/ 12:
  76. /*!**************************************************************!*\
  77. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  78. \**************************************************************/
  79. /*! no static exports found */
  80. /***/ (function(module, exports, __webpack_require__) {
  81. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  82. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  83. function toPropertyKey(t) {
  84. var i = toPrimitive(t, "string");
  85. return "symbol" == _typeof(i) ? i : i + "";
  86. }
  87. module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  88. /***/ }),
  89. /***/ 13:
  90. /*!*******************************************************!*\
  91. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  92. \*******************************************************/
  93. /*! no static exports found */
  94. /***/ (function(module, exports) {
  95. function _typeof(o) {
  96. "@babel/helpers - typeof";
  97. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
  98. return typeof o;
  99. } : function (o) {
  100. return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
  101. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
  102. }
  103. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  104. /***/ }),
  105. /***/ 14:
  106. /*!************************************************************!*\
  107. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  108. \************************************************************/
  109. /*! no static exports found */
  110. /***/ (function(module, exports, __webpack_require__) {
  111. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  112. function toPrimitive(t, r) {
  113. if ("object" != _typeof(t) || !t) return t;
  114. var e = t[Symbol.toPrimitive];
  115. if (void 0 !== e) {
  116. var i = e.call(t, r || "default");
  117. if ("object" != _typeof(i)) return i;
  118. throw new TypeError("@@toPrimitive must return a primitive value.");
  119. }
  120. return ("string" === r ? String : Number)(t);
  121. }
  122. module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  123. /***/ }),
  124. /***/ 15:
  125. /*!**********************************************************!*\
  126. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  127. \**********************************************************/
  128. /*! no static exports found */
  129. /***/ (function(module, exports, __webpack_require__) {
  130. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  131. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  132. function _construct(t, e, r) {
  133. if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
  134. var o = [null];
  135. o.push.apply(o, e);
  136. var p = new (t.bind.apply(t, o))();
  137. return r && setPrototypeOf(p, r.prototype), p;
  138. }
  139. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  140. /***/ }),
  141. /***/ 16:
  142. /*!***************************************************************!*\
  143. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  144. \***************************************************************/
  145. /*! no static exports found */
  146. /***/ (function(module, exports) {
  147. function _setPrototypeOf(o, p) {
  148. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  149. o.__proto__ = p;
  150. return o;
  151. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  152. return _setPrototypeOf(o, p);
  153. }
  154. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  155. /***/ }),
  156. /***/ 17:
  157. /*!*************************************************************************!*\
  158. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  159. \*************************************************************************/
  160. /*! no static exports found */
  161. /***/ (function(module, exports) {
  162. function _isNativeReflectConstruct() {
  163. try {
  164. var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  165. } catch (t) {}
  166. return (module.exports = _isNativeReflectConstruct = function _isNativeReflectConstruct() {
  167. return !!t;
  168. }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
  169. }
  170. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  171. /***/ }),
  172. /***/ 18:
  173. /*!******************************************************************!*\
  174. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  175. \******************************************************************/
  176. /*! no static exports found */
  177. /***/ (function(module, exports, __webpack_require__) {
  178. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  179. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  180. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  181. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  182. function _toConsumableArray(arr) {
  183. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  184. }
  185. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  186. /***/ }),
  187. /***/ 181:
  188. /*!***************************************************************************************************************!*\
  189. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-icons/components/uni-icons/uniicons_file_vue.js ***!
  190. \***************************************************************************************************************/
  191. /*! no static exports found */
  192. /***/ (function(module, exports, __webpack_require__) {
  193. "use strict";
  194. Object.defineProperty(exports, "__esModule", {
  195. value: true
  196. });
  197. exports.fontData = void 0;
  198. var fontData = [{
  199. "font_class": "arrow-down",
  200. "unicode": "\uE6BE"
  201. }, {
  202. "font_class": "arrow-left",
  203. "unicode": "\uE6BC"
  204. }, {
  205. "font_class": "arrow-right",
  206. "unicode": "\uE6BB"
  207. }, {
  208. "font_class": "arrow-up",
  209. "unicode": "\uE6BD"
  210. }, {
  211. "font_class": "auth",
  212. "unicode": "\uE6AB"
  213. }, {
  214. "font_class": "auth-filled",
  215. "unicode": "\uE6CC"
  216. }, {
  217. "font_class": "back",
  218. "unicode": "\uE6B9"
  219. }, {
  220. "font_class": "bars",
  221. "unicode": "\uE627"
  222. }, {
  223. "font_class": "calendar",
  224. "unicode": "\uE6A0"
  225. }, {
  226. "font_class": "calendar-filled",
  227. "unicode": "\uE6C0"
  228. }, {
  229. "font_class": "camera",
  230. "unicode": "\uE65A"
  231. }, {
  232. "font_class": "camera-filled",
  233. "unicode": "\uE658"
  234. }, {
  235. "font_class": "cart",
  236. "unicode": "\uE631"
  237. }, {
  238. "font_class": "cart-filled",
  239. "unicode": "\uE6D0"
  240. }, {
  241. "font_class": "chat",
  242. "unicode": "\uE65D"
  243. }, {
  244. "font_class": "chat-filled",
  245. "unicode": "\uE659"
  246. }, {
  247. "font_class": "chatboxes",
  248. "unicode": "\uE696"
  249. }, {
  250. "font_class": "chatboxes-filled",
  251. "unicode": "\uE692"
  252. }, {
  253. "font_class": "chatbubble",
  254. "unicode": "\uE697"
  255. }, {
  256. "font_class": "chatbubble-filled",
  257. "unicode": "\uE694"
  258. }, {
  259. "font_class": "checkbox",
  260. "unicode": "\uE62B"
  261. }, {
  262. "font_class": "checkbox-filled",
  263. "unicode": "\uE62C"
  264. }, {
  265. "font_class": "checkmarkempty",
  266. "unicode": "\uE65C"
  267. }, {
  268. "font_class": "circle",
  269. "unicode": "\uE65B"
  270. }, {
  271. "font_class": "circle-filled",
  272. "unicode": "\uE65E"
  273. }, {
  274. "font_class": "clear",
  275. "unicode": "\uE66D"
  276. }, {
  277. "font_class": "close",
  278. "unicode": "\uE673"
  279. }, {
  280. "font_class": "closeempty",
  281. "unicode": "\uE66C"
  282. }, {
  283. "font_class": "cloud-download",
  284. "unicode": "\uE647"
  285. }, {
  286. "font_class": "cloud-download-filled",
  287. "unicode": "\uE646"
  288. }, {
  289. "font_class": "cloud-upload",
  290. "unicode": "\uE645"
  291. }, {
  292. "font_class": "cloud-upload-filled",
  293. "unicode": "\uE648"
  294. }, {
  295. "font_class": "color",
  296. "unicode": "\uE6CF"
  297. }, {
  298. "font_class": "color-filled",
  299. "unicode": "\uE6C9"
  300. }, {
  301. "font_class": "compose",
  302. "unicode": "\uE67F"
  303. }, {
  304. "font_class": "contact",
  305. "unicode": "\uE693"
  306. }, {
  307. "font_class": "contact-filled",
  308. "unicode": "\uE695"
  309. }, {
  310. "font_class": "down",
  311. "unicode": "\uE6B8"
  312. }, {
  313. "font_class": "bottom",
  314. "unicode": "\uE6B8"
  315. }, {
  316. "font_class": "download",
  317. "unicode": "\uE68D"
  318. }, {
  319. "font_class": "download-filled",
  320. "unicode": "\uE681"
  321. }, {
  322. "font_class": "email",
  323. "unicode": "\uE69E"
  324. }, {
  325. "font_class": "email-filled",
  326. "unicode": "\uE69A"
  327. }, {
  328. "font_class": "eye",
  329. "unicode": "\uE651"
  330. }, {
  331. "font_class": "eye-filled",
  332. "unicode": "\uE66A"
  333. }, {
  334. "font_class": "eye-slash",
  335. "unicode": "\uE6B3"
  336. }, {
  337. "font_class": "eye-slash-filled",
  338. "unicode": "\uE6B4"
  339. }, {
  340. "font_class": "fire",
  341. "unicode": "\uE6A1"
  342. }, {
  343. "font_class": "fire-filled",
  344. "unicode": "\uE6C5"
  345. }, {
  346. "font_class": "flag",
  347. "unicode": "\uE65F"
  348. }, {
  349. "font_class": "flag-filled",
  350. "unicode": "\uE660"
  351. }, {
  352. "font_class": "folder-add",
  353. "unicode": "\uE6A9"
  354. }, {
  355. "font_class": "folder-add-filled",
  356. "unicode": "\uE6C8"
  357. }, {
  358. "font_class": "font",
  359. "unicode": "\uE6A3"
  360. }, {
  361. "font_class": "forward",
  362. "unicode": "\uE6BA"
  363. }, {
  364. "font_class": "gear",
  365. "unicode": "\uE664"
  366. }, {
  367. "font_class": "gear-filled",
  368. "unicode": "\uE661"
  369. }, {
  370. "font_class": "gift",
  371. "unicode": "\uE6A4"
  372. }, {
  373. "font_class": "gift-filled",
  374. "unicode": "\uE6C4"
  375. }, {
  376. "font_class": "hand-down",
  377. "unicode": "\uE63D"
  378. }, {
  379. "font_class": "hand-down-filled",
  380. "unicode": "\uE63C"
  381. }, {
  382. "font_class": "hand-up",
  383. "unicode": "\uE63F"
  384. }, {
  385. "font_class": "hand-up-filled",
  386. "unicode": "\uE63E"
  387. }, {
  388. "font_class": "headphones",
  389. "unicode": "\uE630"
  390. }, {
  391. "font_class": "heart",
  392. "unicode": "\uE639"
  393. }, {
  394. "font_class": "heart-filled",
  395. "unicode": "\uE641"
  396. }, {
  397. "font_class": "help",
  398. "unicode": "\uE679"
  399. }, {
  400. "font_class": "help-filled",
  401. "unicode": "\uE674"
  402. }, {
  403. "font_class": "home",
  404. "unicode": "\uE662"
  405. }, {
  406. "font_class": "home-filled",
  407. "unicode": "\uE663"
  408. }, {
  409. "font_class": "image",
  410. "unicode": "\uE670"
  411. }, {
  412. "font_class": "image-filled",
  413. "unicode": "\uE678"
  414. }, {
  415. "font_class": "images",
  416. "unicode": "\uE650"
  417. }, {
  418. "font_class": "images-filled",
  419. "unicode": "\uE64B"
  420. }, {
  421. "font_class": "info",
  422. "unicode": "\uE669"
  423. }, {
  424. "font_class": "info-filled",
  425. "unicode": "\uE649"
  426. }, {
  427. "font_class": "left",
  428. "unicode": "\uE6B7"
  429. }, {
  430. "font_class": "link",
  431. "unicode": "\uE6A5"
  432. }, {
  433. "font_class": "list",
  434. "unicode": "\uE644"
  435. }, {
  436. "font_class": "location",
  437. "unicode": "\uE6AE"
  438. }, {
  439. "font_class": "location-filled",
  440. "unicode": "\uE6AF"
  441. }, {
  442. "font_class": "locked",
  443. "unicode": "\uE66B"
  444. }, {
  445. "font_class": "locked-filled",
  446. "unicode": "\uE668"
  447. }, {
  448. "font_class": "loop",
  449. "unicode": "\uE633"
  450. }, {
  451. "font_class": "mail-open",
  452. "unicode": "\uE643"
  453. }, {
  454. "font_class": "mail-open-filled",
  455. "unicode": "\uE63A"
  456. }, {
  457. "font_class": "map",
  458. "unicode": "\uE667"
  459. }, {
  460. "font_class": "map-filled",
  461. "unicode": "\uE666"
  462. }, {
  463. "font_class": "map-pin",
  464. "unicode": "\uE6AD"
  465. }, {
  466. "font_class": "map-pin-ellipse",
  467. "unicode": "\uE6AC"
  468. }, {
  469. "font_class": "medal",
  470. "unicode": "\uE6A2"
  471. }, {
  472. "font_class": "medal-filled",
  473. "unicode": "\uE6C3"
  474. }, {
  475. "font_class": "mic",
  476. "unicode": "\uE671"
  477. }, {
  478. "font_class": "mic-filled",
  479. "unicode": "\uE677"
  480. }, {
  481. "font_class": "micoff",
  482. "unicode": "\uE67E"
  483. }, {
  484. "font_class": "micoff-filled",
  485. "unicode": "\uE6B0"
  486. }, {
  487. "font_class": "minus",
  488. "unicode": "\uE66F"
  489. }, {
  490. "font_class": "minus-filled",
  491. "unicode": "\uE67D"
  492. }, {
  493. "font_class": "more",
  494. "unicode": "\uE64D"
  495. }, {
  496. "font_class": "more-filled",
  497. "unicode": "\uE64E"
  498. }, {
  499. "font_class": "navigate",
  500. "unicode": "\uE66E"
  501. }, {
  502. "font_class": "navigate-filled",
  503. "unicode": "\uE67A"
  504. }, {
  505. "font_class": "notification",
  506. "unicode": "\uE6A6"
  507. }, {
  508. "font_class": "notification-filled",
  509. "unicode": "\uE6C1"
  510. }, {
  511. "font_class": "paperclip",
  512. "unicode": "\uE652"
  513. }, {
  514. "font_class": "paperplane",
  515. "unicode": "\uE672"
  516. }, {
  517. "font_class": "paperplane-filled",
  518. "unicode": "\uE675"
  519. }, {
  520. "font_class": "person",
  521. "unicode": "\uE699"
  522. }, {
  523. "font_class": "person-filled",
  524. "unicode": "\uE69D"
  525. }, {
  526. "font_class": "personadd",
  527. "unicode": "\uE69F"
  528. }, {
  529. "font_class": "personadd-filled",
  530. "unicode": "\uE698"
  531. }, {
  532. "font_class": "personadd-filled-copy",
  533. "unicode": "\uE6D1"
  534. }, {
  535. "font_class": "phone",
  536. "unicode": "\uE69C"
  537. }, {
  538. "font_class": "phone-filled",
  539. "unicode": "\uE69B"
  540. }, {
  541. "font_class": "plus",
  542. "unicode": "\uE676"
  543. }, {
  544. "font_class": "plus-filled",
  545. "unicode": "\uE6C7"
  546. }, {
  547. "font_class": "plusempty",
  548. "unicode": "\uE67B"
  549. }, {
  550. "font_class": "pulldown",
  551. "unicode": "\uE632"
  552. }, {
  553. "font_class": "pyq",
  554. "unicode": "\uE682"
  555. }, {
  556. "font_class": "qq",
  557. "unicode": "\uE680"
  558. }, {
  559. "font_class": "redo",
  560. "unicode": "\uE64A"
  561. }, {
  562. "font_class": "redo-filled",
  563. "unicode": "\uE655"
  564. }, {
  565. "font_class": "refresh",
  566. "unicode": "\uE657"
  567. }, {
  568. "font_class": "refresh-filled",
  569. "unicode": "\uE656"
  570. }, {
  571. "font_class": "refreshempty",
  572. "unicode": "\uE6BF"
  573. }, {
  574. "font_class": "reload",
  575. "unicode": "\uE6B2"
  576. }, {
  577. "font_class": "right",
  578. "unicode": "\uE6B5"
  579. }, {
  580. "font_class": "scan",
  581. "unicode": "\uE62A"
  582. }, {
  583. "font_class": "search",
  584. "unicode": "\uE654"
  585. }, {
  586. "font_class": "settings",
  587. "unicode": "\uE653"
  588. }, {
  589. "font_class": "settings-filled",
  590. "unicode": "\uE6CE"
  591. }, {
  592. "font_class": "shop",
  593. "unicode": "\uE62F"
  594. }, {
  595. "font_class": "shop-filled",
  596. "unicode": "\uE6CD"
  597. }, {
  598. "font_class": "smallcircle",
  599. "unicode": "\uE67C"
  600. }, {
  601. "font_class": "smallcircle-filled",
  602. "unicode": "\uE665"
  603. }, {
  604. "font_class": "sound",
  605. "unicode": "\uE684"
  606. }, {
  607. "font_class": "sound-filled",
  608. "unicode": "\uE686"
  609. }, {
  610. "font_class": "spinner-cycle",
  611. "unicode": "\uE68A"
  612. }, {
  613. "font_class": "staff",
  614. "unicode": "\uE6A7"
  615. }, {
  616. "font_class": "staff-filled",
  617. "unicode": "\uE6CB"
  618. }, {
  619. "font_class": "star",
  620. "unicode": "\uE688"
  621. }, {
  622. "font_class": "star-filled",
  623. "unicode": "\uE68F"
  624. }, {
  625. "font_class": "starhalf",
  626. "unicode": "\uE683"
  627. }, {
  628. "font_class": "trash",
  629. "unicode": "\uE687"
  630. }, {
  631. "font_class": "trash-filled",
  632. "unicode": "\uE685"
  633. }, {
  634. "font_class": "tune",
  635. "unicode": "\uE6AA"
  636. }, {
  637. "font_class": "tune-filled",
  638. "unicode": "\uE6CA"
  639. }, {
  640. "font_class": "undo",
  641. "unicode": "\uE64F"
  642. }, {
  643. "font_class": "undo-filled",
  644. "unicode": "\uE64C"
  645. }, {
  646. "font_class": "up",
  647. "unicode": "\uE6B6"
  648. }, {
  649. "font_class": "top",
  650. "unicode": "\uE6B6"
  651. }, {
  652. "font_class": "upload",
  653. "unicode": "\uE690"
  654. }, {
  655. "font_class": "upload-filled",
  656. "unicode": "\uE68E"
  657. }, {
  658. "font_class": "videocam",
  659. "unicode": "\uE68C"
  660. }, {
  661. "font_class": "videocam-filled",
  662. "unicode": "\uE689"
  663. }, {
  664. "font_class": "vip",
  665. "unicode": "\uE6A8"
  666. }, {
  667. "font_class": "vip-filled",
  668. "unicode": "\uE6C6"
  669. }, {
  670. "font_class": "wallet",
  671. "unicode": "\uE6B1"
  672. }, {
  673. "font_class": "wallet-filled",
  674. "unicode": "\uE6C2"
  675. }, {
  676. "font_class": "weibo",
  677. "unicode": "\uE68B"
  678. }, {
  679. "font_class": "weixin",
  680. "unicode": "\uE691"
  681. }];
  682. // export const fontData = JSON.parse<IconsDataItem>(fontDataJson)
  683. exports.fontData = fontData;
  684. /***/ }),
  685. /***/ 19:
  686. /*!******************************************************************!*\
  687. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  688. \******************************************************************/
  689. /*! no static exports found */
  690. /***/ (function(module, exports, __webpack_require__) {
  691. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  692. function _arrayWithoutHoles(arr) {
  693. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  694. }
  695. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  696. /***/ }),
  697. /***/ 196:
  698. /*!***************************************************************************************************!*\
  699. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-popup/components/uni-popup/popup.js ***!
  700. \***************************************************************************************************/
  701. /*! no static exports found */
  702. /***/ (function(module, exports, __webpack_require__) {
  703. "use strict";
  704. Object.defineProperty(exports, "__esModule", {
  705. value: true
  706. });
  707. exports.default = void 0;
  708. var _default = {
  709. data: function data() {
  710. return {};
  711. },
  712. created: function created() {
  713. this.popup = this.getParent();
  714. },
  715. methods: {
  716. /**
  717. * 获取父元素实例
  718. */
  719. getParent: function getParent() {
  720. var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'uniPopup';
  721. var parent = this.$parent;
  722. var parentName = parent.$options.name;
  723. while (parentName !== name) {
  724. parent = parent.$parent;
  725. if (!parent) return false;
  726. parentName = parent.$options.name;
  727. }
  728. return parent;
  729. }
  730. }
  731. };
  732. exports.default = _default;
  733. /***/ }),
  734. /***/ 197:
  735. /*!********************************************************************************************************!*\
  736. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-popup/components/uni-popup/i18n/index.js ***!
  737. \********************************************************************************************************/
  738. /*! no static exports found */
  739. /***/ (function(module, exports, __webpack_require__) {
  740. "use strict";
  741. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  742. Object.defineProperty(exports, "__esModule", {
  743. value: true
  744. });
  745. exports.default = void 0;
  746. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 198));
  747. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 199));
  748. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 200));
  749. var _default = {
  750. en: _en.default,
  751. 'zh-Hans': _zhHans.default,
  752. 'zh-Hant': _zhHant.default
  753. };
  754. exports.default = _default;
  755. /***/ }),
  756. /***/ 198:
  757. /*!*******************************************************************************************************!*\
  758. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-popup/components/uni-popup/i18n/en.json ***!
  759. \*******************************************************************************************************/
  760. /*! exports provided: uni-popup.cancel, uni-popup.ok, uni-popup.placeholder, uni-popup.title, uni-popup.shareTitle, default */
  761. /***/ (function(module) {
  762. module.exports = JSON.parse("{\"uni-popup.cancel\":\"cancel\",\"uni-popup.ok\":\"ok\",\"uni-popup.placeholder\":\"pleace enter\",\"uni-popup.title\":\"Hint\",\"uni-popup.shareTitle\":\"Share to\"}");
  763. /***/ }),
  764. /***/ 199:
  765. /*!************************************************************************************************************!*\
  766. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json ***!
  767. \************************************************************************************************************/
  768. /*! exports provided: uni-popup.cancel, uni-popup.ok, uni-popup.placeholder, uni-popup.title, uni-popup.shareTitle, default */
  769. /***/ (function(module) {
  770. module.exports = JSON.parse("{\"uni-popup.cancel\":\"取消\",\"uni-popup.ok\":\"确定\",\"uni-popup.placeholder\":\"请输入\",\"uni-popup.title\":\"提示\",\"uni-popup.shareTitle\":\"分享到\"}");
  771. /***/ }),
  772. /***/ 2:
  773. /*!************************************************************!*\
  774. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  775. \************************************************************/
  776. /*! no static exports found */
  777. /***/ (function(module, exports, __webpack_require__) {
  778. "use strict";
  779. /* WEBPACK VAR INJECTION */(function(wx, global) {
  780. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  781. Object.defineProperty(exports, "__esModule", {
  782. value: true
  783. });
  784. exports.createApp = createApp;
  785. exports.createComponent = createComponent;
  786. exports.createPage = createPage;
  787. exports.createPlugin = createPlugin;
  788. exports.createSubpackageApp = createSubpackageApp;
  789. exports.default = void 0;
  790. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  791. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  792. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  793. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  794. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  795. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  796. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  797. 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; }
  798. 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; }
  799. var realAtob;
  800. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  801. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  802. if (typeof atob !== 'function') {
  803. realAtob = function realAtob(str) {
  804. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  805. if (!b64re.test(str)) {
  806. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  807. }
  808. // Adding the padding if missing, for semplicity
  809. str += '=='.slice(2 - (str.length & 3));
  810. var bitmap;
  811. var result = '';
  812. var r1;
  813. var r2;
  814. var i = 0;
  815. for (; i < str.length;) {
  816. 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++)));
  817. 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);
  818. }
  819. return result;
  820. };
  821. } else {
  822. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  823. realAtob = atob;
  824. }
  825. function b64DecodeUnicode(str) {
  826. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  827. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  828. }).join(''));
  829. }
  830. function getCurrentUserInfo() {
  831. var token = wx.getStorageSync('uni_id_token') || '';
  832. var tokenArr = token.split('.');
  833. if (!token || tokenArr.length !== 3) {
  834. return {
  835. uid: null,
  836. role: [],
  837. permission: [],
  838. tokenExpired: 0
  839. };
  840. }
  841. var userInfo;
  842. try {
  843. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  844. } catch (error) {
  845. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  846. }
  847. userInfo.tokenExpired = userInfo.exp * 1000;
  848. delete userInfo.exp;
  849. delete userInfo.iat;
  850. return userInfo;
  851. }
  852. function uniIdMixin(Vue) {
  853. Vue.prototype.uniIDHasRole = function (roleId) {
  854. var _getCurrentUserInfo = getCurrentUserInfo(),
  855. role = _getCurrentUserInfo.role;
  856. return role.indexOf(roleId) > -1;
  857. };
  858. Vue.prototype.uniIDHasPermission = function (permissionId) {
  859. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  860. permission = _getCurrentUserInfo2.permission;
  861. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  862. };
  863. Vue.prototype.uniIDTokenValid = function () {
  864. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  865. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  866. return tokenExpired > Date.now();
  867. };
  868. }
  869. var _toString = Object.prototype.toString;
  870. var hasOwnProperty = Object.prototype.hasOwnProperty;
  871. function isFn(fn) {
  872. return typeof fn === 'function';
  873. }
  874. function isStr(str) {
  875. return typeof str === 'string';
  876. }
  877. function isObject(obj) {
  878. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  879. }
  880. function isPlainObject(obj) {
  881. return _toString.call(obj) === '[object Object]';
  882. }
  883. function hasOwn(obj, key) {
  884. return hasOwnProperty.call(obj, key);
  885. }
  886. function noop() {}
  887. /**
  888. * Create a cached version of a pure function.
  889. */
  890. function cached(fn) {
  891. var cache = Object.create(null);
  892. return function cachedFn(str) {
  893. var hit = cache[str];
  894. return hit || (cache[str] = fn(str));
  895. };
  896. }
  897. /**
  898. * Camelize a hyphen-delimited string.
  899. */
  900. var camelizeRE = /-(\w)/g;
  901. var camelize = cached(function (str) {
  902. return str.replace(camelizeRE, function (_, c) {
  903. return c ? c.toUpperCase() : '';
  904. });
  905. });
  906. function sortObject(obj) {
  907. var sortObj = {};
  908. if (isPlainObject(obj)) {
  909. Object.keys(obj).sort().forEach(function (key) {
  910. sortObj[key] = obj[key];
  911. });
  912. }
  913. return !Object.keys(sortObj) ? obj : sortObj;
  914. }
  915. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  916. var globalInterceptors = {};
  917. var scopedInterceptors = {};
  918. function mergeHook(parentVal, childVal) {
  919. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  920. return res ? dedupeHooks(res) : res;
  921. }
  922. function dedupeHooks(hooks) {
  923. var res = [];
  924. for (var i = 0; i < hooks.length; i++) {
  925. if (res.indexOf(hooks[i]) === -1) {
  926. res.push(hooks[i]);
  927. }
  928. }
  929. return res;
  930. }
  931. function removeHook(hooks, hook) {
  932. var index = hooks.indexOf(hook);
  933. if (index !== -1) {
  934. hooks.splice(index, 1);
  935. }
  936. }
  937. function mergeInterceptorHook(interceptor, option) {
  938. Object.keys(option).forEach(function (hook) {
  939. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  940. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  941. }
  942. });
  943. }
  944. function removeInterceptorHook(interceptor, option) {
  945. if (!interceptor || !option) {
  946. return;
  947. }
  948. Object.keys(option).forEach(function (hook) {
  949. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  950. removeHook(interceptor[hook], option[hook]);
  951. }
  952. });
  953. }
  954. function addInterceptor(method, option) {
  955. if (typeof method === 'string' && isPlainObject(option)) {
  956. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  957. } else if (isPlainObject(method)) {
  958. mergeInterceptorHook(globalInterceptors, method);
  959. }
  960. }
  961. function removeInterceptor(method, option) {
  962. if (typeof method === 'string') {
  963. if (isPlainObject(option)) {
  964. removeInterceptorHook(scopedInterceptors[method], option);
  965. } else {
  966. delete scopedInterceptors[method];
  967. }
  968. } else if (isPlainObject(method)) {
  969. removeInterceptorHook(globalInterceptors, method);
  970. }
  971. }
  972. function wrapperHook(hook, params) {
  973. return function (data) {
  974. return hook(data, params) || data;
  975. };
  976. }
  977. function isPromise(obj) {
  978. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  979. }
  980. function queue(hooks, data, params) {
  981. var promise = false;
  982. for (var i = 0; i < hooks.length; i++) {
  983. var hook = hooks[i];
  984. if (promise) {
  985. promise = Promise.resolve(wrapperHook(hook, params));
  986. } else {
  987. var res = hook(data, params);
  988. if (isPromise(res)) {
  989. promise = Promise.resolve(res);
  990. }
  991. if (res === false) {
  992. return {
  993. then: function then() {}
  994. };
  995. }
  996. }
  997. }
  998. return promise || {
  999. then: function then(callback) {
  1000. return callback(data);
  1001. }
  1002. };
  1003. }
  1004. function wrapperOptions(interceptor) {
  1005. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1006. ['success', 'fail', 'complete'].forEach(function (name) {
  1007. if (Array.isArray(interceptor[name])) {
  1008. var oldCallback = options[name];
  1009. options[name] = function callbackInterceptor(res) {
  1010. queue(interceptor[name], res, options).then(function (res) {
  1011. /* eslint-disable no-mixed-operators */
  1012. return isFn(oldCallback) && oldCallback(res) || res;
  1013. });
  1014. };
  1015. }
  1016. });
  1017. return options;
  1018. }
  1019. function wrapperReturnValue(method, returnValue) {
  1020. var returnValueHooks = [];
  1021. if (Array.isArray(globalInterceptors.returnValue)) {
  1022. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  1023. }
  1024. var interceptor = scopedInterceptors[method];
  1025. if (interceptor && Array.isArray(interceptor.returnValue)) {
  1026. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  1027. }
  1028. returnValueHooks.forEach(function (hook) {
  1029. returnValue = hook(returnValue) || returnValue;
  1030. });
  1031. return returnValue;
  1032. }
  1033. function getApiInterceptorHooks(method) {
  1034. var interceptor = Object.create(null);
  1035. Object.keys(globalInterceptors).forEach(function (hook) {
  1036. if (hook !== 'returnValue') {
  1037. interceptor[hook] = globalInterceptors[hook].slice();
  1038. }
  1039. });
  1040. var scopedInterceptor = scopedInterceptors[method];
  1041. if (scopedInterceptor) {
  1042. Object.keys(scopedInterceptor).forEach(function (hook) {
  1043. if (hook !== 'returnValue') {
  1044. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  1045. }
  1046. });
  1047. }
  1048. return interceptor;
  1049. }
  1050. function invokeApi(method, api, options) {
  1051. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  1052. params[_key - 3] = arguments[_key];
  1053. }
  1054. var interceptor = getApiInterceptorHooks(method);
  1055. if (interceptor && Object.keys(interceptor).length) {
  1056. if (Array.isArray(interceptor.invoke)) {
  1057. var res = queue(interceptor.invoke, options);
  1058. return res.then(function (options) {
  1059. // 重新访问 getApiInterceptorHooks, 允许 invoke 中再次调用 addInterceptor,removeInterceptor
  1060. return api.apply(void 0, [wrapperOptions(getApiInterceptorHooks(method), options)].concat(params));
  1061. });
  1062. } else {
  1063. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  1064. }
  1065. }
  1066. return api.apply(void 0, [options].concat(params));
  1067. }
  1068. var promiseInterceptor = {
  1069. returnValue: function returnValue(res) {
  1070. if (!isPromise(res)) {
  1071. return res;
  1072. }
  1073. return new Promise(function (resolve, reject) {
  1074. res.then(function (res) {
  1075. if (res[0]) {
  1076. reject(res[0]);
  1077. } else {
  1078. resolve(res[1]);
  1079. }
  1080. });
  1081. });
  1082. }
  1083. };
  1084. var SYNC_API_RE = /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting|initUTS|requireUTS|registerUTS/;
  1085. var CONTEXT_API_RE = /^create|Manager$/;
  1086. // Context例外情况
  1087. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  1088. // 同步例外情况
  1089. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  1090. var CALLBACK_API_RE = /^on|^off/;
  1091. function isContextApi(name) {
  1092. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  1093. }
  1094. function isSyncApi(name) {
  1095. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  1096. }
  1097. function isCallbackApi(name) {
  1098. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  1099. }
  1100. function handlePromise(promise) {
  1101. return promise.then(function (data) {
  1102. return [null, data];
  1103. }).catch(function (err) {
  1104. return [err];
  1105. });
  1106. }
  1107. function shouldPromise(name) {
  1108. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  1109. return false;
  1110. }
  1111. return true;
  1112. }
  1113. /* eslint-disable no-extend-native */
  1114. if (!Promise.prototype.finally) {
  1115. Promise.prototype.finally = function (callback) {
  1116. var promise = this.constructor;
  1117. return this.then(function (value) {
  1118. return promise.resolve(callback()).then(function () {
  1119. return value;
  1120. });
  1121. }, function (reason) {
  1122. return promise.resolve(callback()).then(function () {
  1123. throw reason;
  1124. });
  1125. });
  1126. };
  1127. }
  1128. function promisify(name, api) {
  1129. if (!shouldPromise(name) || !isFn(api)) {
  1130. return api;
  1131. }
  1132. return function promiseApi() {
  1133. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1134. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  1135. params[_key2 - 1] = arguments[_key2];
  1136. }
  1137. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  1138. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  1139. }
  1140. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  1141. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  1142. success: resolve,
  1143. fail: reject
  1144. })].concat(params));
  1145. })));
  1146. };
  1147. }
  1148. var EPS = 1e-4;
  1149. var BASE_DEVICE_WIDTH = 750;
  1150. var isIOS = false;
  1151. var deviceWidth = 0;
  1152. var deviceDPR = 0;
  1153. function checkDeviceWidth() {
  1154. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  1155. platform = _wx$getSystemInfoSync.platform,
  1156. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  1157. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  1158. deviceWidth = windowWidth;
  1159. deviceDPR = pixelRatio;
  1160. isIOS = platform === 'ios';
  1161. }
  1162. function upx2px(number, newDeviceWidth) {
  1163. if (deviceWidth === 0) {
  1164. checkDeviceWidth();
  1165. }
  1166. number = Number(number);
  1167. if (number === 0) {
  1168. return 0;
  1169. }
  1170. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  1171. if (result < 0) {
  1172. result = -result;
  1173. }
  1174. result = Math.floor(result + EPS);
  1175. if (result === 0) {
  1176. if (deviceDPR === 1 || !isIOS) {
  1177. result = 1;
  1178. } else {
  1179. result = 0.5;
  1180. }
  1181. }
  1182. return number < 0 ? -result : result;
  1183. }
  1184. var LOCALE_ZH_HANS = 'zh-Hans';
  1185. var LOCALE_ZH_HANT = 'zh-Hant';
  1186. var LOCALE_EN = 'en';
  1187. var LOCALE_FR = 'fr';
  1188. var LOCALE_ES = 'es';
  1189. var messages = {};
  1190. var locale;
  1191. {
  1192. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1193. }
  1194. function initI18nMessages() {
  1195. if (!isEnableLocale()) {
  1196. return;
  1197. }
  1198. var localeKeys = Object.keys(__uniConfig.locales);
  1199. if (localeKeys.length) {
  1200. localeKeys.forEach(function (locale) {
  1201. var curMessages = messages[locale];
  1202. var userMessages = __uniConfig.locales[locale];
  1203. if (curMessages) {
  1204. Object.assign(curMessages, userMessages);
  1205. } else {
  1206. messages[locale] = userMessages;
  1207. }
  1208. });
  1209. }
  1210. }
  1211. initI18nMessages();
  1212. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  1213. var t = i18n.t;
  1214. var i18nMixin = i18n.mixin = {
  1215. beforeCreate: function beforeCreate() {
  1216. var _this = this;
  1217. var unwatch = i18n.i18n.watchLocale(function () {
  1218. _this.$forceUpdate();
  1219. });
  1220. this.$once('hook:beforeDestroy', function () {
  1221. unwatch();
  1222. });
  1223. },
  1224. methods: {
  1225. $$t: function $$t(key, values) {
  1226. return t(key, values);
  1227. }
  1228. }
  1229. };
  1230. var setLocale = i18n.setLocale;
  1231. var getLocale = i18n.getLocale;
  1232. function initAppLocale(Vue, appVm, locale) {
  1233. var state = Vue.observable({
  1234. locale: locale || i18n.getLocale()
  1235. });
  1236. var localeWatchers = [];
  1237. appVm.$watchLocale = function (fn) {
  1238. localeWatchers.push(fn);
  1239. };
  1240. Object.defineProperty(appVm, '$locale', {
  1241. get: function get() {
  1242. return state.locale;
  1243. },
  1244. set: function set(v) {
  1245. state.locale = v;
  1246. localeWatchers.forEach(function (watch) {
  1247. return watch(v);
  1248. });
  1249. }
  1250. });
  1251. }
  1252. function isEnableLocale() {
  1253. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  1254. }
  1255. function include(str, parts) {
  1256. return !!parts.find(function (part) {
  1257. return str.indexOf(part) !== -1;
  1258. });
  1259. }
  1260. function startsWith(str, parts) {
  1261. return parts.find(function (part) {
  1262. return str.indexOf(part) === 0;
  1263. });
  1264. }
  1265. function normalizeLocale(locale, messages) {
  1266. if (!locale) {
  1267. return;
  1268. }
  1269. locale = locale.trim().replace(/_/g, '-');
  1270. if (messages && messages[locale]) {
  1271. return locale;
  1272. }
  1273. locale = locale.toLowerCase();
  1274. if (locale === 'chinese') {
  1275. // 支付宝
  1276. return LOCALE_ZH_HANS;
  1277. }
  1278. if (locale.indexOf('zh') === 0) {
  1279. if (locale.indexOf('-hans') > -1) {
  1280. return LOCALE_ZH_HANS;
  1281. }
  1282. if (locale.indexOf('-hant') > -1) {
  1283. return LOCALE_ZH_HANT;
  1284. }
  1285. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  1286. return LOCALE_ZH_HANT;
  1287. }
  1288. return LOCALE_ZH_HANS;
  1289. }
  1290. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  1291. if (lang) {
  1292. return lang;
  1293. }
  1294. }
  1295. // export function initI18n() {
  1296. // const localeKeys = Object.keys(__uniConfig.locales || {})
  1297. // if (localeKeys.length) {
  1298. // localeKeys.forEach((locale) =>
  1299. // i18n.add(locale, __uniConfig.locales[locale])
  1300. // )
  1301. // }
  1302. // }
  1303. function getLocale$1() {
  1304. // 优先使用 $locale
  1305. if (isFn(getApp)) {
  1306. var app = getApp({
  1307. allowDefault: true
  1308. });
  1309. if (app && app.$vm) {
  1310. return app.$vm.$locale;
  1311. }
  1312. }
  1313. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1314. }
  1315. function setLocale$1(locale) {
  1316. var app = isFn(getApp) ? getApp() : false;
  1317. if (!app) {
  1318. return false;
  1319. }
  1320. var oldLocale = app.$vm.$locale;
  1321. if (oldLocale !== locale) {
  1322. app.$vm.$locale = locale;
  1323. onLocaleChangeCallbacks.forEach(function (fn) {
  1324. return fn({
  1325. locale: locale
  1326. });
  1327. });
  1328. return true;
  1329. }
  1330. return false;
  1331. }
  1332. var onLocaleChangeCallbacks = [];
  1333. function onLocaleChange(fn) {
  1334. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  1335. onLocaleChangeCallbacks.push(fn);
  1336. }
  1337. }
  1338. if (typeof global !== 'undefined') {
  1339. global.getLocale = getLocale$1;
  1340. }
  1341. var interceptors = {
  1342. promiseInterceptor: promiseInterceptor
  1343. };
  1344. var baseApi = /*#__PURE__*/Object.freeze({
  1345. __proto__: null,
  1346. upx2px: upx2px,
  1347. getLocale: getLocale$1,
  1348. setLocale: setLocale$1,
  1349. onLocaleChange: onLocaleChange,
  1350. addInterceptor: addInterceptor,
  1351. removeInterceptor: removeInterceptor,
  1352. interceptors: interceptors
  1353. });
  1354. function findExistsPageIndex(url) {
  1355. var pages = getCurrentPages();
  1356. var len = pages.length;
  1357. while (len--) {
  1358. var page = pages[len];
  1359. if (page.$page && page.$page.fullPath === url) {
  1360. return len;
  1361. }
  1362. }
  1363. return -1;
  1364. }
  1365. var redirectTo = {
  1366. name: function name(fromArgs) {
  1367. if (fromArgs.exists === 'back' && fromArgs.delta) {
  1368. return 'navigateBack';
  1369. }
  1370. return 'redirectTo';
  1371. },
  1372. args: function args(fromArgs) {
  1373. if (fromArgs.exists === 'back' && fromArgs.url) {
  1374. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  1375. if (existsPageIndex !== -1) {
  1376. var delta = getCurrentPages().length - 1 - existsPageIndex;
  1377. if (delta > 0) {
  1378. fromArgs.delta = delta;
  1379. }
  1380. }
  1381. }
  1382. }
  1383. };
  1384. var previewImage = {
  1385. args: function args(fromArgs) {
  1386. var currentIndex = parseInt(fromArgs.current);
  1387. if (isNaN(currentIndex)) {
  1388. return;
  1389. }
  1390. var urls = fromArgs.urls;
  1391. if (!Array.isArray(urls)) {
  1392. return;
  1393. }
  1394. var len = urls.length;
  1395. if (!len) {
  1396. return;
  1397. }
  1398. if (currentIndex < 0) {
  1399. currentIndex = 0;
  1400. } else if (currentIndex >= len) {
  1401. currentIndex = len - 1;
  1402. }
  1403. if (currentIndex > 0) {
  1404. fromArgs.current = urls[currentIndex];
  1405. fromArgs.urls = urls.filter(function (item, index) {
  1406. return index < currentIndex ? item !== urls[currentIndex] : true;
  1407. });
  1408. } else {
  1409. fromArgs.current = urls[0];
  1410. }
  1411. return {
  1412. indicator: false,
  1413. loop: false
  1414. };
  1415. }
  1416. };
  1417. var UUID_KEY = '__DC_STAT_UUID';
  1418. var deviceId;
  1419. function useDeviceId(result) {
  1420. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  1421. if (!deviceId) {
  1422. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  1423. wx.setStorage({
  1424. key: UUID_KEY,
  1425. data: deviceId
  1426. });
  1427. }
  1428. result.deviceId = deviceId;
  1429. }
  1430. function addSafeAreaInsets(result) {
  1431. if (result.safeArea) {
  1432. var safeArea = result.safeArea;
  1433. result.safeAreaInsets = {
  1434. top: safeArea.top,
  1435. left: safeArea.left,
  1436. right: result.windowWidth - safeArea.right,
  1437. bottom: result.screenHeight - safeArea.bottom
  1438. };
  1439. }
  1440. }
  1441. function populateParameters(result) {
  1442. var _result$brand = result.brand,
  1443. brand = _result$brand === void 0 ? '' : _result$brand,
  1444. _result$model = result.model,
  1445. model = _result$model === void 0 ? '' : _result$model,
  1446. _result$system = result.system,
  1447. system = _result$system === void 0 ? '' : _result$system,
  1448. _result$language = result.language,
  1449. language = _result$language === void 0 ? '' : _result$language,
  1450. theme = result.theme,
  1451. version = result.version,
  1452. platform = result.platform,
  1453. fontSizeSetting = result.fontSizeSetting,
  1454. SDKVersion = result.SDKVersion,
  1455. pixelRatio = result.pixelRatio,
  1456. deviceOrientation = result.deviceOrientation;
  1457. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  1458. var extraParam = {};
  1459. // osName osVersion
  1460. var osName = '';
  1461. var osVersion = '';
  1462. {
  1463. osName = system.split(' ')[0] || '';
  1464. osVersion = system.split(' ')[1] || '';
  1465. }
  1466. var hostVersion = version;
  1467. // deviceType
  1468. var deviceType = getGetDeviceType(result, model);
  1469. // deviceModel
  1470. var deviceBrand = getDeviceBrand(brand);
  1471. // hostName
  1472. var _hostName = getHostName(result);
  1473. // deviceOrientation
  1474. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  1475. // devicePixelRatio
  1476. var _devicePixelRatio = pixelRatio;
  1477. // SDKVersion
  1478. var _SDKVersion = SDKVersion;
  1479. // hostLanguage
  1480. var hostLanguage = language.replace(/_/g, '-');
  1481. // wx.getAccountInfoSync
  1482. var parameters = {
  1483. appId: "__UNI__DBC0602",
  1484. appName: "errand_app",
  1485. appVersion: "1.0.0",
  1486. appVersionCode: "100",
  1487. appLanguage: getAppLanguage(hostLanguage),
  1488. uniCompileVersion: "4.24",
  1489. uniRuntimeVersion: "4.24",
  1490. uniPlatform: undefined || "mp-weixin",
  1491. deviceBrand: deviceBrand,
  1492. deviceModel: model,
  1493. deviceType: deviceType,
  1494. devicePixelRatio: _devicePixelRatio,
  1495. deviceOrientation: _deviceOrientation,
  1496. osName: osName.toLocaleLowerCase(),
  1497. osVersion: osVersion,
  1498. hostTheme: theme,
  1499. hostVersion: hostVersion,
  1500. hostLanguage: hostLanguage,
  1501. hostName: _hostName,
  1502. hostSDKVersion: _SDKVersion,
  1503. hostFontSizeSetting: fontSizeSetting,
  1504. windowTop: 0,
  1505. windowBottom: 0,
  1506. // TODO
  1507. osLanguage: undefined,
  1508. osTheme: undefined,
  1509. ua: undefined,
  1510. hostPackageName: undefined,
  1511. browserName: undefined,
  1512. browserVersion: undefined
  1513. };
  1514. Object.assign(result, parameters, extraParam);
  1515. }
  1516. function getGetDeviceType(result, model) {
  1517. var deviceType = result.deviceType || 'phone';
  1518. {
  1519. var deviceTypeMaps = {
  1520. ipad: 'pad',
  1521. windows: 'pc',
  1522. mac: 'pc'
  1523. };
  1524. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  1525. var _model = model.toLocaleLowerCase();
  1526. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  1527. var _m = deviceTypeMapsKeys[index];
  1528. if (_model.indexOf(_m) !== -1) {
  1529. deviceType = deviceTypeMaps[_m];
  1530. break;
  1531. }
  1532. }
  1533. }
  1534. return deviceType;
  1535. }
  1536. function getDeviceBrand(brand) {
  1537. var deviceBrand = brand;
  1538. if (deviceBrand) {
  1539. deviceBrand = brand.toLocaleLowerCase();
  1540. }
  1541. return deviceBrand;
  1542. }
  1543. function getAppLanguage(defaultLanguage) {
  1544. return getLocale$1 ? getLocale$1() : defaultLanguage;
  1545. }
  1546. function getHostName(result) {
  1547. var _platform = 'WeChat';
  1548. var _hostName = result.hostName || _platform; // mp-jd
  1549. {
  1550. if (result.environment) {
  1551. _hostName = result.environment;
  1552. } else if (result.host && result.host.env) {
  1553. _hostName = result.host.env;
  1554. }
  1555. }
  1556. return _hostName;
  1557. }
  1558. var getSystemInfo = {
  1559. returnValue: function returnValue(result) {
  1560. useDeviceId(result);
  1561. addSafeAreaInsets(result);
  1562. populateParameters(result);
  1563. }
  1564. };
  1565. var showActionSheet = {
  1566. args: function args(fromArgs) {
  1567. if ((0, _typeof2.default)(fromArgs) === 'object') {
  1568. fromArgs.alertText = fromArgs.title;
  1569. }
  1570. }
  1571. };
  1572. var getAppBaseInfo = {
  1573. returnValue: function returnValue(result) {
  1574. var _result = result,
  1575. version = _result.version,
  1576. language = _result.language,
  1577. SDKVersion = _result.SDKVersion,
  1578. theme = _result.theme;
  1579. var _hostName = getHostName(result);
  1580. var hostLanguage = language.replace('_', '-');
  1581. result = sortObject(Object.assign(result, {
  1582. appId: "__UNI__DBC0602",
  1583. appName: "errand_app",
  1584. appVersion: "1.0.0",
  1585. appVersionCode: "100",
  1586. appLanguage: getAppLanguage(hostLanguage),
  1587. hostVersion: version,
  1588. hostLanguage: hostLanguage,
  1589. hostName: _hostName,
  1590. hostSDKVersion: SDKVersion,
  1591. hostTheme: theme
  1592. }));
  1593. }
  1594. };
  1595. var getDeviceInfo = {
  1596. returnValue: function returnValue(result) {
  1597. var _result2 = result,
  1598. brand = _result2.brand,
  1599. model = _result2.model;
  1600. var deviceType = getGetDeviceType(result, model);
  1601. var deviceBrand = getDeviceBrand(brand);
  1602. useDeviceId(result);
  1603. result = sortObject(Object.assign(result, {
  1604. deviceType: deviceType,
  1605. deviceBrand: deviceBrand,
  1606. deviceModel: model
  1607. }));
  1608. }
  1609. };
  1610. var getWindowInfo = {
  1611. returnValue: function returnValue(result) {
  1612. addSafeAreaInsets(result);
  1613. result = sortObject(Object.assign(result, {
  1614. windowTop: 0,
  1615. windowBottom: 0
  1616. }));
  1617. }
  1618. };
  1619. var getAppAuthorizeSetting = {
  1620. returnValue: function returnValue(result) {
  1621. var locationReducedAccuracy = result.locationReducedAccuracy;
  1622. result.locationAccuracy = 'unsupported';
  1623. if (locationReducedAccuracy === true) {
  1624. result.locationAccuracy = 'reduced';
  1625. } else if (locationReducedAccuracy === false) {
  1626. result.locationAccuracy = 'full';
  1627. }
  1628. }
  1629. };
  1630. // import navigateTo from 'uni-helpers/navigate-to'
  1631. var compressImage = {
  1632. args: function args(fromArgs) {
  1633. // https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
  1634. if (fromArgs.compressedHeight && !fromArgs.compressHeight) {
  1635. fromArgs.compressHeight = fromArgs.compressedHeight;
  1636. }
  1637. if (fromArgs.compressedWidth && !fromArgs.compressWidth) {
  1638. fromArgs.compressWidth = fromArgs.compressedWidth;
  1639. }
  1640. }
  1641. };
  1642. var protocols = {
  1643. redirectTo: redirectTo,
  1644. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  1645. previewImage: previewImage,
  1646. getSystemInfo: getSystemInfo,
  1647. getSystemInfoSync: getSystemInfo,
  1648. showActionSheet: showActionSheet,
  1649. getAppBaseInfo: getAppBaseInfo,
  1650. getDeviceInfo: getDeviceInfo,
  1651. getWindowInfo: getWindowInfo,
  1652. getAppAuthorizeSetting: getAppAuthorizeSetting,
  1653. compressImage: compressImage
  1654. };
  1655. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  1656. var canIUses = [];
  1657. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  1658. function processCallback(methodName, method, returnValue) {
  1659. return function (res) {
  1660. return method(processReturnValue(methodName, res, returnValue));
  1661. };
  1662. }
  1663. function processArgs(methodName, fromArgs) {
  1664. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  1665. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  1666. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  1667. if (isPlainObject(fromArgs)) {
  1668. // 一般 api 的参数解析
  1669. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  1670. if (isFn(argsOption)) {
  1671. argsOption = argsOption(fromArgs, toArgs) || {};
  1672. }
  1673. for (var key in fromArgs) {
  1674. if (hasOwn(argsOption, key)) {
  1675. var keyOption = argsOption[key];
  1676. if (isFn(keyOption)) {
  1677. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  1678. }
  1679. if (!keyOption) {
  1680. // 不支持的参数
  1681. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  1682. } else if (isStr(keyOption)) {
  1683. // 重写参数 key
  1684. toArgs[keyOption] = fromArgs[key];
  1685. } else if (isPlainObject(keyOption)) {
  1686. // {name:newName,value:value}可重新指定参数 key:value
  1687. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  1688. }
  1689. } else if (CALLBACKS.indexOf(key) !== -1) {
  1690. if (isFn(fromArgs[key])) {
  1691. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  1692. }
  1693. } else {
  1694. if (!keepFromArgs) {
  1695. toArgs[key] = fromArgs[key];
  1696. }
  1697. }
  1698. }
  1699. return toArgs;
  1700. } else if (isFn(fromArgs)) {
  1701. fromArgs = processCallback(methodName, fromArgs, returnValue);
  1702. }
  1703. return fromArgs;
  1704. }
  1705. function processReturnValue(methodName, res, returnValue) {
  1706. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  1707. if (isFn(protocols.returnValue)) {
  1708. // 处理通用 returnValue
  1709. res = protocols.returnValue(methodName, res);
  1710. }
  1711. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  1712. }
  1713. function wrapper(methodName, method) {
  1714. if (hasOwn(protocols, methodName)) {
  1715. var protocol = protocols[methodName];
  1716. if (!protocol) {
  1717. // 暂不支持的 api
  1718. return function () {
  1719. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  1720. };
  1721. }
  1722. return function (arg1, arg2) {
  1723. // 目前 api 最多两个参数
  1724. var options = protocol;
  1725. if (isFn(protocol)) {
  1726. options = protocol(arg1);
  1727. }
  1728. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  1729. var args = [arg1];
  1730. if (typeof arg2 !== 'undefined') {
  1731. args.push(arg2);
  1732. }
  1733. if (isFn(options.name)) {
  1734. methodName = options.name(arg1);
  1735. } else if (isStr(options.name)) {
  1736. methodName = options.name;
  1737. }
  1738. var returnValue = wx[methodName].apply(wx, args);
  1739. if (isSyncApi(methodName)) {
  1740. // 同步 api
  1741. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  1742. }
  1743. return returnValue;
  1744. };
  1745. }
  1746. return method;
  1747. }
  1748. var todoApis = Object.create(null);
  1749. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  1750. function createTodoApi(name) {
  1751. return function todoApi(_ref) {
  1752. var fail = _ref.fail,
  1753. complete = _ref.complete;
  1754. var res = {
  1755. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  1756. };
  1757. isFn(fail) && fail(res);
  1758. isFn(complete) && complete(res);
  1759. };
  1760. }
  1761. TODOS.forEach(function (name) {
  1762. todoApis[name] = createTodoApi(name);
  1763. });
  1764. var providers = {
  1765. oauth: ['weixin'],
  1766. share: ['weixin'],
  1767. payment: ['wxpay'],
  1768. push: ['weixin']
  1769. };
  1770. function getProvider(_ref2) {
  1771. var service = _ref2.service,
  1772. success = _ref2.success,
  1773. fail = _ref2.fail,
  1774. complete = _ref2.complete;
  1775. var res = false;
  1776. if (providers[service]) {
  1777. res = {
  1778. errMsg: 'getProvider:ok',
  1779. service: service,
  1780. provider: providers[service]
  1781. };
  1782. isFn(success) && success(res);
  1783. } else {
  1784. res = {
  1785. errMsg: 'getProvider:fail service not found'
  1786. };
  1787. isFn(fail) && fail(res);
  1788. }
  1789. isFn(complete) && complete(res);
  1790. }
  1791. var extraApi = /*#__PURE__*/Object.freeze({
  1792. __proto__: null,
  1793. getProvider: getProvider
  1794. });
  1795. var getEmitter = function () {
  1796. var Emitter;
  1797. return function getUniEmitter() {
  1798. if (!Emitter) {
  1799. Emitter = new _vue.default();
  1800. }
  1801. return Emitter;
  1802. };
  1803. }();
  1804. function apply(ctx, method, args) {
  1805. return ctx[method].apply(ctx, args);
  1806. }
  1807. function $on() {
  1808. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  1809. }
  1810. function $off() {
  1811. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  1812. }
  1813. function $once() {
  1814. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  1815. }
  1816. function $emit() {
  1817. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  1818. }
  1819. var eventApi = /*#__PURE__*/Object.freeze({
  1820. __proto__: null,
  1821. $on: $on,
  1822. $off: $off,
  1823. $once: $once,
  1824. $emit: $emit
  1825. });
  1826. /**
  1827. * 框架内 try-catch
  1828. */
  1829. /**
  1830. * 开发者 try-catch
  1831. */
  1832. function tryCatch(fn) {
  1833. return function () {
  1834. try {
  1835. return fn.apply(fn, arguments);
  1836. } catch (e) {
  1837. // TODO
  1838. console.error(e);
  1839. }
  1840. };
  1841. }
  1842. function getApiCallbacks(params) {
  1843. var apiCallbacks = {};
  1844. for (var name in params) {
  1845. var param = params[name];
  1846. if (isFn(param)) {
  1847. apiCallbacks[name] = tryCatch(param);
  1848. delete params[name];
  1849. }
  1850. }
  1851. return apiCallbacks;
  1852. }
  1853. var cid;
  1854. var cidErrMsg;
  1855. var enabled;
  1856. function normalizePushMessage(message) {
  1857. try {
  1858. return JSON.parse(message);
  1859. } catch (e) {}
  1860. return message;
  1861. }
  1862. function invokePushCallback(args) {
  1863. if (args.type === 'enabled') {
  1864. enabled = true;
  1865. } else if (args.type === 'clientId') {
  1866. cid = args.cid;
  1867. cidErrMsg = args.errMsg;
  1868. invokeGetPushCidCallbacks(cid, args.errMsg);
  1869. } else if (args.type === 'pushMsg') {
  1870. var message = {
  1871. type: 'receive',
  1872. data: normalizePushMessage(args.message)
  1873. };
  1874. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  1875. var callback = onPushMessageCallbacks[i];
  1876. callback(message);
  1877. // 该消息已被阻止
  1878. if (message.stopped) {
  1879. break;
  1880. }
  1881. }
  1882. } else if (args.type === 'click') {
  1883. onPushMessageCallbacks.forEach(function (callback) {
  1884. callback({
  1885. type: 'click',
  1886. data: normalizePushMessage(args.message)
  1887. });
  1888. });
  1889. }
  1890. }
  1891. var getPushCidCallbacks = [];
  1892. function invokeGetPushCidCallbacks(cid, errMsg) {
  1893. getPushCidCallbacks.forEach(function (callback) {
  1894. callback(cid, errMsg);
  1895. });
  1896. getPushCidCallbacks.length = 0;
  1897. }
  1898. function getPushClientId(args) {
  1899. if (!isPlainObject(args)) {
  1900. args = {};
  1901. }
  1902. var _getApiCallbacks = getApiCallbacks(args),
  1903. success = _getApiCallbacks.success,
  1904. fail = _getApiCallbacks.fail,
  1905. complete = _getApiCallbacks.complete;
  1906. var hasSuccess = isFn(success);
  1907. var hasFail = isFn(fail);
  1908. var hasComplete = isFn(complete);
  1909. Promise.resolve().then(function () {
  1910. if (typeof enabled === 'undefined') {
  1911. enabled = false;
  1912. cid = '';
  1913. cidErrMsg = 'uniPush is not enabled';
  1914. }
  1915. getPushCidCallbacks.push(function (cid, errMsg) {
  1916. var res;
  1917. if (cid) {
  1918. res = {
  1919. errMsg: 'getPushClientId:ok',
  1920. cid: cid
  1921. };
  1922. hasSuccess && success(res);
  1923. } else {
  1924. res = {
  1925. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  1926. };
  1927. hasFail && fail(res);
  1928. }
  1929. hasComplete && complete(res);
  1930. });
  1931. if (typeof cid !== 'undefined') {
  1932. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1933. }
  1934. });
  1935. }
  1936. var onPushMessageCallbacks = [];
  1937. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1938. var onPushMessage = function onPushMessage(fn) {
  1939. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1940. onPushMessageCallbacks.push(fn);
  1941. }
  1942. };
  1943. var offPushMessage = function offPushMessage(fn) {
  1944. if (!fn) {
  1945. onPushMessageCallbacks.length = 0;
  1946. } else {
  1947. var index = onPushMessageCallbacks.indexOf(fn);
  1948. if (index > -1) {
  1949. onPushMessageCallbacks.splice(index, 1);
  1950. }
  1951. }
  1952. };
  1953. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  1954. if (!baseInfo) {
  1955. baseInfo = wx.getSystemInfoSync();
  1956. }
  1957. var host = baseInfo ? baseInfo.host : null;
  1958. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  1959. var api = /*#__PURE__*/Object.freeze({
  1960. __proto__: null,
  1961. shareVideoMessage: shareVideoMessage,
  1962. getPushClientId: getPushClientId,
  1963. onPushMessage: onPushMessage,
  1964. offPushMessage: offPushMessage,
  1965. invokePushCallback: invokePushCallback
  1966. });
  1967. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1968. function findVmByVueId(vm, vuePid) {
  1969. var $children = vm.$children;
  1970. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1971. for (var i = $children.length - 1; i >= 0; i--) {
  1972. var childVm = $children[i];
  1973. if (childVm.$scope._$vueId === vuePid) {
  1974. return childVm;
  1975. }
  1976. }
  1977. // 反向递归查找
  1978. var parentVm;
  1979. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1980. parentVm = findVmByVueId($children[_i], vuePid);
  1981. if (parentVm) {
  1982. return parentVm;
  1983. }
  1984. }
  1985. }
  1986. function initBehavior(options) {
  1987. return Behavior(options);
  1988. }
  1989. function isPage() {
  1990. return !!this.route;
  1991. }
  1992. function initRelation(detail) {
  1993. this.triggerEvent('__l', detail);
  1994. }
  1995. function selectAllComponents(mpInstance, selector, $refs) {
  1996. var components = mpInstance.selectAllComponents(selector) || [];
  1997. components.forEach(function (component) {
  1998. var ref = component.dataset.ref;
  1999. $refs[ref] = component.$vm || toSkip(component);
  2000. {
  2001. if (component.dataset.vueGeneric === 'scoped') {
  2002. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  2003. selectAllComponents(scopedComponent, selector, $refs);
  2004. });
  2005. }
  2006. }
  2007. });
  2008. }
  2009. function syncRefs(refs, newRefs) {
  2010. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  2011. var newKeys = Object.keys(newRefs);
  2012. newKeys.forEach(function (key) {
  2013. var oldValue = refs[key];
  2014. var newValue = newRefs[key];
  2015. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  2016. return oldValue.includes(value);
  2017. })) {
  2018. return;
  2019. }
  2020. refs[key] = newValue;
  2021. oldKeys.delete(key);
  2022. });
  2023. oldKeys.forEach(function (key) {
  2024. delete refs[key];
  2025. });
  2026. return refs;
  2027. }
  2028. function initRefs(vm) {
  2029. var mpInstance = vm.$scope;
  2030. var refs = {};
  2031. Object.defineProperty(vm, '$refs', {
  2032. get: function get() {
  2033. var $refs = {};
  2034. selectAllComponents(mpInstance, '.vue-ref', $refs);
  2035. // TODO 暂不考虑 for 中的 scoped
  2036. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  2037. forComponents.forEach(function (component) {
  2038. var ref = component.dataset.ref;
  2039. if (!$refs[ref]) {
  2040. $refs[ref] = [];
  2041. }
  2042. $refs[ref].push(component.$vm || toSkip(component));
  2043. });
  2044. return syncRefs(refs, $refs);
  2045. }
  2046. });
  2047. }
  2048. function handleLink(event) {
  2049. var _ref3 = event.detail || event.value,
  2050. vuePid = _ref3.vuePid,
  2051. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  2052. var parentVm;
  2053. if (vuePid) {
  2054. parentVm = findVmByVueId(this.$vm, vuePid);
  2055. }
  2056. if (!parentVm) {
  2057. parentVm = this.$vm;
  2058. }
  2059. vueOptions.parent = parentVm;
  2060. }
  2061. function markMPComponent(component) {
  2062. // 在 Vue 中标记为小程序组件
  2063. var IS_MP = '__v_isMPComponent';
  2064. Object.defineProperty(component, IS_MP, {
  2065. configurable: true,
  2066. enumerable: false,
  2067. value: true
  2068. });
  2069. return component;
  2070. }
  2071. function toSkip(obj) {
  2072. var OB = '__ob__';
  2073. var SKIP = '__v_skip';
  2074. if (isObject(obj) && Object.isExtensible(obj)) {
  2075. // 避免被 @vue/composition-api 观测
  2076. Object.defineProperty(obj, OB, {
  2077. configurable: true,
  2078. enumerable: false,
  2079. value: (0, _defineProperty2.default)({}, SKIP, true)
  2080. });
  2081. }
  2082. return obj;
  2083. }
  2084. var WORKLET_RE = /_(.*)_worklet_factory_/;
  2085. function initWorkletMethods(mpMethods, vueMethods) {
  2086. if (vueMethods) {
  2087. Object.keys(vueMethods).forEach(function (name) {
  2088. var matches = name.match(WORKLET_RE);
  2089. if (matches) {
  2090. var workletName = matches[1];
  2091. mpMethods[name] = vueMethods[name];
  2092. mpMethods[workletName] = vueMethods[workletName];
  2093. }
  2094. });
  2095. }
  2096. }
  2097. var MPPage = Page;
  2098. var MPComponent = Component;
  2099. var customizeRE = /:/g;
  2100. var customize = cached(function (str) {
  2101. return camelize(str.replace(customizeRE, '-'));
  2102. });
  2103. function initTriggerEvent(mpInstance) {
  2104. var oldTriggerEvent = mpInstance.triggerEvent;
  2105. var newTriggerEvent = function newTriggerEvent(event) {
  2106. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  2107. args[_key3 - 1] = arguments[_key3];
  2108. }
  2109. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  2110. if (this.$vm || this.dataset && this.dataset.comType) {
  2111. event = customize(event);
  2112. } else {
  2113. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  2114. var newEvent = customize(event);
  2115. if (newEvent !== event) {
  2116. oldTriggerEvent.apply(this, [newEvent].concat(args));
  2117. }
  2118. }
  2119. return oldTriggerEvent.apply(this, [event].concat(args));
  2120. };
  2121. try {
  2122. // 京东小程序 triggerEvent 为只读
  2123. mpInstance.triggerEvent = newTriggerEvent;
  2124. } catch (error) {
  2125. mpInstance._triggerEvent = newTriggerEvent;
  2126. }
  2127. }
  2128. function initHook(name, options, isComponent) {
  2129. var oldHook = options[name];
  2130. options[name] = function () {
  2131. markMPComponent(this);
  2132. initTriggerEvent(this);
  2133. if (oldHook) {
  2134. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  2135. args[_key4] = arguments[_key4];
  2136. }
  2137. return oldHook.apply(this, args);
  2138. }
  2139. };
  2140. }
  2141. if (!MPPage.__$wrappered) {
  2142. MPPage.__$wrappered = true;
  2143. Page = function Page() {
  2144. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2145. initHook('onLoad', options);
  2146. return MPPage(options);
  2147. };
  2148. Page.after = MPPage.after;
  2149. Component = function Component() {
  2150. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2151. initHook('created', options);
  2152. return MPComponent(options);
  2153. };
  2154. }
  2155. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  2156. function initMocks(vm, mocks) {
  2157. var mpInstance = vm.$mp[vm.mpType];
  2158. mocks.forEach(function (mock) {
  2159. if (hasOwn(mpInstance, mock)) {
  2160. vm[mock] = mpInstance[mock];
  2161. }
  2162. });
  2163. }
  2164. function hasHook(hook, vueOptions) {
  2165. if (!vueOptions) {
  2166. return true;
  2167. }
  2168. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  2169. return true;
  2170. }
  2171. vueOptions = vueOptions.default || vueOptions;
  2172. if (isFn(vueOptions)) {
  2173. if (isFn(vueOptions.extendOptions[hook])) {
  2174. return true;
  2175. }
  2176. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  2177. return true;
  2178. }
  2179. return false;
  2180. }
  2181. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  2182. return true;
  2183. }
  2184. var mixins = vueOptions.mixins;
  2185. if (Array.isArray(mixins)) {
  2186. return !!mixins.find(function (mixin) {
  2187. return hasHook(hook, mixin);
  2188. });
  2189. }
  2190. }
  2191. function initHooks(mpOptions, hooks, vueOptions) {
  2192. hooks.forEach(function (hook) {
  2193. if (hasHook(hook, vueOptions)) {
  2194. mpOptions[hook] = function (args) {
  2195. return this.$vm && this.$vm.__call_hook(hook, args);
  2196. };
  2197. }
  2198. });
  2199. }
  2200. function initUnknownHooks(mpOptions, vueOptions) {
  2201. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2202. findHooks(vueOptions).forEach(function (hook) {
  2203. return initHook$1(mpOptions, hook, excludes);
  2204. });
  2205. }
  2206. function findHooks(vueOptions) {
  2207. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  2208. if (vueOptions) {
  2209. Object.keys(vueOptions).forEach(function (name) {
  2210. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  2211. hooks.push(name);
  2212. }
  2213. });
  2214. }
  2215. return hooks;
  2216. }
  2217. function initHook$1(mpOptions, hook, excludes) {
  2218. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  2219. mpOptions[hook] = function (args) {
  2220. return this.$vm && this.$vm.__call_hook(hook, args);
  2221. };
  2222. }
  2223. }
  2224. function initVueComponent(Vue, vueOptions) {
  2225. vueOptions = vueOptions.default || vueOptions;
  2226. var VueComponent;
  2227. if (isFn(vueOptions)) {
  2228. VueComponent = vueOptions;
  2229. } else {
  2230. VueComponent = Vue.extend(vueOptions);
  2231. }
  2232. vueOptions = VueComponent.options;
  2233. return [VueComponent, vueOptions];
  2234. }
  2235. function initSlots(vm, vueSlots) {
  2236. if (Array.isArray(vueSlots) && vueSlots.length) {
  2237. var $slots = Object.create(null);
  2238. vueSlots.forEach(function (slotName) {
  2239. $slots[slotName] = true;
  2240. });
  2241. vm.$scopedSlots = vm.$slots = $slots;
  2242. }
  2243. }
  2244. function initVueIds(vueIds, mpInstance) {
  2245. vueIds = (vueIds || '').split(',');
  2246. var len = vueIds.length;
  2247. if (len === 1) {
  2248. mpInstance._$vueId = vueIds[0];
  2249. } else if (len === 2) {
  2250. mpInstance._$vueId = vueIds[0];
  2251. mpInstance._$vuePid = vueIds[1];
  2252. }
  2253. }
  2254. function initData(vueOptions, context) {
  2255. var data = vueOptions.data || {};
  2256. var methods = vueOptions.methods || {};
  2257. if (typeof data === 'function') {
  2258. try {
  2259. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  2260. } catch (e) {
  2261. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"errand_app","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  2262. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  2263. }
  2264. }
  2265. } else {
  2266. try {
  2267. // 对 data 格式化
  2268. data = JSON.parse(JSON.stringify(data));
  2269. } catch (e) {}
  2270. }
  2271. if (!isPlainObject(data)) {
  2272. data = {};
  2273. }
  2274. Object.keys(methods).forEach(function (methodName) {
  2275. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  2276. data[methodName] = methods[methodName];
  2277. }
  2278. });
  2279. return data;
  2280. }
  2281. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  2282. function createObserver(name) {
  2283. return function observer(newVal, oldVal) {
  2284. if (this.$vm) {
  2285. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  2286. }
  2287. };
  2288. }
  2289. function initBehaviors(vueOptions, initBehavior) {
  2290. var vueBehaviors = vueOptions.behaviors;
  2291. var vueExtends = vueOptions.extends;
  2292. var vueMixins = vueOptions.mixins;
  2293. var vueProps = vueOptions.props;
  2294. if (!vueProps) {
  2295. vueOptions.props = vueProps = [];
  2296. }
  2297. var behaviors = [];
  2298. if (Array.isArray(vueBehaviors)) {
  2299. vueBehaviors.forEach(function (behavior) {
  2300. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  2301. if (behavior === 'uni://form-field') {
  2302. if (Array.isArray(vueProps)) {
  2303. vueProps.push('name');
  2304. vueProps.push('value');
  2305. } else {
  2306. vueProps.name = {
  2307. type: String,
  2308. default: ''
  2309. };
  2310. vueProps.value = {
  2311. type: [String, Number, Boolean, Array, Object, Date],
  2312. default: ''
  2313. };
  2314. }
  2315. }
  2316. });
  2317. }
  2318. if (isPlainObject(vueExtends) && vueExtends.props) {
  2319. behaviors.push(initBehavior({
  2320. properties: initProperties(vueExtends.props, true)
  2321. }));
  2322. }
  2323. if (Array.isArray(vueMixins)) {
  2324. vueMixins.forEach(function (vueMixin) {
  2325. if (isPlainObject(vueMixin) && vueMixin.props) {
  2326. behaviors.push(initBehavior({
  2327. properties: initProperties(vueMixin.props, true)
  2328. }));
  2329. }
  2330. });
  2331. }
  2332. return behaviors;
  2333. }
  2334. function parsePropType(key, type, defaultValue, file) {
  2335. // [String]=>String
  2336. if (Array.isArray(type) && type.length === 1) {
  2337. return type[0];
  2338. }
  2339. return type;
  2340. }
  2341. function initProperties(props) {
  2342. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  2343. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  2344. var options = arguments.length > 3 ? arguments[3] : undefined;
  2345. var properties = {};
  2346. if (!isBehavior) {
  2347. properties.vueId = {
  2348. type: String,
  2349. value: ''
  2350. };
  2351. {
  2352. if (options.virtualHost) {
  2353. properties.virtualHostStyle = {
  2354. type: null,
  2355. value: ''
  2356. };
  2357. properties.virtualHostClass = {
  2358. type: null,
  2359. value: ''
  2360. };
  2361. }
  2362. }
  2363. // scopedSlotsCompiler auto
  2364. properties.scopedSlotsCompiler = {
  2365. type: String,
  2366. value: ''
  2367. };
  2368. properties.vueSlots = {
  2369. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  2370. type: null,
  2371. value: [],
  2372. observer: function observer(newVal, oldVal) {
  2373. var $slots = Object.create(null);
  2374. newVal.forEach(function (slotName) {
  2375. $slots[slotName] = true;
  2376. });
  2377. this.setData({
  2378. $slots: $slots
  2379. });
  2380. }
  2381. };
  2382. }
  2383. if (Array.isArray(props)) {
  2384. // ['title']
  2385. props.forEach(function (key) {
  2386. properties[key] = {
  2387. type: null,
  2388. observer: createObserver(key)
  2389. };
  2390. });
  2391. } else if (isPlainObject(props)) {
  2392. // {title:{type:String,default:''},content:String}
  2393. Object.keys(props).forEach(function (key) {
  2394. var opts = props[key];
  2395. if (isPlainObject(opts)) {
  2396. // title:{type:String,default:''}
  2397. var value = opts.default;
  2398. if (isFn(value)) {
  2399. value = value();
  2400. }
  2401. opts.type = parsePropType(key, opts.type);
  2402. properties[key] = {
  2403. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  2404. value: value,
  2405. observer: createObserver(key)
  2406. };
  2407. } else {
  2408. // content:String
  2409. var type = parsePropType(key, opts);
  2410. properties[key] = {
  2411. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  2412. observer: createObserver(key)
  2413. };
  2414. }
  2415. });
  2416. }
  2417. return properties;
  2418. }
  2419. function wrapper$1(event) {
  2420. // TODO 又得兼容 mpvue 的 mp 对象
  2421. try {
  2422. event.mp = JSON.parse(JSON.stringify(event));
  2423. } catch (e) {}
  2424. event.stopPropagation = noop;
  2425. event.preventDefault = noop;
  2426. event.target = event.target || {};
  2427. if (!hasOwn(event, 'detail')) {
  2428. event.detail = {};
  2429. }
  2430. if (hasOwn(event, 'markerId')) {
  2431. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  2432. event.detail.markerId = event.markerId;
  2433. }
  2434. if (isPlainObject(event.detail)) {
  2435. event.target = Object.assign({}, event.target, event.detail);
  2436. }
  2437. return event;
  2438. }
  2439. function getExtraValue(vm, dataPathsArray) {
  2440. var context = vm;
  2441. dataPathsArray.forEach(function (dataPathArray) {
  2442. var dataPath = dataPathArray[0];
  2443. var value = dataPathArray[2];
  2444. if (dataPath || typeof value !== 'undefined') {
  2445. // ['','',index,'disable']
  2446. var propPath = dataPathArray[1];
  2447. var valuePath = dataPathArray[3];
  2448. var vFor;
  2449. if (Number.isInteger(dataPath)) {
  2450. vFor = dataPath;
  2451. } else if (!dataPath) {
  2452. vFor = context;
  2453. } else if (typeof dataPath === 'string' && dataPath) {
  2454. if (dataPath.indexOf('#s#') === 0) {
  2455. vFor = dataPath.substr(3);
  2456. } else {
  2457. vFor = vm.__get_value(dataPath, context);
  2458. }
  2459. }
  2460. if (Number.isInteger(vFor)) {
  2461. context = value;
  2462. } else if (!propPath) {
  2463. context = vFor[value];
  2464. } else {
  2465. if (Array.isArray(vFor)) {
  2466. context = vFor.find(function (vForItem) {
  2467. return vm.__get_value(propPath, vForItem) === value;
  2468. });
  2469. } else if (isPlainObject(vFor)) {
  2470. context = Object.keys(vFor).find(function (vForKey) {
  2471. return vm.__get_value(propPath, vFor[vForKey]) === value;
  2472. });
  2473. } else {
  2474. console.error('v-for 暂不支持循环数据:', vFor);
  2475. }
  2476. }
  2477. if (valuePath) {
  2478. context = vm.__get_value(valuePath, context);
  2479. }
  2480. }
  2481. });
  2482. return context;
  2483. }
  2484. function processEventExtra(vm, extra, event, __args__) {
  2485. var extraObj = {};
  2486. if (Array.isArray(extra) && extra.length) {
  2487. /**
  2488. *[
  2489. * ['data.items', 'data.id', item.data.id],
  2490. * ['metas', 'id', meta.id]
  2491. *],
  2492. *[
  2493. * ['data.items', 'data.id', item.data.id],
  2494. * ['metas', 'id', meta.id]
  2495. *],
  2496. *'test'
  2497. */
  2498. extra.forEach(function (dataPath, index) {
  2499. if (typeof dataPath === 'string') {
  2500. if (!dataPath) {
  2501. // model,prop.sync
  2502. extraObj['$' + index] = vm;
  2503. } else {
  2504. if (dataPath === '$event') {
  2505. // $event
  2506. extraObj['$' + index] = event;
  2507. } else if (dataPath === 'arguments') {
  2508. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  2509. } else if (dataPath.indexOf('$event.') === 0) {
  2510. // $event.target.value
  2511. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  2512. } else {
  2513. extraObj['$' + index] = vm.__get_value(dataPath);
  2514. }
  2515. }
  2516. } else {
  2517. extraObj['$' + index] = getExtraValue(vm, dataPath);
  2518. }
  2519. });
  2520. }
  2521. return extraObj;
  2522. }
  2523. function getObjByArray(arr) {
  2524. var obj = {};
  2525. for (var i = 1; i < arr.length; i++) {
  2526. var element = arr[i];
  2527. obj[element[0]] = element[1];
  2528. }
  2529. return obj;
  2530. }
  2531. function processEventArgs(vm, event) {
  2532. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2533. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  2534. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  2535. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  2536. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  2537. // fixed 用户直接触发 mpInstance.triggerEvent
  2538. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  2539. if (isCustom) {
  2540. // 自定义事件
  2541. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  2542. if (!args.length) {
  2543. // 无参数,直接传入 event 或 detail 数组
  2544. if (isCustomMPEvent) {
  2545. return [event];
  2546. }
  2547. return __args__;
  2548. }
  2549. }
  2550. var extraObj = processEventExtra(vm, extra, event, __args__);
  2551. var ret = [];
  2552. args.forEach(function (arg) {
  2553. if (arg === '$event') {
  2554. if (methodName === '__set_model' && !isCustom) {
  2555. // input v-model value
  2556. ret.push(event.target.value);
  2557. } else {
  2558. if (isCustom && !isCustomMPEvent) {
  2559. ret.push(__args__[0]);
  2560. } else {
  2561. // wxcomponent 组件或内置组件
  2562. ret.push(event);
  2563. }
  2564. }
  2565. } else {
  2566. if (Array.isArray(arg) && arg[0] === 'o') {
  2567. ret.push(getObjByArray(arg));
  2568. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  2569. ret.push(extraObj[arg]);
  2570. } else {
  2571. ret.push(arg);
  2572. }
  2573. }
  2574. });
  2575. return ret;
  2576. }
  2577. var ONCE = '~';
  2578. var CUSTOM = '^';
  2579. function isMatchEventType(eventType, optType) {
  2580. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  2581. }
  2582. function getContextVm(vm) {
  2583. var $parent = vm.$parent;
  2584. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  2585. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  2586. $parent = $parent.$parent;
  2587. }
  2588. return $parent && $parent.$parent;
  2589. }
  2590. function handleEvent(event) {
  2591. var _this2 = this;
  2592. event = wrapper$1(event);
  2593. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  2594. var dataset = (event.currentTarget || event.target).dataset;
  2595. if (!dataset) {
  2596. return console.warn('事件信息不存在');
  2597. }
  2598. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  2599. if (!eventOpts) {
  2600. return console.warn('事件信息不存在');
  2601. }
  2602. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  2603. var eventType = event.type;
  2604. var ret = [];
  2605. eventOpts.forEach(function (eventOpt) {
  2606. var type = eventOpt[0];
  2607. var eventsArray = eventOpt[1];
  2608. var isCustom = type.charAt(0) === CUSTOM;
  2609. type = isCustom ? type.slice(1) : type;
  2610. var isOnce = type.charAt(0) === ONCE;
  2611. type = isOnce ? type.slice(1) : type;
  2612. if (eventsArray && isMatchEventType(eventType, type)) {
  2613. eventsArray.forEach(function (eventArray) {
  2614. var methodName = eventArray[0];
  2615. if (methodName) {
  2616. var handlerCtx = _this2.$vm;
  2617. if (handlerCtx.$options.generic) {
  2618. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  2619. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  2620. }
  2621. if (methodName === '$emit') {
  2622. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  2623. return;
  2624. }
  2625. var handler = handlerCtx[methodName];
  2626. if (!isFn(handler)) {
  2627. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  2628. var path = _this2.route || _this2.is;
  2629. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  2630. }
  2631. if (isOnce) {
  2632. if (handler.once) {
  2633. return;
  2634. }
  2635. handler.once = true;
  2636. }
  2637. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  2638. params = Array.isArray(params) ? params : [];
  2639. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  2640. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  2641. // eslint-disable-next-line no-sparse-arrays
  2642. params = params.concat([,,,,,,,,,, event]);
  2643. }
  2644. ret.push(handler.apply(handlerCtx, params));
  2645. }
  2646. });
  2647. }
  2648. });
  2649. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  2650. return ret[0];
  2651. }
  2652. }
  2653. var eventChannels = {};
  2654. function getEventChannel(id) {
  2655. var eventChannel = eventChannels[id];
  2656. delete eventChannels[id];
  2657. return eventChannel;
  2658. }
  2659. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  2660. function initEventChannel() {
  2661. _vue.default.prototype.getOpenerEventChannel = function () {
  2662. // 微信小程序使用自身getOpenerEventChannel
  2663. {
  2664. return this.$scope.getOpenerEventChannel();
  2665. }
  2666. };
  2667. var callHook = _vue.default.prototype.__call_hook;
  2668. _vue.default.prototype.__call_hook = function (hook, args) {
  2669. if (hook === 'onLoad' && args && args.__id__) {
  2670. this.__eventChannel__ = getEventChannel(args.__id__);
  2671. delete args.__id__;
  2672. }
  2673. return callHook.call(this, hook, args);
  2674. };
  2675. }
  2676. function initScopedSlotsParams() {
  2677. var center = {};
  2678. var parents = {};
  2679. function currentId(fn) {
  2680. var vueIds = this.$options.propsData.vueId;
  2681. if (vueIds) {
  2682. var vueId = vueIds.split(',')[0];
  2683. fn(vueId);
  2684. }
  2685. }
  2686. _vue.default.prototype.$hasSSP = function (vueId) {
  2687. var slot = center[vueId];
  2688. if (!slot) {
  2689. parents[vueId] = this;
  2690. this.$on('hook:destroyed', function () {
  2691. delete parents[vueId];
  2692. });
  2693. }
  2694. return slot;
  2695. };
  2696. _vue.default.prototype.$getSSP = function (vueId, name, needAll) {
  2697. var slot = center[vueId];
  2698. if (slot) {
  2699. var params = slot[name] || [];
  2700. if (needAll) {
  2701. return params;
  2702. }
  2703. return params[0];
  2704. }
  2705. };
  2706. _vue.default.prototype.$setSSP = function (name, value) {
  2707. var index = 0;
  2708. currentId.call(this, function (vueId) {
  2709. var slot = center[vueId];
  2710. var params = slot[name] = slot[name] || [];
  2711. params.push(value);
  2712. index = params.length - 1;
  2713. });
  2714. return index;
  2715. };
  2716. _vue.default.prototype.$initSSP = function () {
  2717. currentId.call(this, function (vueId) {
  2718. center[vueId] = {};
  2719. });
  2720. };
  2721. _vue.default.prototype.$callSSP = function () {
  2722. currentId.call(this, function (vueId) {
  2723. if (parents[vueId]) {
  2724. parents[vueId].$forceUpdate();
  2725. }
  2726. });
  2727. };
  2728. _vue.default.mixin({
  2729. destroyed: function destroyed() {
  2730. var propsData = this.$options.propsData;
  2731. var vueId = propsData && propsData.vueId;
  2732. if (vueId) {
  2733. delete center[vueId];
  2734. delete parents[vueId];
  2735. }
  2736. }
  2737. });
  2738. }
  2739. function parseBaseApp(vm, _ref4) {
  2740. var mocks = _ref4.mocks,
  2741. initRefs = _ref4.initRefs;
  2742. initEventChannel();
  2743. {
  2744. initScopedSlotsParams();
  2745. }
  2746. if (vm.$options.store) {
  2747. _vue.default.prototype.$store = vm.$options.store;
  2748. }
  2749. uniIdMixin(_vue.default);
  2750. _vue.default.prototype.mpHost = "mp-weixin";
  2751. _vue.default.mixin({
  2752. beforeCreate: function beforeCreate() {
  2753. if (!this.$options.mpType) {
  2754. return;
  2755. }
  2756. this.mpType = this.$options.mpType;
  2757. this.$mp = (0, _defineProperty2.default)({
  2758. data: {}
  2759. }, this.mpType, this.$options.mpInstance);
  2760. this.$scope = this.$options.mpInstance;
  2761. delete this.$options.mpType;
  2762. delete this.$options.mpInstance;
  2763. if (this.mpType === 'page' && typeof getApp === 'function') {
  2764. // hack vue-i18n
  2765. var app = getApp();
  2766. if (app.$vm && app.$vm.$i18n) {
  2767. this._i18n = app.$vm.$i18n;
  2768. }
  2769. }
  2770. if (this.mpType !== 'app') {
  2771. initRefs(this);
  2772. initMocks(this, mocks);
  2773. }
  2774. }
  2775. });
  2776. var appOptions = {
  2777. onLaunch: function onLaunch(args) {
  2778. if (this.$vm) {
  2779. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  2780. return;
  2781. }
  2782. {
  2783. if (wx.canIUse && !wx.canIUse('nextTick')) {
  2784. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  2785. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  2786. }
  2787. }
  2788. this.$vm = vm;
  2789. this.$vm.$mp = {
  2790. app: this
  2791. };
  2792. this.$vm.$scope = this;
  2793. // vm 上也挂载 globalData
  2794. this.$vm.globalData = this.globalData;
  2795. this.$vm._isMounted = true;
  2796. this.$vm.__call_hook('mounted', args);
  2797. this.$vm.__call_hook('onLaunch', args);
  2798. }
  2799. };
  2800. // 兼容旧版本 globalData
  2801. appOptions.globalData = vm.$options.globalData || {};
  2802. // 将 methods 中的方法挂在 getApp() 中
  2803. var methods = vm.$options.methods;
  2804. if (methods) {
  2805. Object.keys(methods).forEach(function (name) {
  2806. appOptions[name] = methods[name];
  2807. });
  2808. }
  2809. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  2810. initHooks(appOptions, hooks);
  2811. initUnknownHooks(appOptions, vm.$options);
  2812. return appOptions;
  2813. }
  2814. function parseApp(vm) {
  2815. return parseBaseApp(vm, {
  2816. mocks: mocks,
  2817. initRefs: initRefs
  2818. });
  2819. }
  2820. function createApp(vm) {
  2821. App(parseApp(vm));
  2822. return vm;
  2823. }
  2824. var encodeReserveRE = /[!'()*]/g;
  2825. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  2826. return '%' + c.charCodeAt(0).toString(16);
  2827. };
  2828. var commaRE = /%2C/g;
  2829. // fixed encodeURIComponent which is more conformant to RFC3986:
  2830. // - escapes [!'()*]
  2831. // - preserve commas
  2832. var encode = function encode(str) {
  2833. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  2834. };
  2835. function stringifyQuery(obj) {
  2836. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  2837. var res = obj ? Object.keys(obj).map(function (key) {
  2838. var val = obj[key];
  2839. if (val === undefined) {
  2840. return '';
  2841. }
  2842. if (val === null) {
  2843. return encodeStr(key);
  2844. }
  2845. if (Array.isArray(val)) {
  2846. var result = [];
  2847. val.forEach(function (val2) {
  2848. if (val2 === undefined) {
  2849. return;
  2850. }
  2851. if (val2 === null) {
  2852. result.push(encodeStr(key));
  2853. } else {
  2854. result.push(encodeStr(key) + '=' + encodeStr(val2));
  2855. }
  2856. });
  2857. return result.join('&');
  2858. }
  2859. return encodeStr(key) + '=' + encodeStr(val);
  2860. }).filter(function (x) {
  2861. return x.length > 0;
  2862. }).join('&') : null;
  2863. return res ? "?".concat(res) : '';
  2864. }
  2865. function parseBaseComponent(vueComponentOptions) {
  2866. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  2867. isPage = _ref5.isPage,
  2868. initRelation = _ref5.initRelation;
  2869. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  2870. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  2871. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  2872. VueComponent = _initVueComponent2[0],
  2873. vueOptions = _initVueComponent2[1];
  2874. var options = _objectSpread({
  2875. multipleSlots: true,
  2876. // styleIsolation: 'apply-shared',
  2877. addGlobalClass: true
  2878. }, vueOptions.options || {});
  2879. {
  2880. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  2881. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  2882. Object.assign(options, vueOptions['mp-weixin'].options);
  2883. }
  2884. }
  2885. var componentOptions = {
  2886. options: options,
  2887. data: initData(vueOptions, _vue.default.prototype),
  2888. behaviors: initBehaviors(vueOptions, initBehavior),
  2889. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  2890. lifetimes: {
  2891. attached: function attached() {
  2892. var properties = this.properties;
  2893. var options = {
  2894. mpType: isPage.call(this) ? 'page' : 'component',
  2895. mpInstance: this,
  2896. propsData: properties
  2897. };
  2898. initVueIds(properties.vueId, this);
  2899. // 处理父子关系
  2900. initRelation.call(this, {
  2901. vuePid: this._$vuePid,
  2902. vueOptions: options
  2903. });
  2904. // 初始化 vue 实例
  2905. this.$vm = new VueComponent(options);
  2906. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  2907. initSlots(this.$vm, properties.vueSlots);
  2908. // 触发首次 setData
  2909. this.$vm.$mount();
  2910. },
  2911. ready: function ready() {
  2912. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  2913. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  2914. if (this.$vm) {
  2915. this.$vm._isMounted = true;
  2916. this.$vm.__call_hook('mounted');
  2917. this.$vm.__call_hook('onReady');
  2918. }
  2919. },
  2920. detached: function detached() {
  2921. this.$vm && this.$vm.$destroy();
  2922. }
  2923. },
  2924. pageLifetimes: {
  2925. show: function show(args) {
  2926. this.$vm && this.$vm.__call_hook('onPageShow', args);
  2927. },
  2928. hide: function hide() {
  2929. this.$vm && this.$vm.__call_hook('onPageHide');
  2930. },
  2931. resize: function resize(size) {
  2932. this.$vm && this.$vm.__call_hook('onPageResize', size);
  2933. }
  2934. },
  2935. methods: {
  2936. __l: handleLink,
  2937. __e: handleEvent
  2938. }
  2939. };
  2940. // externalClasses
  2941. if (vueOptions.externalClasses) {
  2942. componentOptions.externalClasses = vueOptions.externalClasses;
  2943. }
  2944. if (Array.isArray(vueOptions.wxsCallMethods)) {
  2945. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  2946. componentOptions.methods[callMethod] = function (args) {
  2947. return this.$vm[callMethod](args);
  2948. };
  2949. });
  2950. }
  2951. if (needVueOptions) {
  2952. return [componentOptions, vueOptions, VueComponent];
  2953. }
  2954. if (isPage) {
  2955. return componentOptions;
  2956. }
  2957. return [componentOptions, VueComponent];
  2958. }
  2959. function parseComponent(vueComponentOptions, needVueOptions) {
  2960. return parseBaseComponent(vueComponentOptions, {
  2961. isPage: isPage,
  2962. initRelation: initRelation
  2963. }, needVueOptions);
  2964. }
  2965. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  2966. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  2967. function parseBasePage(vuePageOptions) {
  2968. var _parseComponent = parseComponent(vuePageOptions, true),
  2969. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  2970. pageOptions = _parseComponent2[0],
  2971. vueOptions = _parseComponent2[1];
  2972. initHooks(pageOptions.methods, hooks$1, vueOptions);
  2973. pageOptions.methods.onLoad = function (query) {
  2974. this.options = query;
  2975. var copyQuery = Object.assign({}, query);
  2976. delete copyQuery.__id__;
  2977. this.$page = {
  2978. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  2979. };
  2980. this.$vm.$mp.query = query; // 兼容 mpvue
  2981. this.$vm.__call_hook('onLoad', query);
  2982. };
  2983. {
  2984. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  2985. }
  2986. {
  2987. initWorkletMethods(pageOptions.methods, vueOptions.methods);
  2988. }
  2989. return pageOptions;
  2990. }
  2991. function parsePage(vuePageOptions) {
  2992. return parseBasePage(vuePageOptions);
  2993. }
  2994. function createPage(vuePageOptions) {
  2995. {
  2996. return Component(parsePage(vuePageOptions));
  2997. }
  2998. }
  2999. function createComponent(vueOptions) {
  3000. {
  3001. return Component(parseComponent(vueOptions));
  3002. }
  3003. }
  3004. function createSubpackageApp(vm) {
  3005. var appOptions = parseApp(vm);
  3006. var app = getApp({
  3007. allowDefault: true
  3008. });
  3009. vm.$scope = app;
  3010. var globalData = app.globalData;
  3011. if (globalData) {
  3012. Object.keys(appOptions.globalData).forEach(function (name) {
  3013. if (!hasOwn(globalData, name)) {
  3014. globalData[name] = appOptions.globalData[name];
  3015. }
  3016. });
  3017. }
  3018. Object.keys(appOptions).forEach(function (name) {
  3019. if (!hasOwn(app, name)) {
  3020. app[name] = appOptions[name];
  3021. }
  3022. });
  3023. if (isFn(appOptions.onShow) && wx.onAppShow) {
  3024. wx.onAppShow(function () {
  3025. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  3026. args[_key5] = arguments[_key5];
  3027. }
  3028. vm.__call_hook('onShow', args);
  3029. });
  3030. }
  3031. if (isFn(appOptions.onHide) && wx.onAppHide) {
  3032. wx.onAppHide(function () {
  3033. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  3034. args[_key6] = arguments[_key6];
  3035. }
  3036. vm.__call_hook('onHide', args);
  3037. });
  3038. }
  3039. if (isFn(appOptions.onLaunch)) {
  3040. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  3041. vm.__call_hook('onLaunch', args);
  3042. }
  3043. return vm;
  3044. }
  3045. function createPlugin(vm) {
  3046. var appOptions = parseApp(vm);
  3047. if (isFn(appOptions.onShow) && wx.onAppShow) {
  3048. wx.onAppShow(function () {
  3049. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  3050. args[_key7] = arguments[_key7];
  3051. }
  3052. vm.__call_hook('onShow', args);
  3053. });
  3054. }
  3055. if (isFn(appOptions.onHide) && wx.onAppHide) {
  3056. wx.onAppHide(function () {
  3057. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  3058. args[_key8] = arguments[_key8];
  3059. }
  3060. vm.__call_hook('onHide', args);
  3061. });
  3062. }
  3063. if (isFn(appOptions.onLaunch)) {
  3064. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  3065. vm.__call_hook('onLaunch', args);
  3066. }
  3067. return vm;
  3068. }
  3069. todos.forEach(function (todoApi) {
  3070. protocols[todoApi] = false;
  3071. });
  3072. canIUses.forEach(function (canIUseApi) {
  3073. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  3074. if (!wx.canIUse(apiName)) {
  3075. protocols[canIUseApi] = false;
  3076. }
  3077. });
  3078. var uni = {};
  3079. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  3080. uni = new Proxy({}, {
  3081. get: function get(target, name) {
  3082. if (hasOwn(target, name)) {
  3083. return target[name];
  3084. }
  3085. if (baseApi[name]) {
  3086. return baseApi[name];
  3087. }
  3088. if (api[name]) {
  3089. return promisify(name, api[name]);
  3090. }
  3091. {
  3092. if (extraApi[name]) {
  3093. return promisify(name, extraApi[name]);
  3094. }
  3095. if (todoApis[name]) {
  3096. return promisify(name, todoApis[name]);
  3097. }
  3098. }
  3099. if (eventApi[name]) {
  3100. return eventApi[name];
  3101. }
  3102. return promisify(name, wrapper(name, wx[name]));
  3103. },
  3104. set: function set(target, name, value) {
  3105. target[name] = value;
  3106. return true;
  3107. }
  3108. });
  3109. } else {
  3110. Object.keys(baseApi).forEach(function (name) {
  3111. uni[name] = baseApi[name];
  3112. });
  3113. {
  3114. Object.keys(todoApis).forEach(function (name) {
  3115. uni[name] = promisify(name, todoApis[name]);
  3116. });
  3117. Object.keys(extraApi).forEach(function (name) {
  3118. uni[name] = promisify(name, extraApi[name]);
  3119. });
  3120. }
  3121. Object.keys(eventApi).forEach(function (name) {
  3122. uni[name] = eventApi[name];
  3123. });
  3124. Object.keys(api).forEach(function (name) {
  3125. uni[name] = promisify(name, api[name]);
  3126. });
  3127. Object.keys(wx).forEach(function (name) {
  3128. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  3129. uni[name] = promisify(name, wrapper(name, wx[name]));
  3130. }
  3131. });
  3132. }
  3133. wx.createApp = createApp;
  3134. wx.createPage = createPage;
  3135. wx.createComponent = createComponent;
  3136. wx.createSubpackageApp = createSubpackageApp;
  3137. wx.createPlugin = createPlugin;
  3138. var uni$1 = uni;
  3139. var _default = uni$1;
  3140. exports.default = _default;
  3141. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 3)))
  3142. /***/ }),
  3143. /***/ 20:
  3144. /*!****************************************************************!*\
  3145. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  3146. \****************************************************************/
  3147. /*! no static exports found */
  3148. /***/ (function(module, exports) {
  3149. function _iterableToArray(iter) {
  3150. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  3151. }
  3152. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3153. /***/ }),
  3154. /***/ 200:
  3155. /*!************************************************************************************************************!*\
  3156. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json ***!
  3157. \************************************************************************************************************/
  3158. /*! exports provided: uni-popup.cancel, uni-popup.ok, uni-popup.placeholder, uni-popup.title, uni-popup.shareTitle, default */
  3159. /***/ (function(module) {
  3160. module.exports = JSON.parse("{\"uni-popup.cancel\":\"取消\",\"uni-popup.ok\":\"確定\",\"uni-popup.placeholder\":\"請輸入\",\"uni-popup.title\":\"提示\",\"uni-popup.shareTitle\":\"分享到\"}");
  3161. /***/ }),
  3162. /***/ 208:
  3163. /*!************************************************************************************************!*\
  3164. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  3165. \************************************************************************************************/
  3166. /*! no static exports found */
  3167. /***/ (function(module, exports, __webpack_require__) {
  3168. // TODO(Babel 8): Remove this file.
  3169. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 209)();
  3170. module.exports = runtime;
  3171. /***/ }),
  3172. /***/ 209:
  3173. /*!*******************************************************************!*\
  3174. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  3175. \*******************************************************************/
  3176. /*! no static exports found */
  3177. /***/ (function(module, exports, __webpack_require__) {
  3178. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  3179. function _regeneratorRuntime() {
  3180. "use strict";
  3181. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  3182. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  3183. return e;
  3184. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3185. var t,
  3186. e = {},
  3187. r = Object.prototype,
  3188. n = r.hasOwnProperty,
  3189. o = Object.defineProperty || function (t, e, r) {
  3190. t[e] = r.value;
  3191. },
  3192. i = "function" == typeof Symbol ? Symbol : {},
  3193. a = i.iterator || "@@iterator",
  3194. c = i.asyncIterator || "@@asyncIterator",
  3195. u = i.toStringTag || "@@toStringTag";
  3196. function define(t, e, r) {
  3197. return Object.defineProperty(t, e, {
  3198. value: r,
  3199. enumerable: !0,
  3200. configurable: !0,
  3201. writable: !0
  3202. }), t[e];
  3203. }
  3204. try {
  3205. define({}, "");
  3206. } catch (t) {
  3207. define = function define(t, e, r) {
  3208. return t[e] = r;
  3209. };
  3210. }
  3211. function wrap(t, e, r, n) {
  3212. var i = e && e.prototype instanceof Generator ? e : Generator,
  3213. a = Object.create(i.prototype),
  3214. c = new Context(n || []);
  3215. return o(a, "_invoke", {
  3216. value: makeInvokeMethod(t, r, c)
  3217. }), a;
  3218. }
  3219. function tryCatch(t, e, r) {
  3220. try {
  3221. return {
  3222. type: "normal",
  3223. arg: t.call(e, r)
  3224. };
  3225. } catch (t) {
  3226. return {
  3227. type: "throw",
  3228. arg: t
  3229. };
  3230. }
  3231. }
  3232. e.wrap = wrap;
  3233. var h = "suspendedStart",
  3234. l = "suspendedYield",
  3235. f = "executing",
  3236. s = "completed",
  3237. y = {};
  3238. function Generator() {}
  3239. function GeneratorFunction() {}
  3240. function GeneratorFunctionPrototype() {}
  3241. var p = {};
  3242. define(p, a, function () {
  3243. return this;
  3244. });
  3245. var d = Object.getPrototypeOf,
  3246. v = d && d(d(values([])));
  3247. v && v !== r && n.call(v, a) && (p = v);
  3248. var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
  3249. function defineIteratorMethods(t) {
  3250. ["next", "throw", "return"].forEach(function (e) {
  3251. define(t, e, function (t) {
  3252. return this._invoke(e, t);
  3253. });
  3254. });
  3255. }
  3256. function AsyncIterator(t, e) {
  3257. function invoke(r, o, i, a) {
  3258. var c = tryCatch(t[r], t, o);
  3259. if ("throw" !== c.type) {
  3260. var u = c.arg,
  3261. h = u.value;
  3262. return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
  3263. invoke("next", t, i, a);
  3264. }, function (t) {
  3265. invoke("throw", t, i, a);
  3266. }) : e.resolve(h).then(function (t) {
  3267. u.value = t, i(u);
  3268. }, function (t) {
  3269. return invoke("throw", t, i, a);
  3270. });
  3271. }
  3272. a(c.arg);
  3273. }
  3274. var r;
  3275. o(this, "_invoke", {
  3276. value: function value(t, n) {
  3277. function callInvokeWithMethodAndArg() {
  3278. return new e(function (e, r) {
  3279. invoke(t, n, e, r);
  3280. });
  3281. }
  3282. return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  3283. }
  3284. });
  3285. }
  3286. function makeInvokeMethod(e, r, n) {
  3287. var o = h;
  3288. return function (i, a) {
  3289. if (o === f) throw Error("Generator is already running");
  3290. if (o === s) {
  3291. if ("throw" === i) throw a;
  3292. return {
  3293. value: t,
  3294. done: !0
  3295. };
  3296. }
  3297. for (n.method = i, n.arg = a;;) {
  3298. var c = n.delegate;
  3299. if (c) {
  3300. var u = maybeInvokeDelegate(c, n);
  3301. if (u) {
  3302. if (u === y) continue;
  3303. return u;
  3304. }
  3305. }
  3306. if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
  3307. if (o === h) throw o = s, n.arg;
  3308. n.dispatchException(n.arg);
  3309. } else "return" === n.method && n.abrupt("return", n.arg);
  3310. o = f;
  3311. var p = tryCatch(e, r, n);
  3312. if ("normal" === p.type) {
  3313. if (o = n.done ? s : l, p.arg === y) continue;
  3314. return {
  3315. value: p.arg,
  3316. done: n.done
  3317. };
  3318. }
  3319. "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
  3320. }
  3321. };
  3322. }
  3323. function maybeInvokeDelegate(e, r) {
  3324. var n = r.method,
  3325. o = e.iterator[n];
  3326. if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
  3327. var i = tryCatch(o, e.iterator, r.arg);
  3328. if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
  3329. var a = i.arg;
  3330. return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
  3331. }
  3332. function pushTryEntry(t) {
  3333. var e = {
  3334. tryLoc: t[0]
  3335. };
  3336. 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
  3337. }
  3338. function resetTryEntry(t) {
  3339. var e = t.completion || {};
  3340. e.type = "normal", delete e.arg, t.completion = e;
  3341. }
  3342. function Context(t) {
  3343. this.tryEntries = [{
  3344. tryLoc: "root"
  3345. }], t.forEach(pushTryEntry, this), this.reset(!0);
  3346. }
  3347. function values(e) {
  3348. if (e || "" === e) {
  3349. var r = e[a];
  3350. if (r) return r.call(e);
  3351. if ("function" == typeof e.next) return e;
  3352. if (!isNaN(e.length)) {
  3353. var o = -1,
  3354. i = function next() {
  3355. for (; ++o < e.length;) {
  3356. if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
  3357. }
  3358. return next.value = t, next.done = !0, next;
  3359. };
  3360. return i.next = i;
  3361. }
  3362. }
  3363. throw new TypeError(_typeof(e) + " is not iterable");
  3364. }
  3365. return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
  3366. value: GeneratorFunctionPrototype,
  3367. configurable: !0
  3368. }), o(GeneratorFunctionPrototype, "constructor", {
  3369. value: GeneratorFunction,
  3370. configurable: !0
  3371. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
  3372. var e = "function" == typeof t && t.constructor;
  3373. return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
  3374. }, e.mark = function (t) {
  3375. return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
  3376. }, e.awrap = function (t) {
  3377. return {
  3378. __await: t
  3379. };
  3380. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
  3381. return this;
  3382. }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
  3383. void 0 === i && (i = Promise);
  3384. var a = new AsyncIterator(wrap(t, r, n, o), i);
  3385. return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
  3386. return t.done ? t.value : a.next();
  3387. });
  3388. }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
  3389. return this;
  3390. }), define(g, "toString", function () {
  3391. return "[object Generator]";
  3392. }), e.keys = function (t) {
  3393. var e = Object(t),
  3394. r = [];
  3395. for (var n in e) {
  3396. r.push(n);
  3397. }
  3398. return r.reverse(), function next() {
  3399. for (; r.length;) {
  3400. var t = r.pop();
  3401. if (t in e) return next.value = t, next.done = !1, next;
  3402. }
  3403. return next.done = !0, next;
  3404. };
  3405. }, e.values = values, Context.prototype = {
  3406. constructor: Context,
  3407. reset: function reset(e) {
  3408. if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) {
  3409. "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
  3410. }
  3411. },
  3412. stop: function stop() {
  3413. this.done = !0;
  3414. var t = this.tryEntries[0].completion;
  3415. if ("throw" === t.type) throw t.arg;
  3416. return this.rval;
  3417. },
  3418. dispatchException: function dispatchException(e) {
  3419. if (this.done) throw e;
  3420. var r = this;
  3421. function handle(n, o) {
  3422. return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
  3423. }
  3424. for (var o = this.tryEntries.length - 1; o >= 0; --o) {
  3425. var i = this.tryEntries[o],
  3426. a = i.completion;
  3427. if ("root" === i.tryLoc) return handle("end");
  3428. if (i.tryLoc <= this.prev) {
  3429. var c = n.call(i, "catchLoc"),
  3430. u = n.call(i, "finallyLoc");
  3431. if (c && u) {
  3432. if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
  3433. if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
  3434. } else if (c) {
  3435. if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
  3436. } else {
  3437. if (!u) throw Error("try statement without catch or finally");
  3438. if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
  3439. }
  3440. }
  3441. }
  3442. },
  3443. abrupt: function abrupt(t, e) {
  3444. for (var r = this.tryEntries.length - 1; r >= 0; --r) {
  3445. var o = this.tryEntries[r];
  3446. if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
  3447. var i = o;
  3448. break;
  3449. }
  3450. }
  3451. i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
  3452. var a = i ? i.completion : {};
  3453. return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
  3454. },
  3455. complete: function complete(t, e) {
  3456. if ("throw" === t.type) throw t.arg;
  3457. return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
  3458. },
  3459. finish: function finish(t) {
  3460. for (var e = this.tryEntries.length - 1; e >= 0; --e) {
  3461. var r = this.tryEntries[e];
  3462. if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
  3463. }
  3464. },
  3465. "catch": function _catch(t) {
  3466. for (var e = this.tryEntries.length - 1; e >= 0; --e) {
  3467. var r = this.tryEntries[e];
  3468. if (r.tryLoc === t) {
  3469. var n = r.completion;
  3470. if ("throw" === n.type) {
  3471. var o = n.arg;
  3472. resetTryEntry(r);
  3473. }
  3474. return o;
  3475. }
  3476. }
  3477. throw Error("illegal catch attempt");
  3478. },
  3479. delegateYield: function delegateYield(e, r, n) {
  3480. return this.delegate = {
  3481. iterator: values(e),
  3482. resultName: r,
  3483. nextLoc: n
  3484. }, "next" === this.method && (this.arg = t), y;
  3485. }
  3486. }, e;
  3487. }
  3488. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3489. /***/ }),
  3490. /***/ 21:
  3491. /*!******************************************************************!*\
  3492. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  3493. \******************************************************************/
  3494. /*! no static exports found */
  3495. /***/ (function(module, exports) {
  3496. function _nonIterableSpread() {
  3497. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  3498. }
  3499. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3500. /***/ }),
  3501. /***/ 210:
  3502. /*!*****************************************************************!*\
  3503. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  3504. \*****************************************************************/
  3505. /*! no static exports found */
  3506. /***/ (function(module, exports) {
  3507. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  3508. try {
  3509. var info = gen[key](arg);
  3510. var value = info.value;
  3511. } catch (error) {
  3512. reject(error);
  3513. return;
  3514. }
  3515. if (info.done) {
  3516. resolve(value);
  3517. } else {
  3518. Promise.resolve(value).then(_next, _throw);
  3519. }
  3520. }
  3521. function _asyncToGenerator(fn) {
  3522. return function () {
  3523. var self = this,
  3524. args = arguments;
  3525. return new Promise(function (resolve, reject) {
  3526. var gen = fn.apply(self, args);
  3527. function _next(value) {
  3528. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  3529. }
  3530. function _throw(err) {
  3531. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  3532. }
  3533. _next(undefined);
  3534. });
  3535. };
  3536. }
  3537. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3538. /***/ }),
  3539. /***/ 211:
  3540. /*!******************************************************************************************************!*\
  3541. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-forms/components/uni-forms/validate.js ***!
  3542. \******************************************************************************************************/
  3543. /*! no static exports found */
  3544. /***/ (function(module, exports, __webpack_require__) {
  3545. "use strict";
  3546. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  3547. Object.defineProperty(exports, "__esModule", {
  3548. value: true
  3549. });
  3550. exports.default = void 0;
  3551. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 208));
  3552. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 212));
  3553. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 213));
  3554. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 215));
  3555. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 210));
  3556. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  3557. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  3558. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  3559. 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); }; }
  3560. 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; } }
  3561. var pattern = {
  3562. email: /^\S+?@\S+?\.\S+?$/,
  3563. 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]$/,
  3564. 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')
  3565. };
  3566. var FORMAT_MAPPING = {
  3567. "int": 'integer',
  3568. "bool": 'boolean',
  3569. "double": 'number',
  3570. "long": 'number',
  3571. "password": 'string'
  3572. // "fileurls": 'array'
  3573. };
  3574. function formatMessage(args) {
  3575. var resources = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  3576. var defaultMessage = ['label'];
  3577. defaultMessage.forEach(function (item) {
  3578. if (args[item] === undefined) {
  3579. args[item] = '';
  3580. }
  3581. });
  3582. var str = resources;
  3583. for (var key in args) {
  3584. var reg = new RegExp('{' + key + '}');
  3585. str = str.replace(reg, args[key]);
  3586. }
  3587. return str;
  3588. }
  3589. function isEmptyValue(value, type) {
  3590. if (value === undefined || value === null) {
  3591. return true;
  3592. }
  3593. if (typeof value === 'string' && !value) {
  3594. return true;
  3595. }
  3596. if (Array.isArray(value) && !value.length) {
  3597. return true;
  3598. }
  3599. if (type === 'object' && !Object.keys(value).length) {
  3600. return true;
  3601. }
  3602. return false;
  3603. }
  3604. var types = {
  3605. integer: function integer(value) {
  3606. return types.number(value) && parseInt(value, 10) === value;
  3607. },
  3608. string: function string(value) {
  3609. return typeof value === 'string';
  3610. },
  3611. number: function number(value) {
  3612. if (isNaN(value)) {
  3613. return false;
  3614. }
  3615. return typeof value === 'number';
  3616. },
  3617. "boolean": function boolean(value) {
  3618. return typeof value === 'boolean';
  3619. },
  3620. "float": function float(value) {
  3621. return types.number(value) && !types.integer(value);
  3622. },
  3623. array: function array(value) {
  3624. return Array.isArray(value);
  3625. },
  3626. object: function object(value) {
  3627. return (0, _typeof2.default)(value) === 'object' && !types.array(value);
  3628. },
  3629. date: function date(value) {
  3630. return value instanceof Date;
  3631. },
  3632. timestamp: function timestamp(value) {
  3633. if (!this.integer(value) || Math.abs(value).toString().length > 16) {
  3634. return false;
  3635. }
  3636. return true;
  3637. },
  3638. file: function file(value) {
  3639. return typeof value.url === 'string';
  3640. },
  3641. email: function email(value) {
  3642. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  3643. },
  3644. url: function url(value) {
  3645. return typeof value === 'string' && !!value.match(pattern.url);
  3646. },
  3647. pattern: function pattern(reg, value) {
  3648. try {
  3649. return new RegExp(reg).test(value);
  3650. } catch (e) {
  3651. return false;
  3652. }
  3653. },
  3654. method: function method(value) {
  3655. return typeof value === 'function';
  3656. },
  3657. idcard: function idcard(value) {
  3658. return typeof value === 'string' && !!value.match(pattern.idcard);
  3659. },
  3660. 'url-https': function urlHttps(value) {
  3661. return this.url(value) && value.startsWith('https://');
  3662. },
  3663. 'url-scheme': function urlScheme(value) {
  3664. return value.startsWith('://');
  3665. },
  3666. 'url-web': function urlWeb(value) {
  3667. return false;
  3668. }
  3669. };
  3670. var RuleValidator = /*#__PURE__*/function () {
  3671. function RuleValidator(message) {
  3672. (0, _classCallCheck2.default)(this, RuleValidator);
  3673. this._message = message;
  3674. }
  3675. (0, _createClass2.default)(RuleValidator, [{
  3676. key: "validateRule",
  3677. value: function () {
  3678. var _validateRule = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(fieldKey, fieldValue, value, data, allData) {
  3679. var result, rules, hasRequired, message, i, rule, vt, now, resultExpr;
  3680. return _regenerator.default.wrap(function _callee$(_context) {
  3681. while (1) {
  3682. switch (_context.prev = _context.next) {
  3683. case 0:
  3684. result = null;
  3685. rules = fieldValue.rules;
  3686. hasRequired = rules.findIndex(function (item) {
  3687. return item.required;
  3688. });
  3689. if (!(hasRequired < 0)) {
  3690. _context.next = 8;
  3691. break;
  3692. }
  3693. if (!(value === null || value === undefined)) {
  3694. _context.next = 6;
  3695. break;
  3696. }
  3697. return _context.abrupt("return", result);
  3698. case 6:
  3699. if (!(typeof value === 'string' && !value.length)) {
  3700. _context.next = 8;
  3701. break;
  3702. }
  3703. return _context.abrupt("return", result);
  3704. case 8:
  3705. message = this._message;
  3706. if (!(rules === undefined)) {
  3707. _context.next = 11;
  3708. break;
  3709. }
  3710. return _context.abrupt("return", message['default']);
  3711. case 11:
  3712. i = 0;
  3713. case 12:
  3714. if (!(i < rules.length)) {
  3715. _context.next = 35;
  3716. break;
  3717. }
  3718. rule = rules[i];
  3719. vt = this._getValidateType(rule);
  3720. Object.assign(rule, {
  3721. label: fieldValue.label || "[\"".concat(fieldKey, "\"]")
  3722. });
  3723. if (!RuleValidatorHelper[vt]) {
  3724. _context.next = 20;
  3725. break;
  3726. }
  3727. result = RuleValidatorHelper[vt](rule, value, message);
  3728. if (!(result != null)) {
  3729. _context.next = 20;
  3730. break;
  3731. }
  3732. return _context.abrupt("break", 35);
  3733. case 20:
  3734. if (!rule.validateExpr) {
  3735. _context.next = 26;
  3736. break;
  3737. }
  3738. now = Date.now();
  3739. resultExpr = rule.validateExpr(value, allData, now);
  3740. if (!(resultExpr === false)) {
  3741. _context.next = 26;
  3742. break;
  3743. }
  3744. result = this._getMessage(rule, rule.errorMessage || this._message['default']);
  3745. return _context.abrupt("break", 35);
  3746. case 26:
  3747. if (!rule.validateFunction) {
  3748. _context.next = 32;
  3749. break;
  3750. }
  3751. _context.next = 29;
  3752. return this.validateFunction(rule, value, data, allData, vt);
  3753. case 29:
  3754. result = _context.sent;
  3755. if (!(result !== null)) {
  3756. _context.next = 32;
  3757. break;
  3758. }
  3759. return _context.abrupt("break", 35);
  3760. case 32:
  3761. i++;
  3762. _context.next = 12;
  3763. break;
  3764. case 35:
  3765. if (result !== null) {
  3766. result = message.TAG + result;
  3767. }
  3768. return _context.abrupt("return", result);
  3769. case 37:
  3770. case "end":
  3771. return _context.stop();
  3772. }
  3773. }
  3774. }, _callee, this);
  3775. }));
  3776. function validateRule(_x, _x2, _x3, _x4, _x5) {
  3777. return _validateRule.apply(this, arguments);
  3778. }
  3779. return validateRule;
  3780. }()
  3781. }, {
  3782. key: "validateFunction",
  3783. value: function () {
  3784. var _validateFunction = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(rule, value, data, allData, vt) {
  3785. var result, callbackMessage, res;
  3786. return _regenerator.default.wrap(function _callee2$(_context2) {
  3787. while (1) {
  3788. switch (_context2.prev = _context2.next) {
  3789. case 0:
  3790. result = null;
  3791. _context2.prev = 1;
  3792. callbackMessage = null;
  3793. _context2.next = 5;
  3794. return rule.validateFunction(rule, value, allData || data, function (message) {
  3795. callbackMessage = message;
  3796. });
  3797. case 5:
  3798. res = _context2.sent;
  3799. if (callbackMessage || typeof res === 'string' && res || res === false) {
  3800. result = this._getMessage(rule, callbackMessage || res, vt);
  3801. }
  3802. _context2.next = 12;
  3803. break;
  3804. case 9:
  3805. _context2.prev = 9;
  3806. _context2.t0 = _context2["catch"](1);
  3807. result = this._getMessage(rule, _context2.t0.message, vt);
  3808. case 12:
  3809. return _context2.abrupt("return", result);
  3810. case 13:
  3811. case "end":
  3812. return _context2.stop();
  3813. }
  3814. }
  3815. }, _callee2, this, [[1, 9]]);
  3816. }));
  3817. function validateFunction(_x6, _x7, _x8, _x9, _x10) {
  3818. return _validateFunction.apply(this, arguments);
  3819. }
  3820. return validateFunction;
  3821. }()
  3822. }, {
  3823. key: "_getMessage",
  3824. value: function _getMessage(rule, message, vt) {
  3825. return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default']);
  3826. }
  3827. }, {
  3828. key: "_getValidateType",
  3829. value: function _getValidateType(rule) {
  3830. var result = '';
  3831. if (rule.required) {
  3832. result = 'required';
  3833. } else if (rule.format) {
  3834. result = 'format';
  3835. } else if (rule.arrayType) {
  3836. result = 'arrayTypeFormat';
  3837. } else if (rule.range) {
  3838. result = 'range';
  3839. } else if (rule.maximum !== undefined || rule.minimum !== undefined) {
  3840. result = 'rangeNumber';
  3841. } else if (rule.maxLength !== undefined || rule.minLength !== undefined) {
  3842. result = 'rangeLength';
  3843. } else if (rule.pattern) {
  3844. result = 'pattern';
  3845. } else if (rule.validateFunction) {
  3846. result = 'validateFunction';
  3847. }
  3848. return result;
  3849. }
  3850. }]);
  3851. return RuleValidator;
  3852. }();
  3853. var RuleValidatorHelper = {
  3854. required: function required(rule, value, message) {
  3855. if (rule.required && isEmptyValue(value, rule.format || (0, _typeof2.default)(value))) {
  3856. return formatMessage(rule, rule.errorMessage || message.required);
  3857. }
  3858. return null;
  3859. },
  3860. range: function range(rule, value, message) {
  3861. var range = rule.range,
  3862. errorMessage = rule.errorMessage;
  3863. var list = new Array(range.length);
  3864. for (var i = 0; i < range.length; i++) {
  3865. var item = range[i];
  3866. if (types.object(item) && item.value !== undefined) {
  3867. list[i] = item.value;
  3868. } else {
  3869. list[i] = item;
  3870. }
  3871. }
  3872. var result = false;
  3873. if (Array.isArray(value)) {
  3874. result = new Set(value.concat(list)).size === list.length;
  3875. } else {
  3876. if (list.indexOf(value) > -1) {
  3877. result = true;
  3878. }
  3879. }
  3880. if (!result) {
  3881. return formatMessage(rule, errorMessage || message['enum']);
  3882. }
  3883. return null;
  3884. },
  3885. rangeNumber: function rangeNumber(rule, value, message) {
  3886. if (!types.number(value)) {
  3887. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  3888. }
  3889. var minimum = rule.minimum,
  3890. maximum = rule.maximum,
  3891. exclusiveMinimum = rule.exclusiveMinimum,
  3892. exclusiveMaximum = rule.exclusiveMaximum;
  3893. var min = exclusiveMinimum ? value <= minimum : value < minimum;
  3894. var max = exclusiveMaximum ? value >= maximum : value > maximum;
  3895. if (minimum !== undefined && min) {
  3896. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMinimum ? 'exclusiveMinimum' : 'minimum']);
  3897. } else if (maximum !== undefined && max) {
  3898. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMaximum ? 'exclusiveMaximum' : 'maximum']);
  3899. } else if (minimum !== undefined && maximum !== undefined && (min || max)) {
  3900. return formatMessage(rule, rule.errorMessage || message['number'].range);
  3901. }
  3902. return null;
  3903. },
  3904. rangeLength: function rangeLength(rule, value, message) {
  3905. if (!types.string(value) && !types.array(value)) {
  3906. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  3907. }
  3908. var min = rule.minLength;
  3909. var max = rule.maxLength;
  3910. var val = value.length;
  3911. if (min !== undefined && val < min) {
  3912. return formatMessage(rule, rule.errorMessage || message['length'].minLength);
  3913. } else if (max !== undefined && val > max) {
  3914. return formatMessage(rule, rule.errorMessage || message['length'].maxLength);
  3915. } else if (min !== undefined && max !== undefined && (val < min || val > max)) {
  3916. return formatMessage(rule, rule.errorMessage || message['length'].range);
  3917. }
  3918. return null;
  3919. },
  3920. pattern: function pattern(rule, value, message) {
  3921. if (!types['pattern'](rule.pattern, value)) {
  3922. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  3923. }
  3924. return null;
  3925. },
  3926. format: function format(rule, value, message) {
  3927. var customTypes = Object.keys(types);
  3928. var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format || rule.arrayType;
  3929. if (customTypes.indexOf(format) > -1) {
  3930. if (!types[format](value)) {
  3931. return formatMessage(rule, rule.errorMessage || message.typeError);
  3932. }
  3933. }
  3934. return null;
  3935. },
  3936. arrayTypeFormat: function arrayTypeFormat(rule, value, message) {
  3937. if (!Array.isArray(value)) {
  3938. return formatMessage(rule, rule.errorMessage || message.typeError);
  3939. }
  3940. for (var i = 0; i < value.length; i++) {
  3941. var element = value[i];
  3942. var formatResult = this.format(rule, element, message);
  3943. if (formatResult !== null) {
  3944. return formatResult;
  3945. }
  3946. }
  3947. return null;
  3948. }
  3949. };
  3950. var SchemaValidator = /*#__PURE__*/function (_RuleValidator) {
  3951. (0, _inherits2.default)(SchemaValidator, _RuleValidator);
  3952. var _super = _createSuper(SchemaValidator);
  3953. function SchemaValidator(schema, options) {
  3954. var _this;
  3955. (0, _classCallCheck2.default)(this, SchemaValidator);
  3956. _this = _super.call(this, SchemaValidator.message);
  3957. _this._schema = schema;
  3958. _this._options = options || null;
  3959. return _this;
  3960. }
  3961. (0, _createClass2.default)(SchemaValidator, [{
  3962. key: "updateSchema",
  3963. value: function updateSchema(schema) {
  3964. this._schema = schema;
  3965. }
  3966. }, {
  3967. key: "validate",
  3968. value: function () {
  3969. var _validate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(data, allData) {
  3970. var result;
  3971. return _regenerator.default.wrap(function _callee3$(_context3) {
  3972. while (1) {
  3973. switch (_context3.prev = _context3.next) {
  3974. case 0:
  3975. result = this._checkFieldInSchema(data);
  3976. if (result) {
  3977. _context3.next = 5;
  3978. break;
  3979. }
  3980. _context3.next = 4;
  3981. return this.invokeValidate(data, false, allData);
  3982. case 4:
  3983. result = _context3.sent;
  3984. case 5:
  3985. return _context3.abrupt("return", result.length ? result[0] : null);
  3986. case 6:
  3987. case "end":
  3988. return _context3.stop();
  3989. }
  3990. }
  3991. }, _callee3, this);
  3992. }));
  3993. function validate(_x11, _x12) {
  3994. return _validate.apply(this, arguments);
  3995. }
  3996. return validate;
  3997. }()
  3998. }, {
  3999. key: "validateAll",
  4000. value: function () {
  4001. var _validateAll = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(data, allData) {
  4002. var result;
  4003. return _regenerator.default.wrap(function _callee4$(_context4) {
  4004. while (1) {
  4005. switch (_context4.prev = _context4.next) {
  4006. case 0:
  4007. result = this._checkFieldInSchema(data);
  4008. if (result) {
  4009. _context4.next = 5;
  4010. break;
  4011. }
  4012. _context4.next = 4;
  4013. return this.invokeValidate(data, true, allData);
  4014. case 4:
  4015. result = _context4.sent;
  4016. case 5:
  4017. return _context4.abrupt("return", result);
  4018. case 6:
  4019. case "end":
  4020. return _context4.stop();
  4021. }
  4022. }
  4023. }, _callee4, this);
  4024. }));
  4025. function validateAll(_x13, _x14) {
  4026. return _validateAll.apply(this, arguments);
  4027. }
  4028. return validateAll;
  4029. }()
  4030. }, {
  4031. key: "validateUpdate",
  4032. value: function () {
  4033. var _validateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(data, allData) {
  4034. var result;
  4035. return _regenerator.default.wrap(function _callee5$(_context5) {
  4036. while (1) {
  4037. switch (_context5.prev = _context5.next) {
  4038. case 0:
  4039. result = this._checkFieldInSchema(data);
  4040. if (result) {
  4041. _context5.next = 5;
  4042. break;
  4043. }
  4044. _context5.next = 4;
  4045. return this.invokeValidateUpdate(data, false, allData);
  4046. case 4:
  4047. result = _context5.sent;
  4048. case 5:
  4049. return _context5.abrupt("return", result.length ? result[0] : null);
  4050. case 6:
  4051. case "end":
  4052. return _context5.stop();
  4053. }
  4054. }
  4055. }, _callee5, this);
  4056. }));
  4057. function validateUpdate(_x15, _x16) {
  4058. return _validateUpdate.apply(this, arguments);
  4059. }
  4060. return validateUpdate;
  4061. }()
  4062. }, {
  4063. key: "invokeValidate",
  4064. value: function () {
  4065. var _invokeValidate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(data, all, allData) {
  4066. var result, schema, key, value, errorMessage;
  4067. return _regenerator.default.wrap(function _callee6$(_context6) {
  4068. while (1) {
  4069. switch (_context6.prev = _context6.next) {
  4070. case 0:
  4071. result = [];
  4072. schema = this._schema;
  4073. _context6.t0 = _regenerator.default.keys(schema);
  4074. case 3:
  4075. if ((_context6.t1 = _context6.t0()).done) {
  4076. _context6.next = 15;
  4077. break;
  4078. }
  4079. key = _context6.t1.value;
  4080. value = schema[key];
  4081. _context6.next = 8;
  4082. return this.validateRule(key, value, data[key], data, allData);
  4083. case 8:
  4084. errorMessage = _context6.sent;
  4085. if (!(errorMessage != null)) {
  4086. _context6.next = 13;
  4087. break;
  4088. }
  4089. result.push({
  4090. key: key,
  4091. errorMessage: errorMessage
  4092. });
  4093. if (all) {
  4094. _context6.next = 13;
  4095. break;
  4096. }
  4097. return _context6.abrupt("break", 15);
  4098. case 13:
  4099. _context6.next = 3;
  4100. break;
  4101. case 15:
  4102. return _context6.abrupt("return", result);
  4103. case 16:
  4104. case "end":
  4105. return _context6.stop();
  4106. }
  4107. }
  4108. }, _callee6, this);
  4109. }));
  4110. function invokeValidate(_x17, _x18, _x19) {
  4111. return _invokeValidate.apply(this, arguments);
  4112. }
  4113. return invokeValidate;
  4114. }()
  4115. }, {
  4116. key: "invokeValidateUpdate",
  4117. value: function () {
  4118. var _invokeValidateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(data, all, allData) {
  4119. var result, key, errorMessage;
  4120. return _regenerator.default.wrap(function _callee7$(_context7) {
  4121. while (1) {
  4122. switch (_context7.prev = _context7.next) {
  4123. case 0:
  4124. result = [];
  4125. _context7.t0 = _regenerator.default.keys(data);
  4126. case 2:
  4127. if ((_context7.t1 = _context7.t0()).done) {
  4128. _context7.next = 13;
  4129. break;
  4130. }
  4131. key = _context7.t1.value;
  4132. _context7.next = 6;
  4133. return this.validateRule(key, this._schema[key], data[key], data, allData);
  4134. case 6:
  4135. errorMessage = _context7.sent;
  4136. if (!(errorMessage != null)) {
  4137. _context7.next = 11;
  4138. break;
  4139. }
  4140. result.push({
  4141. key: key,
  4142. errorMessage: errorMessage
  4143. });
  4144. if (all) {
  4145. _context7.next = 11;
  4146. break;
  4147. }
  4148. return _context7.abrupt("break", 13);
  4149. case 11:
  4150. _context7.next = 2;
  4151. break;
  4152. case 13:
  4153. return _context7.abrupt("return", result);
  4154. case 14:
  4155. case "end":
  4156. return _context7.stop();
  4157. }
  4158. }
  4159. }, _callee7, this);
  4160. }));
  4161. function invokeValidateUpdate(_x20, _x21, _x22) {
  4162. return _invokeValidateUpdate.apply(this, arguments);
  4163. }
  4164. return invokeValidateUpdate;
  4165. }()
  4166. }, {
  4167. key: "_checkFieldInSchema",
  4168. value: function _checkFieldInSchema(data) {
  4169. var keys = Object.keys(data);
  4170. var keys2 = Object.keys(this._schema);
  4171. if (new Set(keys.concat(keys2)).size === keys2.length) {
  4172. return '';
  4173. }
  4174. var noExistFields = keys.filter(function (key) {
  4175. return keys2.indexOf(key) < 0;
  4176. });
  4177. var errorMessage = formatMessage({
  4178. field: JSON.stringify(noExistFields)
  4179. }, SchemaValidator.message.TAG + SchemaValidator.message['defaultInvalid']);
  4180. return [{
  4181. key: 'invalid',
  4182. errorMessage: errorMessage
  4183. }];
  4184. }
  4185. }]);
  4186. return SchemaValidator;
  4187. }(RuleValidator);
  4188. function Message() {
  4189. return {
  4190. TAG: "",
  4191. default: '验证错误',
  4192. defaultInvalid: '提交的字段{field}在数据库中并不存在',
  4193. validateFunction: '验证无效',
  4194. required: '{label}必填',
  4195. 'enum': '{label}超出范围',
  4196. timestamp: '{label}格式无效',
  4197. whitespace: '{label}不能为空',
  4198. typeError: '{label}类型无效',
  4199. date: {
  4200. format: '{label}日期{value}格式无效',
  4201. parse: '{label}日期无法解析,{value}无效',
  4202. invalid: '{label}日期{value}无效'
  4203. },
  4204. length: {
  4205. minLength: '{label}长度不能少于{minLength}',
  4206. maxLength: '{label}长度不能超过{maxLength}',
  4207. range: '{label}必须介于{minLength}和{maxLength}之间'
  4208. },
  4209. number: {
  4210. minimum: '{label}不能小于{minimum}',
  4211. maximum: '{label}不能大于{maximum}',
  4212. exclusiveMinimum: '{label}不能小于等于{minimum}',
  4213. exclusiveMaximum: '{label}不能大于等于{maximum}',
  4214. range: '{label}必须介于{minimum}and{maximum}之间'
  4215. },
  4216. pattern: {
  4217. mismatch: '{label}格式不匹配'
  4218. }
  4219. };
  4220. }
  4221. SchemaValidator.message = new Message();
  4222. var _default = SchemaValidator;
  4223. exports.default = _default;
  4224. /***/ }),
  4225. /***/ 212:
  4226. /*!*********************************************************!*\
  4227. !*** ./node_modules/@babel/runtime/helpers/inherits.js ***!
  4228. \*********************************************************/
  4229. /*! no static exports found */
  4230. /***/ (function(module, exports, __webpack_require__) {
  4231. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  4232. function _inherits(subClass, superClass) {
  4233. if (typeof superClass !== "function" && superClass !== null) {
  4234. throw new TypeError("Super expression must either be null or a function");
  4235. }
  4236. subClass.prototype = Object.create(superClass && superClass.prototype, {
  4237. constructor: {
  4238. value: subClass,
  4239. writable: true,
  4240. configurable: true
  4241. }
  4242. });
  4243. Object.defineProperty(subClass, "prototype", {
  4244. writable: false
  4245. });
  4246. if (superClass) setPrototypeOf(subClass, superClass);
  4247. }
  4248. module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4249. /***/ }),
  4250. /***/ 213:
  4251. /*!**************************************************************************!*\
  4252. !*** ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
  4253. \**************************************************************************/
  4254. /*! no static exports found */
  4255. /***/ (function(module, exports, __webpack_require__) {
  4256. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  4257. var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ 214);
  4258. function _possibleConstructorReturn(self, call) {
  4259. if (call && (_typeof(call) === "object" || typeof call === "function")) {
  4260. return call;
  4261. } else if (call !== void 0) {
  4262. throw new TypeError("Derived constructors may only return object or undefined");
  4263. }
  4264. return assertThisInitialized(self);
  4265. }
  4266. module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4267. /***/ }),
  4268. /***/ 214:
  4269. /*!**********************************************************************!*\
  4270. !*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
  4271. \**********************************************************************/
  4272. /*! no static exports found */
  4273. /***/ (function(module, exports) {
  4274. function _assertThisInitialized(self) {
  4275. if (self === void 0) {
  4276. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  4277. }
  4278. return self;
  4279. }
  4280. module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4281. /***/ }),
  4282. /***/ 215:
  4283. /*!***************************************************************!*\
  4284. !*** ./node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
  4285. \***************************************************************/
  4286. /*! no static exports found */
  4287. /***/ (function(module, exports) {
  4288. function _getPrototypeOf(o) {
  4289. module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
  4290. return o.__proto__ || Object.getPrototypeOf(o);
  4291. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4292. return _getPrototypeOf(o);
  4293. }
  4294. module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4295. /***/ }),
  4296. /***/ 216:
  4297. /*!***************************************************************************************************!*\
  4298. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-forms/components/uni-forms/utils.js ***!
  4299. \***************************************************************************************************/
  4300. /*! no static exports found */
  4301. /***/ (function(module, exports, __webpack_require__) {
  4302. "use strict";
  4303. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  4304. Object.defineProperty(exports, "__esModule", {
  4305. value: true
  4306. });
  4307. exports.typeFilter = exports.type = exports.setDataValue = exports.realName = exports.rawData = exports.objSet = exports.objGet = exports.name2arr = exports.isRequiredField = exports.isRealName = exports.isNumber = exports.isEqual = exports.isBoolean = exports.getValue = exports.getDataValueType = exports.getDataValue = exports.deepCopy = void 0;
  4308. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  4309. /**
  4310. * 简单处理对象拷贝
  4311. * @param {Obejct} 被拷贝对象
  4312. * @@return {Object} 拷贝对象
  4313. */
  4314. var deepCopy = function deepCopy(val) {
  4315. return JSON.parse(JSON.stringify(val));
  4316. };
  4317. /**
  4318. * 过滤数字类型
  4319. * @param {String} format 数字类型
  4320. * @@return {Boolean} 返回是否为数字类型
  4321. */
  4322. exports.deepCopy = deepCopy;
  4323. var typeFilter = function typeFilter(format) {
  4324. return format === 'int' || format === 'double' || format === 'number' || format === 'timestamp';
  4325. };
  4326. /**
  4327. * 把 value 转换成指定的类型,用于处理初始值,原因是初始值需要入库不能为 undefined
  4328. * @param {String} key 字段名
  4329. * @param {any} value 字段值
  4330. * @param {Object} rules 表单校验规则
  4331. */
  4332. exports.typeFilter = typeFilter;
  4333. var getValue = function getValue(key, value, rules) {
  4334. var isRuleNumType = rules.find(function (val) {
  4335. return val.format && typeFilter(val.format);
  4336. });
  4337. var isRuleBoolType = rules.find(function (val) {
  4338. return val.format && val.format === 'boolean' || val.format === 'bool';
  4339. });
  4340. // 输入类型为 number
  4341. if (!!isRuleNumType) {
  4342. if (!value && value !== 0) {
  4343. value = null;
  4344. } else {
  4345. value = isNumber(Number(value)) ? Number(value) : value;
  4346. }
  4347. }
  4348. // 输入类型为 boolean
  4349. if (!!isRuleBoolType) {
  4350. value = isBoolean(value) ? value : false;
  4351. }
  4352. return value;
  4353. };
  4354. /**
  4355. * 获取表单数据
  4356. * @param {String|Array} name 真实名称,需要使用 realName 获取
  4357. * @param {Object} data 原始数据
  4358. * @param {any} value 需要设置的值
  4359. */
  4360. exports.getValue = getValue;
  4361. var setDataValue = function setDataValue(field, formdata, value) {
  4362. formdata[field] = value;
  4363. return value || '';
  4364. };
  4365. /**
  4366. * 获取表单数据
  4367. * @param {String|Array} field 真实名称,需要使用 realName 获取
  4368. * @param {Object} data 原始数据
  4369. */
  4370. exports.setDataValue = setDataValue;
  4371. var getDataValue = function getDataValue(field, data) {
  4372. return objGet(data, field);
  4373. };
  4374. /**
  4375. * 获取表单类型
  4376. * @param {String|Array} field 真实名称,需要使用 realName 获取
  4377. */
  4378. exports.getDataValue = getDataValue;
  4379. var getDataValueType = function getDataValueType(field, data) {
  4380. var value = getDataValue(field, data);
  4381. return {
  4382. type: type(value),
  4383. value: value
  4384. };
  4385. };
  4386. /**
  4387. * 获取表单可用的真实name
  4388. * @param {String|Array} name 表单name
  4389. * @@return {String} 表单可用的真实name
  4390. */
  4391. exports.getDataValueType = getDataValueType;
  4392. var realName = function realName(name) {
  4393. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  4394. var base_name = _basePath(name);
  4395. if ((0, _typeof2.default)(base_name) === 'object' && Array.isArray(base_name) && base_name.length > 1) {
  4396. var realname = base_name.reduce(function (a, b) {
  4397. return a += "#".concat(b);
  4398. }, '_formdata_');
  4399. return realname;
  4400. }
  4401. return base_name[0] || name;
  4402. };
  4403. /**
  4404. * 判断是否表单可用的真实name
  4405. * @param {String|Array} name 表单name
  4406. * @@return {String} 表单可用的真实name
  4407. */
  4408. exports.realName = realName;
  4409. var isRealName = function isRealName(name) {
  4410. var reg = /^_formdata_#*/;
  4411. return reg.test(name);
  4412. };
  4413. /**
  4414. * 获取表单数据的原始格式
  4415. * @@return {Object|Array} object 需要解析的数据
  4416. */
  4417. exports.isRealName = isRealName;
  4418. var rawData = function rawData() {
  4419. var object = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  4420. var name = arguments.length > 1 ? arguments[1] : undefined;
  4421. var newData = JSON.parse(JSON.stringify(object));
  4422. var formData = {};
  4423. for (var i in newData) {
  4424. var path = name2arr(i);
  4425. objSet(formData, path, newData[i]);
  4426. }
  4427. return formData;
  4428. };
  4429. /**
  4430. * 真实name还原为 array
  4431. * @param {*} name
  4432. */
  4433. exports.rawData = rawData;
  4434. var name2arr = function name2arr(name) {
  4435. var field = name.replace('_formdata_#', '');
  4436. field = field.split('#').map(function (v) {
  4437. return isNumber(v) ? Number(v) : v;
  4438. });
  4439. return field;
  4440. };
  4441. /**
  4442. * 对象中设置值
  4443. * @param {Object|Array} object 源数据
  4444. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  4445. * @param {String} value 需要设置的值
  4446. */
  4447. exports.name2arr = name2arr;
  4448. var objSet = function objSet(object, path, value) {
  4449. if ((0, _typeof2.default)(object) !== 'object') return object;
  4450. _basePath(path).reduce(function (o, k, i, _) {
  4451. if (i === _.length - 1) {
  4452. // 若遍历结束直接赋值
  4453. o[k] = value;
  4454. return null;
  4455. } else if (k in o) {
  4456. // 若存在对应路径,则返回找到的对象,进行下一次遍历
  4457. return o[k];
  4458. } else {
  4459. // 若不存在对应路径,则创建对应对象,若下一路径是数字,新对象赋值为空数组,否则赋值为空对象
  4460. o[k] = /^[0-9]{1,}$/.test(_[i + 1]) ? [] : {};
  4461. return o[k];
  4462. }
  4463. }, object);
  4464. // 返回object
  4465. return object;
  4466. };
  4467. // 处理 path, path有三种形式:'a[0].b.c'、'a.0.b.c' 和 ['a','0','b','c'],需要统一处理成数组,便于后续使用
  4468. exports.objSet = objSet;
  4469. function _basePath(path) {
  4470. // 若是数组,则直接返回
  4471. if (Array.isArray(path)) return path;
  4472. // 若有 '[',']',则替换成将 '[' 替换成 '.',去掉 ']'
  4473. return path.replace(/\[/g, '.').replace(/\]/g, '').split('.');
  4474. }
  4475. /**
  4476. * 从对象中获取值
  4477. * @param {Object|Array} object 源数据
  4478. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  4479. * @param {String} defaultVal 如果无法从调用链中获取值的默认值
  4480. */
  4481. var objGet = function objGet(object, path) {
  4482. var defaultVal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'undefined';
  4483. // 先将path处理成统一格式
  4484. var newPath = _basePath(path);
  4485. // 递归处理,返回最后结果
  4486. var val = newPath.reduce(function (o, k) {
  4487. return (o || {})[k];
  4488. }, object);
  4489. return !val || val !== undefined ? val : defaultVal;
  4490. };
  4491. /**
  4492. * 是否为 number 类型
  4493. * @param {any} num 需要判断的值
  4494. * @return {Boolean} 是否为 number
  4495. */
  4496. exports.objGet = objGet;
  4497. var isNumber = function isNumber(num) {
  4498. return !isNaN(Number(num));
  4499. };
  4500. /**
  4501. * 是否为 boolean 类型
  4502. * @param {any} bool 需要判断的值
  4503. * @return {Boolean} 是否为 boolean
  4504. */
  4505. exports.isNumber = isNumber;
  4506. var isBoolean = function isBoolean(bool) {
  4507. return typeof bool === 'boolean';
  4508. };
  4509. /**
  4510. * 是否有必填字段
  4511. * @param {Object} rules 规则
  4512. * @return {Boolean} 是否有必填字段
  4513. */
  4514. exports.isBoolean = isBoolean;
  4515. var isRequiredField = function isRequiredField(rules) {
  4516. var isNoField = false;
  4517. for (var i = 0; i < rules.length; i++) {
  4518. var ruleData = rules[i];
  4519. if (ruleData.required) {
  4520. isNoField = true;
  4521. break;
  4522. }
  4523. }
  4524. return isNoField;
  4525. };
  4526. /**
  4527. * 获取数据类型
  4528. * @param {Any} obj 需要获取数据类型的值
  4529. */
  4530. exports.isRequiredField = isRequiredField;
  4531. var type = function type(obj) {
  4532. var class2type = {};
  4533. // 生成class2type映射
  4534. "Boolean Number String Function Array Date RegExp Object Error".split(" ").map(function (item, index) {
  4535. class2type["[object " + item + "]"] = item.toLowerCase();
  4536. });
  4537. if (obj == null) {
  4538. return obj + "";
  4539. }
  4540. return (0, _typeof2.default)(obj) === "object" || typeof obj === "function" ? class2type[Object.prototype.toString.call(obj)] || "object" : (0, _typeof2.default)(obj);
  4541. };
  4542. /**
  4543. * 判断两个值是否相等
  4544. * @param {any} a 值
  4545. * @param {any} b 值
  4546. * @return {Boolean} 是否相等
  4547. */
  4548. exports.type = type;
  4549. var isEqual = function isEqual(a, b) {
  4550. //如果a和b本来就全等
  4551. if (a === b) {
  4552. //判断是否为0和-0
  4553. return a !== 0 || 1 / a === 1 / b;
  4554. }
  4555. //判断是否为null和undefined
  4556. if (a == null || b == null) {
  4557. return a === b;
  4558. }
  4559. //接下来判断a和b的数据类型
  4560. var classNameA = toString.call(a),
  4561. classNameB = toString.call(b);
  4562. //如果数据类型不相等,则返回false
  4563. if (classNameA !== classNameB) {
  4564. return false;
  4565. }
  4566. //如果数据类型相等,再根据不同数据类型分别判断
  4567. switch (classNameA) {
  4568. case '[object RegExp]':
  4569. case '[object String]':
  4570. //进行字符串转换比较
  4571. return '' + a === '' + b;
  4572. case '[object Number]':
  4573. //进行数字转换比较,判断是否为NaN
  4574. if (+a !== +a) {
  4575. return +b !== +b;
  4576. }
  4577. //判断是否为0或-0
  4578. return +a === 0 ? 1 / +a === 1 / b : +a === +b;
  4579. case '[object Date]':
  4580. case '[object Boolean]':
  4581. return +a === +b;
  4582. }
  4583. //如果是对象类型
  4584. if (classNameA == '[object Object]') {
  4585. //获取a和b的属性长度
  4586. var propsA = Object.getOwnPropertyNames(a),
  4587. propsB = Object.getOwnPropertyNames(b);
  4588. if (propsA.length != propsB.length) {
  4589. return false;
  4590. }
  4591. for (var i = 0; i < propsA.length; i++) {
  4592. var propName = propsA[i];
  4593. //如果对应属性对应值不相等,则返回false
  4594. if (a[propName] !== b[propName]) {
  4595. return false;
  4596. }
  4597. }
  4598. return true;
  4599. }
  4600. //如果是数组类型
  4601. if (classNameA == '[object Array]') {
  4602. if (a.toString() == b.toString()) {
  4603. return true;
  4604. }
  4605. return false;
  4606. }
  4607. };
  4608. exports.isEqual = isEqual;
  4609. /***/ }),
  4610. /***/ 22:
  4611. /*!*************************************************************!*\
  4612. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  4613. \*************************************************************/
  4614. /*! no static exports found */
  4615. /***/ (function(module, exports, __webpack_require__) {
  4616. "use strict";
  4617. /* WEBPACK VAR INJECTION */(function(uni, global) {
  4618. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  4619. Object.defineProperty(exports, "__esModule", {
  4620. value: true
  4621. });
  4622. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  4623. exports.compileI18nJsonStr = compileI18nJsonStr;
  4624. exports.hasI18nJson = hasI18nJson;
  4625. exports.initVueI18n = initVueI18n;
  4626. exports.isI18nStr = isI18nStr;
  4627. exports.isString = void 0;
  4628. exports.normalizeLocale = normalizeLocale;
  4629. exports.parseI18nJson = parseI18nJson;
  4630. exports.resolveLocale = resolveLocale;
  4631. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  4632. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  4633. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  4634. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  4635. var isObject = function isObject(val) {
  4636. return val !== null && (0, _typeof2.default)(val) === 'object';
  4637. };
  4638. var defaultDelimiters = ['{', '}'];
  4639. var BaseFormatter = /*#__PURE__*/function () {
  4640. function BaseFormatter() {
  4641. (0, _classCallCheck2.default)(this, BaseFormatter);
  4642. this._caches = Object.create(null);
  4643. }
  4644. (0, _createClass2.default)(BaseFormatter, [{
  4645. key: "interpolate",
  4646. value: function interpolate(message, values) {
  4647. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  4648. if (!values) {
  4649. return [message];
  4650. }
  4651. var tokens = this._caches[message];
  4652. if (!tokens) {
  4653. tokens = parse(message, delimiters);
  4654. this._caches[message] = tokens;
  4655. }
  4656. return compile(tokens, values);
  4657. }
  4658. }]);
  4659. return BaseFormatter;
  4660. }();
  4661. exports.Formatter = BaseFormatter;
  4662. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  4663. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  4664. function parse(format, _ref) {
  4665. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  4666. startDelimiter = _ref2[0],
  4667. endDelimiter = _ref2[1];
  4668. var tokens = [];
  4669. var position = 0;
  4670. var text = '';
  4671. while (position < format.length) {
  4672. var char = format[position++];
  4673. if (char === startDelimiter) {
  4674. if (text) {
  4675. tokens.push({
  4676. type: 'text',
  4677. value: text
  4678. });
  4679. }
  4680. text = '';
  4681. var sub = '';
  4682. char = format[position++];
  4683. while (char !== undefined && char !== endDelimiter) {
  4684. sub += char;
  4685. char = format[position++];
  4686. }
  4687. var isClosed = char === endDelimiter;
  4688. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  4689. tokens.push({
  4690. value: sub,
  4691. type: type
  4692. });
  4693. }
  4694. // else if (char === '%') {
  4695. // // when found rails i18n syntax, skip text capture
  4696. // if (format[position] !== '{') {
  4697. // text += char
  4698. // }
  4699. // }
  4700. else {
  4701. text += char;
  4702. }
  4703. }
  4704. text && tokens.push({
  4705. type: 'text',
  4706. value: text
  4707. });
  4708. return tokens;
  4709. }
  4710. function compile(tokens, values) {
  4711. var compiled = [];
  4712. var index = 0;
  4713. var mode = Array.isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  4714. if (mode === 'unknown') {
  4715. return compiled;
  4716. }
  4717. while (index < tokens.length) {
  4718. var token = tokens[index];
  4719. switch (token.type) {
  4720. case 'text':
  4721. compiled.push(token.value);
  4722. break;
  4723. case 'list':
  4724. compiled.push(values[parseInt(token.value, 10)]);
  4725. break;
  4726. case 'named':
  4727. if (mode === 'named') {
  4728. compiled.push(values[token.value]);
  4729. } else {
  4730. if (true) {
  4731. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  4732. }
  4733. }
  4734. break;
  4735. case 'unknown':
  4736. if (true) {
  4737. console.warn("Detect 'unknown' type of token!");
  4738. }
  4739. break;
  4740. }
  4741. index++;
  4742. }
  4743. return compiled;
  4744. }
  4745. var LOCALE_ZH_HANS = 'zh-Hans';
  4746. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  4747. var LOCALE_ZH_HANT = 'zh-Hant';
  4748. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  4749. var LOCALE_EN = 'en';
  4750. exports.LOCALE_EN = LOCALE_EN;
  4751. var LOCALE_FR = 'fr';
  4752. exports.LOCALE_FR = LOCALE_FR;
  4753. var LOCALE_ES = 'es';
  4754. exports.LOCALE_ES = LOCALE_ES;
  4755. var hasOwnProperty = Object.prototype.hasOwnProperty;
  4756. var hasOwn = function hasOwn(val, key) {
  4757. return hasOwnProperty.call(val, key);
  4758. };
  4759. var defaultFormatter = new BaseFormatter();
  4760. function include(str, parts) {
  4761. return !!parts.find(function (part) {
  4762. return str.indexOf(part) !== -1;
  4763. });
  4764. }
  4765. function startsWith(str, parts) {
  4766. return parts.find(function (part) {
  4767. return str.indexOf(part) === 0;
  4768. });
  4769. }
  4770. function normalizeLocale(locale, messages) {
  4771. if (!locale) {
  4772. return;
  4773. }
  4774. locale = locale.trim().replace(/_/g, '-');
  4775. if (messages && messages[locale]) {
  4776. return locale;
  4777. }
  4778. locale = locale.toLowerCase();
  4779. if (locale === 'chinese') {
  4780. // 支付宝
  4781. return LOCALE_ZH_HANS;
  4782. }
  4783. if (locale.indexOf('zh') === 0) {
  4784. if (locale.indexOf('-hans') > -1) {
  4785. return LOCALE_ZH_HANS;
  4786. }
  4787. if (locale.indexOf('-hant') > -1) {
  4788. return LOCALE_ZH_HANT;
  4789. }
  4790. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  4791. return LOCALE_ZH_HANT;
  4792. }
  4793. return LOCALE_ZH_HANS;
  4794. }
  4795. var locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
  4796. if (messages && Object.keys(messages).length > 0) {
  4797. locales = Object.keys(messages);
  4798. }
  4799. var lang = startsWith(locale, locales);
  4800. if (lang) {
  4801. return lang;
  4802. }
  4803. }
  4804. var I18n = /*#__PURE__*/function () {
  4805. function I18n(_ref3) {
  4806. var locale = _ref3.locale,
  4807. fallbackLocale = _ref3.fallbackLocale,
  4808. messages = _ref3.messages,
  4809. watcher = _ref3.watcher,
  4810. formater = _ref3.formater;
  4811. (0, _classCallCheck2.default)(this, I18n);
  4812. this.locale = LOCALE_EN;
  4813. this.fallbackLocale = LOCALE_EN;
  4814. this.message = {};
  4815. this.messages = {};
  4816. this.watchers = [];
  4817. if (fallbackLocale) {
  4818. this.fallbackLocale = fallbackLocale;
  4819. }
  4820. this.formater = formater || defaultFormatter;
  4821. this.messages = messages || {};
  4822. this.setLocale(locale || LOCALE_EN);
  4823. if (watcher) {
  4824. this.watchLocale(watcher);
  4825. }
  4826. }
  4827. (0, _createClass2.default)(I18n, [{
  4828. key: "setLocale",
  4829. value: function setLocale(locale) {
  4830. var _this = this;
  4831. var oldLocale = this.locale;
  4832. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  4833. if (!this.messages[this.locale]) {
  4834. // 可能初始化时不存在
  4835. this.messages[this.locale] = {};
  4836. }
  4837. this.message = this.messages[this.locale];
  4838. // 仅发生变化时,通知
  4839. if (oldLocale !== this.locale) {
  4840. this.watchers.forEach(function (watcher) {
  4841. watcher(_this.locale, oldLocale);
  4842. });
  4843. }
  4844. }
  4845. }, {
  4846. key: "getLocale",
  4847. value: function getLocale() {
  4848. return this.locale;
  4849. }
  4850. }, {
  4851. key: "watchLocale",
  4852. value: function watchLocale(fn) {
  4853. var _this2 = this;
  4854. var index = this.watchers.push(fn) - 1;
  4855. return function () {
  4856. _this2.watchers.splice(index, 1);
  4857. };
  4858. }
  4859. }, {
  4860. key: "add",
  4861. value: function add(locale, message) {
  4862. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  4863. var curMessages = this.messages[locale];
  4864. if (curMessages) {
  4865. if (override) {
  4866. Object.assign(curMessages, message);
  4867. } else {
  4868. Object.keys(message).forEach(function (key) {
  4869. if (!hasOwn(curMessages, key)) {
  4870. curMessages[key] = message[key];
  4871. }
  4872. });
  4873. }
  4874. } else {
  4875. this.messages[locale] = message;
  4876. }
  4877. }
  4878. }, {
  4879. key: "f",
  4880. value: function f(message, values, delimiters) {
  4881. return this.formater.interpolate(message, values, delimiters).join('');
  4882. }
  4883. }, {
  4884. key: "t",
  4885. value: function t(key, locale, values) {
  4886. var message = this.message;
  4887. if (typeof locale === 'string') {
  4888. locale = normalizeLocale(locale, this.messages);
  4889. locale && (message = this.messages[locale]);
  4890. } else {
  4891. values = locale;
  4892. }
  4893. if (!hasOwn(message, key)) {
  4894. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  4895. return key;
  4896. }
  4897. return this.formater.interpolate(message[key], values).join('');
  4898. }
  4899. }]);
  4900. return I18n;
  4901. }();
  4902. exports.I18n = I18n;
  4903. function watchAppLocale(appVm, i18n) {
  4904. // 需要保证 watch 的触发在组件渲染之前
  4905. if (appVm.$watchLocale) {
  4906. // vue2
  4907. appVm.$watchLocale(function (newLocale) {
  4908. i18n.setLocale(newLocale);
  4909. });
  4910. } else {
  4911. appVm.$watch(function () {
  4912. return appVm.$locale;
  4913. }, function (newLocale) {
  4914. i18n.setLocale(newLocale);
  4915. });
  4916. }
  4917. }
  4918. function getDefaultLocale() {
  4919. if (typeof uni !== 'undefined' && uni.getLocale) {
  4920. return uni.getLocale();
  4921. }
  4922. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  4923. if (typeof global !== 'undefined' && global.getLocale) {
  4924. return global.getLocale();
  4925. }
  4926. return LOCALE_EN;
  4927. }
  4928. function initVueI18n(locale) {
  4929. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  4930. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  4931. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  4932. // 兼容旧版本入参
  4933. if (typeof locale !== 'string') {
  4934. var _ref4 = [messages, locale];
  4935. locale = _ref4[0];
  4936. messages = _ref4[1];
  4937. }
  4938. if (typeof locale !== 'string') {
  4939. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  4940. locale = getDefaultLocale();
  4941. }
  4942. if (typeof fallbackLocale !== 'string') {
  4943. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  4944. }
  4945. var i18n = new I18n({
  4946. locale: locale,
  4947. fallbackLocale: fallbackLocale,
  4948. messages: messages,
  4949. watcher: watcher
  4950. });
  4951. var _t = function t(key, values) {
  4952. if (typeof getApp !== 'function') {
  4953. // app view
  4954. /* eslint-disable no-func-assign */
  4955. _t = function t(key, values) {
  4956. return i18n.t(key, values);
  4957. };
  4958. } else {
  4959. var isWatchedAppLocale = false;
  4960. _t = function t(key, values) {
  4961. var appVm = getApp().$vm;
  4962. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  4963. // options: {
  4964. // type: Array,
  4965. // default () {
  4966. // return [{
  4967. // icon: 'shop',
  4968. // text: t("uni-goods-nav.options.shop"),
  4969. // }, {
  4970. // icon: 'cart',
  4971. // text: t("uni-goods-nav.options.cart")
  4972. // }]
  4973. // }
  4974. // },
  4975. if (appVm) {
  4976. // 触发响应式
  4977. appVm.$locale;
  4978. if (!isWatchedAppLocale) {
  4979. isWatchedAppLocale = true;
  4980. watchAppLocale(appVm, i18n);
  4981. }
  4982. }
  4983. return i18n.t(key, values);
  4984. };
  4985. }
  4986. return _t(key, values);
  4987. };
  4988. return {
  4989. i18n: i18n,
  4990. f: function f(message, values, delimiters) {
  4991. return i18n.f(message, values, delimiters);
  4992. },
  4993. t: function t(key, values) {
  4994. return _t(key, values);
  4995. },
  4996. add: function add(locale, message) {
  4997. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  4998. return i18n.add(locale, message, override);
  4999. },
  5000. watch: function watch(fn) {
  5001. return i18n.watchLocale(fn);
  5002. },
  5003. getLocale: function getLocale() {
  5004. return i18n.getLocale();
  5005. },
  5006. setLocale: function setLocale(newLocale) {
  5007. return i18n.setLocale(newLocale);
  5008. }
  5009. };
  5010. }
  5011. var isString = function isString(val) {
  5012. return typeof val === 'string';
  5013. };
  5014. exports.isString = isString;
  5015. var formater;
  5016. function hasI18nJson(jsonObj, delimiters) {
  5017. if (!formater) {
  5018. formater = new BaseFormatter();
  5019. }
  5020. return walkJsonObj(jsonObj, function (jsonObj, key) {
  5021. var value = jsonObj[key];
  5022. if (isString(value)) {
  5023. if (isI18nStr(value, delimiters)) {
  5024. return true;
  5025. }
  5026. } else {
  5027. return hasI18nJson(value, delimiters);
  5028. }
  5029. });
  5030. }
  5031. function parseI18nJson(jsonObj, values, delimiters) {
  5032. if (!formater) {
  5033. formater = new BaseFormatter();
  5034. }
  5035. walkJsonObj(jsonObj, function (jsonObj, key) {
  5036. var value = jsonObj[key];
  5037. if (isString(value)) {
  5038. if (isI18nStr(value, delimiters)) {
  5039. jsonObj[key] = compileStr(value, values, delimiters);
  5040. }
  5041. } else {
  5042. parseI18nJson(value, values, delimiters);
  5043. }
  5044. });
  5045. return jsonObj;
  5046. }
  5047. function compileI18nJsonStr(jsonStr, _ref5) {
  5048. var locale = _ref5.locale,
  5049. locales = _ref5.locales,
  5050. delimiters = _ref5.delimiters;
  5051. if (!isI18nStr(jsonStr, delimiters)) {
  5052. return jsonStr;
  5053. }
  5054. if (!formater) {
  5055. formater = new BaseFormatter();
  5056. }
  5057. var localeValues = [];
  5058. Object.keys(locales).forEach(function (name) {
  5059. if (name !== locale) {
  5060. localeValues.push({
  5061. locale: name,
  5062. values: locales[name]
  5063. });
  5064. }
  5065. });
  5066. localeValues.unshift({
  5067. locale: locale,
  5068. values: locales[locale]
  5069. });
  5070. try {
  5071. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  5072. } catch (e) {}
  5073. return jsonStr;
  5074. }
  5075. function isI18nStr(value, delimiters) {
  5076. return value.indexOf(delimiters[0]) > -1;
  5077. }
  5078. function compileStr(value, values, delimiters) {
  5079. return formater.interpolate(value, values, delimiters).join('');
  5080. }
  5081. function compileValue(jsonObj, key, localeValues, delimiters) {
  5082. var value = jsonObj[key];
  5083. if (isString(value)) {
  5084. // 存在国际化
  5085. if (isI18nStr(value, delimiters)) {
  5086. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  5087. if (localeValues.length > 1) {
  5088. // 格式化国际化语言
  5089. var valueLocales = jsonObj[key + 'Locales'] = {};
  5090. localeValues.forEach(function (localValue) {
  5091. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  5092. });
  5093. }
  5094. }
  5095. } else {
  5096. compileJsonObj(value, localeValues, delimiters);
  5097. }
  5098. }
  5099. function compileJsonObj(jsonObj, localeValues, delimiters) {
  5100. walkJsonObj(jsonObj, function (jsonObj, key) {
  5101. compileValue(jsonObj, key, localeValues, delimiters);
  5102. });
  5103. return jsonObj;
  5104. }
  5105. function walkJsonObj(jsonObj, walk) {
  5106. if (Array.isArray(jsonObj)) {
  5107. for (var i = 0; i < jsonObj.length; i++) {
  5108. if (walk(jsonObj, i)) {
  5109. return true;
  5110. }
  5111. }
  5112. } else if (isObject(jsonObj)) {
  5113. for (var key in jsonObj) {
  5114. if (walk(jsonObj, key)) {
  5115. return true;
  5116. }
  5117. }
  5118. }
  5119. return false;
  5120. }
  5121. function resolveLocale(locales) {
  5122. return function (locale) {
  5123. if (!locale) {
  5124. return locale;
  5125. }
  5126. locale = normalizeLocale(locale) || locale;
  5127. return resolveLocaleChain(locale).find(function (locale) {
  5128. return locales.indexOf(locale) > -1;
  5129. });
  5130. };
  5131. }
  5132. function resolveLocaleChain(locale) {
  5133. var chain = [];
  5134. var tokens = locale.split('-');
  5135. while (tokens.length) {
  5136. chain.push(tokens.join('-'));
  5137. tokens.pop();
  5138. }
  5139. return chain;
  5140. }
  5141. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 3)))
  5142. /***/ }),
  5143. /***/ 23:
  5144. /*!***************************************************************!*\
  5145. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  5146. \***************************************************************/
  5147. /*! no static exports found */
  5148. /***/ (function(module, exports) {
  5149. function _classCallCheck(instance, Constructor) {
  5150. if (!(instance instanceof Constructor)) {
  5151. throw new TypeError("Cannot call a class as a function");
  5152. }
  5153. }
  5154. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  5155. /***/ }),
  5156. /***/ 24:
  5157. /*!************************************************************!*\
  5158. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  5159. \************************************************************/
  5160. /*! no static exports found */
  5161. /***/ (function(module, exports, __webpack_require__) {
  5162. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  5163. function _defineProperties(target, props) {
  5164. for (var i = 0; i < props.length; i++) {
  5165. var descriptor = props[i];
  5166. descriptor.enumerable = descriptor.enumerable || false;
  5167. descriptor.configurable = true;
  5168. if ("value" in descriptor) descriptor.writable = true;
  5169. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  5170. }
  5171. }
  5172. function _createClass(Constructor, protoProps, staticProps) {
  5173. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  5174. if (staticProps) _defineProperties(Constructor, staticProps);
  5175. Object.defineProperty(Constructor, "prototype", {
  5176. writable: false
  5177. });
  5178. return Constructor;
  5179. }
  5180. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  5181. /***/ }),
  5182. /***/ 25:
  5183. /*!******************************************************************************************!*\
  5184. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  5185. \******************************************************************************************/
  5186. /*! exports provided: default */
  5187. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5188. "use strict";
  5189. __webpack_require__.r(__webpack_exports__);
  5190. /* WEBPACK VAR INJECTION */(function(global) {/*!
  5191. * Vue.js v2.6.11
  5192. * (c) 2014-2023 Evan You
  5193. * Released under the MIT License.
  5194. */
  5195. /* */
  5196. var emptyObject = Object.freeze({});
  5197. // These helpers produce better VM code in JS engines due to their
  5198. // explicitness and function inlining.
  5199. function isUndef (v) {
  5200. return v === undefined || v === null
  5201. }
  5202. function isDef (v) {
  5203. return v !== undefined && v !== null
  5204. }
  5205. function isTrue (v) {
  5206. return v === true
  5207. }
  5208. function isFalse (v) {
  5209. return v === false
  5210. }
  5211. /**
  5212. * Check if value is primitive.
  5213. */
  5214. function isPrimitive (value) {
  5215. return (
  5216. typeof value === 'string' ||
  5217. typeof value === 'number' ||
  5218. // $flow-disable-line
  5219. typeof value === 'symbol' ||
  5220. typeof value === 'boolean'
  5221. )
  5222. }
  5223. /**
  5224. * Quick object check - this is primarily used to tell
  5225. * Objects from primitive values when we know the value
  5226. * is a JSON-compliant type.
  5227. */
  5228. function isObject (obj) {
  5229. return obj !== null && typeof obj === 'object'
  5230. }
  5231. /**
  5232. * Get the raw type string of a value, e.g., [object Object].
  5233. */
  5234. var _toString = Object.prototype.toString;
  5235. function toRawType (value) {
  5236. return _toString.call(value).slice(8, -1)
  5237. }
  5238. /**
  5239. * Strict object type check. Only returns true
  5240. * for plain JavaScript objects.
  5241. */
  5242. function isPlainObject (obj) {
  5243. return _toString.call(obj) === '[object Object]'
  5244. }
  5245. function isRegExp (v) {
  5246. return _toString.call(v) === '[object RegExp]'
  5247. }
  5248. /**
  5249. * Check if val is a valid array index.
  5250. */
  5251. function isValidArrayIndex (val) {
  5252. var n = parseFloat(String(val));
  5253. return n >= 0 && Math.floor(n) === n && isFinite(val)
  5254. }
  5255. function isPromise (val) {
  5256. return (
  5257. isDef(val) &&
  5258. typeof val.then === 'function' &&
  5259. typeof val.catch === 'function'
  5260. )
  5261. }
  5262. /**
  5263. * Convert a value to a string that is actually rendered.
  5264. */
  5265. function toString (val) {
  5266. return val == null
  5267. ? ''
  5268. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  5269. ? JSON.stringify(val, null, 2)
  5270. : String(val)
  5271. }
  5272. /**
  5273. * Convert an input value to a number for persistence.
  5274. * If the conversion fails, return original string.
  5275. */
  5276. function toNumber (val) {
  5277. var n = parseFloat(val);
  5278. return isNaN(n) ? val : n
  5279. }
  5280. /**
  5281. * Make a map and return a function for checking if a key
  5282. * is in that map.
  5283. */
  5284. function makeMap (
  5285. str,
  5286. expectsLowerCase
  5287. ) {
  5288. var map = Object.create(null);
  5289. var list = str.split(',');
  5290. for (var i = 0; i < list.length; i++) {
  5291. map[list[i]] = true;
  5292. }
  5293. return expectsLowerCase
  5294. ? function (val) { return map[val.toLowerCase()]; }
  5295. : function (val) { return map[val]; }
  5296. }
  5297. /**
  5298. * Check if a tag is a built-in tag.
  5299. */
  5300. var isBuiltInTag = makeMap('slot,component', true);
  5301. /**
  5302. * Check if an attribute is a reserved attribute.
  5303. */
  5304. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  5305. /**
  5306. * Remove an item from an array.
  5307. */
  5308. function remove (arr, item) {
  5309. if (arr.length) {
  5310. var index = arr.indexOf(item);
  5311. if (index > -1) {
  5312. return arr.splice(index, 1)
  5313. }
  5314. }
  5315. }
  5316. /**
  5317. * Check whether an object has the property.
  5318. */
  5319. var hasOwnProperty = Object.prototype.hasOwnProperty;
  5320. function hasOwn (obj, key) {
  5321. return hasOwnProperty.call(obj, key)
  5322. }
  5323. /**
  5324. * Create a cached version of a pure function.
  5325. */
  5326. function cached (fn) {
  5327. var cache = Object.create(null);
  5328. return (function cachedFn (str) {
  5329. var hit = cache[str];
  5330. return hit || (cache[str] = fn(str))
  5331. })
  5332. }
  5333. /**
  5334. * Camelize a hyphen-delimited string.
  5335. */
  5336. var camelizeRE = /-(\w)/g;
  5337. var camelize = cached(function (str) {
  5338. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  5339. });
  5340. /**
  5341. * Capitalize a string.
  5342. */
  5343. var capitalize = cached(function (str) {
  5344. return str.charAt(0).toUpperCase() + str.slice(1)
  5345. });
  5346. /**
  5347. * Hyphenate a camelCase string.
  5348. */
  5349. var hyphenateRE = /\B([A-Z])/g;
  5350. var hyphenate = cached(function (str) {
  5351. return str.replace(hyphenateRE, '-$1').toLowerCase()
  5352. });
  5353. /**
  5354. * Simple bind polyfill for environments that do not support it,
  5355. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  5356. * since native bind is now performant enough in most browsers.
  5357. * But removing it would mean breaking code that was able to run in
  5358. * PhantomJS 1.x, so this must be kept for backward compatibility.
  5359. */
  5360. /* istanbul ignore next */
  5361. function polyfillBind (fn, ctx) {
  5362. function boundFn (a) {
  5363. var l = arguments.length;
  5364. return l
  5365. ? l > 1
  5366. ? fn.apply(ctx, arguments)
  5367. : fn.call(ctx, a)
  5368. : fn.call(ctx)
  5369. }
  5370. boundFn._length = fn.length;
  5371. return boundFn
  5372. }
  5373. function nativeBind (fn, ctx) {
  5374. return fn.bind(ctx)
  5375. }
  5376. var bind = Function.prototype.bind
  5377. ? nativeBind
  5378. : polyfillBind;
  5379. /**
  5380. * Convert an Array-like object to a real Array.
  5381. */
  5382. function toArray (list, start) {
  5383. start = start || 0;
  5384. var i = list.length - start;
  5385. var ret = new Array(i);
  5386. while (i--) {
  5387. ret[i] = list[i + start];
  5388. }
  5389. return ret
  5390. }
  5391. /**
  5392. * Mix properties into target object.
  5393. */
  5394. function extend (to, _from) {
  5395. for (var key in _from) {
  5396. to[key] = _from[key];
  5397. }
  5398. return to
  5399. }
  5400. /**
  5401. * Merge an Array of Objects into a single Object.
  5402. */
  5403. function toObject (arr) {
  5404. var res = {};
  5405. for (var i = 0; i < arr.length; i++) {
  5406. if (arr[i]) {
  5407. extend(res, arr[i]);
  5408. }
  5409. }
  5410. return res
  5411. }
  5412. /* eslint-disable no-unused-vars */
  5413. /**
  5414. * Perform no operation.
  5415. * Stubbing args to make Flow happy without leaving useless transpiled code
  5416. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  5417. */
  5418. function noop (a, b, c) {}
  5419. /**
  5420. * Always return false.
  5421. */
  5422. var no = function (a, b, c) { return false; };
  5423. /* eslint-enable no-unused-vars */
  5424. /**
  5425. * Return the same value.
  5426. */
  5427. var identity = function (_) { return _; };
  5428. /**
  5429. * Check if two values are loosely equal - that is,
  5430. * if they are plain objects, do they have the same shape?
  5431. */
  5432. function looseEqual (a, b) {
  5433. if (a === b) { return true }
  5434. var isObjectA = isObject(a);
  5435. var isObjectB = isObject(b);
  5436. if (isObjectA && isObjectB) {
  5437. try {
  5438. var isArrayA = Array.isArray(a);
  5439. var isArrayB = Array.isArray(b);
  5440. if (isArrayA && isArrayB) {
  5441. return a.length === b.length && a.every(function (e, i) {
  5442. return looseEqual(e, b[i])
  5443. })
  5444. } else if (a instanceof Date && b instanceof Date) {
  5445. return a.getTime() === b.getTime()
  5446. } else if (!isArrayA && !isArrayB) {
  5447. var keysA = Object.keys(a);
  5448. var keysB = Object.keys(b);
  5449. return keysA.length === keysB.length && keysA.every(function (key) {
  5450. return looseEqual(a[key], b[key])
  5451. })
  5452. } else {
  5453. /* istanbul ignore next */
  5454. return false
  5455. }
  5456. } catch (e) {
  5457. /* istanbul ignore next */
  5458. return false
  5459. }
  5460. } else if (!isObjectA && !isObjectB) {
  5461. return String(a) === String(b)
  5462. } else {
  5463. return false
  5464. }
  5465. }
  5466. /**
  5467. * Return the first index at which a loosely equal value can be
  5468. * found in the array (if value is a plain object, the array must
  5469. * contain an object of the same shape), or -1 if it is not present.
  5470. */
  5471. function looseIndexOf (arr, val) {
  5472. for (var i = 0; i < arr.length; i++) {
  5473. if (looseEqual(arr[i], val)) { return i }
  5474. }
  5475. return -1
  5476. }
  5477. /**
  5478. * Ensure a function is called only once.
  5479. */
  5480. function once (fn) {
  5481. var called = false;
  5482. return function () {
  5483. if (!called) {
  5484. called = true;
  5485. fn.apply(this, arguments);
  5486. }
  5487. }
  5488. }
  5489. var ASSET_TYPES = [
  5490. 'component',
  5491. 'directive',
  5492. 'filter'
  5493. ];
  5494. var LIFECYCLE_HOOKS = [
  5495. 'beforeCreate',
  5496. 'created',
  5497. 'beforeMount',
  5498. 'mounted',
  5499. 'beforeUpdate',
  5500. 'updated',
  5501. 'beforeDestroy',
  5502. 'destroyed',
  5503. 'activated',
  5504. 'deactivated',
  5505. 'errorCaptured',
  5506. 'serverPrefetch'
  5507. ];
  5508. /* */
  5509. var config = ({
  5510. /**
  5511. * Option merge strategies (used in core/util/options)
  5512. */
  5513. // $flow-disable-line
  5514. optionMergeStrategies: Object.create(null),
  5515. /**
  5516. * Whether to suppress warnings.
  5517. */
  5518. silent: false,
  5519. /**
  5520. * Show production mode tip message on boot?
  5521. */
  5522. productionTip: "development" !== 'production',
  5523. /**
  5524. * Whether to enable devtools
  5525. */
  5526. devtools: "development" !== 'production',
  5527. /**
  5528. * Whether to record perf
  5529. */
  5530. performance: false,
  5531. /**
  5532. * Error handler for watcher errors
  5533. */
  5534. errorHandler: null,
  5535. /**
  5536. * Warn handler for watcher warns
  5537. */
  5538. warnHandler: null,
  5539. /**
  5540. * Ignore certain custom elements
  5541. */
  5542. ignoredElements: [],
  5543. /**
  5544. * Custom user key aliases for v-on
  5545. */
  5546. // $flow-disable-line
  5547. keyCodes: Object.create(null),
  5548. /**
  5549. * Check if a tag is reserved so that it cannot be registered as a
  5550. * component. This is platform-dependent and may be overwritten.
  5551. */
  5552. isReservedTag: no,
  5553. /**
  5554. * Check if an attribute is reserved so that it cannot be used as a component
  5555. * prop. This is platform-dependent and may be overwritten.
  5556. */
  5557. isReservedAttr: no,
  5558. /**
  5559. * Check if a tag is an unknown element.
  5560. * Platform-dependent.
  5561. */
  5562. isUnknownElement: no,
  5563. /**
  5564. * Get the namespace of an element
  5565. */
  5566. getTagNamespace: noop,
  5567. /**
  5568. * Parse the real tag name for the specific platform.
  5569. */
  5570. parsePlatformTagName: identity,
  5571. /**
  5572. * Check if an attribute must be bound using property, e.g. value
  5573. * Platform-dependent.
  5574. */
  5575. mustUseProp: no,
  5576. /**
  5577. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  5578. * This will significantly reduce performance if set to false.
  5579. */
  5580. async: true,
  5581. /**
  5582. * Exposed for legacy reasons
  5583. */
  5584. _lifecycleHooks: LIFECYCLE_HOOKS
  5585. });
  5586. /* */
  5587. /**
  5588. * unicode letters used for parsing html tags, component names and property paths.
  5589. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  5590. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  5591. */
  5592. 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/;
  5593. /**
  5594. * Check if a string starts with $ or _
  5595. */
  5596. function isReserved (str) {
  5597. var c = (str + '').charCodeAt(0);
  5598. return c === 0x24 || c === 0x5F
  5599. }
  5600. /**
  5601. * Define a property.
  5602. */
  5603. function def (obj, key, val, enumerable) {
  5604. Object.defineProperty(obj, key, {
  5605. value: val,
  5606. enumerable: !!enumerable,
  5607. writable: true,
  5608. configurable: true
  5609. });
  5610. }
  5611. /**
  5612. * Parse simple path.
  5613. */
  5614. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  5615. function parsePath (path) {
  5616. if (bailRE.test(path)) {
  5617. return
  5618. }
  5619. var segments = path.split('.');
  5620. return function (obj) {
  5621. for (var i = 0; i < segments.length; i++) {
  5622. if (!obj) { return }
  5623. obj = obj[segments[i]];
  5624. }
  5625. return obj
  5626. }
  5627. }
  5628. /* */
  5629. // can we use __proto__?
  5630. var hasProto = '__proto__' in {};
  5631. // Browser environment sniffing
  5632. var inBrowser = typeof window !== 'undefined';
  5633. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  5634. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  5635. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  5636. var isIE = UA && /msie|trident/.test(UA);
  5637. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  5638. var isEdge = UA && UA.indexOf('edge/') > 0;
  5639. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  5640. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  5641. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  5642. var isPhantomJS = UA && /phantomjs/.test(UA);
  5643. var isFF = UA && UA.match(/firefox\/(\d+)/);
  5644. // Firefox has a "watch" function on Object.prototype...
  5645. var nativeWatch = ({}).watch;
  5646. if (inBrowser) {
  5647. try {
  5648. var opts = {};
  5649. Object.defineProperty(opts, 'passive', ({
  5650. get: function get () {
  5651. }
  5652. })); // https://github.com/facebook/flow/issues/285
  5653. window.addEventListener('test-passive', null, opts);
  5654. } catch (e) {}
  5655. }
  5656. // this needs to be lazy-evaled because vue may be required before
  5657. // vue-server-renderer can set VUE_ENV
  5658. var _isServer;
  5659. var isServerRendering = function () {
  5660. if (_isServer === undefined) {
  5661. /* istanbul ignore if */
  5662. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  5663. // detect presence of vue-server-renderer and avoid
  5664. // Webpack shimming the process
  5665. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  5666. } else {
  5667. _isServer = false;
  5668. }
  5669. }
  5670. return _isServer
  5671. };
  5672. // detect devtools
  5673. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  5674. /* istanbul ignore next */
  5675. function isNative (Ctor) {
  5676. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  5677. }
  5678. var hasSymbol =
  5679. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  5680. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  5681. var _Set;
  5682. /* istanbul ignore if */ // $flow-disable-line
  5683. if (typeof Set !== 'undefined' && isNative(Set)) {
  5684. // use native Set when available.
  5685. _Set = Set;
  5686. } else {
  5687. // a non-standard Set polyfill that only works with primitive keys.
  5688. _Set = /*@__PURE__*/(function () {
  5689. function Set () {
  5690. this.set = Object.create(null);
  5691. }
  5692. Set.prototype.has = function has (key) {
  5693. return this.set[key] === true
  5694. };
  5695. Set.prototype.add = function add (key) {
  5696. this.set[key] = true;
  5697. };
  5698. Set.prototype.clear = function clear () {
  5699. this.set = Object.create(null);
  5700. };
  5701. return Set;
  5702. }());
  5703. }
  5704. /* */
  5705. var warn = noop;
  5706. var tip = noop;
  5707. var generateComponentTrace = (noop); // work around flow check
  5708. var formatComponentName = (noop);
  5709. if (true) {
  5710. var hasConsole = typeof console !== 'undefined';
  5711. var classifyRE = /(?:^|[-_])(\w)/g;
  5712. var classify = function (str) { return str
  5713. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  5714. .replace(/[-_]/g, ''); };
  5715. warn = function (msg, vm) {
  5716. var trace = vm ? generateComponentTrace(vm) : '';
  5717. if (config.warnHandler) {
  5718. config.warnHandler.call(null, msg, vm, trace);
  5719. } else if (hasConsole && (!config.silent)) {
  5720. console.error(("[Vue warn]: " + msg + trace));
  5721. }
  5722. };
  5723. tip = function (msg, vm) {
  5724. if (hasConsole && (!config.silent)) {
  5725. console.warn("[Vue tip]: " + msg + (
  5726. vm ? generateComponentTrace(vm) : ''
  5727. ));
  5728. }
  5729. };
  5730. formatComponentName = function (vm, includeFile) {
  5731. if (vm.$root === vm) {
  5732. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  5733. return ('') + vm.$options.__file
  5734. }
  5735. return '<Root>'
  5736. }
  5737. var options = typeof vm === 'function' && vm.cid != null
  5738. ? vm.options
  5739. : vm._isVue
  5740. ? vm.$options || vm.constructor.options
  5741. : vm;
  5742. var name = options.name || options._componentTag;
  5743. var file = options.__file;
  5744. if (!name && file) {
  5745. var match = file.match(/([^/\\]+)\.vue$/);
  5746. name = match && match[1];
  5747. }
  5748. return (
  5749. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  5750. (file && includeFile !== false ? (" at " + file) : '')
  5751. )
  5752. };
  5753. var repeat = function (str, n) {
  5754. var res = '';
  5755. while (n) {
  5756. if (n % 2 === 1) { res += str; }
  5757. if (n > 1) { str += str; }
  5758. n >>= 1;
  5759. }
  5760. return res
  5761. };
  5762. generateComponentTrace = function (vm) {
  5763. if (vm._isVue && vm.$parent) {
  5764. var tree = [];
  5765. var currentRecursiveSequence = 0;
  5766. while (vm && vm.$options.name !== 'PageBody') {
  5767. if (tree.length > 0) {
  5768. var last = tree[tree.length - 1];
  5769. if (last.constructor === vm.constructor) {
  5770. currentRecursiveSequence++;
  5771. vm = vm.$parent;
  5772. continue
  5773. } else if (currentRecursiveSequence > 0) {
  5774. tree[tree.length - 1] = [last, currentRecursiveSequence];
  5775. currentRecursiveSequence = 0;
  5776. }
  5777. }
  5778. !vm.$options.isReserved && tree.push(vm);
  5779. vm = vm.$parent;
  5780. }
  5781. return '\n\nfound in\n\n' + tree
  5782. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  5783. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  5784. : formatComponentName(vm))); })
  5785. .join('\n')
  5786. } else {
  5787. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  5788. }
  5789. };
  5790. }
  5791. /* */
  5792. var uid = 0;
  5793. /**
  5794. * A dep is an observable that can have multiple
  5795. * directives subscribing to it.
  5796. */
  5797. var Dep = function Dep () {
  5798. this.id = uid++;
  5799. this.subs = [];
  5800. };
  5801. Dep.prototype.addSub = function addSub (sub) {
  5802. this.subs.push(sub);
  5803. };
  5804. Dep.prototype.removeSub = function removeSub (sub) {
  5805. remove(this.subs, sub);
  5806. };
  5807. Dep.prototype.depend = function depend () {
  5808. if (Dep.SharedObject.target) {
  5809. Dep.SharedObject.target.addDep(this);
  5810. }
  5811. };
  5812. Dep.prototype.notify = function notify () {
  5813. // stabilize the subscriber list first
  5814. var subs = this.subs.slice();
  5815. if ( true && !config.async) {
  5816. // subs aren't sorted in scheduler if not running async
  5817. // we need to sort them now to make sure they fire in correct
  5818. // order
  5819. subs.sort(function (a, b) { return a.id - b.id; });
  5820. }
  5821. for (var i = 0, l = subs.length; i < l; i++) {
  5822. subs[i].update();
  5823. }
  5824. };
  5825. // The current target watcher being evaluated.
  5826. // This is globally unique because only one watcher
  5827. // can be evaluated at a time.
  5828. // fixed by xxxxxx (nvue shared vuex)
  5829. /* eslint-disable no-undef */
  5830. Dep.SharedObject = {};
  5831. Dep.SharedObject.target = null;
  5832. Dep.SharedObject.targetStack = [];
  5833. function pushTarget (target) {
  5834. Dep.SharedObject.targetStack.push(target);
  5835. Dep.SharedObject.target = target;
  5836. Dep.target = target;
  5837. }
  5838. function popTarget () {
  5839. Dep.SharedObject.targetStack.pop();
  5840. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  5841. Dep.target = Dep.SharedObject.target;
  5842. }
  5843. /* */
  5844. var VNode = function VNode (
  5845. tag,
  5846. data,
  5847. children,
  5848. text,
  5849. elm,
  5850. context,
  5851. componentOptions,
  5852. asyncFactory
  5853. ) {
  5854. this.tag = tag;
  5855. this.data = data;
  5856. this.children = children;
  5857. this.text = text;
  5858. this.elm = elm;
  5859. this.ns = undefined;
  5860. this.context = context;
  5861. this.fnContext = undefined;
  5862. this.fnOptions = undefined;
  5863. this.fnScopeId = undefined;
  5864. this.key = data && data.key;
  5865. this.componentOptions = componentOptions;
  5866. this.componentInstance = undefined;
  5867. this.parent = undefined;
  5868. this.raw = false;
  5869. this.isStatic = false;
  5870. this.isRootInsert = true;
  5871. this.isComment = false;
  5872. this.isCloned = false;
  5873. this.isOnce = false;
  5874. this.asyncFactory = asyncFactory;
  5875. this.asyncMeta = undefined;
  5876. this.isAsyncPlaceholder = false;
  5877. };
  5878. var prototypeAccessors = { child: { configurable: true } };
  5879. // DEPRECATED: alias for componentInstance for backwards compat.
  5880. /* istanbul ignore next */
  5881. prototypeAccessors.child.get = function () {
  5882. return this.componentInstance
  5883. };
  5884. Object.defineProperties( VNode.prototype, prototypeAccessors );
  5885. var createEmptyVNode = function (text) {
  5886. if ( text === void 0 ) text = '';
  5887. var node = new VNode();
  5888. node.text = text;
  5889. node.isComment = true;
  5890. return node
  5891. };
  5892. function createTextVNode (val) {
  5893. return new VNode(undefined, undefined, undefined, String(val))
  5894. }
  5895. // optimized shallow clone
  5896. // used for static nodes and slot nodes because they may be reused across
  5897. // multiple renders, cloning them avoids errors when DOM manipulations rely
  5898. // on their elm reference.
  5899. function cloneVNode (vnode) {
  5900. var cloned = new VNode(
  5901. vnode.tag,
  5902. vnode.data,
  5903. // #7975
  5904. // clone children array to avoid mutating original in case of cloning
  5905. // a child.
  5906. vnode.children && vnode.children.slice(),
  5907. vnode.text,
  5908. vnode.elm,
  5909. vnode.context,
  5910. vnode.componentOptions,
  5911. vnode.asyncFactory
  5912. );
  5913. cloned.ns = vnode.ns;
  5914. cloned.isStatic = vnode.isStatic;
  5915. cloned.key = vnode.key;
  5916. cloned.isComment = vnode.isComment;
  5917. cloned.fnContext = vnode.fnContext;
  5918. cloned.fnOptions = vnode.fnOptions;
  5919. cloned.fnScopeId = vnode.fnScopeId;
  5920. cloned.asyncMeta = vnode.asyncMeta;
  5921. cloned.isCloned = true;
  5922. return cloned
  5923. }
  5924. /*
  5925. * not type checking this file because flow doesn't play well with
  5926. * dynamically accessing methods on Array prototype
  5927. */
  5928. var arrayProto = Array.prototype;
  5929. var arrayMethods = Object.create(arrayProto);
  5930. var methodsToPatch = [
  5931. 'push',
  5932. 'pop',
  5933. 'shift',
  5934. 'unshift',
  5935. 'splice',
  5936. 'sort',
  5937. 'reverse'
  5938. ];
  5939. /**
  5940. * Intercept mutating methods and emit events
  5941. */
  5942. methodsToPatch.forEach(function (method) {
  5943. // cache original method
  5944. var original = arrayProto[method];
  5945. def(arrayMethods, method, function mutator () {
  5946. var args = [], len = arguments.length;
  5947. while ( len-- ) args[ len ] = arguments[ len ];
  5948. var result = original.apply(this, args);
  5949. var ob = this.__ob__;
  5950. var inserted;
  5951. switch (method) {
  5952. case 'push':
  5953. case 'unshift':
  5954. inserted = args;
  5955. break
  5956. case 'splice':
  5957. inserted = args.slice(2);
  5958. break
  5959. }
  5960. if (inserted) { ob.observeArray(inserted); }
  5961. // notify change
  5962. ob.dep.notify();
  5963. return result
  5964. });
  5965. });
  5966. /* */
  5967. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  5968. /**
  5969. * In some cases we may want to disable observation inside a component's
  5970. * update computation.
  5971. */
  5972. var shouldObserve = true;
  5973. function toggleObserving (value) {
  5974. shouldObserve = value;
  5975. }
  5976. /**
  5977. * Observer class that is attached to each observed
  5978. * object. Once attached, the observer converts the target
  5979. * object's property keys into getter/setters that
  5980. * collect dependencies and dispatch updates.
  5981. */
  5982. var Observer = function Observer (value) {
  5983. this.value = value;
  5984. this.dep = new Dep();
  5985. this.vmCount = 0;
  5986. def(value, '__ob__', this);
  5987. if (Array.isArray(value)) {
  5988. if (hasProto) {
  5989. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  5990. if(value.push !== value.__proto__.push){
  5991. copyAugment(value, arrayMethods, arrayKeys);
  5992. } else {
  5993. protoAugment(value, arrayMethods);
  5994. }
  5995. }
  5996. } else {
  5997. copyAugment(value, arrayMethods, arrayKeys);
  5998. }
  5999. this.observeArray(value);
  6000. } else {
  6001. this.walk(value);
  6002. }
  6003. };
  6004. /**
  6005. * Walk through all properties and convert them into
  6006. * getter/setters. This method should only be called when
  6007. * value type is Object.
  6008. */
  6009. Observer.prototype.walk = function walk (obj) {
  6010. var keys = Object.keys(obj);
  6011. for (var i = 0; i < keys.length; i++) {
  6012. defineReactive$$1(obj, keys[i]);
  6013. }
  6014. };
  6015. /**
  6016. * Observe a list of Array items.
  6017. */
  6018. Observer.prototype.observeArray = function observeArray (items) {
  6019. for (var i = 0, l = items.length; i < l; i++) {
  6020. observe(items[i]);
  6021. }
  6022. };
  6023. // helpers
  6024. /**
  6025. * Augment a target Object or Array by intercepting
  6026. * the prototype chain using __proto__
  6027. */
  6028. function protoAugment (target, src) {
  6029. /* eslint-disable no-proto */
  6030. target.__proto__ = src;
  6031. /* eslint-enable no-proto */
  6032. }
  6033. /**
  6034. * Augment a target Object or Array by defining
  6035. * hidden properties.
  6036. */
  6037. /* istanbul ignore next */
  6038. function copyAugment (target, src, keys) {
  6039. for (var i = 0, l = keys.length; i < l; i++) {
  6040. var key = keys[i];
  6041. def(target, key, src[key]);
  6042. }
  6043. }
  6044. /**
  6045. * Attempt to create an observer instance for a value,
  6046. * returns the new observer if successfully observed,
  6047. * or the existing observer if the value already has one.
  6048. */
  6049. function observe (value, asRootData) {
  6050. if (!isObject(value) || value instanceof VNode) {
  6051. return
  6052. }
  6053. var ob;
  6054. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  6055. ob = value.__ob__;
  6056. } else if (
  6057. shouldObserve &&
  6058. !isServerRendering() &&
  6059. (Array.isArray(value) || isPlainObject(value)) &&
  6060. Object.isExtensible(value) &&
  6061. !value._isVue &&
  6062. !value.__v_isMPComponent
  6063. ) {
  6064. ob = new Observer(value);
  6065. }
  6066. if (asRootData && ob) {
  6067. ob.vmCount++;
  6068. }
  6069. return ob
  6070. }
  6071. /**
  6072. * Define a reactive property on an Object.
  6073. */
  6074. function defineReactive$$1 (
  6075. obj,
  6076. key,
  6077. val,
  6078. customSetter,
  6079. shallow
  6080. ) {
  6081. var dep = new Dep();
  6082. var property = Object.getOwnPropertyDescriptor(obj, key);
  6083. if (property && property.configurable === false) {
  6084. return
  6085. }
  6086. // cater for pre-defined getter/setters
  6087. var getter = property && property.get;
  6088. var setter = property && property.set;
  6089. if ((!getter || setter) && arguments.length === 2) {
  6090. val = obj[key];
  6091. }
  6092. var childOb = !shallow && observe(val);
  6093. Object.defineProperty(obj, key, {
  6094. enumerable: true,
  6095. configurable: true,
  6096. get: function reactiveGetter () {
  6097. var value = getter ? getter.call(obj) : val;
  6098. if (Dep.SharedObject.target) { // fixed by xxxxxx
  6099. dep.depend();
  6100. if (childOb) {
  6101. childOb.dep.depend();
  6102. if (Array.isArray(value)) {
  6103. dependArray(value);
  6104. }
  6105. }
  6106. }
  6107. return value
  6108. },
  6109. set: function reactiveSetter (newVal) {
  6110. var value = getter ? getter.call(obj) : val;
  6111. /* eslint-disable no-self-compare */
  6112. if (newVal === value || (newVal !== newVal && value !== value)) {
  6113. return
  6114. }
  6115. /* eslint-enable no-self-compare */
  6116. if ( true && customSetter) {
  6117. customSetter();
  6118. }
  6119. // #7981: for accessor properties without setter
  6120. if (getter && !setter) { return }
  6121. if (setter) {
  6122. setter.call(obj, newVal);
  6123. } else {
  6124. val = newVal;
  6125. }
  6126. childOb = !shallow && observe(newVal);
  6127. dep.notify();
  6128. }
  6129. });
  6130. }
  6131. /**
  6132. * Set a property on an object. Adds the new property and
  6133. * triggers change notification if the property doesn't
  6134. * already exist.
  6135. */
  6136. function set (target, key, val) {
  6137. if ( true &&
  6138. (isUndef(target) || isPrimitive(target))
  6139. ) {
  6140. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  6141. }
  6142. if (Array.isArray(target) && isValidArrayIndex(key)) {
  6143. target.length = Math.max(target.length, key);
  6144. target.splice(key, 1, val);
  6145. return val
  6146. }
  6147. if (key in target && !(key in Object.prototype)) {
  6148. target[key] = val;
  6149. return val
  6150. }
  6151. var ob = (target).__ob__;
  6152. if (target._isVue || (ob && ob.vmCount)) {
  6153. true && warn(
  6154. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  6155. 'at runtime - declare it upfront in the data option.'
  6156. );
  6157. return val
  6158. }
  6159. if (!ob) {
  6160. target[key] = val;
  6161. return val
  6162. }
  6163. defineReactive$$1(ob.value, key, val);
  6164. ob.dep.notify();
  6165. return val
  6166. }
  6167. /**
  6168. * Delete a property and trigger change if necessary.
  6169. */
  6170. function del (target, key) {
  6171. if ( true &&
  6172. (isUndef(target) || isPrimitive(target))
  6173. ) {
  6174. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  6175. }
  6176. if (Array.isArray(target) && isValidArrayIndex(key)) {
  6177. target.splice(key, 1);
  6178. return
  6179. }
  6180. var ob = (target).__ob__;
  6181. if (target._isVue || (ob && ob.vmCount)) {
  6182. true && warn(
  6183. 'Avoid deleting properties on a Vue instance or its root $data ' +
  6184. '- just set it to null.'
  6185. );
  6186. return
  6187. }
  6188. if (!hasOwn(target, key)) {
  6189. return
  6190. }
  6191. delete target[key];
  6192. if (!ob) {
  6193. return
  6194. }
  6195. ob.dep.notify();
  6196. }
  6197. /**
  6198. * Collect dependencies on array elements when the array is touched, since
  6199. * we cannot intercept array element access like property getters.
  6200. */
  6201. function dependArray (value) {
  6202. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  6203. e = value[i];
  6204. e && e.__ob__ && e.__ob__.dep.depend();
  6205. if (Array.isArray(e)) {
  6206. dependArray(e);
  6207. }
  6208. }
  6209. }
  6210. /* */
  6211. /**
  6212. * Option overwriting strategies are functions that handle
  6213. * how to merge a parent option value and a child option
  6214. * value into the final value.
  6215. */
  6216. var strats = config.optionMergeStrategies;
  6217. /**
  6218. * Options with restrictions
  6219. */
  6220. if (true) {
  6221. strats.el = strats.propsData = function (parent, child, vm, key) {
  6222. if (!vm) {
  6223. warn(
  6224. "option \"" + key + "\" can only be used during instance " +
  6225. 'creation with the `new` keyword.'
  6226. );
  6227. }
  6228. return defaultStrat(parent, child)
  6229. };
  6230. }
  6231. /**
  6232. * Helper that recursively merges two data objects together.
  6233. */
  6234. function mergeData (to, from) {
  6235. if (!from) { return to }
  6236. var key, toVal, fromVal;
  6237. var keys = hasSymbol
  6238. ? Reflect.ownKeys(from)
  6239. : Object.keys(from);
  6240. for (var i = 0; i < keys.length; i++) {
  6241. key = keys[i];
  6242. // in case the object is already observed...
  6243. if (key === '__ob__') { continue }
  6244. toVal = to[key];
  6245. fromVal = from[key];
  6246. if (!hasOwn(to, key)) {
  6247. set(to, key, fromVal);
  6248. } else if (
  6249. toVal !== fromVal &&
  6250. isPlainObject(toVal) &&
  6251. isPlainObject(fromVal)
  6252. ) {
  6253. mergeData(toVal, fromVal);
  6254. }
  6255. }
  6256. return to
  6257. }
  6258. /**
  6259. * Data
  6260. */
  6261. function mergeDataOrFn (
  6262. parentVal,
  6263. childVal,
  6264. vm
  6265. ) {
  6266. if (!vm) {
  6267. // in a Vue.extend merge, both should be functions
  6268. if (!childVal) {
  6269. return parentVal
  6270. }
  6271. if (!parentVal) {
  6272. return childVal
  6273. }
  6274. // when parentVal & childVal are both present,
  6275. // we need to return a function that returns the
  6276. // merged result of both functions... no need to
  6277. // check if parentVal is a function here because
  6278. // it has to be a function to pass previous merges.
  6279. return function mergedDataFn () {
  6280. return mergeData(
  6281. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  6282. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  6283. )
  6284. }
  6285. } else {
  6286. return function mergedInstanceDataFn () {
  6287. // instance merge
  6288. var instanceData = typeof childVal === 'function'
  6289. ? childVal.call(vm, vm)
  6290. : childVal;
  6291. var defaultData = typeof parentVal === 'function'
  6292. ? parentVal.call(vm, vm)
  6293. : parentVal;
  6294. if (instanceData) {
  6295. return mergeData(instanceData, defaultData)
  6296. } else {
  6297. return defaultData
  6298. }
  6299. }
  6300. }
  6301. }
  6302. strats.data = function (
  6303. parentVal,
  6304. childVal,
  6305. vm
  6306. ) {
  6307. if (!vm) {
  6308. if (childVal && typeof childVal !== 'function') {
  6309. true && warn(
  6310. 'The "data" option should be a function ' +
  6311. 'that returns a per-instance value in component ' +
  6312. 'definitions.',
  6313. vm
  6314. );
  6315. return parentVal
  6316. }
  6317. return mergeDataOrFn(parentVal, childVal)
  6318. }
  6319. return mergeDataOrFn(parentVal, childVal, vm)
  6320. };
  6321. /**
  6322. * Hooks and props are merged as arrays.
  6323. */
  6324. function mergeHook (
  6325. parentVal,
  6326. childVal
  6327. ) {
  6328. var res = childVal
  6329. ? parentVal
  6330. ? parentVal.concat(childVal)
  6331. : Array.isArray(childVal)
  6332. ? childVal
  6333. : [childVal]
  6334. : parentVal;
  6335. return res
  6336. ? dedupeHooks(res)
  6337. : res
  6338. }
  6339. function dedupeHooks (hooks) {
  6340. var res = [];
  6341. for (var i = 0; i < hooks.length; i++) {
  6342. if (res.indexOf(hooks[i]) === -1) {
  6343. res.push(hooks[i]);
  6344. }
  6345. }
  6346. return res
  6347. }
  6348. LIFECYCLE_HOOKS.forEach(function (hook) {
  6349. strats[hook] = mergeHook;
  6350. });
  6351. /**
  6352. * Assets
  6353. *
  6354. * When a vm is present (instance creation), we need to do
  6355. * a three-way merge between constructor options, instance
  6356. * options and parent options.
  6357. */
  6358. function mergeAssets (
  6359. parentVal,
  6360. childVal,
  6361. vm,
  6362. key
  6363. ) {
  6364. var res = Object.create(parentVal || null);
  6365. if (childVal) {
  6366. true && assertObjectType(key, childVal, vm);
  6367. return extend(res, childVal)
  6368. } else {
  6369. return res
  6370. }
  6371. }
  6372. ASSET_TYPES.forEach(function (type) {
  6373. strats[type + 's'] = mergeAssets;
  6374. });
  6375. /**
  6376. * Watchers.
  6377. *
  6378. * Watchers hashes should not overwrite one
  6379. * another, so we merge them as arrays.
  6380. */
  6381. strats.watch = function (
  6382. parentVal,
  6383. childVal,
  6384. vm,
  6385. key
  6386. ) {
  6387. // work around Firefox's Object.prototype.watch...
  6388. if (parentVal === nativeWatch) { parentVal = undefined; }
  6389. if (childVal === nativeWatch) { childVal = undefined; }
  6390. /* istanbul ignore if */
  6391. if (!childVal) { return Object.create(parentVal || null) }
  6392. if (true) {
  6393. assertObjectType(key, childVal, vm);
  6394. }
  6395. if (!parentVal) { return childVal }
  6396. var ret = {};
  6397. extend(ret, parentVal);
  6398. for (var key$1 in childVal) {
  6399. var parent = ret[key$1];
  6400. var child = childVal[key$1];
  6401. if (parent && !Array.isArray(parent)) {
  6402. parent = [parent];
  6403. }
  6404. ret[key$1] = parent
  6405. ? parent.concat(child)
  6406. : Array.isArray(child) ? child : [child];
  6407. }
  6408. return ret
  6409. };
  6410. /**
  6411. * Other object hashes.
  6412. */
  6413. strats.props =
  6414. strats.methods =
  6415. strats.inject =
  6416. strats.computed = function (
  6417. parentVal,
  6418. childVal,
  6419. vm,
  6420. key
  6421. ) {
  6422. if (childVal && "development" !== 'production') {
  6423. assertObjectType(key, childVal, vm);
  6424. }
  6425. if (!parentVal) { return childVal }
  6426. var ret = Object.create(null);
  6427. extend(ret, parentVal);
  6428. if (childVal) { extend(ret, childVal); }
  6429. return ret
  6430. };
  6431. strats.provide = mergeDataOrFn;
  6432. /**
  6433. * Default strategy.
  6434. */
  6435. var defaultStrat = function (parentVal, childVal) {
  6436. return childVal === undefined
  6437. ? parentVal
  6438. : childVal
  6439. };
  6440. /**
  6441. * Validate component names
  6442. */
  6443. function checkComponents (options) {
  6444. for (var key in options.components) {
  6445. validateComponentName(key);
  6446. }
  6447. }
  6448. function validateComponentName (name) {
  6449. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  6450. warn(
  6451. 'Invalid component name: "' + name + '". Component names ' +
  6452. 'should conform to valid custom element name in html5 specification.'
  6453. );
  6454. }
  6455. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  6456. warn(
  6457. 'Do not use built-in or reserved HTML elements as component ' +
  6458. 'id: ' + name
  6459. );
  6460. }
  6461. }
  6462. /**
  6463. * Ensure all props option syntax are normalized into the
  6464. * Object-based format.
  6465. */
  6466. function normalizeProps (options, vm) {
  6467. var props = options.props;
  6468. if (!props) { return }
  6469. var res = {};
  6470. var i, val, name;
  6471. if (Array.isArray(props)) {
  6472. i = props.length;
  6473. while (i--) {
  6474. val = props[i];
  6475. if (typeof val === 'string') {
  6476. name = camelize(val);
  6477. res[name] = { type: null };
  6478. } else if (true) {
  6479. warn('props must be strings when using array syntax.');
  6480. }
  6481. }
  6482. } else if (isPlainObject(props)) {
  6483. for (var key in props) {
  6484. val = props[key];
  6485. name = camelize(key);
  6486. res[name] = isPlainObject(val)
  6487. ? val
  6488. : { type: val };
  6489. }
  6490. } else if (true) {
  6491. warn(
  6492. "Invalid value for option \"props\": expected an Array or an Object, " +
  6493. "but got " + (toRawType(props)) + ".",
  6494. vm
  6495. );
  6496. }
  6497. options.props = res;
  6498. }
  6499. /**
  6500. * Normalize all injections into Object-based format
  6501. */
  6502. function normalizeInject (options, vm) {
  6503. var inject = options.inject;
  6504. if (!inject) { return }
  6505. var normalized = options.inject = {};
  6506. if (Array.isArray(inject)) {
  6507. for (var i = 0; i < inject.length; i++) {
  6508. normalized[inject[i]] = { from: inject[i] };
  6509. }
  6510. } else if (isPlainObject(inject)) {
  6511. for (var key in inject) {
  6512. var val = inject[key];
  6513. normalized[key] = isPlainObject(val)
  6514. ? extend({ from: key }, val)
  6515. : { from: val };
  6516. }
  6517. } else if (true) {
  6518. warn(
  6519. "Invalid value for option \"inject\": expected an Array or an Object, " +
  6520. "but got " + (toRawType(inject)) + ".",
  6521. vm
  6522. );
  6523. }
  6524. }
  6525. /**
  6526. * Normalize raw function directives into object format.
  6527. */
  6528. function normalizeDirectives (options) {
  6529. var dirs = options.directives;
  6530. if (dirs) {
  6531. for (var key in dirs) {
  6532. var def$$1 = dirs[key];
  6533. if (typeof def$$1 === 'function') {
  6534. dirs[key] = { bind: def$$1, update: def$$1 };
  6535. }
  6536. }
  6537. }
  6538. }
  6539. function assertObjectType (name, value, vm) {
  6540. if (!isPlainObject(value)) {
  6541. warn(
  6542. "Invalid value for option \"" + name + "\": expected an Object, " +
  6543. "but got " + (toRawType(value)) + ".",
  6544. vm
  6545. );
  6546. }
  6547. }
  6548. /**
  6549. * Merge two option objects into a new one.
  6550. * Core utility used in both instantiation and inheritance.
  6551. */
  6552. function mergeOptions (
  6553. parent,
  6554. child,
  6555. vm
  6556. ) {
  6557. if (true) {
  6558. checkComponents(child);
  6559. }
  6560. if (typeof child === 'function') {
  6561. child = child.options;
  6562. }
  6563. normalizeProps(child, vm);
  6564. normalizeInject(child, vm);
  6565. normalizeDirectives(child);
  6566. // Apply extends and mixins on the child options,
  6567. // but only if it is a raw options object that isn't
  6568. // the result of another mergeOptions call.
  6569. // Only merged options has the _base property.
  6570. if (!child._base) {
  6571. if (child.extends) {
  6572. parent = mergeOptions(parent, child.extends, vm);
  6573. }
  6574. if (child.mixins) {
  6575. for (var i = 0, l = child.mixins.length; i < l; i++) {
  6576. parent = mergeOptions(parent, child.mixins[i], vm);
  6577. }
  6578. }
  6579. }
  6580. var options = {};
  6581. var key;
  6582. for (key in parent) {
  6583. mergeField(key);
  6584. }
  6585. for (key in child) {
  6586. if (!hasOwn(parent, key)) {
  6587. mergeField(key);
  6588. }
  6589. }
  6590. function mergeField (key) {
  6591. var strat = strats[key] || defaultStrat;
  6592. options[key] = strat(parent[key], child[key], vm, key);
  6593. }
  6594. return options
  6595. }
  6596. /**
  6597. * Resolve an asset.
  6598. * This function is used because child instances need access
  6599. * to assets defined in its ancestor chain.
  6600. */
  6601. function resolveAsset (
  6602. options,
  6603. type,
  6604. id,
  6605. warnMissing
  6606. ) {
  6607. /* istanbul ignore if */
  6608. if (typeof id !== 'string') {
  6609. return
  6610. }
  6611. var assets = options[type];
  6612. // check local registration variations first
  6613. if (hasOwn(assets, id)) { return assets[id] }
  6614. var camelizedId = camelize(id);
  6615. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  6616. var PascalCaseId = capitalize(camelizedId);
  6617. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  6618. // fallback to prototype chain
  6619. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  6620. if ( true && warnMissing && !res) {
  6621. warn(
  6622. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  6623. options
  6624. );
  6625. }
  6626. return res
  6627. }
  6628. /* */
  6629. function validateProp (
  6630. key,
  6631. propOptions,
  6632. propsData,
  6633. vm
  6634. ) {
  6635. var prop = propOptions[key];
  6636. var absent = !hasOwn(propsData, key);
  6637. var value = propsData[key];
  6638. // boolean casting
  6639. var booleanIndex = getTypeIndex(Boolean, prop.type);
  6640. if (booleanIndex > -1) {
  6641. if (absent && !hasOwn(prop, 'default')) {
  6642. value = false;
  6643. } else if (value === '' || value === hyphenate(key)) {
  6644. // only cast empty string / same name to boolean if
  6645. // boolean has higher priority
  6646. var stringIndex = getTypeIndex(String, prop.type);
  6647. if (stringIndex < 0 || booleanIndex < stringIndex) {
  6648. value = true;
  6649. }
  6650. }
  6651. }
  6652. // check default value
  6653. if (value === undefined) {
  6654. value = getPropDefaultValue(vm, prop, key);
  6655. // since the default value is a fresh copy,
  6656. // make sure to observe it.
  6657. var prevShouldObserve = shouldObserve;
  6658. toggleObserving(true);
  6659. observe(value);
  6660. toggleObserving(prevShouldObserve);
  6661. }
  6662. if (
  6663. true
  6664. ) {
  6665. assertProp(prop, key, value, vm, absent);
  6666. }
  6667. return value
  6668. }
  6669. /**
  6670. * Get the default value of a prop.
  6671. */
  6672. function getPropDefaultValue (vm, prop, key) {
  6673. // no default, return undefined
  6674. if (!hasOwn(prop, 'default')) {
  6675. return undefined
  6676. }
  6677. var def = prop.default;
  6678. // warn against non-factory defaults for Object & Array
  6679. if ( true && isObject(def)) {
  6680. warn(
  6681. 'Invalid default value for prop "' + key + '": ' +
  6682. 'Props with type Object/Array must use a factory function ' +
  6683. 'to return the default value.',
  6684. vm
  6685. );
  6686. }
  6687. // the raw prop value was also undefined from previous render,
  6688. // return previous default value to avoid unnecessary watcher trigger
  6689. if (vm && vm.$options.propsData &&
  6690. vm.$options.propsData[key] === undefined &&
  6691. vm._props[key] !== undefined
  6692. ) {
  6693. return vm._props[key]
  6694. }
  6695. // call factory function for non-Function types
  6696. // a value is Function if its prototype is function even across different execution context
  6697. return typeof def === 'function' && getType(prop.type) !== 'Function'
  6698. ? def.call(vm)
  6699. : def
  6700. }
  6701. /**
  6702. * Assert whether a prop is valid.
  6703. */
  6704. function assertProp (
  6705. prop,
  6706. name,
  6707. value,
  6708. vm,
  6709. absent
  6710. ) {
  6711. if (prop.required && absent) {
  6712. warn(
  6713. 'Missing required prop: "' + name + '"',
  6714. vm
  6715. );
  6716. return
  6717. }
  6718. if (value == null && !prop.required) {
  6719. return
  6720. }
  6721. var type = prop.type;
  6722. var valid = !type || type === true;
  6723. var expectedTypes = [];
  6724. if (type) {
  6725. if (!Array.isArray(type)) {
  6726. type = [type];
  6727. }
  6728. for (var i = 0; i < type.length && !valid; i++) {
  6729. var assertedType = assertType(value, type[i]);
  6730. expectedTypes.push(assertedType.expectedType || '');
  6731. valid = assertedType.valid;
  6732. }
  6733. }
  6734. if (!valid) {
  6735. warn(
  6736. getInvalidTypeMessage(name, value, expectedTypes),
  6737. vm
  6738. );
  6739. return
  6740. }
  6741. var validator = prop.validator;
  6742. if (validator) {
  6743. if (!validator(value)) {
  6744. warn(
  6745. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  6746. vm
  6747. );
  6748. }
  6749. }
  6750. }
  6751. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  6752. function assertType (value, type) {
  6753. var valid;
  6754. var expectedType = getType(type);
  6755. if (simpleCheckRE.test(expectedType)) {
  6756. var t = typeof value;
  6757. valid = t === expectedType.toLowerCase();
  6758. // for primitive wrapper objects
  6759. if (!valid && t === 'object') {
  6760. valid = value instanceof type;
  6761. }
  6762. } else if (expectedType === 'Object') {
  6763. valid = isPlainObject(value);
  6764. } else if (expectedType === 'Array') {
  6765. valid = Array.isArray(value);
  6766. } else {
  6767. valid = value instanceof type;
  6768. }
  6769. return {
  6770. valid: valid,
  6771. expectedType: expectedType
  6772. }
  6773. }
  6774. /**
  6775. * Use function string name to check built-in types,
  6776. * because a simple equality check will fail when running
  6777. * across different vms / iframes.
  6778. */
  6779. function getType (fn) {
  6780. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  6781. return match ? match[1] : ''
  6782. }
  6783. function isSameType (a, b) {
  6784. return getType(a) === getType(b)
  6785. }
  6786. function getTypeIndex (type, expectedTypes) {
  6787. if (!Array.isArray(expectedTypes)) {
  6788. return isSameType(expectedTypes, type) ? 0 : -1
  6789. }
  6790. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  6791. if (isSameType(expectedTypes[i], type)) {
  6792. return i
  6793. }
  6794. }
  6795. return -1
  6796. }
  6797. function getInvalidTypeMessage (name, value, expectedTypes) {
  6798. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  6799. " Expected " + (expectedTypes.map(capitalize).join(', '));
  6800. var expectedType = expectedTypes[0];
  6801. var receivedType = toRawType(value);
  6802. var expectedValue = styleValue(value, expectedType);
  6803. var receivedValue = styleValue(value, receivedType);
  6804. // check if we need to specify expected value
  6805. if (expectedTypes.length === 1 &&
  6806. isExplicable(expectedType) &&
  6807. !isBoolean(expectedType, receivedType)) {
  6808. message += " with value " + expectedValue;
  6809. }
  6810. message += ", got " + receivedType + " ";
  6811. // check if we need to specify received value
  6812. if (isExplicable(receivedType)) {
  6813. message += "with value " + receivedValue + ".";
  6814. }
  6815. return message
  6816. }
  6817. function styleValue (value, type) {
  6818. if (type === 'String') {
  6819. return ("\"" + value + "\"")
  6820. } else if (type === 'Number') {
  6821. return ("" + (Number(value)))
  6822. } else {
  6823. return ("" + value)
  6824. }
  6825. }
  6826. function isExplicable (value) {
  6827. var explicitTypes = ['string', 'number', 'boolean'];
  6828. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  6829. }
  6830. function isBoolean () {
  6831. var args = [], len = arguments.length;
  6832. while ( len-- ) args[ len ] = arguments[ len ];
  6833. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  6834. }
  6835. /* */
  6836. function handleError (err, vm, info) {
  6837. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  6838. // See: https://github.com/vuejs/vuex/issues/1505
  6839. pushTarget();
  6840. try {
  6841. if (vm) {
  6842. var cur = vm;
  6843. while ((cur = cur.$parent)) {
  6844. var hooks = cur.$options.errorCaptured;
  6845. if (hooks) {
  6846. for (var i = 0; i < hooks.length; i++) {
  6847. try {
  6848. var capture = hooks[i].call(cur, err, vm, info) === false;
  6849. if (capture) { return }
  6850. } catch (e) {
  6851. globalHandleError(e, cur, 'errorCaptured hook');
  6852. }
  6853. }
  6854. }
  6855. }
  6856. }
  6857. globalHandleError(err, vm, info);
  6858. } finally {
  6859. popTarget();
  6860. }
  6861. }
  6862. function invokeWithErrorHandling (
  6863. handler,
  6864. context,
  6865. args,
  6866. vm,
  6867. info
  6868. ) {
  6869. var res;
  6870. try {
  6871. res = args ? handler.apply(context, args) : handler.call(context);
  6872. if (res && !res._isVue && isPromise(res) && !res._handled) {
  6873. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  6874. // issue #9511
  6875. // avoid catch triggering multiple times when nested calls
  6876. res._handled = true;
  6877. }
  6878. } catch (e) {
  6879. handleError(e, vm, info);
  6880. }
  6881. return res
  6882. }
  6883. function globalHandleError (err, vm, info) {
  6884. if (config.errorHandler) {
  6885. try {
  6886. return config.errorHandler.call(null, err, vm, info)
  6887. } catch (e) {
  6888. // if the user intentionally throws the original error in the handler,
  6889. // do not log it twice
  6890. if (e !== err) {
  6891. logError(e, null, 'config.errorHandler');
  6892. }
  6893. }
  6894. }
  6895. logError(err, vm, info);
  6896. }
  6897. function logError (err, vm, info) {
  6898. if (true) {
  6899. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  6900. }
  6901. /* istanbul ignore else */
  6902. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  6903. console.error(err);
  6904. } else {
  6905. throw err
  6906. }
  6907. }
  6908. /* */
  6909. var callbacks = [];
  6910. var pending = false;
  6911. function flushCallbacks () {
  6912. pending = false;
  6913. var copies = callbacks.slice(0);
  6914. callbacks.length = 0;
  6915. for (var i = 0; i < copies.length; i++) {
  6916. copies[i]();
  6917. }
  6918. }
  6919. // Here we have async deferring wrappers using microtasks.
  6920. // In 2.5 we used (macro) tasks (in combination with microtasks).
  6921. // However, it has subtle problems when state is changed right before repaint
  6922. // (e.g. #6813, out-in transitions).
  6923. // Also, using (macro) tasks in event handler would cause some weird behaviors
  6924. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  6925. // So we now use microtasks everywhere, again.
  6926. // A major drawback of this tradeoff is that there are some scenarios
  6927. // where microtasks have too high a priority and fire in between supposedly
  6928. // sequential events (e.g. #4521, #6690, which have workarounds)
  6929. // or even between bubbling of the same event (#6566).
  6930. var timerFunc;
  6931. // The nextTick behavior leverages the microtask queue, which can be accessed
  6932. // via either native Promise.then or MutationObserver.
  6933. // MutationObserver has wider support, however it is seriously bugged in
  6934. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  6935. // completely stops working after triggering a few times... so, if native
  6936. // Promise is available, we will use it:
  6937. /* istanbul ignore next, $flow-disable-line */
  6938. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  6939. var p = Promise.resolve();
  6940. timerFunc = function () {
  6941. p.then(flushCallbacks);
  6942. // In problematic UIWebViews, Promise.then doesn't completely break, but
  6943. // it can get stuck in a weird state where callbacks are pushed into the
  6944. // microtask queue but the queue isn't being flushed, until the browser
  6945. // needs to do some other work, e.g. handle a timer. Therefore we can
  6946. // "force" the microtask queue to be flushed by adding an empty timer.
  6947. if (isIOS) { setTimeout(noop); }
  6948. };
  6949. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  6950. isNative(MutationObserver) ||
  6951. // PhantomJS and iOS 7.x
  6952. MutationObserver.toString() === '[object MutationObserverConstructor]'
  6953. )) {
  6954. // Use MutationObserver where native Promise is not available,
  6955. // e.g. PhantomJS, iOS7, Android 4.4
  6956. // (#6466 MutationObserver is unreliable in IE11)
  6957. var counter = 1;
  6958. var observer = new MutationObserver(flushCallbacks);
  6959. var textNode = document.createTextNode(String(counter));
  6960. observer.observe(textNode, {
  6961. characterData: true
  6962. });
  6963. timerFunc = function () {
  6964. counter = (counter + 1) % 2;
  6965. textNode.data = String(counter);
  6966. };
  6967. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  6968. // Fallback to setImmediate.
  6969. // Technically it leverages the (macro) task queue,
  6970. // but it is still a better choice than setTimeout.
  6971. timerFunc = function () {
  6972. setImmediate(flushCallbacks);
  6973. };
  6974. } else {
  6975. // Fallback to setTimeout.
  6976. timerFunc = function () {
  6977. setTimeout(flushCallbacks, 0);
  6978. };
  6979. }
  6980. function nextTick (cb, ctx) {
  6981. var _resolve;
  6982. callbacks.push(function () {
  6983. if (cb) {
  6984. try {
  6985. cb.call(ctx);
  6986. } catch (e) {
  6987. handleError(e, ctx, 'nextTick');
  6988. }
  6989. } else if (_resolve) {
  6990. _resolve(ctx);
  6991. }
  6992. });
  6993. if (!pending) {
  6994. pending = true;
  6995. timerFunc();
  6996. }
  6997. // $flow-disable-line
  6998. if (!cb && typeof Promise !== 'undefined') {
  6999. return new Promise(function (resolve) {
  7000. _resolve = resolve;
  7001. })
  7002. }
  7003. }
  7004. /* */
  7005. /* not type checking this file because flow doesn't play well with Proxy */
  7006. var initProxy;
  7007. if (true) {
  7008. var allowedGlobals = makeMap(
  7009. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  7010. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  7011. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  7012. 'require' // for Webpack/Browserify
  7013. );
  7014. var warnNonPresent = function (target, key) {
  7015. warn(
  7016. "Property or method \"" + key + "\" is not defined on the instance but " +
  7017. 'referenced during render. Make sure that this property is reactive, ' +
  7018. 'either in the data option, or for class-based components, by ' +
  7019. 'initializing the property. ' +
  7020. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  7021. target
  7022. );
  7023. };
  7024. var warnReservedPrefix = function (target, key) {
  7025. warn(
  7026. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  7027. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  7028. 'prevent conflicts with Vue internals. ' +
  7029. 'See: https://vuejs.org/v2/api/#data',
  7030. target
  7031. );
  7032. };
  7033. var hasProxy =
  7034. typeof Proxy !== 'undefined' && isNative(Proxy);
  7035. if (hasProxy) {
  7036. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  7037. config.keyCodes = new Proxy(config.keyCodes, {
  7038. set: function set (target, key, value) {
  7039. if (isBuiltInModifier(key)) {
  7040. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  7041. return false
  7042. } else {
  7043. target[key] = value;
  7044. return true
  7045. }
  7046. }
  7047. });
  7048. }
  7049. var hasHandler = {
  7050. has: function has (target, key) {
  7051. var has = key in target;
  7052. var isAllowed = allowedGlobals(key) ||
  7053. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  7054. if (!has && !isAllowed) {
  7055. if (key in target.$data) { warnReservedPrefix(target, key); }
  7056. else { warnNonPresent(target, key); }
  7057. }
  7058. return has || !isAllowed
  7059. }
  7060. };
  7061. var getHandler = {
  7062. get: function get (target, key) {
  7063. if (typeof key === 'string' && !(key in target)) {
  7064. if (key in target.$data) { warnReservedPrefix(target, key); }
  7065. else { warnNonPresent(target, key); }
  7066. }
  7067. return target[key]
  7068. }
  7069. };
  7070. initProxy = function initProxy (vm) {
  7071. if (hasProxy) {
  7072. // determine which proxy handler to use
  7073. var options = vm.$options;
  7074. var handlers = options.render && options.render._withStripped
  7075. ? getHandler
  7076. : hasHandler;
  7077. vm._renderProxy = new Proxy(vm, handlers);
  7078. } else {
  7079. vm._renderProxy = vm;
  7080. }
  7081. };
  7082. }
  7083. /* */
  7084. var seenObjects = new _Set();
  7085. /**
  7086. * Recursively traverse an object to evoke all converted
  7087. * getters, so that every nested property inside the object
  7088. * is collected as a "deep" dependency.
  7089. */
  7090. function traverse (val) {
  7091. _traverse(val, seenObjects);
  7092. seenObjects.clear();
  7093. }
  7094. function _traverse (val, seen) {
  7095. var i, keys;
  7096. var isA = Array.isArray(val);
  7097. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  7098. return
  7099. }
  7100. if (val.__ob__) {
  7101. var depId = val.__ob__.dep.id;
  7102. if (seen.has(depId)) {
  7103. return
  7104. }
  7105. seen.add(depId);
  7106. }
  7107. if (isA) {
  7108. i = val.length;
  7109. while (i--) { _traverse(val[i], seen); }
  7110. } else {
  7111. keys = Object.keys(val);
  7112. i = keys.length;
  7113. while (i--) { _traverse(val[keys[i]], seen); }
  7114. }
  7115. }
  7116. var mark;
  7117. var measure;
  7118. if (true) {
  7119. var perf = inBrowser && window.performance;
  7120. /* istanbul ignore if */
  7121. if (
  7122. perf &&
  7123. perf.mark &&
  7124. perf.measure &&
  7125. perf.clearMarks &&
  7126. perf.clearMeasures
  7127. ) {
  7128. mark = function (tag) { return perf.mark(tag); };
  7129. measure = function (name, startTag, endTag) {
  7130. perf.measure(name, startTag, endTag);
  7131. perf.clearMarks(startTag);
  7132. perf.clearMarks(endTag);
  7133. // perf.clearMeasures(name)
  7134. };
  7135. }
  7136. }
  7137. /* */
  7138. var normalizeEvent = cached(function (name) {
  7139. var passive = name.charAt(0) === '&';
  7140. name = passive ? name.slice(1) : name;
  7141. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  7142. name = once$$1 ? name.slice(1) : name;
  7143. var capture = name.charAt(0) === '!';
  7144. name = capture ? name.slice(1) : name;
  7145. return {
  7146. name: name,
  7147. once: once$$1,
  7148. capture: capture,
  7149. passive: passive
  7150. }
  7151. });
  7152. function createFnInvoker (fns, vm) {
  7153. function invoker () {
  7154. var arguments$1 = arguments;
  7155. var fns = invoker.fns;
  7156. if (Array.isArray(fns)) {
  7157. var cloned = fns.slice();
  7158. for (var i = 0; i < cloned.length; i++) {
  7159. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  7160. }
  7161. } else {
  7162. // return handler return value for single handlers
  7163. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  7164. }
  7165. }
  7166. invoker.fns = fns;
  7167. return invoker
  7168. }
  7169. function updateListeners (
  7170. on,
  7171. oldOn,
  7172. add,
  7173. remove$$1,
  7174. createOnceHandler,
  7175. vm
  7176. ) {
  7177. var name, def$$1, cur, old, event;
  7178. for (name in on) {
  7179. def$$1 = cur = on[name];
  7180. old = oldOn[name];
  7181. event = normalizeEvent(name);
  7182. if (isUndef(cur)) {
  7183. true && warn(
  7184. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  7185. vm
  7186. );
  7187. } else if (isUndef(old)) {
  7188. if (isUndef(cur.fns)) {
  7189. cur = on[name] = createFnInvoker(cur, vm);
  7190. }
  7191. if (isTrue(event.once)) {
  7192. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  7193. }
  7194. add(event.name, cur, event.capture, event.passive, event.params);
  7195. } else if (cur !== old) {
  7196. old.fns = cur;
  7197. on[name] = old;
  7198. }
  7199. }
  7200. for (name in oldOn) {
  7201. if (isUndef(on[name])) {
  7202. event = normalizeEvent(name);
  7203. remove$$1(event.name, oldOn[name], event.capture);
  7204. }
  7205. }
  7206. }
  7207. /* */
  7208. /* */
  7209. // fixed by xxxxxx (mp properties)
  7210. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  7211. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  7212. if (isUndef(propOptions)) {
  7213. return res
  7214. }
  7215. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  7216. var attrs = data.attrs;
  7217. var props = data.props;
  7218. if (isDef(attrs) || isDef(props)) {
  7219. for (var key in propOptions) {
  7220. var altKey = hyphenate(key);
  7221. var result = checkProp(res, props, key, altKey, true) ||
  7222. checkProp(res, attrs, key, altKey, false);
  7223. // externalClass
  7224. if (
  7225. result &&
  7226. res[key] &&
  7227. externalClasses.indexOf(altKey) !== -1 &&
  7228. context[camelize(res[key])]
  7229. ) {
  7230. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  7231. res[key] = context[camelize(res[key])];
  7232. }
  7233. }
  7234. }
  7235. return res
  7236. }
  7237. function extractPropsFromVNodeData (
  7238. data,
  7239. Ctor,
  7240. tag,
  7241. context// fixed by xxxxxx
  7242. ) {
  7243. // we are only extracting raw values here.
  7244. // validation and default values are handled in the child
  7245. // component itself.
  7246. var propOptions = Ctor.options.props;
  7247. if (isUndef(propOptions)) {
  7248. // fixed by xxxxxx
  7249. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  7250. }
  7251. var res = {};
  7252. var attrs = data.attrs;
  7253. var props = data.props;
  7254. if (isDef(attrs) || isDef(props)) {
  7255. for (var key in propOptions) {
  7256. var altKey = hyphenate(key);
  7257. if (true) {
  7258. var keyInLowerCase = key.toLowerCase();
  7259. if (
  7260. key !== keyInLowerCase &&
  7261. attrs && hasOwn(attrs, keyInLowerCase)
  7262. ) {
  7263. tip(
  7264. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  7265. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  7266. " \"" + key + "\". " +
  7267. "Note that HTML attributes are case-insensitive and camelCased " +
  7268. "props need to use their kebab-case equivalents when using in-DOM " +
  7269. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  7270. );
  7271. }
  7272. }
  7273. checkProp(res, props, key, altKey, true) ||
  7274. checkProp(res, attrs, key, altKey, false);
  7275. }
  7276. }
  7277. // fixed by xxxxxx
  7278. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  7279. }
  7280. function checkProp (
  7281. res,
  7282. hash,
  7283. key,
  7284. altKey,
  7285. preserve
  7286. ) {
  7287. if (isDef(hash)) {
  7288. if (hasOwn(hash, key)) {
  7289. res[key] = hash[key];
  7290. if (!preserve) {
  7291. delete hash[key];
  7292. }
  7293. return true
  7294. } else if (hasOwn(hash, altKey)) {
  7295. res[key] = hash[altKey];
  7296. if (!preserve) {
  7297. delete hash[altKey];
  7298. }
  7299. return true
  7300. }
  7301. }
  7302. return false
  7303. }
  7304. /* */
  7305. // The template compiler attempts to minimize the need for normalization by
  7306. // statically analyzing the template at compile time.
  7307. //
  7308. // For plain HTML markup, normalization can be completely skipped because the
  7309. // generated render function is guaranteed to return Array<VNode>. There are
  7310. // two cases where extra normalization is needed:
  7311. // 1. When the children contains components - because a functional component
  7312. // may return an Array instead of a single root. In this case, just a simple
  7313. // normalization is needed - if any child is an Array, we flatten the whole
  7314. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  7315. // because functional components already normalize their own children.
  7316. function simpleNormalizeChildren (children) {
  7317. for (var i = 0; i < children.length; i++) {
  7318. if (Array.isArray(children[i])) {
  7319. return Array.prototype.concat.apply([], children)
  7320. }
  7321. }
  7322. return children
  7323. }
  7324. // 2. When the children contains constructs that always generated nested Arrays,
  7325. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  7326. // with hand-written render functions / JSX. In such cases a full normalization
  7327. // is needed to cater to all possible types of children values.
  7328. function normalizeChildren (children) {
  7329. return isPrimitive(children)
  7330. ? [createTextVNode(children)]
  7331. : Array.isArray(children)
  7332. ? normalizeArrayChildren(children)
  7333. : undefined
  7334. }
  7335. function isTextNode (node) {
  7336. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  7337. }
  7338. function normalizeArrayChildren (children, nestedIndex) {
  7339. var res = [];
  7340. var i, c, lastIndex, last;
  7341. for (i = 0; i < children.length; i++) {
  7342. c = children[i];
  7343. if (isUndef(c) || typeof c === 'boolean') { continue }
  7344. lastIndex = res.length - 1;
  7345. last = res[lastIndex];
  7346. // nested
  7347. if (Array.isArray(c)) {
  7348. if (c.length > 0) {
  7349. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  7350. // merge adjacent text nodes
  7351. if (isTextNode(c[0]) && isTextNode(last)) {
  7352. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  7353. c.shift();
  7354. }
  7355. res.push.apply(res, c);
  7356. }
  7357. } else if (isPrimitive(c)) {
  7358. if (isTextNode(last)) {
  7359. // merge adjacent text nodes
  7360. // this is necessary for SSR hydration because text nodes are
  7361. // essentially merged when rendered to HTML strings
  7362. res[lastIndex] = createTextVNode(last.text + c);
  7363. } else if (c !== '') {
  7364. // convert primitive to vnode
  7365. res.push(createTextVNode(c));
  7366. }
  7367. } else {
  7368. if (isTextNode(c) && isTextNode(last)) {
  7369. // merge adjacent text nodes
  7370. res[lastIndex] = createTextVNode(last.text + c.text);
  7371. } else {
  7372. // default key for nested array children (likely generated by v-for)
  7373. if (isTrue(children._isVList) &&
  7374. isDef(c.tag) &&
  7375. isUndef(c.key) &&
  7376. isDef(nestedIndex)) {
  7377. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  7378. }
  7379. res.push(c);
  7380. }
  7381. }
  7382. }
  7383. return res
  7384. }
  7385. /* */
  7386. function initProvide (vm) {
  7387. var provide = vm.$options.provide;
  7388. if (provide) {
  7389. vm._provided = typeof provide === 'function'
  7390. ? provide.call(vm)
  7391. : provide;
  7392. }
  7393. }
  7394. function initInjections (vm) {
  7395. var result = resolveInject(vm.$options.inject, vm);
  7396. if (result) {
  7397. toggleObserving(false);
  7398. Object.keys(result).forEach(function (key) {
  7399. /* istanbul ignore else */
  7400. if (true) {
  7401. defineReactive$$1(vm, key, result[key], function () {
  7402. warn(
  7403. "Avoid mutating an injected value directly since the changes will be " +
  7404. "overwritten whenever the provided component re-renders. " +
  7405. "injection being mutated: \"" + key + "\"",
  7406. vm
  7407. );
  7408. });
  7409. } else {}
  7410. });
  7411. toggleObserving(true);
  7412. }
  7413. }
  7414. function resolveInject (inject, vm) {
  7415. if (inject) {
  7416. // inject is :any because flow is not smart enough to figure out cached
  7417. var result = Object.create(null);
  7418. var keys = hasSymbol
  7419. ? Reflect.ownKeys(inject)
  7420. : Object.keys(inject);
  7421. for (var i = 0; i < keys.length; i++) {
  7422. var key = keys[i];
  7423. // #6574 in case the inject object is observed...
  7424. if (key === '__ob__') { continue }
  7425. var provideKey = inject[key].from;
  7426. var source = vm;
  7427. while (source) {
  7428. if (source._provided && hasOwn(source._provided, provideKey)) {
  7429. result[key] = source._provided[provideKey];
  7430. break
  7431. }
  7432. source = source.$parent;
  7433. }
  7434. if (!source) {
  7435. if ('default' in inject[key]) {
  7436. var provideDefault = inject[key].default;
  7437. result[key] = typeof provideDefault === 'function'
  7438. ? provideDefault.call(vm)
  7439. : provideDefault;
  7440. } else if (true) {
  7441. warn(("Injection \"" + key + "\" not found"), vm);
  7442. }
  7443. }
  7444. }
  7445. return result
  7446. }
  7447. }
  7448. /* */
  7449. /**
  7450. * Runtime helper for resolving raw children VNodes into a slot object.
  7451. */
  7452. function resolveSlots (
  7453. children,
  7454. context
  7455. ) {
  7456. if (!children || !children.length) {
  7457. return {}
  7458. }
  7459. var slots = {};
  7460. for (var i = 0, l = children.length; i < l; i++) {
  7461. var child = children[i];
  7462. var data = child.data;
  7463. // remove slot attribute if the node is resolved as a Vue slot node
  7464. if (data && data.attrs && data.attrs.slot) {
  7465. delete data.attrs.slot;
  7466. }
  7467. // named slots should only be respected if the vnode was rendered in the
  7468. // same context.
  7469. if ((child.context === context || child.fnContext === context) &&
  7470. data && data.slot != null
  7471. ) {
  7472. var name = data.slot;
  7473. var slot = (slots[name] || (slots[name] = []));
  7474. if (child.tag === 'template') {
  7475. slot.push.apply(slot, child.children || []);
  7476. } else {
  7477. slot.push(child);
  7478. }
  7479. } else {
  7480. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  7481. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  7482. (slots['page'] || (slots['page'] = [])).push(child);
  7483. }else{
  7484. (slots.default || (slots.default = [])).push(child);
  7485. }
  7486. }
  7487. }
  7488. // ignore slots that contains only whitespace
  7489. for (var name$1 in slots) {
  7490. if (slots[name$1].every(isWhitespace)) {
  7491. delete slots[name$1];
  7492. }
  7493. }
  7494. return slots
  7495. }
  7496. function isWhitespace (node) {
  7497. return (node.isComment && !node.asyncFactory) || node.text === ' '
  7498. }
  7499. /* */
  7500. function normalizeScopedSlots (
  7501. slots,
  7502. normalSlots,
  7503. prevSlots
  7504. ) {
  7505. var res;
  7506. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  7507. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  7508. var key = slots && slots.$key;
  7509. if (!slots) {
  7510. res = {};
  7511. } else if (slots._normalized) {
  7512. // fast path 1: child component re-render only, parent did not change
  7513. return slots._normalized
  7514. } else if (
  7515. isStable &&
  7516. prevSlots &&
  7517. prevSlots !== emptyObject &&
  7518. key === prevSlots.$key &&
  7519. !hasNormalSlots &&
  7520. !prevSlots.$hasNormal
  7521. ) {
  7522. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  7523. // only need to normalize once
  7524. return prevSlots
  7525. } else {
  7526. res = {};
  7527. for (var key$1 in slots) {
  7528. if (slots[key$1] && key$1[0] !== '$') {
  7529. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  7530. }
  7531. }
  7532. }
  7533. // expose normal slots on scopedSlots
  7534. for (var key$2 in normalSlots) {
  7535. if (!(key$2 in res)) {
  7536. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  7537. }
  7538. }
  7539. // avoriaz seems to mock a non-extensible $scopedSlots object
  7540. // and when that is passed down this would cause an error
  7541. if (slots && Object.isExtensible(slots)) {
  7542. (slots)._normalized = res;
  7543. }
  7544. def(res, '$stable', isStable);
  7545. def(res, '$key', key);
  7546. def(res, '$hasNormal', hasNormalSlots);
  7547. return res
  7548. }
  7549. function normalizeScopedSlot(normalSlots, key, fn) {
  7550. var normalized = function () {
  7551. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  7552. res = res && typeof res === 'object' && !Array.isArray(res)
  7553. ? [res] // single vnode
  7554. : normalizeChildren(res);
  7555. return res && (
  7556. res.length === 0 ||
  7557. (res.length === 1 && res[0].isComment) // #9658
  7558. ) ? undefined
  7559. : res
  7560. };
  7561. // this is a slot using the new v-slot syntax without scope. although it is
  7562. // compiled as a scoped slot, render fn users would expect it to be present
  7563. // on this.$slots because the usage is semantically a normal slot.
  7564. if (fn.proxy) {
  7565. Object.defineProperty(normalSlots, key, {
  7566. get: normalized,
  7567. enumerable: true,
  7568. configurable: true
  7569. });
  7570. }
  7571. return normalized
  7572. }
  7573. function proxyNormalSlot(slots, key) {
  7574. return function () { return slots[key]; }
  7575. }
  7576. /* */
  7577. /**
  7578. * Runtime helper for rendering v-for lists.
  7579. */
  7580. function renderList (
  7581. val,
  7582. render
  7583. ) {
  7584. var ret, i, l, keys, key;
  7585. if (Array.isArray(val) || typeof val === 'string') {
  7586. ret = new Array(val.length);
  7587. for (i = 0, l = val.length; i < l; i++) {
  7588. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  7589. }
  7590. } else if (typeof val === 'number') {
  7591. ret = new Array(val);
  7592. for (i = 0; i < val; i++) {
  7593. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  7594. }
  7595. } else if (isObject(val)) {
  7596. if (hasSymbol && val[Symbol.iterator]) {
  7597. ret = [];
  7598. var iterator = val[Symbol.iterator]();
  7599. var result = iterator.next();
  7600. while (!result.done) {
  7601. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  7602. result = iterator.next();
  7603. }
  7604. } else {
  7605. keys = Object.keys(val);
  7606. ret = new Array(keys.length);
  7607. for (i = 0, l = keys.length; i < l; i++) {
  7608. key = keys[i];
  7609. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  7610. }
  7611. }
  7612. }
  7613. if (!isDef(ret)) {
  7614. ret = [];
  7615. }
  7616. (ret)._isVList = true;
  7617. return ret
  7618. }
  7619. /* */
  7620. /**
  7621. * Runtime helper for rendering <slot>
  7622. */
  7623. function renderSlot (
  7624. name,
  7625. fallback,
  7626. props,
  7627. bindObject
  7628. ) {
  7629. var scopedSlotFn = this.$scopedSlots[name];
  7630. var nodes;
  7631. if (scopedSlotFn) { // scoped slot
  7632. props = props || {};
  7633. if (bindObject) {
  7634. if ( true && !isObject(bindObject)) {
  7635. warn(
  7636. 'slot v-bind without argument expects an Object',
  7637. this
  7638. );
  7639. }
  7640. props = extend(extend({}, bindObject), props);
  7641. }
  7642. // fixed by xxxxxx app-plus scopedSlot
  7643. nodes = scopedSlotFn(props, this, props._i) || fallback;
  7644. } else {
  7645. nodes = this.$slots[name] || fallback;
  7646. }
  7647. var target = props && props.slot;
  7648. if (target) {
  7649. return this.$createElement('template', { slot: target }, nodes)
  7650. } else {
  7651. return nodes
  7652. }
  7653. }
  7654. /* */
  7655. /**
  7656. * Runtime helper for resolving filters
  7657. */
  7658. function resolveFilter (id) {
  7659. return resolveAsset(this.$options, 'filters', id, true) || identity
  7660. }
  7661. /* */
  7662. function isKeyNotMatch (expect, actual) {
  7663. if (Array.isArray(expect)) {
  7664. return expect.indexOf(actual) === -1
  7665. } else {
  7666. return expect !== actual
  7667. }
  7668. }
  7669. /**
  7670. * Runtime helper for checking keyCodes from config.
  7671. * exposed as Vue.prototype._k
  7672. * passing in eventKeyName as last argument separately for backwards compat
  7673. */
  7674. function checkKeyCodes (
  7675. eventKeyCode,
  7676. key,
  7677. builtInKeyCode,
  7678. eventKeyName,
  7679. builtInKeyName
  7680. ) {
  7681. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  7682. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  7683. return isKeyNotMatch(builtInKeyName, eventKeyName)
  7684. } else if (mappedKeyCode) {
  7685. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  7686. } else if (eventKeyName) {
  7687. return hyphenate(eventKeyName) !== key
  7688. }
  7689. }
  7690. /* */
  7691. /**
  7692. * Runtime helper for merging v-bind="object" into a VNode's data.
  7693. */
  7694. function bindObjectProps (
  7695. data,
  7696. tag,
  7697. value,
  7698. asProp,
  7699. isSync
  7700. ) {
  7701. if (value) {
  7702. if (!isObject(value)) {
  7703. true && warn(
  7704. 'v-bind without argument expects an Object or Array value',
  7705. this
  7706. );
  7707. } else {
  7708. if (Array.isArray(value)) {
  7709. value = toObject(value);
  7710. }
  7711. var hash;
  7712. var loop = function ( key ) {
  7713. if (
  7714. key === 'class' ||
  7715. key === 'style' ||
  7716. isReservedAttribute(key)
  7717. ) {
  7718. hash = data;
  7719. } else {
  7720. var type = data.attrs && data.attrs.type;
  7721. hash = asProp || config.mustUseProp(tag, type, key)
  7722. ? data.domProps || (data.domProps = {})
  7723. : data.attrs || (data.attrs = {});
  7724. }
  7725. var camelizedKey = camelize(key);
  7726. var hyphenatedKey = hyphenate(key);
  7727. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  7728. hash[key] = value[key];
  7729. if (isSync) {
  7730. var on = data.on || (data.on = {});
  7731. on[("update:" + key)] = function ($event) {
  7732. value[key] = $event;
  7733. };
  7734. }
  7735. }
  7736. };
  7737. for (var key in value) loop( key );
  7738. }
  7739. }
  7740. return data
  7741. }
  7742. /* */
  7743. /**
  7744. * Runtime helper for rendering static trees.
  7745. */
  7746. function renderStatic (
  7747. index,
  7748. isInFor
  7749. ) {
  7750. var cached = this._staticTrees || (this._staticTrees = []);
  7751. var tree = cached[index];
  7752. // if has already-rendered static tree and not inside v-for,
  7753. // we can reuse the same tree.
  7754. if (tree && !isInFor) {
  7755. return tree
  7756. }
  7757. // otherwise, render a fresh tree.
  7758. tree = cached[index] = this.$options.staticRenderFns[index].call(
  7759. this._renderProxy,
  7760. null,
  7761. this // for render fns generated for functional component templates
  7762. );
  7763. markStatic(tree, ("__static__" + index), false);
  7764. return tree
  7765. }
  7766. /**
  7767. * Runtime helper for v-once.
  7768. * Effectively it means marking the node as static with a unique key.
  7769. */
  7770. function markOnce (
  7771. tree,
  7772. index,
  7773. key
  7774. ) {
  7775. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  7776. return tree
  7777. }
  7778. function markStatic (
  7779. tree,
  7780. key,
  7781. isOnce
  7782. ) {
  7783. if (Array.isArray(tree)) {
  7784. for (var i = 0; i < tree.length; i++) {
  7785. if (tree[i] && typeof tree[i] !== 'string') {
  7786. markStaticNode(tree[i], (key + "_" + i), isOnce);
  7787. }
  7788. }
  7789. } else {
  7790. markStaticNode(tree, key, isOnce);
  7791. }
  7792. }
  7793. function markStaticNode (node, key, isOnce) {
  7794. node.isStatic = true;
  7795. node.key = key;
  7796. node.isOnce = isOnce;
  7797. }
  7798. /* */
  7799. function bindObjectListeners (data, value) {
  7800. if (value) {
  7801. if (!isPlainObject(value)) {
  7802. true && warn(
  7803. 'v-on without argument expects an Object value',
  7804. this
  7805. );
  7806. } else {
  7807. var on = data.on = data.on ? extend({}, data.on) : {};
  7808. for (var key in value) {
  7809. var existing = on[key];
  7810. var ours = value[key];
  7811. on[key] = existing ? [].concat(existing, ours) : ours;
  7812. }
  7813. }
  7814. }
  7815. return data
  7816. }
  7817. /* */
  7818. function resolveScopedSlots (
  7819. fns, // see flow/vnode
  7820. res,
  7821. // the following are added in 2.6
  7822. hasDynamicKeys,
  7823. contentHashKey
  7824. ) {
  7825. res = res || { $stable: !hasDynamicKeys };
  7826. for (var i = 0; i < fns.length; i++) {
  7827. var slot = fns[i];
  7828. if (Array.isArray(slot)) {
  7829. resolveScopedSlots(slot, res, hasDynamicKeys);
  7830. } else if (slot) {
  7831. // marker for reverse proxying v-slot without scope on this.$slots
  7832. if (slot.proxy) {
  7833. slot.fn.proxy = true;
  7834. }
  7835. res[slot.key] = slot.fn;
  7836. }
  7837. }
  7838. if (contentHashKey) {
  7839. (res).$key = contentHashKey;
  7840. }
  7841. return res
  7842. }
  7843. /* */
  7844. function bindDynamicKeys (baseObj, values) {
  7845. for (var i = 0; i < values.length; i += 2) {
  7846. var key = values[i];
  7847. if (typeof key === 'string' && key) {
  7848. baseObj[values[i]] = values[i + 1];
  7849. } else if ( true && key !== '' && key !== null) {
  7850. // null is a special value for explicitly removing a binding
  7851. warn(
  7852. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  7853. this
  7854. );
  7855. }
  7856. }
  7857. return baseObj
  7858. }
  7859. // helper to dynamically append modifier runtime markers to event names.
  7860. // ensure only append when value is already string, otherwise it will be cast
  7861. // to string and cause the type check to miss.
  7862. function prependModifier (value, symbol) {
  7863. return typeof value === 'string' ? symbol + value : value
  7864. }
  7865. /* */
  7866. function installRenderHelpers (target) {
  7867. target._o = markOnce;
  7868. target._n = toNumber;
  7869. target._s = toString;
  7870. target._l = renderList;
  7871. target._t = renderSlot;
  7872. target._q = looseEqual;
  7873. target._i = looseIndexOf;
  7874. target._m = renderStatic;
  7875. target._f = resolveFilter;
  7876. target._k = checkKeyCodes;
  7877. target._b = bindObjectProps;
  7878. target._v = createTextVNode;
  7879. target._e = createEmptyVNode;
  7880. target._u = resolveScopedSlots;
  7881. target._g = bindObjectListeners;
  7882. target._d = bindDynamicKeys;
  7883. target._p = prependModifier;
  7884. }
  7885. /* */
  7886. function FunctionalRenderContext (
  7887. data,
  7888. props,
  7889. children,
  7890. parent,
  7891. Ctor
  7892. ) {
  7893. var this$1 = this;
  7894. var options = Ctor.options;
  7895. // ensure the createElement function in functional components
  7896. // gets a unique context - this is necessary for correct named slot check
  7897. var contextVm;
  7898. if (hasOwn(parent, '_uid')) {
  7899. contextVm = Object.create(parent);
  7900. // $flow-disable-line
  7901. contextVm._original = parent;
  7902. } else {
  7903. // the context vm passed in is a functional context as well.
  7904. // in this case we want to make sure we are able to get a hold to the
  7905. // real context instance.
  7906. contextVm = parent;
  7907. // $flow-disable-line
  7908. parent = parent._original;
  7909. }
  7910. var isCompiled = isTrue(options._compiled);
  7911. var needNormalization = !isCompiled;
  7912. this.data = data;
  7913. this.props = props;
  7914. this.children = children;
  7915. this.parent = parent;
  7916. this.listeners = data.on || emptyObject;
  7917. this.injections = resolveInject(options.inject, parent);
  7918. this.slots = function () {
  7919. if (!this$1.$slots) {
  7920. normalizeScopedSlots(
  7921. data.scopedSlots,
  7922. this$1.$slots = resolveSlots(children, parent)
  7923. );
  7924. }
  7925. return this$1.$slots
  7926. };
  7927. Object.defineProperty(this, 'scopedSlots', ({
  7928. enumerable: true,
  7929. get: function get () {
  7930. return normalizeScopedSlots(data.scopedSlots, this.slots())
  7931. }
  7932. }));
  7933. // support for compiled functional template
  7934. if (isCompiled) {
  7935. // exposing $options for renderStatic()
  7936. this.$options = options;
  7937. // pre-resolve slots for renderSlot()
  7938. this.$slots = this.slots();
  7939. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  7940. }
  7941. if (options._scopeId) {
  7942. this._c = function (a, b, c, d) {
  7943. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  7944. if (vnode && !Array.isArray(vnode)) {
  7945. vnode.fnScopeId = options._scopeId;
  7946. vnode.fnContext = parent;
  7947. }
  7948. return vnode
  7949. };
  7950. } else {
  7951. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  7952. }
  7953. }
  7954. installRenderHelpers(FunctionalRenderContext.prototype);
  7955. function createFunctionalComponent (
  7956. Ctor,
  7957. propsData,
  7958. data,
  7959. contextVm,
  7960. children
  7961. ) {
  7962. var options = Ctor.options;
  7963. var props = {};
  7964. var propOptions = options.props;
  7965. if (isDef(propOptions)) {
  7966. for (var key in propOptions) {
  7967. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  7968. }
  7969. } else {
  7970. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  7971. if (isDef(data.props)) { mergeProps(props, data.props); }
  7972. }
  7973. var renderContext = new FunctionalRenderContext(
  7974. data,
  7975. props,
  7976. children,
  7977. contextVm,
  7978. Ctor
  7979. );
  7980. var vnode = options.render.call(null, renderContext._c, renderContext);
  7981. if (vnode instanceof VNode) {
  7982. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  7983. } else if (Array.isArray(vnode)) {
  7984. var vnodes = normalizeChildren(vnode) || [];
  7985. var res = new Array(vnodes.length);
  7986. for (var i = 0; i < vnodes.length; i++) {
  7987. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  7988. }
  7989. return res
  7990. }
  7991. }
  7992. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  7993. // #7817 clone node before setting fnContext, otherwise if the node is reused
  7994. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  7995. // that should not be matched to match.
  7996. var clone = cloneVNode(vnode);
  7997. clone.fnContext = contextVm;
  7998. clone.fnOptions = options;
  7999. if (true) {
  8000. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  8001. }
  8002. if (data.slot) {
  8003. (clone.data || (clone.data = {})).slot = data.slot;
  8004. }
  8005. return clone
  8006. }
  8007. function mergeProps (to, from) {
  8008. for (var key in from) {
  8009. to[camelize(key)] = from[key];
  8010. }
  8011. }
  8012. /* */
  8013. /* */
  8014. /* */
  8015. /* */
  8016. // inline hooks to be invoked on component VNodes during patch
  8017. var componentVNodeHooks = {
  8018. init: function init (vnode, hydrating) {
  8019. if (
  8020. vnode.componentInstance &&
  8021. !vnode.componentInstance._isDestroyed &&
  8022. vnode.data.keepAlive
  8023. ) {
  8024. // kept-alive components, treat as a patch
  8025. var mountedNode = vnode; // work around flow
  8026. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  8027. } else {
  8028. var child = vnode.componentInstance = createComponentInstanceForVnode(
  8029. vnode,
  8030. activeInstance
  8031. );
  8032. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  8033. }
  8034. },
  8035. prepatch: function prepatch (oldVnode, vnode) {
  8036. var options = vnode.componentOptions;
  8037. var child = vnode.componentInstance = oldVnode.componentInstance;
  8038. updateChildComponent(
  8039. child,
  8040. options.propsData, // updated props
  8041. options.listeners, // updated listeners
  8042. vnode, // new parent vnode
  8043. options.children // new children
  8044. );
  8045. },
  8046. insert: function insert (vnode) {
  8047. var context = vnode.context;
  8048. var componentInstance = vnode.componentInstance;
  8049. if (!componentInstance._isMounted) {
  8050. callHook(componentInstance, 'onServiceCreated');
  8051. callHook(componentInstance, 'onServiceAttached');
  8052. componentInstance._isMounted = true;
  8053. callHook(componentInstance, 'mounted');
  8054. }
  8055. if (vnode.data.keepAlive) {
  8056. if (context._isMounted) {
  8057. // vue-router#1212
  8058. // During updates, a kept-alive component's child components may
  8059. // change, so directly walking the tree here may call activated hooks
  8060. // on incorrect children. Instead we push them into a queue which will
  8061. // be processed after the whole patch process ended.
  8062. queueActivatedComponent(componentInstance);
  8063. } else {
  8064. activateChildComponent(componentInstance, true /* direct */);
  8065. }
  8066. }
  8067. },
  8068. destroy: function destroy (vnode) {
  8069. var componentInstance = vnode.componentInstance;
  8070. if (!componentInstance._isDestroyed) {
  8071. if (!vnode.data.keepAlive) {
  8072. componentInstance.$destroy();
  8073. } else {
  8074. deactivateChildComponent(componentInstance, true /* direct */);
  8075. }
  8076. }
  8077. }
  8078. };
  8079. var hooksToMerge = Object.keys(componentVNodeHooks);
  8080. function createComponent (
  8081. Ctor,
  8082. data,
  8083. context,
  8084. children,
  8085. tag
  8086. ) {
  8087. if (isUndef(Ctor)) {
  8088. return
  8089. }
  8090. var baseCtor = context.$options._base;
  8091. // plain options object: turn it into a constructor
  8092. if (isObject(Ctor)) {
  8093. Ctor = baseCtor.extend(Ctor);
  8094. }
  8095. // if at this stage it's not a constructor or an async component factory,
  8096. // reject.
  8097. if (typeof Ctor !== 'function') {
  8098. if (true) {
  8099. warn(("Invalid Component definition: " + (String(Ctor))), context);
  8100. }
  8101. return
  8102. }
  8103. // async component
  8104. var asyncFactory;
  8105. if (isUndef(Ctor.cid)) {
  8106. asyncFactory = Ctor;
  8107. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  8108. if (Ctor === undefined) {
  8109. // return a placeholder node for async component, which is rendered
  8110. // as a comment node but preserves all the raw information for the node.
  8111. // the information will be used for async server-rendering and hydration.
  8112. return createAsyncPlaceholder(
  8113. asyncFactory,
  8114. data,
  8115. context,
  8116. children,
  8117. tag
  8118. )
  8119. }
  8120. }
  8121. data = data || {};
  8122. // resolve constructor options in case global mixins are applied after
  8123. // component constructor creation
  8124. resolveConstructorOptions(Ctor);
  8125. // transform component v-model data into props & events
  8126. if (isDef(data.model)) {
  8127. transformModel(Ctor.options, data);
  8128. }
  8129. // extract props
  8130. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  8131. // functional component
  8132. if (isTrue(Ctor.options.functional)) {
  8133. return createFunctionalComponent(Ctor, propsData, data, context, children)
  8134. }
  8135. // extract listeners, since these needs to be treated as
  8136. // child component listeners instead of DOM listeners
  8137. var listeners = data.on;
  8138. // replace with listeners with .native modifier
  8139. // so it gets processed during parent component patch.
  8140. data.on = data.nativeOn;
  8141. if (isTrue(Ctor.options.abstract)) {
  8142. // abstract components do not keep anything
  8143. // other than props & listeners & slot
  8144. // work around flow
  8145. var slot = data.slot;
  8146. data = {};
  8147. if (slot) {
  8148. data.slot = slot;
  8149. }
  8150. }
  8151. // install component management hooks onto the placeholder node
  8152. installComponentHooks(data);
  8153. // return a placeholder vnode
  8154. var name = Ctor.options.name || tag;
  8155. var vnode = new VNode(
  8156. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  8157. data, undefined, undefined, undefined, context,
  8158. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  8159. asyncFactory
  8160. );
  8161. return vnode
  8162. }
  8163. function createComponentInstanceForVnode (
  8164. vnode, // we know it's MountedComponentVNode but flow doesn't
  8165. parent // activeInstance in lifecycle state
  8166. ) {
  8167. var options = {
  8168. _isComponent: true,
  8169. _parentVnode: vnode,
  8170. parent: parent
  8171. };
  8172. // check inline-template render functions
  8173. var inlineTemplate = vnode.data.inlineTemplate;
  8174. if (isDef(inlineTemplate)) {
  8175. options.render = inlineTemplate.render;
  8176. options.staticRenderFns = inlineTemplate.staticRenderFns;
  8177. }
  8178. return new vnode.componentOptions.Ctor(options)
  8179. }
  8180. function installComponentHooks (data) {
  8181. var hooks = data.hook || (data.hook = {});
  8182. for (var i = 0; i < hooksToMerge.length; i++) {
  8183. var key = hooksToMerge[i];
  8184. var existing = hooks[key];
  8185. var toMerge = componentVNodeHooks[key];
  8186. if (existing !== toMerge && !(existing && existing._merged)) {
  8187. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  8188. }
  8189. }
  8190. }
  8191. function mergeHook$1 (f1, f2) {
  8192. var merged = function (a, b) {
  8193. // flow complains about extra args which is why we use any
  8194. f1(a, b);
  8195. f2(a, b);
  8196. };
  8197. merged._merged = true;
  8198. return merged
  8199. }
  8200. // transform component v-model info (value and callback) into
  8201. // prop and event handler respectively.
  8202. function transformModel (options, data) {
  8203. var prop = (options.model && options.model.prop) || 'value';
  8204. var event = (options.model && options.model.event) || 'input'
  8205. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  8206. var on = data.on || (data.on = {});
  8207. var existing = on[event];
  8208. var callback = data.model.callback;
  8209. if (isDef(existing)) {
  8210. if (
  8211. Array.isArray(existing)
  8212. ? existing.indexOf(callback) === -1
  8213. : existing !== callback
  8214. ) {
  8215. on[event] = [callback].concat(existing);
  8216. }
  8217. } else {
  8218. on[event] = callback;
  8219. }
  8220. }
  8221. /* */
  8222. var SIMPLE_NORMALIZE = 1;
  8223. var ALWAYS_NORMALIZE = 2;
  8224. // wrapper function for providing a more flexible interface
  8225. // without getting yelled at by flow
  8226. function createElement (
  8227. context,
  8228. tag,
  8229. data,
  8230. children,
  8231. normalizationType,
  8232. alwaysNormalize
  8233. ) {
  8234. if (Array.isArray(data) || isPrimitive(data)) {
  8235. normalizationType = children;
  8236. children = data;
  8237. data = undefined;
  8238. }
  8239. if (isTrue(alwaysNormalize)) {
  8240. normalizationType = ALWAYS_NORMALIZE;
  8241. }
  8242. return _createElement(context, tag, data, children, normalizationType)
  8243. }
  8244. function _createElement (
  8245. context,
  8246. tag,
  8247. data,
  8248. children,
  8249. normalizationType
  8250. ) {
  8251. if (isDef(data) && isDef((data).__ob__)) {
  8252. true && warn(
  8253. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  8254. 'Always create fresh vnode data objects in each render!',
  8255. context
  8256. );
  8257. return createEmptyVNode()
  8258. }
  8259. // object syntax in v-bind
  8260. if (isDef(data) && isDef(data.is)) {
  8261. tag = data.is;
  8262. }
  8263. if (!tag) {
  8264. // in case of component :is set to falsy value
  8265. return createEmptyVNode()
  8266. }
  8267. // warn against non-primitive key
  8268. if ( true &&
  8269. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  8270. ) {
  8271. {
  8272. warn(
  8273. 'Avoid using non-primitive value as key, ' +
  8274. 'use string/number value instead.',
  8275. context
  8276. );
  8277. }
  8278. }
  8279. // support single function children as default scoped slot
  8280. if (Array.isArray(children) &&
  8281. typeof children[0] === 'function'
  8282. ) {
  8283. data = data || {};
  8284. data.scopedSlots = { default: children[0] };
  8285. children.length = 0;
  8286. }
  8287. if (normalizationType === ALWAYS_NORMALIZE) {
  8288. children = normalizeChildren(children);
  8289. } else if (normalizationType === SIMPLE_NORMALIZE) {
  8290. children = simpleNormalizeChildren(children);
  8291. }
  8292. var vnode, ns;
  8293. if (typeof tag === 'string') {
  8294. var Ctor;
  8295. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  8296. if (config.isReservedTag(tag)) {
  8297. // platform built-in elements
  8298. if ( true && isDef(data) && isDef(data.nativeOn)) {
  8299. warn(
  8300. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  8301. context
  8302. );
  8303. }
  8304. vnode = new VNode(
  8305. config.parsePlatformTagName(tag), data, children,
  8306. undefined, undefined, context
  8307. );
  8308. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  8309. // component
  8310. vnode = createComponent(Ctor, data, context, children, tag);
  8311. } else {
  8312. // unknown or unlisted namespaced elements
  8313. // check at runtime because it may get assigned a namespace when its
  8314. // parent normalizes children
  8315. vnode = new VNode(
  8316. tag, data, children,
  8317. undefined, undefined, context
  8318. );
  8319. }
  8320. } else {
  8321. // direct component options / constructor
  8322. vnode = createComponent(tag, data, context, children);
  8323. }
  8324. if (Array.isArray(vnode)) {
  8325. return vnode
  8326. } else if (isDef(vnode)) {
  8327. if (isDef(ns)) { applyNS(vnode, ns); }
  8328. if (isDef(data)) { registerDeepBindings(data); }
  8329. return vnode
  8330. } else {
  8331. return createEmptyVNode()
  8332. }
  8333. }
  8334. function applyNS (vnode, ns, force) {
  8335. vnode.ns = ns;
  8336. if (vnode.tag === 'foreignObject') {
  8337. // use default namespace inside foreignObject
  8338. ns = undefined;
  8339. force = true;
  8340. }
  8341. if (isDef(vnode.children)) {
  8342. for (var i = 0, l = vnode.children.length; i < l; i++) {
  8343. var child = vnode.children[i];
  8344. if (isDef(child.tag) && (
  8345. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  8346. applyNS(child, ns, force);
  8347. }
  8348. }
  8349. }
  8350. }
  8351. // ref #5318
  8352. // necessary to ensure parent re-render when deep bindings like :style and
  8353. // :class are used on slot nodes
  8354. function registerDeepBindings (data) {
  8355. if (isObject(data.style)) {
  8356. traverse(data.style);
  8357. }
  8358. if (isObject(data.class)) {
  8359. traverse(data.class);
  8360. }
  8361. }
  8362. /* */
  8363. function initRender (vm) {
  8364. vm._vnode = null; // the root of the child tree
  8365. vm._staticTrees = null; // v-once cached trees
  8366. var options = vm.$options;
  8367. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  8368. var renderContext = parentVnode && parentVnode.context;
  8369. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  8370. vm.$scopedSlots = emptyObject;
  8371. // bind the createElement fn to this instance
  8372. // so that we get proper render context inside it.
  8373. // args order: tag, data, children, normalizationType, alwaysNormalize
  8374. // internal version is used by render functions compiled from templates
  8375. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  8376. // normalization is always applied for the public version, used in
  8377. // user-written render functions.
  8378. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  8379. // $attrs & $listeners are exposed for easier HOC creation.
  8380. // they need to be reactive so that HOCs using them are always updated
  8381. var parentData = parentVnode && parentVnode.data;
  8382. /* istanbul ignore else */
  8383. if (true) {
  8384. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  8385. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  8386. }, true);
  8387. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  8388. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  8389. }, true);
  8390. } else {}
  8391. }
  8392. var currentRenderingInstance = null;
  8393. function renderMixin (Vue) {
  8394. // install runtime convenience helpers
  8395. installRenderHelpers(Vue.prototype);
  8396. Vue.prototype.$nextTick = function (fn) {
  8397. return nextTick(fn, this)
  8398. };
  8399. Vue.prototype._render = function () {
  8400. var vm = this;
  8401. var ref = vm.$options;
  8402. var render = ref.render;
  8403. var _parentVnode = ref._parentVnode;
  8404. if (_parentVnode) {
  8405. vm.$scopedSlots = normalizeScopedSlots(
  8406. _parentVnode.data.scopedSlots,
  8407. vm.$slots,
  8408. vm.$scopedSlots
  8409. );
  8410. }
  8411. // set parent vnode. this allows render functions to have access
  8412. // to the data on the placeholder node.
  8413. vm.$vnode = _parentVnode;
  8414. // render self
  8415. var vnode;
  8416. try {
  8417. // There's no need to maintain a stack because all render fns are called
  8418. // separately from one another. Nested component's render fns are called
  8419. // when parent component is patched.
  8420. currentRenderingInstance = vm;
  8421. vnode = render.call(vm._renderProxy, vm.$createElement);
  8422. } catch (e) {
  8423. handleError(e, vm, "render");
  8424. // return error render result,
  8425. // or previous vnode to prevent render error causing blank component
  8426. /* istanbul ignore else */
  8427. if ( true && vm.$options.renderError) {
  8428. try {
  8429. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  8430. } catch (e) {
  8431. handleError(e, vm, "renderError");
  8432. vnode = vm._vnode;
  8433. }
  8434. } else {
  8435. vnode = vm._vnode;
  8436. }
  8437. } finally {
  8438. currentRenderingInstance = null;
  8439. }
  8440. // if the returned array contains only a single node, allow it
  8441. if (Array.isArray(vnode) && vnode.length === 1) {
  8442. vnode = vnode[0];
  8443. }
  8444. // return empty vnode in case the render function errored out
  8445. if (!(vnode instanceof VNode)) {
  8446. if ( true && Array.isArray(vnode)) {
  8447. warn(
  8448. 'Multiple root nodes returned from render function. Render function ' +
  8449. 'should return a single root node.',
  8450. vm
  8451. );
  8452. }
  8453. vnode = createEmptyVNode();
  8454. }
  8455. // set parent
  8456. vnode.parent = _parentVnode;
  8457. return vnode
  8458. };
  8459. }
  8460. /* */
  8461. function ensureCtor (comp, base) {
  8462. if (
  8463. comp.__esModule ||
  8464. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  8465. ) {
  8466. comp = comp.default;
  8467. }
  8468. return isObject(comp)
  8469. ? base.extend(comp)
  8470. : comp
  8471. }
  8472. function createAsyncPlaceholder (
  8473. factory,
  8474. data,
  8475. context,
  8476. children,
  8477. tag
  8478. ) {
  8479. var node = createEmptyVNode();
  8480. node.asyncFactory = factory;
  8481. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  8482. return node
  8483. }
  8484. function resolveAsyncComponent (
  8485. factory,
  8486. baseCtor
  8487. ) {
  8488. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  8489. return factory.errorComp
  8490. }
  8491. if (isDef(factory.resolved)) {
  8492. return factory.resolved
  8493. }
  8494. var owner = currentRenderingInstance;
  8495. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  8496. // already pending
  8497. factory.owners.push(owner);
  8498. }
  8499. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  8500. return factory.loadingComp
  8501. }
  8502. if (owner && !isDef(factory.owners)) {
  8503. var owners = factory.owners = [owner];
  8504. var sync = true;
  8505. var timerLoading = null;
  8506. var timerTimeout = null
  8507. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  8508. var forceRender = function (renderCompleted) {
  8509. for (var i = 0, l = owners.length; i < l; i++) {
  8510. (owners[i]).$forceUpdate();
  8511. }
  8512. if (renderCompleted) {
  8513. owners.length = 0;
  8514. if (timerLoading !== null) {
  8515. clearTimeout(timerLoading);
  8516. timerLoading = null;
  8517. }
  8518. if (timerTimeout !== null) {
  8519. clearTimeout(timerTimeout);
  8520. timerTimeout = null;
  8521. }
  8522. }
  8523. };
  8524. var resolve = once(function (res) {
  8525. // cache resolved
  8526. factory.resolved = ensureCtor(res, baseCtor);
  8527. // invoke callbacks only if this is not a synchronous resolve
  8528. // (async resolves are shimmed as synchronous during SSR)
  8529. if (!sync) {
  8530. forceRender(true);
  8531. } else {
  8532. owners.length = 0;
  8533. }
  8534. });
  8535. var reject = once(function (reason) {
  8536. true && warn(
  8537. "Failed to resolve async component: " + (String(factory)) +
  8538. (reason ? ("\nReason: " + reason) : '')
  8539. );
  8540. if (isDef(factory.errorComp)) {
  8541. factory.error = true;
  8542. forceRender(true);
  8543. }
  8544. });
  8545. var res = factory(resolve, reject);
  8546. if (isObject(res)) {
  8547. if (isPromise(res)) {
  8548. // () => Promise
  8549. if (isUndef(factory.resolved)) {
  8550. res.then(resolve, reject);
  8551. }
  8552. } else if (isPromise(res.component)) {
  8553. res.component.then(resolve, reject);
  8554. if (isDef(res.error)) {
  8555. factory.errorComp = ensureCtor(res.error, baseCtor);
  8556. }
  8557. if (isDef(res.loading)) {
  8558. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  8559. if (res.delay === 0) {
  8560. factory.loading = true;
  8561. } else {
  8562. timerLoading = setTimeout(function () {
  8563. timerLoading = null;
  8564. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  8565. factory.loading = true;
  8566. forceRender(false);
  8567. }
  8568. }, res.delay || 200);
  8569. }
  8570. }
  8571. if (isDef(res.timeout)) {
  8572. timerTimeout = setTimeout(function () {
  8573. timerTimeout = null;
  8574. if (isUndef(factory.resolved)) {
  8575. reject(
  8576. true
  8577. ? ("timeout (" + (res.timeout) + "ms)")
  8578. : undefined
  8579. );
  8580. }
  8581. }, res.timeout);
  8582. }
  8583. }
  8584. }
  8585. sync = false;
  8586. // return in case resolved synchronously
  8587. return factory.loading
  8588. ? factory.loadingComp
  8589. : factory.resolved
  8590. }
  8591. }
  8592. /* */
  8593. function isAsyncPlaceholder (node) {
  8594. return node.isComment && node.asyncFactory
  8595. }
  8596. /* */
  8597. function getFirstComponentChild (children) {
  8598. if (Array.isArray(children)) {
  8599. for (var i = 0; i < children.length; i++) {
  8600. var c = children[i];
  8601. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  8602. return c
  8603. }
  8604. }
  8605. }
  8606. }
  8607. /* */
  8608. /* */
  8609. function initEvents (vm) {
  8610. vm._events = Object.create(null);
  8611. vm._hasHookEvent = false;
  8612. // init parent attached events
  8613. var listeners = vm.$options._parentListeners;
  8614. if (listeners) {
  8615. updateComponentListeners(vm, listeners);
  8616. }
  8617. }
  8618. var target;
  8619. function add (event, fn) {
  8620. target.$on(event, fn);
  8621. }
  8622. function remove$1 (event, fn) {
  8623. target.$off(event, fn);
  8624. }
  8625. function createOnceHandler (event, fn) {
  8626. var _target = target;
  8627. return function onceHandler () {
  8628. var res = fn.apply(null, arguments);
  8629. if (res !== null) {
  8630. _target.$off(event, onceHandler);
  8631. }
  8632. }
  8633. }
  8634. function updateComponentListeners (
  8635. vm,
  8636. listeners,
  8637. oldListeners
  8638. ) {
  8639. target = vm;
  8640. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  8641. target = undefined;
  8642. }
  8643. function eventsMixin (Vue) {
  8644. var hookRE = /^hook:/;
  8645. Vue.prototype.$on = function (event, fn) {
  8646. var vm = this;
  8647. if (Array.isArray(event)) {
  8648. for (var i = 0, l = event.length; i < l; i++) {
  8649. vm.$on(event[i], fn);
  8650. }
  8651. } else {
  8652. (vm._events[event] || (vm._events[event] = [])).push(fn);
  8653. // optimize hook:event cost by using a boolean flag marked at registration
  8654. // instead of a hash lookup
  8655. if (hookRE.test(event)) {
  8656. vm._hasHookEvent = true;
  8657. }
  8658. }
  8659. return vm
  8660. };
  8661. Vue.prototype.$once = function (event, fn) {
  8662. var vm = this;
  8663. function on () {
  8664. vm.$off(event, on);
  8665. fn.apply(vm, arguments);
  8666. }
  8667. on.fn = fn;
  8668. vm.$on(event, on);
  8669. return vm
  8670. };
  8671. Vue.prototype.$off = function (event, fn) {
  8672. var vm = this;
  8673. // all
  8674. if (!arguments.length) {
  8675. vm._events = Object.create(null);
  8676. return vm
  8677. }
  8678. // array of events
  8679. if (Array.isArray(event)) {
  8680. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  8681. vm.$off(event[i$1], fn);
  8682. }
  8683. return vm
  8684. }
  8685. // specific event
  8686. var cbs = vm._events[event];
  8687. if (!cbs) {
  8688. return vm
  8689. }
  8690. if (!fn) {
  8691. vm._events[event] = null;
  8692. return vm
  8693. }
  8694. // specific handler
  8695. var cb;
  8696. var i = cbs.length;
  8697. while (i--) {
  8698. cb = cbs[i];
  8699. if (cb === fn || cb.fn === fn) {
  8700. cbs.splice(i, 1);
  8701. break
  8702. }
  8703. }
  8704. return vm
  8705. };
  8706. Vue.prototype.$emit = function (event) {
  8707. var vm = this;
  8708. if (true) {
  8709. var lowerCaseEvent = event.toLowerCase();
  8710. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  8711. tip(
  8712. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  8713. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  8714. "Note that HTML attributes are case-insensitive and you cannot use " +
  8715. "v-on to listen to camelCase events when using in-DOM templates. " +
  8716. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  8717. );
  8718. }
  8719. }
  8720. var cbs = vm._events[event];
  8721. if (cbs) {
  8722. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  8723. var args = toArray(arguments, 1);
  8724. var info = "event handler for \"" + event + "\"";
  8725. for (var i = 0, l = cbs.length; i < l; i++) {
  8726. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  8727. }
  8728. }
  8729. return vm
  8730. };
  8731. }
  8732. /* */
  8733. var activeInstance = null;
  8734. var isUpdatingChildComponent = false;
  8735. function setActiveInstance(vm) {
  8736. var prevActiveInstance = activeInstance;
  8737. activeInstance = vm;
  8738. return function () {
  8739. activeInstance = prevActiveInstance;
  8740. }
  8741. }
  8742. function initLifecycle (vm) {
  8743. var options = vm.$options;
  8744. // locate first non-abstract parent
  8745. var parent = options.parent;
  8746. if (parent && !options.abstract) {
  8747. while (parent.$options.abstract && parent.$parent) {
  8748. parent = parent.$parent;
  8749. }
  8750. parent.$children.push(vm);
  8751. }
  8752. vm.$parent = parent;
  8753. vm.$root = parent ? parent.$root : vm;
  8754. vm.$children = [];
  8755. vm.$refs = {};
  8756. vm._watcher = null;
  8757. vm._inactive = null;
  8758. vm._directInactive = false;
  8759. vm._isMounted = false;
  8760. vm._isDestroyed = false;
  8761. vm._isBeingDestroyed = false;
  8762. }
  8763. function lifecycleMixin (Vue) {
  8764. Vue.prototype._update = function (vnode, hydrating) {
  8765. var vm = this;
  8766. var prevEl = vm.$el;
  8767. var prevVnode = vm._vnode;
  8768. var restoreActiveInstance = setActiveInstance(vm);
  8769. vm._vnode = vnode;
  8770. // Vue.prototype.__patch__ is injected in entry points
  8771. // based on the rendering backend used.
  8772. if (!prevVnode) {
  8773. // initial render
  8774. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  8775. } else {
  8776. // updates
  8777. vm.$el = vm.__patch__(prevVnode, vnode);
  8778. }
  8779. restoreActiveInstance();
  8780. // update __vue__ reference
  8781. if (prevEl) {
  8782. prevEl.__vue__ = null;
  8783. }
  8784. if (vm.$el) {
  8785. vm.$el.__vue__ = vm;
  8786. }
  8787. // if parent is an HOC, update its $el as well
  8788. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  8789. vm.$parent.$el = vm.$el;
  8790. }
  8791. // updated hook is called by the scheduler to ensure that children are
  8792. // updated in a parent's updated hook.
  8793. };
  8794. Vue.prototype.$forceUpdate = function () {
  8795. var vm = this;
  8796. if (vm._watcher) {
  8797. vm._watcher.update();
  8798. }
  8799. };
  8800. Vue.prototype.$destroy = function () {
  8801. var vm = this;
  8802. if (vm._isBeingDestroyed) {
  8803. return
  8804. }
  8805. callHook(vm, 'beforeDestroy');
  8806. vm._isBeingDestroyed = true;
  8807. // remove self from parent
  8808. var parent = vm.$parent;
  8809. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  8810. remove(parent.$children, vm);
  8811. }
  8812. // teardown watchers
  8813. if (vm._watcher) {
  8814. vm._watcher.teardown();
  8815. }
  8816. var i = vm._watchers.length;
  8817. while (i--) {
  8818. vm._watchers[i].teardown();
  8819. }
  8820. // remove reference from data ob
  8821. // frozen object may not have observer.
  8822. if (vm._data.__ob__) {
  8823. vm._data.__ob__.vmCount--;
  8824. }
  8825. // call the last hook...
  8826. vm._isDestroyed = true;
  8827. // invoke destroy hooks on current rendered tree
  8828. vm.__patch__(vm._vnode, null);
  8829. // fire destroyed hook
  8830. callHook(vm, 'destroyed');
  8831. // turn off all instance listeners.
  8832. vm.$off();
  8833. // remove __vue__ reference
  8834. if (vm.$el) {
  8835. vm.$el.__vue__ = null;
  8836. }
  8837. // release circular reference (#6759)
  8838. if (vm.$vnode) {
  8839. vm.$vnode.parent = null;
  8840. }
  8841. };
  8842. }
  8843. function updateChildComponent (
  8844. vm,
  8845. propsData,
  8846. listeners,
  8847. parentVnode,
  8848. renderChildren
  8849. ) {
  8850. if (true) {
  8851. isUpdatingChildComponent = true;
  8852. }
  8853. // determine whether component has slot children
  8854. // we need to do this before overwriting $options._renderChildren.
  8855. // check if there are dynamic scopedSlots (hand-written or compiled but with
  8856. // dynamic slot names). Static scoped slots compiled from template has the
  8857. // "$stable" marker.
  8858. var newScopedSlots = parentVnode.data.scopedSlots;
  8859. var oldScopedSlots = vm.$scopedSlots;
  8860. var hasDynamicScopedSlot = !!(
  8861. (newScopedSlots && !newScopedSlots.$stable) ||
  8862. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  8863. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  8864. );
  8865. // Any static slot children from the parent may have changed during parent's
  8866. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  8867. // update is necessary to ensure correctness.
  8868. var needsForceUpdate = !!(
  8869. renderChildren || // has new static slots
  8870. vm.$options._renderChildren || // has old static slots
  8871. hasDynamicScopedSlot
  8872. );
  8873. vm.$options._parentVnode = parentVnode;
  8874. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  8875. if (vm._vnode) { // update child tree's parent
  8876. vm._vnode.parent = parentVnode;
  8877. }
  8878. vm.$options._renderChildren = renderChildren;
  8879. // update $attrs and $listeners hash
  8880. // these are also reactive so they may trigger child update if the child
  8881. // used them during render
  8882. vm.$attrs = parentVnode.data.attrs || emptyObject;
  8883. vm.$listeners = listeners || emptyObject;
  8884. // update props
  8885. if (propsData && vm.$options.props) {
  8886. toggleObserving(false);
  8887. var props = vm._props;
  8888. var propKeys = vm.$options._propKeys || [];
  8889. for (var i = 0; i < propKeys.length; i++) {
  8890. var key = propKeys[i];
  8891. var propOptions = vm.$options.props; // wtf flow?
  8892. props[key] = validateProp(key, propOptions, propsData, vm);
  8893. }
  8894. toggleObserving(true);
  8895. // keep a copy of raw propsData
  8896. vm.$options.propsData = propsData;
  8897. }
  8898. // fixed by xxxxxx update properties(mp runtime)
  8899. vm._$updateProperties && vm._$updateProperties(vm);
  8900. // update listeners
  8901. listeners = listeners || emptyObject;
  8902. var oldListeners = vm.$options._parentListeners;
  8903. vm.$options._parentListeners = listeners;
  8904. updateComponentListeners(vm, listeners, oldListeners);
  8905. // resolve slots + force update if has children
  8906. if (needsForceUpdate) {
  8907. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  8908. vm.$forceUpdate();
  8909. }
  8910. if (true) {
  8911. isUpdatingChildComponent = false;
  8912. }
  8913. }
  8914. function isInInactiveTree (vm) {
  8915. while (vm && (vm = vm.$parent)) {
  8916. if (vm._inactive) { return true }
  8917. }
  8918. return false
  8919. }
  8920. function activateChildComponent (vm, direct) {
  8921. if (direct) {
  8922. vm._directInactive = false;
  8923. if (isInInactiveTree(vm)) {
  8924. return
  8925. }
  8926. } else if (vm._directInactive) {
  8927. return
  8928. }
  8929. if (vm._inactive || vm._inactive === null) {
  8930. vm._inactive = false;
  8931. for (var i = 0; i < vm.$children.length; i++) {
  8932. activateChildComponent(vm.$children[i]);
  8933. }
  8934. callHook(vm, 'activated');
  8935. }
  8936. }
  8937. function deactivateChildComponent (vm, direct) {
  8938. if (direct) {
  8939. vm._directInactive = true;
  8940. if (isInInactiveTree(vm)) {
  8941. return
  8942. }
  8943. }
  8944. if (!vm._inactive) {
  8945. vm._inactive = true;
  8946. for (var i = 0; i < vm.$children.length; i++) {
  8947. deactivateChildComponent(vm.$children[i]);
  8948. }
  8949. callHook(vm, 'deactivated');
  8950. }
  8951. }
  8952. function callHook (vm, hook) {
  8953. // #7573 disable dep collection when invoking lifecycle hooks
  8954. pushTarget();
  8955. var handlers = vm.$options[hook];
  8956. var info = hook + " hook";
  8957. if (handlers) {
  8958. for (var i = 0, j = handlers.length; i < j; i++) {
  8959. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  8960. }
  8961. }
  8962. if (vm._hasHookEvent) {
  8963. vm.$emit('hook:' + hook);
  8964. }
  8965. popTarget();
  8966. }
  8967. /* */
  8968. var MAX_UPDATE_COUNT = 100;
  8969. var queue = [];
  8970. var activatedChildren = [];
  8971. var has = {};
  8972. var circular = {};
  8973. var waiting = false;
  8974. var flushing = false;
  8975. var index = 0;
  8976. /**
  8977. * Reset the scheduler's state.
  8978. */
  8979. function resetSchedulerState () {
  8980. index = queue.length = activatedChildren.length = 0;
  8981. has = {};
  8982. if (true) {
  8983. circular = {};
  8984. }
  8985. waiting = flushing = false;
  8986. }
  8987. // Async edge case #6566 requires saving the timestamp when event listeners are
  8988. // attached. However, calling performance.now() has a perf overhead especially
  8989. // if the page has thousands of event listeners. Instead, we take a timestamp
  8990. // every time the scheduler flushes and use that for all event listeners
  8991. // attached during that flush.
  8992. var currentFlushTimestamp = 0;
  8993. // Async edge case fix requires storing an event listener's attach timestamp.
  8994. var getNow = Date.now;
  8995. // Determine what event timestamp the browser is using. Annoyingly, the
  8996. // timestamp can either be hi-res (relative to page load) or low-res
  8997. // (relative to UNIX epoch), so in order to compare time we have to use the
  8998. // same timestamp type when saving the flush timestamp.
  8999. // All IE versions use low-res event timestamps, and have problematic clock
  9000. // implementations (#9632)
  9001. if (inBrowser && !isIE) {
  9002. var performance = window.performance;
  9003. if (
  9004. performance &&
  9005. typeof performance.now === 'function' &&
  9006. getNow() > document.createEvent('Event').timeStamp
  9007. ) {
  9008. // if the event timestamp, although evaluated AFTER the Date.now(), is
  9009. // smaller than it, it means the event is using a hi-res timestamp,
  9010. // and we need to use the hi-res version for event listener timestamps as
  9011. // well.
  9012. getNow = function () { return performance.now(); };
  9013. }
  9014. }
  9015. /**
  9016. * Flush both queues and run the watchers.
  9017. */
  9018. function flushSchedulerQueue () {
  9019. currentFlushTimestamp = getNow();
  9020. flushing = true;
  9021. var watcher, id;
  9022. // Sort queue before flush.
  9023. // This ensures that:
  9024. // 1. Components are updated from parent to child. (because parent is always
  9025. // created before the child)
  9026. // 2. A component's user watchers are run before its render watcher (because
  9027. // user watchers are created before the render watcher)
  9028. // 3. If a component is destroyed during a parent component's watcher run,
  9029. // its watchers can be skipped.
  9030. queue.sort(function (a, b) { return a.id - b.id; });
  9031. // do not cache length because more watchers might be pushed
  9032. // as we run existing watchers
  9033. for (index = 0; index < queue.length; index++) {
  9034. watcher = queue[index];
  9035. if (watcher.before) {
  9036. watcher.before();
  9037. }
  9038. id = watcher.id;
  9039. has[id] = null;
  9040. watcher.run();
  9041. // in dev build, check and stop circular updates.
  9042. if ( true && has[id] != null) {
  9043. circular[id] = (circular[id] || 0) + 1;
  9044. if (circular[id] > MAX_UPDATE_COUNT) {
  9045. warn(
  9046. 'You may have an infinite update loop ' + (
  9047. watcher.user
  9048. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  9049. : "in a component render function."
  9050. ),
  9051. watcher.vm
  9052. );
  9053. break
  9054. }
  9055. }
  9056. }
  9057. // keep copies of post queues before resetting state
  9058. var activatedQueue = activatedChildren.slice();
  9059. var updatedQueue = queue.slice();
  9060. resetSchedulerState();
  9061. // call component updated and activated hooks
  9062. callActivatedHooks(activatedQueue);
  9063. callUpdatedHooks(updatedQueue);
  9064. // devtool hook
  9065. /* istanbul ignore if */
  9066. if (devtools && config.devtools) {
  9067. devtools.emit('flush');
  9068. }
  9069. }
  9070. function callUpdatedHooks (queue) {
  9071. var i = queue.length;
  9072. while (i--) {
  9073. var watcher = queue[i];
  9074. var vm = watcher.vm;
  9075. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  9076. callHook(vm, 'updated');
  9077. }
  9078. }
  9079. }
  9080. /**
  9081. * Queue a kept-alive component that was activated during patch.
  9082. * The queue will be processed after the entire tree has been patched.
  9083. */
  9084. function queueActivatedComponent (vm) {
  9085. // setting _inactive to false here so that a render function can
  9086. // rely on checking whether it's in an inactive tree (e.g. router-view)
  9087. vm._inactive = false;
  9088. activatedChildren.push(vm);
  9089. }
  9090. function callActivatedHooks (queue) {
  9091. for (var i = 0; i < queue.length; i++) {
  9092. queue[i]._inactive = true;
  9093. activateChildComponent(queue[i], true /* true */);
  9094. }
  9095. }
  9096. /**
  9097. * Push a watcher into the watcher queue.
  9098. * Jobs with duplicate IDs will be skipped unless it's
  9099. * pushed when the queue is being flushed.
  9100. */
  9101. function queueWatcher (watcher) {
  9102. var id = watcher.id;
  9103. if (has[id] == null) {
  9104. has[id] = true;
  9105. if (!flushing) {
  9106. queue.push(watcher);
  9107. } else {
  9108. // if already flushing, splice the watcher based on its id
  9109. // if already past its id, it will be run next immediately.
  9110. var i = queue.length - 1;
  9111. while (i > index && queue[i].id > watcher.id) {
  9112. i--;
  9113. }
  9114. queue.splice(i + 1, 0, watcher);
  9115. }
  9116. // queue the flush
  9117. if (!waiting) {
  9118. waiting = true;
  9119. if ( true && !config.async) {
  9120. flushSchedulerQueue();
  9121. return
  9122. }
  9123. nextTick(flushSchedulerQueue);
  9124. }
  9125. }
  9126. }
  9127. /* */
  9128. var uid$2 = 0;
  9129. /**
  9130. * A watcher parses an expression, collects dependencies,
  9131. * and fires callback when the expression value changes.
  9132. * This is used for both the $watch() api and directives.
  9133. */
  9134. var Watcher = function Watcher (
  9135. vm,
  9136. expOrFn,
  9137. cb,
  9138. options,
  9139. isRenderWatcher
  9140. ) {
  9141. this.vm = vm;
  9142. if (isRenderWatcher) {
  9143. vm._watcher = this;
  9144. }
  9145. vm._watchers.push(this);
  9146. // options
  9147. if (options) {
  9148. this.deep = !!options.deep;
  9149. this.user = !!options.user;
  9150. this.lazy = !!options.lazy;
  9151. this.sync = !!options.sync;
  9152. this.before = options.before;
  9153. } else {
  9154. this.deep = this.user = this.lazy = this.sync = false;
  9155. }
  9156. this.cb = cb;
  9157. this.id = ++uid$2; // uid for batching
  9158. this.active = true;
  9159. this.dirty = this.lazy; // for lazy watchers
  9160. this.deps = [];
  9161. this.newDeps = [];
  9162. this.depIds = new _Set();
  9163. this.newDepIds = new _Set();
  9164. this.expression = true
  9165. ? expOrFn.toString()
  9166. : undefined;
  9167. // parse expression for getter
  9168. if (typeof expOrFn === 'function') {
  9169. this.getter = expOrFn;
  9170. } else {
  9171. this.getter = parsePath(expOrFn);
  9172. if (!this.getter) {
  9173. this.getter = noop;
  9174. true && warn(
  9175. "Failed watching path: \"" + expOrFn + "\" " +
  9176. 'Watcher only accepts simple dot-delimited paths. ' +
  9177. 'For full control, use a function instead.',
  9178. vm
  9179. );
  9180. }
  9181. }
  9182. this.value = this.lazy
  9183. ? undefined
  9184. : this.get();
  9185. };
  9186. /**
  9187. * Evaluate the getter, and re-collect dependencies.
  9188. */
  9189. Watcher.prototype.get = function get () {
  9190. pushTarget(this);
  9191. var value;
  9192. var vm = this.vm;
  9193. try {
  9194. value = this.getter.call(vm, vm);
  9195. } catch (e) {
  9196. if (this.user) {
  9197. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  9198. } else {
  9199. throw e
  9200. }
  9201. } finally {
  9202. // "touch" every property so they are all tracked as
  9203. // dependencies for deep watching
  9204. if (this.deep) {
  9205. traverse(value);
  9206. }
  9207. popTarget();
  9208. this.cleanupDeps();
  9209. }
  9210. return value
  9211. };
  9212. /**
  9213. * Add a dependency to this directive.
  9214. */
  9215. Watcher.prototype.addDep = function addDep (dep) {
  9216. var id = dep.id;
  9217. if (!this.newDepIds.has(id)) {
  9218. this.newDepIds.add(id);
  9219. this.newDeps.push(dep);
  9220. if (!this.depIds.has(id)) {
  9221. dep.addSub(this);
  9222. }
  9223. }
  9224. };
  9225. /**
  9226. * Clean up for dependency collection.
  9227. */
  9228. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  9229. var i = this.deps.length;
  9230. while (i--) {
  9231. var dep = this.deps[i];
  9232. if (!this.newDepIds.has(dep.id)) {
  9233. dep.removeSub(this);
  9234. }
  9235. }
  9236. var tmp = this.depIds;
  9237. this.depIds = this.newDepIds;
  9238. this.newDepIds = tmp;
  9239. this.newDepIds.clear();
  9240. tmp = this.deps;
  9241. this.deps = this.newDeps;
  9242. this.newDeps = tmp;
  9243. this.newDeps.length = 0;
  9244. };
  9245. /**
  9246. * Subscriber interface.
  9247. * Will be called when a dependency changes.
  9248. */
  9249. Watcher.prototype.update = function update () {
  9250. /* istanbul ignore else */
  9251. if (this.lazy) {
  9252. this.dirty = true;
  9253. } else if (this.sync) {
  9254. this.run();
  9255. } else {
  9256. queueWatcher(this);
  9257. }
  9258. };
  9259. /**
  9260. * Scheduler job interface.
  9261. * Will be called by the scheduler.
  9262. */
  9263. Watcher.prototype.run = function run () {
  9264. if (this.active) {
  9265. var value = this.get();
  9266. if (
  9267. value !== this.value ||
  9268. // Deep watchers and watchers on Object/Arrays should fire even
  9269. // when the value is the same, because the value may
  9270. // have mutated.
  9271. isObject(value) ||
  9272. this.deep
  9273. ) {
  9274. // set new value
  9275. var oldValue = this.value;
  9276. this.value = value;
  9277. if (this.user) {
  9278. try {
  9279. this.cb.call(this.vm, value, oldValue);
  9280. } catch (e) {
  9281. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  9282. }
  9283. } else {
  9284. this.cb.call(this.vm, value, oldValue);
  9285. }
  9286. }
  9287. }
  9288. };
  9289. /**
  9290. * Evaluate the value of the watcher.
  9291. * This only gets called for lazy watchers.
  9292. */
  9293. Watcher.prototype.evaluate = function evaluate () {
  9294. this.value = this.get();
  9295. this.dirty = false;
  9296. };
  9297. /**
  9298. * Depend on all deps collected by this watcher.
  9299. */
  9300. Watcher.prototype.depend = function depend () {
  9301. var i = this.deps.length;
  9302. while (i--) {
  9303. this.deps[i].depend();
  9304. }
  9305. };
  9306. /**
  9307. * Remove self from all dependencies' subscriber list.
  9308. */
  9309. Watcher.prototype.teardown = function teardown () {
  9310. if (this.active) {
  9311. // remove self from vm's watcher list
  9312. // this is a somewhat expensive operation so we skip it
  9313. // if the vm is being destroyed.
  9314. if (!this.vm._isBeingDestroyed) {
  9315. remove(this.vm._watchers, this);
  9316. }
  9317. var i = this.deps.length;
  9318. while (i--) {
  9319. this.deps[i].removeSub(this);
  9320. }
  9321. this.active = false;
  9322. }
  9323. };
  9324. /* */
  9325. var sharedPropertyDefinition = {
  9326. enumerable: true,
  9327. configurable: true,
  9328. get: noop,
  9329. set: noop
  9330. };
  9331. function proxy (target, sourceKey, key) {
  9332. sharedPropertyDefinition.get = function proxyGetter () {
  9333. return this[sourceKey][key]
  9334. };
  9335. sharedPropertyDefinition.set = function proxySetter (val) {
  9336. this[sourceKey][key] = val;
  9337. };
  9338. Object.defineProperty(target, key, sharedPropertyDefinition);
  9339. }
  9340. function initState (vm) {
  9341. vm._watchers = [];
  9342. var opts = vm.$options;
  9343. if (opts.props) { initProps(vm, opts.props); }
  9344. if (opts.methods) { initMethods(vm, opts.methods); }
  9345. if (opts.data) {
  9346. initData(vm);
  9347. } else {
  9348. observe(vm._data = {}, true /* asRootData */);
  9349. }
  9350. if (opts.computed) { initComputed(vm, opts.computed); }
  9351. if (opts.watch && opts.watch !== nativeWatch) {
  9352. initWatch(vm, opts.watch);
  9353. }
  9354. }
  9355. function initProps (vm, propsOptions) {
  9356. var propsData = vm.$options.propsData || {};
  9357. var props = vm._props = {};
  9358. // cache prop keys so that future props updates can iterate using Array
  9359. // instead of dynamic object key enumeration.
  9360. var keys = vm.$options._propKeys = [];
  9361. var isRoot = !vm.$parent;
  9362. // root instance props should be converted
  9363. if (!isRoot) {
  9364. toggleObserving(false);
  9365. }
  9366. var loop = function ( key ) {
  9367. keys.push(key);
  9368. var value = validateProp(key, propsOptions, propsData, vm);
  9369. /* istanbul ignore else */
  9370. if (true) {
  9371. var hyphenatedKey = hyphenate(key);
  9372. if (isReservedAttribute(hyphenatedKey) ||
  9373. config.isReservedAttr(hyphenatedKey)) {
  9374. warn(
  9375. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  9376. vm
  9377. );
  9378. }
  9379. defineReactive$$1(props, key, value, function () {
  9380. if (!isRoot && !isUpdatingChildComponent) {
  9381. {
  9382. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  9383. return
  9384. }
  9385. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  9386. if(
  9387. key === 'value' &&
  9388. Array.isArray(vm.$options.behaviors) &&
  9389. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  9390. ){
  9391. return
  9392. }
  9393. if(vm._getFormData){
  9394. return
  9395. }
  9396. var $parent = vm.$parent;
  9397. while($parent){
  9398. if($parent.__next_tick_pending){
  9399. return
  9400. }
  9401. $parent = $parent.$parent;
  9402. }
  9403. }
  9404. warn(
  9405. "Avoid mutating a prop directly since the value will be " +
  9406. "overwritten whenever the parent component re-renders. " +
  9407. "Instead, use a data or computed property based on the prop's " +
  9408. "value. Prop being mutated: \"" + key + "\"",
  9409. vm
  9410. );
  9411. }
  9412. });
  9413. } else {}
  9414. // static props are already proxied on the component's prototype
  9415. // during Vue.extend(). We only need to proxy props defined at
  9416. // instantiation here.
  9417. if (!(key in vm)) {
  9418. proxy(vm, "_props", key);
  9419. }
  9420. };
  9421. for (var key in propsOptions) loop( key );
  9422. toggleObserving(true);
  9423. }
  9424. function initData (vm) {
  9425. var data = vm.$options.data;
  9426. data = vm._data = typeof data === 'function'
  9427. ? getData(data, vm)
  9428. : data || {};
  9429. if (!isPlainObject(data)) {
  9430. data = {};
  9431. true && warn(
  9432. 'data functions should return an object:\n' +
  9433. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  9434. vm
  9435. );
  9436. }
  9437. // proxy data on instance
  9438. var keys = Object.keys(data);
  9439. var props = vm.$options.props;
  9440. var methods = vm.$options.methods;
  9441. var i = keys.length;
  9442. while (i--) {
  9443. var key = keys[i];
  9444. if (true) {
  9445. if (methods && hasOwn(methods, key)) {
  9446. warn(
  9447. ("Method \"" + key + "\" has already been defined as a data property."),
  9448. vm
  9449. );
  9450. }
  9451. }
  9452. if (props && hasOwn(props, key)) {
  9453. true && warn(
  9454. "The data property \"" + key + "\" is already declared as a prop. " +
  9455. "Use prop default value instead.",
  9456. vm
  9457. );
  9458. } else if (!isReserved(key)) {
  9459. proxy(vm, "_data", key);
  9460. }
  9461. }
  9462. // observe data
  9463. observe(data, true /* asRootData */);
  9464. }
  9465. function getData (data, vm) {
  9466. // #7573 disable dep collection when invoking data getters
  9467. pushTarget();
  9468. try {
  9469. return data.call(vm, vm)
  9470. } catch (e) {
  9471. handleError(e, vm, "data()");
  9472. return {}
  9473. } finally {
  9474. popTarget();
  9475. }
  9476. }
  9477. var computedWatcherOptions = { lazy: true };
  9478. function initComputed (vm, computed) {
  9479. // $flow-disable-line
  9480. var watchers = vm._computedWatchers = Object.create(null);
  9481. // computed properties are just getters during SSR
  9482. var isSSR = isServerRendering();
  9483. for (var key in computed) {
  9484. var userDef = computed[key];
  9485. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  9486. if ( true && getter == null) {
  9487. warn(
  9488. ("Getter is missing for computed property \"" + key + "\"."),
  9489. vm
  9490. );
  9491. }
  9492. if (!isSSR) {
  9493. // create internal watcher for the computed property.
  9494. watchers[key] = new Watcher(
  9495. vm,
  9496. getter || noop,
  9497. noop,
  9498. computedWatcherOptions
  9499. );
  9500. }
  9501. // component-defined computed properties are already defined on the
  9502. // component prototype. We only need to define computed properties defined
  9503. // at instantiation here.
  9504. if (!(key in vm)) {
  9505. defineComputed(vm, key, userDef);
  9506. } else if (true) {
  9507. if (key in vm.$data) {
  9508. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  9509. } else if (vm.$options.props && key in vm.$options.props) {
  9510. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  9511. }
  9512. }
  9513. }
  9514. }
  9515. function defineComputed (
  9516. target,
  9517. key,
  9518. userDef
  9519. ) {
  9520. var shouldCache = !isServerRendering();
  9521. if (typeof userDef === 'function') {
  9522. sharedPropertyDefinition.get = shouldCache
  9523. ? createComputedGetter(key)
  9524. : createGetterInvoker(userDef);
  9525. sharedPropertyDefinition.set = noop;
  9526. } else {
  9527. sharedPropertyDefinition.get = userDef.get
  9528. ? shouldCache && userDef.cache !== false
  9529. ? createComputedGetter(key)
  9530. : createGetterInvoker(userDef.get)
  9531. : noop;
  9532. sharedPropertyDefinition.set = userDef.set || noop;
  9533. }
  9534. if ( true &&
  9535. sharedPropertyDefinition.set === noop) {
  9536. sharedPropertyDefinition.set = function () {
  9537. warn(
  9538. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  9539. this
  9540. );
  9541. };
  9542. }
  9543. Object.defineProperty(target, key, sharedPropertyDefinition);
  9544. }
  9545. function createComputedGetter (key) {
  9546. return function computedGetter () {
  9547. var watcher = this._computedWatchers && this._computedWatchers[key];
  9548. if (watcher) {
  9549. if (watcher.dirty) {
  9550. watcher.evaluate();
  9551. }
  9552. if (Dep.SharedObject.target) {// fixed by xxxxxx
  9553. watcher.depend();
  9554. }
  9555. return watcher.value
  9556. }
  9557. }
  9558. }
  9559. function createGetterInvoker(fn) {
  9560. return function computedGetter () {
  9561. return fn.call(this, this)
  9562. }
  9563. }
  9564. function initMethods (vm, methods) {
  9565. var props = vm.$options.props;
  9566. for (var key in methods) {
  9567. if (true) {
  9568. if (typeof methods[key] !== 'function') {
  9569. warn(
  9570. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  9571. "Did you reference the function correctly?",
  9572. vm
  9573. );
  9574. }
  9575. if (props && hasOwn(props, key)) {
  9576. warn(
  9577. ("Method \"" + key + "\" has already been defined as a prop."),
  9578. vm
  9579. );
  9580. }
  9581. if ((key in vm) && isReserved(key)) {
  9582. warn(
  9583. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  9584. "Avoid defining component methods that start with _ or $."
  9585. );
  9586. }
  9587. }
  9588. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  9589. }
  9590. }
  9591. function initWatch (vm, watch) {
  9592. for (var key in watch) {
  9593. var handler = watch[key];
  9594. if (Array.isArray(handler)) {
  9595. for (var i = 0; i < handler.length; i++) {
  9596. createWatcher(vm, key, handler[i]);
  9597. }
  9598. } else {
  9599. createWatcher(vm, key, handler);
  9600. }
  9601. }
  9602. }
  9603. function createWatcher (
  9604. vm,
  9605. expOrFn,
  9606. handler,
  9607. options
  9608. ) {
  9609. if (isPlainObject(handler)) {
  9610. options = handler;
  9611. handler = handler.handler;
  9612. }
  9613. if (typeof handler === 'string') {
  9614. handler = vm[handler];
  9615. }
  9616. return vm.$watch(expOrFn, handler, options)
  9617. }
  9618. function stateMixin (Vue) {
  9619. // flow somehow has problems with directly declared definition object
  9620. // when using Object.defineProperty, so we have to procedurally build up
  9621. // the object here.
  9622. var dataDef = {};
  9623. dataDef.get = function () { return this._data };
  9624. var propsDef = {};
  9625. propsDef.get = function () { return this._props };
  9626. if (true) {
  9627. dataDef.set = function () {
  9628. warn(
  9629. 'Avoid replacing instance root $data. ' +
  9630. 'Use nested data properties instead.',
  9631. this
  9632. );
  9633. };
  9634. propsDef.set = function () {
  9635. warn("$props is readonly.", this);
  9636. };
  9637. }
  9638. Object.defineProperty(Vue.prototype, '$data', dataDef);
  9639. Object.defineProperty(Vue.prototype, '$props', propsDef);
  9640. Vue.prototype.$set = set;
  9641. Vue.prototype.$delete = del;
  9642. Vue.prototype.$watch = function (
  9643. expOrFn,
  9644. cb,
  9645. options
  9646. ) {
  9647. var vm = this;
  9648. if (isPlainObject(cb)) {
  9649. return createWatcher(vm, expOrFn, cb, options)
  9650. }
  9651. options = options || {};
  9652. options.user = true;
  9653. var watcher = new Watcher(vm, expOrFn, cb, options);
  9654. if (options.immediate) {
  9655. try {
  9656. cb.call(vm, watcher.value);
  9657. } catch (error) {
  9658. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  9659. }
  9660. }
  9661. return function unwatchFn () {
  9662. watcher.teardown();
  9663. }
  9664. };
  9665. }
  9666. /* */
  9667. var uid$3 = 0;
  9668. function initMixin (Vue) {
  9669. Vue.prototype._init = function (options) {
  9670. var vm = this;
  9671. // a uid
  9672. vm._uid = uid$3++;
  9673. var startTag, endTag;
  9674. /* istanbul ignore if */
  9675. if ( true && config.performance && mark) {
  9676. startTag = "vue-perf-start:" + (vm._uid);
  9677. endTag = "vue-perf-end:" + (vm._uid);
  9678. mark(startTag);
  9679. }
  9680. // a flag to avoid this being observed
  9681. vm._isVue = true;
  9682. // merge options
  9683. if (options && options._isComponent) {
  9684. // optimize internal component instantiation
  9685. // since dynamic options merging is pretty slow, and none of the
  9686. // internal component options needs special treatment.
  9687. initInternalComponent(vm, options);
  9688. } else {
  9689. vm.$options = mergeOptions(
  9690. resolveConstructorOptions(vm.constructor),
  9691. options || {},
  9692. vm
  9693. );
  9694. }
  9695. /* istanbul ignore else */
  9696. if (true) {
  9697. initProxy(vm);
  9698. } else {}
  9699. // expose real self
  9700. vm._self = vm;
  9701. initLifecycle(vm);
  9702. initEvents(vm);
  9703. initRender(vm);
  9704. callHook(vm, 'beforeCreate');
  9705. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  9706. initState(vm);
  9707. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  9708. !vm._$fallback && callHook(vm, 'created');
  9709. /* istanbul ignore if */
  9710. if ( true && config.performance && mark) {
  9711. vm._name = formatComponentName(vm, false);
  9712. mark(endTag);
  9713. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  9714. }
  9715. if (vm.$options.el) {
  9716. vm.$mount(vm.$options.el);
  9717. }
  9718. };
  9719. }
  9720. function initInternalComponent (vm, options) {
  9721. var opts = vm.$options = Object.create(vm.constructor.options);
  9722. // doing this because it's faster than dynamic enumeration.
  9723. var parentVnode = options._parentVnode;
  9724. opts.parent = options.parent;
  9725. opts._parentVnode = parentVnode;
  9726. var vnodeComponentOptions = parentVnode.componentOptions;
  9727. opts.propsData = vnodeComponentOptions.propsData;
  9728. opts._parentListeners = vnodeComponentOptions.listeners;
  9729. opts._renderChildren = vnodeComponentOptions.children;
  9730. opts._componentTag = vnodeComponentOptions.tag;
  9731. if (options.render) {
  9732. opts.render = options.render;
  9733. opts.staticRenderFns = options.staticRenderFns;
  9734. }
  9735. }
  9736. function resolveConstructorOptions (Ctor) {
  9737. var options = Ctor.options;
  9738. if (Ctor.super) {
  9739. var superOptions = resolveConstructorOptions(Ctor.super);
  9740. var cachedSuperOptions = Ctor.superOptions;
  9741. if (superOptions !== cachedSuperOptions) {
  9742. // super option changed,
  9743. // need to resolve new options.
  9744. Ctor.superOptions = superOptions;
  9745. // check if there are any late-modified/attached options (#4976)
  9746. var modifiedOptions = resolveModifiedOptions(Ctor);
  9747. // update base extend options
  9748. if (modifiedOptions) {
  9749. extend(Ctor.extendOptions, modifiedOptions);
  9750. }
  9751. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  9752. if (options.name) {
  9753. options.components[options.name] = Ctor;
  9754. }
  9755. }
  9756. }
  9757. return options
  9758. }
  9759. function resolveModifiedOptions (Ctor) {
  9760. var modified;
  9761. var latest = Ctor.options;
  9762. var sealed = Ctor.sealedOptions;
  9763. for (var key in latest) {
  9764. if (latest[key] !== sealed[key]) {
  9765. if (!modified) { modified = {}; }
  9766. modified[key] = latest[key];
  9767. }
  9768. }
  9769. return modified
  9770. }
  9771. function Vue (options) {
  9772. if ( true &&
  9773. !(this instanceof Vue)
  9774. ) {
  9775. warn('Vue is a constructor and should be called with the `new` keyword');
  9776. }
  9777. this._init(options);
  9778. }
  9779. initMixin(Vue);
  9780. stateMixin(Vue);
  9781. eventsMixin(Vue);
  9782. lifecycleMixin(Vue);
  9783. renderMixin(Vue);
  9784. /* */
  9785. function initUse (Vue) {
  9786. Vue.use = function (plugin) {
  9787. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  9788. if (installedPlugins.indexOf(plugin) > -1) {
  9789. return this
  9790. }
  9791. // additional parameters
  9792. var args = toArray(arguments, 1);
  9793. args.unshift(this);
  9794. if (typeof plugin.install === 'function') {
  9795. plugin.install.apply(plugin, args);
  9796. } else if (typeof plugin === 'function') {
  9797. plugin.apply(null, args);
  9798. }
  9799. installedPlugins.push(plugin);
  9800. return this
  9801. };
  9802. }
  9803. /* */
  9804. function initMixin$1 (Vue) {
  9805. Vue.mixin = function (mixin) {
  9806. this.options = mergeOptions(this.options, mixin);
  9807. return this
  9808. };
  9809. }
  9810. /* */
  9811. function initExtend (Vue) {
  9812. /**
  9813. * Each instance constructor, including Vue, has a unique
  9814. * cid. This enables us to create wrapped "child
  9815. * constructors" for prototypal inheritance and cache them.
  9816. */
  9817. Vue.cid = 0;
  9818. var cid = 1;
  9819. /**
  9820. * Class inheritance
  9821. */
  9822. Vue.extend = function (extendOptions) {
  9823. extendOptions = extendOptions || {};
  9824. var Super = this;
  9825. var SuperId = Super.cid;
  9826. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  9827. if (cachedCtors[SuperId]) {
  9828. return cachedCtors[SuperId]
  9829. }
  9830. var name = extendOptions.name || Super.options.name;
  9831. if ( true && name) {
  9832. validateComponentName(name);
  9833. }
  9834. var Sub = function VueComponent (options) {
  9835. this._init(options);
  9836. };
  9837. Sub.prototype = Object.create(Super.prototype);
  9838. Sub.prototype.constructor = Sub;
  9839. Sub.cid = cid++;
  9840. Sub.options = mergeOptions(
  9841. Super.options,
  9842. extendOptions
  9843. );
  9844. Sub['super'] = Super;
  9845. // For props and computed properties, we define the proxy getters on
  9846. // the Vue instances at extension time, on the extended prototype. This
  9847. // avoids Object.defineProperty calls for each instance created.
  9848. if (Sub.options.props) {
  9849. initProps$1(Sub);
  9850. }
  9851. if (Sub.options.computed) {
  9852. initComputed$1(Sub);
  9853. }
  9854. // allow further extension/mixin/plugin usage
  9855. Sub.extend = Super.extend;
  9856. Sub.mixin = Super.mixin;
  9857. Sub.use = Super.use;
  9858. // create asset registers, so extended classes
  9859. // can have their private assets too.
  9860. ASSET_TYPES.forEach(function (type) {
  9861. Sub[type] = Super[type];
  9862. });
  9863. // enable recursive self-lookup
  9864. if (name) {
  9865. Sub.options.components[name] = Sub;
  9866. }
  9867. // keep a reference to the super options at extension time.
  9868. // later at instantiation we can check if Super's options have
  9869. // been updated.
  9870. Sub.superOptions = Super.options;
  9871. Sub.extendOptions = extendOptions;
  9872. Sub.sealedOptions = extend({}, Sub.options);
  9873. // cache constructor
  9874. cachedCtors[SuperId] = Sub;
  9875. return Sub
  9876. };
  9877. }
  9878. function initProps$1 (Comp) {
  9879. var props = Comp.options.props;
  9880. for (var key in props) {
  9881. proxy(Comp.prototype, "_props", key);
  9882. }
  9883. }
  9884. function initComputed$1 (Comp) {
  9885. var computed = Comp.options.computed;
  9886. for (var key in computed) {
  9887. defineComputed(Comp.prototype, key, computed[key]);
  9888. }
  9889. }
  9890. /* */
  9891. function initAssetRegisters (Vue) {
  9892. /**
  9893. * Create asset registration methods.
  9894. */
  9895. ASSET_TYPES.forEach(function (type) {
  9896. Vue[type] = function (
  9897. id,
  9898. definition
  9899. ) {
  9900. if (!definition) {
  9901. return this.options[type + 's'][id]
  9902. } else {
  9903. /* istanbul ignore if */
  9904. if ( true && type === 'component') {
  9905. validateComponentName(id);
  9906. }
  9907. if (type === 'component' && isPlainObject(definition)) {
  9908. definition.name = definition.name || id;
  9909. definition = this.options._base.extend(definition);
  9910. }
  9911. if (type === 'directive' && typeof definition === 'function') {
  9912. definition = { bind: definition, update: definition };
  9913. }
  9914. this.options[type + 's'][id] = definition;
  9915. return definition
  9916. }
  9917. };
  9918. });
  9919. }
  9920. /* */
  9921. function getComponentName (opts) {
  9922. return opts && (opts.Ctor.options.name || opts.tag)
  9923. }
  9924. function matches (pattern, name) {
  9925. if (Array.isArray(pattern)) {
  9926. return pattern.indexOf(name) > -1
  9927. } else if (typeof pattern === 'string') {
  9928. return pattern.split(',').indexOf(name) > -1
  9929. } else if (isRegExp(pattern)) {
  9930. return pattern.test(name)
  9931. }
  9932. /* istanbul ignore next */
  9933. return false
  9934. }
  9935. function pruneCache (keepAliveInstance, filter) {
  9936. var cache = keepAliveInstance.cache;
  9937. var keys = keepAliveInstance.keys;
  9938. var _vnode = keepAliveInstance._vnode;
  9939. for (var key in cache) {
  9940. var cachedNode = cache[key];
  9941. if (cachedNode) {
  9942. var name = getComponentName(cachedNode.componentOptions);
  9943. if (name && !filter(name)) {
  9944. pruneCacheEntry(cache, key, keys, _vnode);
  9945. }
  9946. }
  9947. }
  9948. }
  9949. function pruneCacheEntry (
  9950. cache,
  9951. key,
  9952. keys,
  9953. current
  9954. ) {
  9955. var cached$$1 = cache[key];
  9956. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  9957. cached$$1.componentInstance.$destroy();
  9958. }
  9959. cache[key] = null;
  9960. remove(keys, key);
  9961. }
  9962. var patternTypes = [String, RegExp, Array];
  9963. var KeepAlive = {
  9964. name: 'keep-alive',
  9965. abstract: true,
  9966. props: {
  9967. include: patternTypes,
  9968. exclude: patternTypes,
  9969. max: [String, Number]
  9970. },
  9971. created: function created () {
  9972. this.cache = Object.create(null);
  9973. this.keys = [];
  9974. },
  9975. destroyed: function destroyed () {
  9976. for (var key in this.cache) {
  9977. pruneCacheEntry(this.cache, key, this.keys);
  9978. }
  9979. },
  9980. mounted: function mounted () {
  9981. var this$1 = this;
  9982. this.$watch('include', function (val) {
  9983. pruneCache(this$1, function (name) { return matches(val, name); });
  9984. });
  9985. this.$watch('exclude', function (val) {
  9986. pruneCache(this$1, function (name) { return !matches(val, name); });
  9987. });
  9988. },
  9989. render: function render () {
  9990. var slot = this.$slots.default;
  9991. var vnode = getFirstComponentChild(slot);
  9992. var componentOptions = vnode && vnode.componentOptions;
  9993. if (componentOptions) {
  9994. // check pattern
  9995. var name = getComponentName(componentOptions);
  9996. var ref = this;
  9997. var include = ref.include;
  9998. var exclude = ref.exclude;
  9999. if (
  10000. // not included
  10001. (include && (!name || !matches(include, name))) ||
  10002. // excluded
  10003. (exclude && name && matches(exclude, name))
  10004. ) {
  10005. return vnode
  10006. }
  10007. var ref$1 = this;
  10008. var cache = ref$1.cache;
  10009. var keys = ref$1.keys;
  10010. var key = vnode.key == null
  10011. // same constructor may get registered as different local components
  10012. // so cid alone is not enough (#3269)
  10013. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  10014. : vnode.key;
  10015. if (cache[key]) {
  10016. vnode.componentInstance = cache[key].componentInstance;
  10017. // make current key freshest
  10018. remove(keys, key);
  10019. keys.push(key);
  10020. } else {
  10021. cache[key] = vnode;
  10022. keys.push(key);
  10023. // prune oldest entry
  10024. if (this.max && keys.length > parseInt(this.max)) {
  10025. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  10026. }
  10027. }
  10028. vnode.data.keepAlive = true;
  10029. }
  10030. return vnode || (slot && slot[0])
  10031. }
  10032. };
  10033. var builtInComponents = {
  10034. KeepAlive: KeepAlive
  10035. };
  10036. /* */
  10037. function initGlobalAPI (Vue) {
  10038. // config
  10039. var configDef = {};
  10040. configDef.get = function () { return config; };
  10041. if (true) {
  10042. configDef.set = function () {
  10043. warn(
  10044. 'Do not replace the Vue.config object, set individual fields instead.'
  10045. );
  10046. };
  10047. }
  10048. Object.defineProperty(Vue, 'config', configDef);
  10049. // exposed util methods.
  10050. // NOTE: these are not considered part of the public API - avoid relying on
  10051. // them unless you are aware of the risk.
  10052. Vue.util = {
  10053. warn: warn,
  10054. extend: extend,
  10055. mergeOptions: mergeOptions,
  10056. defineReactive: defineReactive$$1
  10057. };
  10058. Vue.set = set;
  10059. Vue.delete = del;
  10060. Vue.nextTick = nextTick;
  10061. // 2.6 explicit observable API
  10062. Vue.observable = function (obj) {
  10063. observe(obj);
  10064. return obj
  10065. };
  10066. Vue.options = Object.create(null);
  10067. ASSET_TYPES.forEach(function (type) {
  10068. Vue.options[type + 's'] = Object.create(null);
  10069. });
  10070. // this is used to identify the "base" constructor to extend all plain-object
  10071. // components with in Weex's multi-instance scenarios.
  10072. Vue.options._base = Vue;
  10073. extend(Vue.options.components, builtInComponents);
  10074. initUse(Vue);
  10075. initMixin$1(Vue);
  10076. initExtend(Vue);
  10077. initAssetRegisters(Vue);
  10078. }
  10079. initGlobalAPI(Vue);
  10080. Object.defineProperty(Vue.prototype, '$isServer', {
  10081. get: isServerRendering
  10082. });
  10083. Object.defineProperty(Vue.prototype, '$ssrContext', {
  10084. get: function get () {
  10085. /* istanbul ignore next */
  10086. return this.$vnode && this.$vnode.ssrContext
  10087. }
  10088. });
  10089. // expose FunctionalRenderContext for ssr runtime helper installation
  10090. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  10091. value: FunctionalRenderContext
  10092. });
  10093. Vue.version = '2.6.11';
  10094. /**
  10095. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  10096. */
  10097. var ARRAYTYPE = '[object Array]';
  10098. var OBJECTTYPE = '[object Object]';
  10099. var NULLTYPE = '[object Null]';
  10100. var UNDEFINEDTYPE = '[object Undefined]';
  10101. // const FUNCTIONTYPE = '[object Function]'
  10102. function diff(current, pre) {
  10103. var result = {};
  10104. syncKeys(current, pre);
  10105. _diff(current, pre, '', result);
  10106. return result
  10107. }
  10108. function syncKeys(current, pre) {
  10109. if (current === pre) { return }
  10110. var rootCurrentType = type(current);
  10111. var rootPreType = type(pre);
  10112. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  10113. if(Object.keys(current).length >= Object.keys(pre).length){
  10114. for (var key in pre) {
  10115. var currentValue = current[key];
  10116. if (currentValue === undefined) {
  10117. current[key] = null;
  10118. } else {
  10119. syncKeys(currentValue, pre[key]);
  10120. }
  10121. }
  10122. }
  10123. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  10124. if (current.length >= pre.length) {
  10125. pre.forEach(function (item, index) {
  10126. syncKeys(current[index], item);
  10127. });
  10128. }
  10129. }
  10130. }
  10131. function nullOrUndefined(currentType, preType) {
  10132. if(
  10133. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  10134. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  10135. ) {
  10136. return false
  10137. }
  10138. return true
  10139. }
  10140. function _diff(current, pre, path, result) {
  10141. if (current === pre) { return }
  10142. var rootCurrentType = type(current);
  10143. var rootPreType = type(pre);
  10144. if (rootCurrentType == OBJECTTYPE) {
  10145. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  10146. setResult(result, path, current);
  10147. } else {
  10148. var loop = function ( key ) {
  10149. var currentValue = current[key];
  10150. var preValue = pre[key];
  10151. var currentType = type(currentValue);
  10152. var preType = type(preValue);
  10153. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  10154. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  10155. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  10156. }
  10157. } else if (currentType == ARRAYTYPE) {
  10158. if (preType != ARRAYTYPE) {
  10159. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  10160. } else {
  10161. if (currentValue.length < preValue.length) {
  10162. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  10163. } else {
  10164. currentValue.forEach(function (item, index) {
  10165. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  10166. });
  10167. }
  10168. }
  10169. } else if (currentType == OBJECTTYPE) {
  10170. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  10171. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  10172. } else {
  10173. for (var subKey in currentValue) {
  10174. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  10175. }
  10176. }
  10177. }
  10178. };
  10179. for (var key in current) loop( key );
  10180. }
  10181. } else if (rootCurrentType == ARRAYTYPE) {
  10182. if (rootPreType != ARRAYTYPE) {
  10183. setResult(result, path, current);
  10184. } else {
  10185. if (current.length < pre.length) {
  10186. setResult(result, path, current);
  10187. } else {
  10188. current.forEach(function (item, index) {
  10189. _diff(item, pre[index], path + '[' + index + ']', result);
  10190. });
  10191. }
  10192. }
  10193. } else {
  10194. setResult(result, path, current);
  10195. }
  10196. }
  10197. function setResult(result, k, v) {
  10198. // if (type(v) != FUNCTIONTYPE) {
  10199. result[k] = v;
  10200. // }
  10201. }
  10202. function type(obj) {
  10203. return Object.prototype.toString.call(obj)
  10204. }
  10205. /* */
  10206. function flushCallbacks$1(vm) {
  10207. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  10208. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"errand_app","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  10209. var mpInstance = vm.$scope;
  10210. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  10211. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  10212. }
  10213. var copies = vm.__next_tick_callbacks.slice(0);
  10214. vm.__next_tick_callbacks.length = 0;
  10215. for (var i = 0; i < copies.length; i++) {
  10216. copies[i]();
  10217. }
  10218. }
  10219. }
  10220. function hasRenderWatcher(vm) {
  10221. return queue.find(function (watcher) { return vm._watcher === watcher; })
  10222. }
  10223. function nextTick$1(vm, cb) {
  10224. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  10225. //2.nextTick 之前存在 render watcher
  10226. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  10227. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"errand_app","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  10228. var mpInstance = vm.$scope;
  10229. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  10230. ']:nextVueTick');
  10231. }
  10232. return nextTick(cb, vm)
  10233. }else{
  10234. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"errand_app","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  10235. var mpInstance$1 = vm.$scope;
  10236. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  10237. ']:nextMPTick');
  10238. }
  10239. }
  10240. var _resolve;
  10241. if (!vm.__next_tick_callbacks) {
  10242. vm.__next_tick_callbacks = [];
  10243. }
  10244. vm.__next_tick_callbacks.push(function () {
  10245. if (cb) {
  10246. try {
  10247. cb.call(vm);
  10248. } catch (e) {
  10249. handleError(e, vm, 'nextTick');
  10250. }
  10251. } else if (_resolve) {
  10252. _resolve(vm);
  10253. }
  10254. });
  10255. // $flow-disable-line
  10256. if (!cb && typeof Promise !== 'undefined') {
  10257. return new Promise(function (resolve) {
  10258. _resolve = resolve;
  10259. })
  10260. }
  10261. }
  10262. /* */
  10263. function clearInstance(key, value) {
  10264. // 简易去除 Vue 和小程序组件实例
  10265. if (value) {
  10266. if (value._isVue || value.__v_isMPComponent) {
  10267. return {}
  10268. }
  10269. }
  10270. return value
  10271. }
  10272. function cloneWithData(vm) {
  10273. // 确保当前 vm 所有数据被同步
  10274. var ret = Object.create(null);
  10275. var dataKeys = [].concat(
  10276. Object.keys(vm._data || {}),
  10277. Object.keys(vm._computedWatchers || {}));
  10278. dataKeys.reduce(function(ret, key) {
  10279. ret[key] = vm[key];
  10280. return ret
  10281. }, ret);
  10282. // vue-composition-api
  10283. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  10284. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  10285. if (rawBindings) {
  10286. Object.keys(rawBindings).forEach(function (key) {
  10287. ret[key] = vm[key];
  10288. });
  10289. }
  10290. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  10291. Object.assign(ret, vm.$mp.data || {});
  10292. if (
  10293. Array.isArray(vm.$options.behaviors) &&
  10294. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  10295. ) { //form-field
  10296. ret['name'] = vm.name;
  10297. ret['value'] = vm.value;
  10298. }
  10299. return JSON.parse(JSON.stringify(ret, clearInstance))
  10300. }
  10301. var patch = function(oldVnode, vnode) {
  10302. var this$1 = this;
  10303. if (vnode === null) { //destroy
  10304. return
  10305. }
  10306. if (this.mpType === 'page' || this.mpType === 'component') {
  10307. var mpInstance = this.$scope;
  10308. var data = Object.create(null);
  10309. try {
  10310. data = cloneWithData(this);
  10311. } catch (err) {
  10312. console.error(err);
  10313. }
  10314. data.__webviewId__ = mpInstance.data.__webviewId__;
  10315. var mpData = Object.create(null);
  10316. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  10317. mpData[key] = mpInstance.data[key];
  10318. });
  10319. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  10320. if (Object.keys(diffData).length) {
  10321. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"errand_app","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  10322. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  10323. ']差量更新',
  10324. JSON.stringify(diffData));
  10325. }
  10326. this.__next_tick_pending = true;
  10327. mpInstance.setData(diffData, function () {
  10328. this$1.__next_tick_pending = false;
  10329. flushCallbacks$1(this$1);
  10330. });
  10331. } else {
  10332. flushCallbacks$1(this);
  10333. }
  10334. }
  10335. };
  10336. /* */
  10337. function createEmptyRender() {
  10338. }
  10339. function mountComponent$1(
  10340. vm,
  10341. el,
  10342. hydrating
  10343. ) {
  10344. if (!vm.mpType) {//main.js 中的 new Vue
  10345. return vm
  10346. }
  10347. if (vm.mpType === 'app') {
  10348. vm.$options.render = createEmptyRender;
  10349. }
  10350. if (!vm.$options.render) {
  10351. vm.$options.render = createEmptyRender;
  10352. if (true) {
  10353. /* istanbul ignore if */
  10354. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  10355. vm.$options.el || el) {
  10356. warn(
  10357. 'You are using the runtime-only build of Vue where the template ' +
  10358. 'compiler is not available. Either pre-compile the templates into ' +
  10359. 'render functions, or use the compiler-included build.',
  10360. vm
  10361. );
  10362. } else {
  10363. warn(
  10364. 'Failed to mount component: template or render function not defined.',
  10365. vm
  10366. );
  10367. }
  10368. }
  10369. }
  10370. !vm._$fallback && callHook(vm, 'beforeMount');
  10371. var updateComponent = function () {
  10372. vm._update(vm._render(), hydrating);
  10373. };
  10374. // we set this to vm._watcher inside the watcher's constructor
  10375. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  10376. // component's mounted hook), which relies on vm._watcher being already defined
  10377. new Watcher(vm, updateComponent, noop, {
  10378. before: function before() {
  10379. if (vm._isMounted && !vm._isDestroyed) {
  10380. callHook(vm, 'beforeUpdate');
  10381. }
  10382. }
  10383. }, true /* isRenderWatcher */);
  10384. hydrating = false;
  10385. return vm
  10386. }
  10387. /* */
  10388. function renderClass (
  10389. staticClass,
  10390. dynamicClass
  10391. ) {
  10392. if (isDef(staticClass) || isDef(dynamicClass)) {
  10393. return concat(staticClass, stringifyClass(dynamicClass))
  10394. }
  10395. /* istanbul ignore next */
  10396. return ''
  10397. }
  10398. function concat (a, b) {
  10399. return a ? b ? (a + ' ' + b) : a : (b || '')
  10400. }
  10401. function stringifyClass (value) {
  10402. if (Array.isArray(value)) {
  10403. return stringifyArray(value)
  10404. }
  10405. if (isObject(value)) {
  10406. return stringifyObject(value)
  10407. }
  10408. if (typeof value === 'string') {
  10409. return value
  10410. }
  10411. /* istanbul ignore next */
  10412. return ''
  10413. }
  10414. function stringifyArray (value) {
  10415. var res = '';
  10416. var stringified;
  10417. for (var i = 0, l = value.length; i < l; i++) {
  10418. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  10419. if (res) { res += ' '; }
  10420. res += stringified;
  10421. }
  10422. }
  10423. return res
  10424. }
  10425. function stringifyObject (value) {
  10426. var res = '';
  10427. for (var key in value) {
  10428. if (value[key]) {
  10429. if (res) { res += ' '; }
  10430. res += key;
  10431. }
  10432. }
  10433. return res
  10434. }
  10435. /* */
  10436. var parseStyleText = cached(function (cssText) {
  10437. var res = {};
  10438. var listDelimiter = /;(?![^(]*\))/g;
  10439. var propertyDelimiter = /:(.+)/;
  10440. cssText.split(listDelimiter).forEach(function (item) {
  10441. if (item) {
  10442. var tmp = item.split(propertyDelimiter);
  10443. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  10444. }
  10445. });
  10446. return res
  10447. });
  10448. // normalize possible array / string values into Object
  10449. function normalizeStyleBinding (bindingStyle) {
  10450. if (Array.isArray(bindingStyle)) {
  10451. return toObject(bindingStyle)
  10452. }
  10453. if (typeof bindingStyle === 'string') {
  10454. return parseStyleText(bindingStyle)
  10455. }
  10456. return bindingStyle
  10457. }
  10458. /* */
  10459. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  10460. function getTarget(obj, path) {
  10461. var parts = path.split('.');
  10462. var key = parts[0];
  10463. if (key.indexOf('__$n') === 0) { //number index
  10464. key = parseInt(key.replace('__$n', ''));
  10465. }
  10466. if (parts.length === 1) {
  10467. return obj[key]
  10468. }
  10469. return getTarget(obj[key], parts.slice(1).join('.'))
  10470. }
  10471. function internalMixin(Vue) {
  10472. Vue.config.errorHandler = function(err, vm, info) {
  10473. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  10474. console.error(err);
  10475. /* eslint-disable no-undef */
  10476. var app = typeof getApp === 'function' && getApp();
  10477. if (app && app.onError) {
  10478. app.onError(err);
  10479. }
  10480. };
  10481. var oldEmit = Vue.prototype.$emit;
  10482. Vue.prototype.$emit = function(event) {
  10483. if (this.$scope && event) {
  10484. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  10485. if (triggerEvent) {
  10486. try {
  10487. triggerEvent.call(this.$scope, event, {
  10488. __args__: toArray(arguments, 1)
  10489. });
  10490. } catch (error) {
  10491. }
  10492. }
  10493. }
  10494. return oldEmit.apply(this, arguments)
  10495. };
  10496. Vue.prototype.$nextTick = function(fn) {
  10497. return nextTick$1(this, fn)
  10498. };
  10499. MP_METHODS.forEach(function (method) {
  10500. Vue.prototype[method] = function(args) {
  10501. if (this.$scope && this.$scope[method]) {
  10502. return this.$scope[method](args)
  10503. }
  10504. // mp-alipay
  10505. if (typeof my === 'undefined') {
  10506. return
  10507. }
  10508. if (method === 'createSelectorQuery') {
  10509. /* eslint-disable no-undef */
  10510. return my.createSelectorQuery(args)
  10511. } else if (method === 'createIntersectionObserver') {
  10512. /* eslint-disable no-undef */
  10513. return my.createIntersectionObserver(args)
  10514. }
  10515. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  10516. };
  10517. });
  10518. Vue.prototype.__init_provide = initProvide;
  10519. Vue.prototype.__init_injections = initInjections;
  10520. Vue.prototype.__call_hook = function(hook, args) {
  10521. var vm = this;
  10522. // #7573 disable dep collection when invoking lifecycle hooks
  10523. pushTarget();
  10524. var handlers = vm.$options[hook];
  10525. var info = hook + " hook";
  10526. var ret;
  10527. if (handlers) {
  10528. for (var i = 0, j = handlers.length; i < j; i++) {
  10529. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  10530. }
  10531. }
  10532. if (vm._hasHookEvent) {
  10533. vm.$emit('hook:' + hook, args);
  10534. }
  10535. popTarget();
  10536. return ret
  10537. };
  10538. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  10539. if (Array.isArray(modifiers)) {
  10540. if (modifiers.indexOf('trim') !== -1) {
  10541. value = value.trim();
  10542. }
  10543. if (modifiers.indexOf('number') !== -1) {
  10544. value = this._n(value);
  10545. }
  10546. }
  10547. if (!target) {
  10548. target = this;
  10549. }
  10550. // 解决动态属性添加
  10551. Vue.set(target, key, value);
  10552. };
  10553. Vue.prototype.__set_sync = function(target, key, value) {
  10554. if (!target) {
  10555. target = this;
  10556. }
  10557. // 解决动态属性添加
  10558. Vue.set(target, key, value);
  10559. };
  10560. Vue.prototype.__get_orig = function(item) {
  10561. if (isPlainObject(item)) {
  10562. return item['$orig'] || item
  10563. }
  10564. return item
  10565. };
  10566. Vue.prototype.__get_value = function(dataPath, target) {
  10567. return getTarget(target || this, dataPath)
  10568. };
  10569. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  10570. return renderClass(staticClass, dynamicClass)
  10571. };
  10572. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  10573. if (!dynamicStyle && !staticStyle) {
  10574. return ''
  10575. }
  10576. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  10577. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  10578. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  10579. };
  10580. Vue.prototype.__map = function(val, iteratee) {
  10581. //TODO 暂不考虑 string
  10582. var ret, i, l, keys, key;
  10583. if (Array.isArray(val)) {
  10584. ret = new Array(val.length);
  10585. for (i = 0, l = val.length; i < l; i++) {
  10586. ret[i] = iteratee(val[i], i);
  10587. }
  10588. return ret
  10589. } else if (isObject(val)) {
  10590. keys = Object.keys(val);
  10591. ret = Object.create(null);
  10592. for (i = 0, l = keys.length; i < l; i++) {
  10593. key = keys[i];
  10594. ret[key] = iteratee(val[key], key, i);
  10595. }
  10596. return ret
  10597. } else if (typeof val === 'number') {
  10598. ret = new Array(val);
  10599. for (i = 0, l = val; i < l; i++) {
  10600. // 第一个参数暂时仍和小程序一致
  10601. ret[i] = iteratee(i, i);
  10602. }
  10603. return ret
  10604. }
  10605. return []
  10606. };
  10607. }
  10608. /* */
  10609. var LIFECYCLE_HOOKS$1 = [
  10610. //App
  10611. 'onLaunch',
  10612. 'onShow',
  10613. 'onHide',
  10614. 'onUniNViewMessage',
  10615. 'onPageNotFound',
  10616. 'onThemeChange',
  10617. 'onError',
  10618. 'onUnhandledRejection',
  10619. //Page
  10620. 'onInit',
  10621. 'onLoad',
  10622. // 'onShow',
  10623. 'onReady',
  10624. // 'onHide',
  10625. 'onUnload',
  10626. 'onPullDownRefresh',
  10627. 'onReachBottom',
  10628. 'onTabItemTap',
  10629. 'onAddToFavorites',
  10630. 'onShareTimeline',
  10631. 'onShareAppMessage',
  10632. 'onResize',
  10633. 'onPageScroll',
  10634. 'onNavigationBarButtonTap',
  10635. 'onBackPress',
  10636. 'onNavigationBarSearchInputChanged',
  10637. 'onNavigationBarSearchInputConfirmed',
  10638. 'onNavigationBarSearchInputClicked',
  10639. 'onUploadDouyinVideo',
  10640. 'onNFCReadMessage',
  10641. //Component
  10642. // 'onReady', // 兼容旧版本,应该移除该事件
  10643. 'onPageShow',
  10644. 'onPageHide',
  10645. 'onPageResize'
  10646. ];
  10647. function lifecycleMixin$1(Vue) {
  10648. //fixed vue-class-component
  10649. var oldExtend = Vue.extend;
  10650. Vue.extend = function(extendOptions) {
  10651. extendOptions = extendOptions || {};
  10652. var methods = extendOptions.methods;
  10653. if (methods) {
  10654. Object.keys(methods).forEach(function (methodName) {
  10655. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  10656. extendOptions[methodName] = methods[methodName];
  10657. delete methods[methodName];
  10658. }
  10659. });
  10660. }
  10661. return oldExtend.call(this, extendOptions)
  10662. };
  10663. var strategies = Vue.config.optionMergeStrategies;
  10664. var mergeHook = strategies.created;
  10665. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  10666. strategies[hook] = mergeHook;
  10667. });
  10668. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  10669. }
  10670. /* */
  10671. // install platform patch function
  10672. Vue.prototype.__patch__ = patch;
  10673. // public mount method
  10674. Vue.prototype.$mount = function(
  10675. el ,
  10676. hydrating
  10677. ) {
  10678. return mountComponent$1(this, el, hydrating)
  10679. };
  10680. lifecycleMixin$1(Vue);
  10681. internalMixin(Vue);
  10682. /* */
  10683. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  10684. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  10685. /***/ }),
  10686. /***/ 252:
  10687. /*!************************************************************************************!*\
  10688. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js ***!
  10689. \************************************************************************************/
  10690. /*! no static exports found */
  10691. /***/ (function(module, exports, __webpack_require__) {
  10692. "use strict";
  10693. /* WEBPACK VAR INJECTION */(function(global, uni, wx) {
  10694. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10695. Object.defineProperty(exports, "__esModule", {
  10696. value: true
  10697. });
  10698. exports.default = void 0;
  10699. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 208));
  10700. var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ 214));
  10701. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  10702. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  10703. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  10704. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 210));
  10705. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  10706. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 212));
  10707. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 213));
  10708. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 215));
  10709. var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ 253));
  10710. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  10711. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  10712. var _pages = _interopRequireDefault(__webpack_require__(/*! @/pages.json */ 255));
  10713. 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; } } }; }
  10714. 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); }
  10715. 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; }
  10716. 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; }
  10717. 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; }
  10718. 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); }; }
  10719. 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; } }
  10720. "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self;
  10721. function t(e) {
  10722. return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
  10723. }
  10724. function n(e, t, n) {
  10725. return e(n = {
  10726. path: t,
  10727. exports: {},
  10728. require: function require(e, t) {
  10729. return function () {
  10730. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  10731. }(null == t && n.path);
  10732. }
  10733. }, n.exports), n.exports;
  10734. }
  10735. var s = n(function (e, t) {
  10736. var n;
  10737. e.exports = (n = n || function (e, t) {
  10738. var n = Object.create || function () {
  10739. function e() {}
  10740. return function (t) {
  10741. var n;
  10742. return e.prototype = t, n = new e(), e.prototype = null, n;
  10743. };
  10744. }(),
  10745. s = {},
  10746. r = s.lib = {},
  10747. i = r.Base = {
  10748. extend: function extend(e) {
  10749. var t = n(this);
  10750. return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () {
  10751. t.$super.init.apply(this, arguments);
  10752. }), t.init.prototype = t, t.$super = this, t;
  10753. },
  10754. create: function create() {
  10755. var e = this.extend();
  10756. return e.init.apply(e, arguments), e;
  10757. },
  10758. init: function init() {},
  10759. mixIn: function mixIn(e) {
  10760. for (var t in e) {
  10761. e.hasOwnProperty(t) && (this[t] = e[t]);
  10762. }
  10763. e.hasOwnProperty("toString") && (this.toString = e.toString);
  10764. },
  10765. clone: function clone() {
  10766. return this.init.prototype.extend(this);
  10767. }
  10768. },
  10769. o = r.WordArray = i.extend({
  10770. init: function init(e, n) {
  10771. e = this.words = e || [], this.sigBytes = n != t ? n : 4 * e.length;
  10772. },
  10773. toString: function toString(e) {
  10774. return (e || c).stringify(this);
  10775. },
  10776. concat: function concat(e) {
  10777. var t = this.words,
  10778. n = e.words,
  10779. s = this.sigBytes,
  10780. r = e.sigBytes;
  10781. if (this.clamp(), s % 4) for (var i = 0; i < r; i++) {
  10782. var o = n[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  10783. t[s + i >>> 2] |= o << 24 - (s + i) % 4 * 8;
  10784. } else for (i = 0; i < r; i += 4) {
  10785. t[s + i >>> 2] = n[i >>> 2];
  10786. }
  10787. return this.sigBytes += r, this;
  10788. },
  10789. clamp: function clamp() {
  10790. var t = this.words,
  10791. n = this.sigBytes;
  10792. t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4);
  10793. },
  10794. clone: function clone() {
  10795. var e = i.clone.call(this);
  10796. return e.words = this.words.slice(0), e;
  10797. },
  10798. random: function random(t) {
  10799. for (var n, s = [], r = function r(t) {
  10800. t = t;
  10801. var n = 987654321,
  10802. s = 4294967295;
  10803. return function () {
  10804. var r = ((n = 36969 * (65535 & n) + (n >> 16) & s) << 16) + (t = 18e3 * (65535 & t) + (t >> 16) & s) & s;
  10805. return r /= 4294967296, (r += .5) * (e.random() > .5 ? 1 : -1);
  10806. };
  10807. }, i = 0; i < t; i += 4) {
  10808. var a = r(4294967296 * (n || e.random()));
  10809. n = 987654071 * a(), s.push(4294967296 * a() | 0);
  10810. }
  10811. return new o.init(s, t);
  10812. }
  10813. }),
  10814. a = s.enc = {},
  10815. c = a.Hex = {
  10816. stringify: function stringify(e) {
  10817. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  10818. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  10819. s.push((i >>> 4).toString(16)), s.push((15 & i).toString(16));
  10820. }
  10821. return s.join("");
  10822. },
  10823. parse: function parse(e) {
  10824. for (var t = e.length, n = [], s = 0; s < t; s += 2) {
  10825. n[s >>> 3] |= parseInt(e.substr(s, 2), 16) << 24 - s % 8 * 4;
  10826. }
  10827. return new o.init(n, t / 2);
  10828. }
  10829. },
  10830. u = a.Latin1 = {
  10831. stringify: function stringify(e) {
  10832. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  10833. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  10834. s.push(String.fromCharCode(i));
  10835. }
  10836. return s.join("");
  10837. },
  10838. parse: function parse(e) {
  10839. for (var t = e.length, n = [], s = 0; s < t; s++) {
  10840. n[s >>> 2] |= (255 & e.charCodeAt(s)) << 24 - s % 4 * 8;
  10841. }
  10842. return new o.init(n, t);
  10843. }
  10844. },
  10845. h = a.Utf8 = {
  10846. stringify: function stringify(e) {
  10847. try {
  10848. return decodeURIComponent(escape(u.stringify(e)));
  10849. } catch (e) {
  10850. throw new Error("Malformed UTF-8 data");
  10851. }
  10852. },
  10853. parse: function parse(e) {
  10854. return u.parse(unescape(encodeURIComponent(e)));
  10855. }
  10856. },
  10857. l = r.BufferedBlockAlgorithm = i.extend({
  10858. reset: function reset() {
  10859. this._data = new o.init(), this._nDataBytes = 0;
  10860. },
  10861. _append: function _append(e) {
  10862. "string" == typeof e && (e = h.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
  10863. },
  10864. _process: function _process(t) {
  10865. var n = this._data,
  10866. s = n.words,
  10867. r = n.sigBytes,
  10868. i = this.blockSize,
  10869. a = r / (4 * i),
  10870. c = (a = t ? e.ceil(a) : e.max((0 | a) - this._minBufferSize, 0)) * i,
  10871. u = e.min(4 * c, r);
  10872. if (c) {
  10873. for (var h = 0; h < c; h += i) {
  10874. this._doProcessBlock(s, h);
  10875. }
  10876. var l = s.splice(0, c);
  10877. n.sigBytes -= u;
  10878. }
  10879. return new o.init(l, u);
  10880. },
  10881. clone: function clone() {
  10882. var e = i.clone.call(this);
  10883. return e._data = this._data.clone(), e;
  10884. },
  10885. _minBufferSize: 0
  10886. });
  10887. r.Hasher = l.extend({
  10888. cfg: i.extend(),
  10889. init: function init(e) {
  10890. this.cfg = this.cfg.extend(e), this.reset();
  10891. },
  10892. reset: function reset() {
  10893. l.reset.call(this), this._doReset();
  10894. },
  10895. update: function update(e) {
  10896. return this._append(e), this._process(), this;
  10897. },
  10898. finalize: function finalize(e) {
  10899. return e && this._append(e), this._doFinalize();
  10900. },
  10901. blockSize: 16,
  10902. _createHelper: function _createHelper(e) {
  10903. return function (t, n) {
  10904. return new e.init(n).finalize(t);
  10905. };
  10906. },
  10907. _createHmacHelper: function _createHmacHelper(e) {
  10908. return function (t, n) {
  10909. return new d.HMAC.init(e, n).finalize(t);
  10910. };
  10911. }
  10912. });
  10913. var d = s.algo = {};
  10914. return s;
  10915. }(Math), n);
  10916. }),
  10917. r = s,
  10918. i = (n(function (e, t) {
  10919. var n;
  10920. e.exports = (n = r, function (e) {
  10921. var t = n,
  10922. s = t.lib,
  10923. r = s.WordArray,
  10924. i = s.Hasher,
  10925. o = t.algo,
  10926. a = [];
  10927. !function () {
  10928. for (var t = 0; t < 64; t++) {
  10929. a[t] = 4294967296 * e.abs(e.sin(t + 1)) | 0;
  10930. }
  10931. }();
  10932. var c = o.MD5 = i.extend({
  10933. _doReset: function _doReset() {
  10934. this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878]);
  10935. },
  10936. _doProcessBlock: function _doProcessBlock(e, t) {
  10937. for (var n = 0; n < 16; n++) {
  10938. var s = t + n,
  10939. r = e[s];
  10940. e[s] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8);
  10941. }
  10942. var i = this._hash.words,
  10943. o = e[t + 0],
  10944. c = e[t + 1],
  10945. p = e[t + 2],
  10946. f = e[t + 3],
  10947. g = e[t + 4],
  10948. m = e[t + 5],
  10949. y = e[t + 6],
  10950. _ = e[t + 7],
  10951. w = e[t + 8],
  10952. v = e[t + 9],
  10953. I = e[t + 10],
  10954. S = e[t + 11],
  10955. b = e[t + 12],
  10956. k = e[t + 13],
  10957. A = e[t + 14],
  10958. C = e[t + 15],
  10959. P = i[0],
  10960. T = i[1],
  10961. x = i[2],
  10962. O = i[3];
  10963. P = u(P, T, x, O, o, 7, a[0]), O = u(O, P, T, x, c, 12, a[1]), x = u(x, O, P, T, p, 17, a[2]), T = u(T, x, O, P, f, 22, a[3]), P = u(P, T, x, O, g, 7, a[4]), O = u(O, P, T, x, m, 12, a[5]), x = u(x, O, P, T, y, 17, a[6]), T = u(T, x, O, P, _, 22, a[7]), P = u(P, T, x, O, w, 7, a[8]), O = u(O, P, T, x, v, 12, a[9]), x = u(x, O, P, T, I, 17, a[10]), T = u(T, x, O, P, S, 22, a[11]), P = u(P, T, x, O, b, 7, a[12]), O = u(O, P, T, x, k, 12, a[13]), x = u(x, O, P, T, A, 17, a[14]), P = h(P, T = u(T, x, O, P, C, 22, a[15]), x, O, c, 5, a[16]), O = h(O, P, T, x, y, 9, a[17]), x = h(x, O, P, T, S, 14, a[18]), T = h(T, x, O, P, o, 20, a[19]), P = h(P, T, x, O, m, 5, a[20]), O = h(O, P, T, x, I, 9, a[21]), x = h(x, O, P, T, C, 14, a[22]), T = h(T, x, O, P, g, 20, a[23]), P = h(P, T, x, O, v, 5, a[24]), O = h(O, P, T, x, A, 9, a[25]), x = h(x, O, P, T, f, 14, a[26]), T = h(T, x, O, P, w, 20, a[27]), P = h(P, T, x, O, k, 5, a[28]), O = h(O, P, T, x, p, 9, a[29]), x = h(x, O, P, T, _, 14, a[30]), P = l(P, T = h(T, x, O, P, b, 20, a[31]), x, O, m, 4, a[32]), O = l(O, P, T, x, w, 11, a[33]), x = l(x, O, P, T, S, 16, a[34]), T = l(T, x, O, P, A, 23, a[35]), P = l(P, T, x, O, c, 4, a[36]), O = l(O, P, T, x, g, 11, a[37]), x = l(x, O, P, T, _, 16, a[38]), T = l(T, x, O, P, I, 23, a[39]), P = l(P, T, x, O, k, 4, a[40]), O = l(O, P, T, x, o, 11, a[41]), x = l(x, O, P, T, f, 16, a[42]), T = l(T, x, O, P, y, 23, a[43]), P = l(P, T, x, O, v, 4, a[44]), O = l(O, P, T, x, b, 11, a[45]), x = l(x, O, P, T, C, 16, a[46]), P = d(P, T = l(T, x, O, P, p, 23, a[47]), x, O, o, 6, a[48]), O = d(O, P, T, x, _, 10, a[49]), x = d(x, O, P, T, A, 15, a[50]), T = d(T, x, O, P, m, 21, a[51]), P = d(P, T, x, O, b, 6, a[52]), O = d(O, P, T, x, f, 10, a[53]), x = d(x, O, P, T, I, 15, a[54]), T = d(T, x, O, P, c, 21, a[55]), P = d(P, T, x, O, w, 6, a[56]), O = d(O, P, T, x, C, 10, a[57]), x = d(x, O, P, T, y, 15, a[58]), T = d(T, x, O, P, k, 21, a[59]), P = d(P, T, x, O, g, 6, a[60]), O = d(O, P, T, x, S, 10, a[61]), x = d(x, O, P, T, p, 15, a[62]), T = d(T, x, O, P, v, 21, a[63]), i[0] = i[0] + P | 0, i[1] = i[1] + T | 0, i[2] = i[2] + x | 0, i[3] = i[3] + O | 0;
  10964. },
  10965. _doFinalize: function _doFinalize() {
  10966. var t = this._data,
  10967. n = t.words,
  10968. s = 8 * this._nDataBytes,
  10969. r = 8 * t.sigBytes;
  10970. n[r >>> 5] |= 128 << 24 - r % 32;
  10971. var i = e.floor(s / 4294967296),
  10972. o = s;
  10973. 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();
  10974. for (var a = this._hash, c = a.words, u = 0; u < 4; u++) {
  10975. var h = c[u];
  10976. c[u] = 16711935 & (h << 8 | h >>> 24) | 4278255360 & (h << 24 | h >>> 8);
  10977. }
  10978. return a;
  10979. },
  10980. clone: function clone() {
  10981. var e = i.clone.call(this);
  10982. return e._hash = this._hash.clone(), e;
  10983. }
  10984. });
  10985. function u(e, t, n, s, r, i, o) {
  10986. var a = e + (t & n | ~t & s) + r + o;
  10987. return (a << i | a >>> 32 - i) + t;
  10988. }
  10989. function h(e, t, n, s, r, i, o) {
  10990. var a = e + (t & s | n & ~s) + r + o;
  10991. return (a << i | a >>> 32 - i) + t;
  10992. }
  10993. function l(e, t, n, s, r, i, o) {
  10994. var a = e + (t ^ n ^ s) + r + o;
  10995. return (a << i | a >>> 32 - i) + t;
  10996. }
  10997. function d(e, t, n, s, r, i, o) {
  10998. var a = e + (n ^ (t | ~s)) + r + o;
  10999. return (a << i | a >>> 32 - i) + t;
  11000. }
  11001. t.MD5 = i._createHelper(c), t.HmacMD5 = i._createHmacHelper(c);
  11002. }(Math), n.MD5);
  11003. }), n(function (e, t) {
  11004. var n;
  11005. e.exports = (n = r, void function () {
  11006. var e = n,
  11007. t = e.lib.Base,
  11008. s = e.enc.Utf8;
  11009. e.algo.HMAC = t.extend({
  11010. init: function init(e, t) {
  11011. e = this._hasher = new e.init(), "string" == typeof t && (t = s.parse(t));
  11012. var n = e.blockSize,
  11013. r = 4 * n;
  11014. t.sigBytes > r && (t = e.finalize(t)), t.clamp();
  11015. for (var i = this._oKey = t.clone(), o = this._iKey = t.clone(), a = i.words, c = o.words, u = 0; u < n; u++) {
  11016. a[u] ^= 1549556828, c[u] ^= 909522486;
  11017. }
  11018. i.sigBytes = o.sigBytes = r, this.reset();
  11019. },
  11020. reset: function reset() {
  11021. var e = this._hasher;
  11022. e.reset(), e.update(this._iKey);
  11023. },
  11024. update: function update(e) {
  11025. return this._hasher.update(e), this;
  11026. },
  11027. finalize: function finalize(e) {
  11028. var t = this._hasher,
  11029. n = t.finalize(e);
  11030. return t.reset(), t.finalize(this._oKey.clone().concat(n));
  11031. }
  11032. });
  11033. }());
  11034. }), n(function (e, t) {
  11035. e.exports = r.HmacMD5;
  11036. })),
  11037. o = n(function (e, t) {
  11038. e.exports = r.enc.Utf8;
  11039. }),
  11040. a = n(function (e, t) {
  11041. var n;
  11042. e.exports = (n = r, function () {
  11043. var e = n,
  11044. t = e.lib.WordArray;
  11045. function s(e, n, s) {
  11046. for (var r = [], i = 0, o = 0; o < n; o++) {
  11047. if (o % 4) {
  11048. var a = s[e.charCodeAt(o - 1)] << o % 4 * 2,
  11049. c = s[e.charCodeAt(o)] >>> 6 - o % 4 * 2;
  11050. r[i >>> 2] |= (a | c) << 24 - i % 4 * 8, i++;
  11051. }
  11052. }
  11053. return t.create(r, i);
  11054. }
  11055. e.enc.Base64 = {
  11056. stringify: function stringify(e) {
  11057. var t = e.words,
  11058. n = e.sigBytes,
  11059. s = this._map;
  11060. e.clamp();
  11061. for (var r = [], i = 0; i < n; i += 3) {
  11062. 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++) {
  11063. r.push(s.charAt(o >>> 6 * (3 - a) & 63));
  11064. }
  11065. }
  11066. var c = s.charAt(64);
  11067. if (c) for (; r.length % 4;) {
  11068. r.push(c);
  11069. }
  11070. return r.join("");
  11071. },
  11072. parse: function parse(e) {
  11073. var t = e.length,
  11074. n = this._map,
  11075. r = this._reverseMap;
  11076. if (!r) {
  11077. r = this._reverseMap = [];
  11078. for (var i = 0; i < n.length; i++) {
  11079. r[n.charCodeAt(i)] = i;
  11080. }
  11081. }
  11082. var o = n.charAt(64);
  11083. if (o) {
  11084. var a = e.indexOf(o);
  11085. -1 !== a && (t = a);
  11086. }
  11087. return s(e, t, r);
  11088. },
  11089. _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
  11090. };
  11091. }(), n.enc.Base64);
  11092. });
  11093. var c = "FUNCTION",
  11094. u = "OBJECT",
  11095. h = "CLIENT_DB",
  11096. l = "pending",
  11097. d = "fulfilled",
  11098. p = "rejected";
  11099. function f(e) {
  11100. return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();
  11101. }
  11102. function g(e) {
  11103. return "object" === f(e);
  11104. }
  11105. function m(e) {
  11106. return "function" == typeof e;
  11107. }
  11108. function y(e) {
  11109. return function () {
  11110. try {
  11111. return e.apply(e, arguments);
  11112. } catch (e) {
  11113. console.error(e);
  11114. }
  11115. };
  11116. }
  11117. var _ = "REJECTED",
  11118. w = "NOT_PENDING";
  11119. var v = /*#__PURE__*/function () {
  11120. function v() {
  11121. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  11122. e = _ref.createPromise,
  11123. _ref$retryRule = _ref.retryRule,
  11124. t = _ref$retryRule === void 0 ? _ : _ref$retryRule;
  11125. (0, _classCallCheck2.default)(this, v);
  11126. this.createPromise = e, this.status = null, this.promise = null, this.retryRule = t;
  11127. }
  11128. (0, _createClass2.default)(v, [{
  11129. key: "needRetry",
  11130. get: function get() {
  11131. if (!this.status) return !0;
  11132. switch (this.retryRule) {
  11133. case _:
  11134. return this.status === p;
  11135. case w:
  11136. return this.status !== l;
  11137. }
  11138. }
  11139. }, {
  11140. key: "exec",
  11141. value: function exec() {
  11142. var _this = this;
  11143. return this.needRetry ? (this.status = l, this.promise = this.createPromise().then(function (e) {
  11144. return _this.status = d, Promise.resolve(e);
  11145. }, function (e) {
  11146. return _this.status = p, Promise.reject(e);
  11147. }), this.promise) : this.promise;
  11148. }
  11149. }]);
  11150. return v;
  11151. }();
  11152. function I(e) {
  11153. return e && "string" == typeof e ? JSON.parse(e) : e;
  11154. }
  11155. var S = "development" === "development",
  11156. b = "mp-weixin",
  11157. k = "true" === undefined || !0 === undefined,
  11158. A = I([]),
  11159. C = "h5" === b ? "web" : "app-plus" === b ? "app" : b,
  11160. P = I(undefined),
  11161. T = I([]) || [],
  11162. x = true;
  11163. var O = "";
  11164. try {
  11165. O = (__webpack_require__(/*! uni-stat-config */ 256).default || __webpack_require__(/*! uni-stat-config */ 256)).appid;
  11166. } catch (e) {}
  11167. var E = {};
  11168. function L(e) {
  11169. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11170. var n, s;
  11171. return n = E, s = e, Object.prototype.hasOwnProperty.call(n, s) || (E[e] = t), E[e];
  11172. }
  11173. "app" === C && (E = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {});
  11174. var R = ["invoke", "success", "fail", "complete"],
  11175. U = L("_globalUniCloudInterceptor");
  11176. function N(e, t) {
  11177. U[e] || (U[e] = {}), g(t) && Object.keys(t).forEach(function (n) {
  11178. R.indexOf(n) > -1 && function (e, t, n) {
  11179. var s = U[e][t];
  11180. s || (s = U[e][t] = []), -1 === s.indexOf(n) && m(n) && s.push(n);
  11181. }(e, n, t[n]);
  11182. });
  11183. }
  11184. function D(e, t) {
  11185. U[e] || (U[e] = {}), g(t) ? Object.keys(t).forEach(function (n) {
  11186. R.indexOf(n) > -1 && function (e, t, n) {
  11187. var s = U[e][t];
  11188. if (!s) return;
  11189. var r = s.indexOf(n);
  11190. r > -1 && s.splice(r, 1);
  11191. }(e, n, t[n]);
  11192. }) : delete U[e];
  11193. }
  11194. function M(e, t) {
  11195. return e && 0 !== e.length ? e.reduce(function (e, n) {
  11196. return e.then(function () {
  11197. return n(t);
  11198. });
  11199. }, Promise.resolve()) : Promise.resolve();
  11200. }
  11201. function q(e, t) {
  11202. return U[e] && U[e][t] || [];
  11203. }
  11204. function F(e) {
  11205. N("callObject", e);
  11206. }
  11207. var K = L("_globalUniCloudListener"),
  11208. j = "response",
  11209. $ = "needLogin",
  11210. B = "refreshToken",
  11211. W = "clientdb",
  11212. H = "cloudfunction",
  11213. z = "cloudobject";
  11214. function J(e) {
  11215. return K[e] || (K[e] = []), K[e];
  11216. }
  11217. function V(e, t) {
  11218. var n = J(e);
  11219. n.includes(t) || n.push(t);
  11220. }
  11221. function G(e, t) {
  11222. var n = J(e),
  11223. s = n.indexOf(t);
  11224. -1 !== s && n.splice(s, 1);
  11225. }
  11226. function Y(e, t) {
  11227. var n = J(e);
  11228. for (var _e2 = 0; _e2 < n.length; _e2++) {
  11229. (0, n[_e2])(t);
  11230. }
  11231. }
  11232. var Q,
  11233. X = !1;
  11234. function Z() {
  11235. return Q || (Q = new Promise(function (e) {
  11236. X && e(), function t() {
  11237. if ("function" == typeof getCurrentPages) {
  11238. var _t2 = getCurrentPages();
  11239. _t2 && _t2[0] && (X = !0, e());
  11240. }
  11241. X || setTimeout(function () {
  11242. t();
  11243. }, 30);
  11244. }();
  11245. }), Q);
  11246. }
  11247. function ee(e) {
  11248. var t = {};
  11249. for (var _n2 in e) {
  11250. var _s2 = e[_n2];
  11251. m(_s2) && (t[_n2] = y(_s2));
  11252. }
  11253. return t;
  11254. }
  11255. var te = /*#__PURE__*/function (_Error) {
  11256. (0, _inherits2.default)(te, _Error);
  11257. var _super = _createSuper(te);
  11258. function te(e) {
  11259. var _this2;
  11260. (0, _classCallCheck2.default)(this, te);
  11261. _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;
  11262. return _this2;
  11263. }
  11264. (0, _createClass2.default)(te, [{
  11265. key: "toJson",
  11266. value: function toJson() {
  11267. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  11268. if (!(e >= 10)) return e++, {
  11269. errCode: this.errCode,
  11270. errMsg: this.errMsg,
  11271. errSubject: this.errSubject,
  11272. cause: this.cause && this.cause.toJson ? this.cause.toJson(e) : this.cause
  11273. };
  11274. }
  11275. }]);
  11276. return te;
  11277. }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
  11278. var ne = {
  11279. request: function request(e) {
  11280. return uni.request(e);
  11281. },
  11282. uploadFile: function uploadFile(e) {
  11283. return uni.uploadFile(e);
  11284. },
  11285. setStorageSync: function setStorageSync(e, t) {
  11286. return uni.setStorageSync(e, t);
  11287. },
  11288. getStorageSync: function getStorageSync(e) {
  11289. return uni.getStorageSync(e);
  11290. },
  11291. removeStorageSync: function removeStorageSync(e) {
  11292. return uni.removeStorageSync(e);
  11293. },
  11294. clearStorageSync: function clearStorageSync() {
  11295. return uni.clearStorageSync();
  11296. },
  11297. connectSocket: function connectSocket(e) {
  11298. return uni.connectSocket(e);
  11299. }
  11300. };
  11301. function se() {
  11302. return {
  11303. token: ne.getStorageSync("uni_id_token") || ne.getStorageSync("uniIdToken"),
  11304. tokenExpired: ne.getStorageSync("uni_id_token_expired")
  11305. };
  11306. }
  11307. function re() {
  11308. var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  11309. e = _ref2.token,
  11310. t = _ref2.tokenExpired;
  11311. e && ne.setStorageSync("uni_id_token", e), t && ne.setStorageSync("uni_id_token_expired", t);
  11312. }
  11313. var ie, oe;
  11314. function ae() {
  11315. return ie || (ie = uni.getSystemInfoSync()), ie;
  11316. }
  11317. function ce() {
  11318. var e, t;
  11319. try {
  11320. if (uni.getLaunchOptionsSync) {
  11321. if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1) return;
  11322. var _uni$getLaunchOptions = uni.getLaunchOptionsSync(),
  11323. _n3 = _uni$getLaunchOptions.scene,
  11324. _s3 = _uni$getLaunchOptions.channel;
  11325. e = _s3, t = _n3;
  11326. }
  11327. } catch (e) {}
  11328. return {
  11329. channel: e,
  11330. scene: t
  11331. };
  11332. }
  11333. var ue = {};
  11334. function he() {
  11335. var e = uni.getLocale && uni.getLocale() || "en";
  11336. if (oe) return _objectSpread(_objectSpread(_objectSpread({}, ue), oe), {}, {
  11337. locale: e,
  11338. LOCALE: e
  11339. });
  11340. var t = ae(),
  11341. n = t.deviceId,
  11342. s = t.osName,
  11343. r = t.uniPlatform,
  11344. i = t.appId,
  11345. o = ["appId", "appLanguage", "appName", "appVersion", "appVersionCode", "appWgtVersion", "browserName", "browserVersion", "deviceBrand", "deviceId", "deviceModel", "deviceType", "osName", "osVersion", "romName", "romVersion", "ua", "hostName", "hostVersion", "uniPlatform", "uniRuntimeVersion", "uniRuntimeVersionCode", "uniCompilerVersion", "uniCompilerVersionCode"];
  11346. for (var _e3 in t) {
  11347. Object.hasOwnProperty.call(t, _e3) && -1 === o.indexOf(_e3) && delete t[_e3];
  11348. }
  11349. return oe = _objectSpread(_objectSpread({
  11350. PLATFORM: r,
  11351. OS: s,
  11352. APPID: i,
  11353. DEVICEID: n
  11354. }, ce()), t), _objectSpread(_objectSpread(_objectSpread({}, ue), oe), {}, {
  11355. locale: e,
  11356. LOCALE: e
  11357. });
  11358. }
  11359. var le = {
  11360. sign: function sign(e, t) {
  11361. var n = "";
  11362. return Object.keys(e).sort().forEach(function (t) {
  11363. e[t] && (n = n + "&" + t + "=" + e[t]);
  11364. }), n = n.slice(1), i(n, t).toString();
  11365. },
  11366. wrappedRequest: function wrappedRequest(e, t) {
  11367. return new Promise(function (n, s) {
  11368. t(Object.assign(e, {
  11369. complete: function complete(e) {
  11370. e || (e = {}), S && "web" === C && e.errMsg && 0 === e.errMsg.indexOf("request:fail") && console.warn("发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5");
  11371. var t = e.data && e.data.header && e.data.header["x-serverless-request-id"] || e.header && e.header["request-id"];
  11372. if (!e.statusCode || e.statusCode >= 400) {
  11373. var _n4 = e.data && e.data.error && e.data.error.code || "SYS_ERR",
  11374. _r = e.data && e.data.error && e.data.error.message || e.errMsg || "request:fail";
  11375. return s(new te({
  11376. code: _n4,
  11377. message: _r,
  11378. requestId: t
  11379. }));
  11380. }
  11381. var r = e.data;
  11382. if (r.error) return s(new te({
  11383. code: r.error.code,
  11384. message: r.error.message,
  11385. requestId: t
  11386. }));
  11387. r.result = r.data, r.requestId = t, delete r.data, n(r);
  11388. }
  11389. }));
  11390. });
  11391. },
  11392. toBase64: function toBase64(e) {
  11393. return a.stringify(o.parse(e));
  11394. }
  11395. };
  11396. var de = /*#__PURE__*/function () {
  11397. function de(e) {
  11398. var _this3 = this;
  11399. (0, _classCallCheck2.default)(this, de);
  11400. ["spaceId", "clientSecret"].forEach(function (t) {
  11401. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error("".concat(t, " required"));
  11402. }), this.config = Object.assign({}, {
  11403. endpoint: 0 === e.spaceId.indexOf("mp-") ? "https://api.next.bspapp.com" : "https://api.bspapp.com"
  11404. }, 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 = ne, this._getAccessTokenPromiseHub = new v({
  11405. createPromise: function createPromise() {
  11406. return _this3.requestAuth(_this3.setupRequest({
  11407. method: "serverless.auth.user.anonymousAuthorize",
  11408. params: "{}"
  11409. }, "auth")).then(function (e) {
  11410. if (!e.result || !e.result.accessToken) throw new te({
  11411. code: "AUTH_FAILED",
  11412. message: "获取accessToken失败"
  11413. });
  11414. _this3.setAccessToken(e.result.accessToken);
  11415. });
  11416. },
  11417. retryRule: w
  11418. });
  11419. }
  11420. (0, _createClass2.default)(de, [{
  11421. key: "hasAccessToken",
  11422. get: function get() {
  11423. return !!this.accessToken;
  11424. }
  11425. }, {
  11426. key: "setAccessToken",
  11427. value: function setAccessToken(e) {
  11428. this.accessToken = e;
  11429. }
  11430. }, {
  11431. key: "requestWrapped",
  11432. value: function requestWrapped(e) {
  11433. return le.wrappedRequest(e, this.adapter.request);
  11434. }
  11435. }, {
  11436. key: "requestAuth",
  11437. value: function requestAuth(e) {
  11438. return this.requestWrapped(e);
  11439. }
  11440. }, {
  11441. key: "request",
  11442. value: function request(e, t) {
  11443. var _this4 = this;
  11444. return Promise.resolve().then(function () {
  11445. return _this4.hasAccessToken ? t ? _this4.requestWrapped(e) : _this4.requestWrapped(e).catch(function (t) {
  11446. return new Promise(function (e, n) {
  11447. !t || "GATEWAY_INVALID_TOKEN" !== t.code && "InvalidParameter.InvalidToken" !== t.code ? n(t) : e();
  11448. }).then(function () {
  11449. return _this4.getAccessToken();
  11450. }).then(function () {
  11451. var t = _this4.rebuildRequest(e);
  11452. return _this4.request(t, !0);
  11453. });
  11454. }) : _this4.getAccessToken().then(function () {
  11455. var t = _this4.rebuildRequest(e);
  11456. return _this4.request(t, !0);
  11457. });
  11458. });
  11459. }
  11460. }, {
  11461. key: "rebuildRequest",
  11462. value: function rebuildRequest(e) {
  11463. var t = Object.assign({}, e);
  11464. return t.data.token = this.accessToken, t.header["x-basement-token"] = this.accessToken, t.header["x-serverless-sign"] = le.sign(t.data, this.config.clientSecret), t;
  11465. }
  11466. }, {
  11467. key: "setupRequest",
  11468. value: function setupRequest(e, t) {
  11469. var n = Object.assign({}, e, {
  11470. spaceId: this.config.spaceId,
  11471. timestamp: Date.now()
  11472. }),
  11473. s = {
  11474. "Content-Type": "application/json"
  11475. };
  11476. return "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = le.sign(n, this.config.clientSecret), {
  11477. url: this.config.requestUrl,
  11478. method: "POST",
  11479. data: n,
  11480. dataType: "json",
  11481. header: s
  11482. };
  11483. }
  11484. }, {
  11485. key: "getAccessToken",
  11486. value: function getAccessToken() {
  11487. return this._getAccessTokenPromiseHub.exec();
  11488. }
  11489. }, {
  11490. key: "authorize",
  11491. value: function () {
  11492. var _authorize = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  11493. return _regenerator.default.wrap(function _callee$(_context) {
  11494. while (1) {
  11495. switch (_context.prev = _context.next) {
  11496. case 0:
  11497. _context.next = 2;
  11498. return this.getAccessToken();
  11499. case 2:
  11500. case "end":
  11501. return _context.stop();
  11502. }
  11503. }
  11504. }, _callee, this);
  11505. }));
  11506. function authorize() {
  11507. return _authorize.apply(this, arguments);
  11508. }
  11509. return authorize;
  11510. }()
  11511. }, {
  11512. key: "callFunction",
  11513. value: function callFunction(e) {
  11514. var t = {
  11515. method: "serverless.function.runtime.invoke",
  11516. params: JSON.stringify({
  11517. functionTarget: e.name,
  11518. functionArgs: e.data || {}
  11519. })
  11520. };
  11521. return this.request(this.setupRequest(t));
  11522. }
  11523. }, {
  11524. key: "getOSSUploadOptionsFromPath",
  11525. value: function getOSSUploadOptionsFromPath(e) {
  11526. var t = {
  11527. method: "serverless.file.resource.generateProximalSign",
  11528. params: JSON.stringify(e)
  11529. };
  11530. return this.request(this.setupRequest(t));
  11531. }
  11532. }, {
  11533. key: "uploadFileToOSS",
  11534. value: function uploadFileToOSS(_ref3) {
  11535. var _this5 = this;
  11536. var e = _ref3.url,
  11537. t = _ref3.formData,
  11538. n = _ref3.name,
  11539. s = _ref3.filePath,
  11540. r = _ref3.fileType,
  11541. i = _ref3.onUploadProgress;
  11542. return new Promise(function (o, a) {
  11543. var c = _this5.adapter.uploadFile({
  11544. url: e,
  11545. formData: t,
  11546. name: n,
  11547. filePath: s,
  11548. fileType: r,
  11549. header: {
  11550. "X-OSS-server-side-encrpytion": "AES256"
  11551. },
  11552. success: function success(e) {
  11553. e && e.statusCode < 400 ? o(e) : a(new te({
  11554. code: "UPLOAD_FAILED",
  11555. message: "文件上传失败"
  11556. }));
  11557. },
  11558. fail: function fail(e) {
  11559. a(new te({
  11560. code: e.code || "UPLOAD_FAILED",
  11561. message: e.message || e.errMsg || "文件上传失败"
  11562. }));
  11563. }
  11564. });
  11565. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  11566. i({
  11567. loaded: e.totalBytesSent,
  11568. total: e.totalBytesExpectedToSend
  11569. });
  11570. });
  11571. });
  11572. }
  11573. }, {
  11574. key: "reportOSSUpload",
  11575. value: function reportOSSUpload(e) {
  11576. var t = {
  11577. method: "serverless.file.resource.report",
  11578. params: JSON.stringify(e)
  11579. };
  11580. return this.request(this.setupRequest(t));
  11581. }
  11582. }, {
  11583. key: "uploadFile",
  11584. value: function () {
  11585. var _uploadFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref4) {
  11586. var e, t, _ref4$fileType, n, _ref4$cloudPathAsReal, s, r, i, o, a, c, u, h, l, d, p, g, m, y, _, _e4, w;
  11587. return _regenerator.default.wrap(function _callee2$(_context2) {
  11588. while (1) {
  11589. switch (_context2.prev = _context2.next) {
  11590. case 0:
  11591. e = _ref4.filePath, t = _ref4.cloudPath, _ref4$fileType = _ref4.fileType, n = _ref4$fileType === void 0 ? "image" : _ref4$fileType, _ref4$cloudPathAsReal = _ref4.cloudPathAsRealPath, s = _ref4$cloudPathAsReal === void 0 ? !1 : _ref4$cloudPathAsReal, r = _ref4.onUploadProgress, i = _ref4.config;
  11592. if (!("string" !== f(t))) {
  11593. _context2.next = 3;
  11594. break;
  11595. }
  11596. throw new te({
  11597. code: "INVALID_PARAM",
  11598. message: "cloudPath必须为字符串类型"
  11599. });
  11600. case 3:
  11601. if (t = t.trim()) {
  11602. _context2.next = 5;
  11603. break;
  11604. }
  11605. throw new te({
  11606. code: "INVALID_PARAM",
  11607. message: "cloudPath不可为空"
  11608. });
  11609. case 5:
  11610. if (!/:\/\//.test(t)) {
  11611. _context2.next = 7;
  11612. break;
  11613. }
  11614. throw new te({
  11615. code: "INVALID_PARAM",
  11616. message: "cloudPath不合法"
  11617. });
  11618. case 7:
  11619. o = i && i.envType || this.config.envType;
  11620. if (!(s && ("/" !== t[0] && (t = "/" + t), t.indexOf("\\") > -1))) {
  11621. _context2.next = 10;
  11622. break;
  11623. }
  11624. throw new te({
  11625. code: "INVALID_PARAM",
  11626. message: "使用cloudPath作为路径时,cloudPath不可包含“\\”"
  11627. });
  11628. case 10:
  11629. _context2.next = 12;
  11630. return this.getOSSUploadOptionsFromPath({
  11631. env: o,
  11632. filename: s ? t.split("/").pop() : t,
  11633. fileId: s ? t : void 0
  11634. });
  11635. case 12:
  11636. a = _context2.sent.result;
  11637. c = "https://" + a.cdnDomain + "/" + a.ossPath;
  11638. u = a.securityToken;
  11639. h = a.accessKeyId;
  11640. l = a.signature;
  11641. d = a.host;
  11642. p = a.ossPath;
  11643. g = a.id;
  11644. m = a.policy;
  11645. y = a.ossCallbackUrl;
  11646. _ = {
  11647. "Cache-Control": "max-age=2592000",
  11648. "Content-Disposition": "attachment",
  11649. OSSAccessKeyId: h,
  11650. Signature: l,
  11651. host: d,
  11652. id: g,
  11653. key: p,
  11654. policy: m,
  11655. success_action_status: 200
  11656. };
  11657. if (u && (_["x-oss-security-token"] = u), y) {
  11658. _e4 = JSON.stringify({
  11659. callbackUrl: y,
  11660. callbackBody: JSON.stringify({
  11661. fileId: g,
  11662. spaceId: this.config.spaceId
  11663. }),
  11664. callbackBodyType: "application/json"
  11665. });
  11666. _.callback = le.toBase64(_e4);
  11667. }
  11668. w = {
  11669. url: "https://" + a.host,
  11670. formData: _,
  11671. fileName: "file",
  11672. name: "file",
  11673. filePath: e,
  11674. fileType: n
  11675. };
  11676. _context2.next = 27;
  11677. return this.uploadFileToOSS(Object.assign({}, w, {
  11678. onUploadProgress: r
  11679. }));
  11680. case 27:
  11681. if (!y) {
  11682. _context2.next = 29;
  11683. break;
  11684. }
  11685. return _context2.abrupt("return", {
  11686. success: !0,
  11687. filePath: e,
  11688. fileID: c
  11689. });
  11690. case 29:
  11691. _context2.next = 31;
  11692. return this.reportOSSUpload({
  11693. id: g
  11694. });
  11695. case 31:
  11696. if (!_context2.sent.success) {
  11697. _context2.next = 33;
  11698. break;
  11699. }
  11700. return _context2.abrupt("return", {
  11701. success: !0,
  11702. filePath: e,
  11703. fileID: c
  11704. });
  11705. case 33:
  11706. throw new te({
  11707. code: "UPLOAD_FAILED",
  11708. message: "文件上传失败"
  11709. });
  11710. case 34:
  11711. case "end":
  11712. return _context2.stop();
  11713. }
  11714. }
  11715. }, _callee2, this);
  11716. }));
  11717. function uploadFile(_x) {
  11718. return _uploadFile.apply(this, arguments);
  11719. }
  11720. return uploadFile;
  11721. }()
  11722. }, {
  11723. key: "getTempFileURL",
  11724. value: function getTempFileURL() {
  11725. var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  11726. e = _ref5.fileList;
  11727. return new Promise(function (t, n) {
  11728. Array.isArray(e) && 0 !== e.length || n(new te({
  11729. code: "INVALID_PARAM",
  11730. message: "fileList的元素必须是非空的字符串"
  11731. })), t({
  11732. fileList: e.map(function (e) {
  11733. return {
  11734. fileID: e,
  11735. tempFileURL: e
  11736. };
  11737. })
  11738. });
  11739. });
  11740. }
  11741. }, {
  11742. key: "getFileInfo",
  11743. value: function () {
  11744. var _getFileInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
  11745. var _ref6,
  11746. e,
  11747. t,
  11748. _args3 = arguments;
  11749. return _regenerator.default.wrap(function _callee3$(_context3) {
  11750. while (1) {
  11751. switch (_context3.prev = _context3.next) {
  11752. case 0:
  11753. _ref6 = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, e = _ref6.fileList;
  11754. if (!(!Array.isArray(e) || 0 === e.length)) {
  11755. _context3.next = 3;
  11756. break;
  11757. }
  11758. throw new te({
  11759. code: "INVALID_PARAM",
  11760. message: "fileList的元素必须是非空的字符串"
  11761. });
  11762. case 3:
  11763. t = {
  11764. method: "serverless.file.resource.info",
  11765. params: JSON.stringify({
  11766. id: e.map(function (e) {
  11767. return e.split("?")[0];
  11768. }).join(",")
  11769. })
  11770. };
  11771. _context3.next = 6;
  11772. return this.request(this.setupRequest(t));
  11773. case 6:
  11774. _context3.t0 = _context3.sent.result;
  11775. return _context3.abrupt("return", {
  11776. fileList: _context3.t0
  11777. });
  11778. case 8:
  11779. case "end":
  11780. return _context3.stop();
  11781. }
  11782. }
  11783. }, _callee3, this);
  11784. }));
  11785. function getFileInfo() {
  11786. return _getFileInfo.apply(this, arguments);
  11787. }
  11788. return getFileInfo;
  11789. }()
  11790. }]);
  11791. return de;
  11792. }();
  11793. var pe = {
  11794. init: function init(e) {
  11795. var t = new de(e),
  11796. n = {
  11797. signInAnonymously: function signInAnonymously() {
  11798. return t.authorize();
  11799. },
  11800. getLoginState: function getLoginState() {
  11801. return Promise.resolve(!1);
  11802. }
  11803. };
  11804. return t.auth = function () {
  11805. return n;
  11806. }, t.customAuth = t.auth, t;
  11807. }
  11808. };
  11809. var fe = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
  11810. var ge;
  11811. !function (e) {
  11812. e.local = "local", e.none = "none", e.session = "session";
  11813. }(ge || (ge = {}));
  11814. var me = function me() {},
  11815. ye = n(function (e, t) {
  11816. var n;
  11817. e.exports = (n = r, function (e) {
  11818. var t = n,
  11819. s = t.lib,
  11820. r = s.WordArray,
  11821. i = s.Hasher,
  11822. o = t.algo,
  11823. a = [],
  11824. c = [];
  11825. !function () {
  11826. function t(t) {
  11827. for (var n = e.sqrt(t), s = 2; s <= n; s++) {
  11828. if (!(t % s)) return !1;
  11829. }
  11830. return !0;
  11831. }
  11832. function n(e) {
  11833. return 4294967296 * (e - (0 | e)) | 0;
  11834. }
  11835. for (var s = 2, r = 0; r < 64;) {
  11836. t(s) && (r < 8 && (a[r] = n(e.pow(s, .5))), c[r] = n(e.pow(s, 1 / 3)), r++), s++;
  11837. }
  11838. }();
  11839. var u = [],
  11840. h = o.SHA256 = i.extend({
  11841. _doReset: function _doReset() {
  11842. this._hash = new r.init(a.slice(0));
  11843. },
  11844. _doProcessBlock: function _doProcessBlock(e, t) {
  11845. for (var n = this._hash.words, s = n[0], r = n[1], i = n[2], o = n[3], a = n[4], h = n[5], l = n[6], d = n[7], p = 0; p < 64; p++) {
  11846. if (p < 16) u[p] = 0 | e[t + p];else {
  11847. var f = u[p - 15],
  11848. g = (f << 25 | f >>> 7) ^ (f << 14 | f >>> 18) ^ f >>> 3,
  11849. m = u[p - 2],
  11850. y = (m << 15 | m >>> 17) ^ (m << 13 | m >>> 19) ^ m >>> 10;
  11851. u[p] = g + u[p - 7] + y + u[p - 16];
  11852. }
  11853. var _ = s & r ^ s & i ^ r & i,
  11854. w = (s << 30 | s >>> 2) ^ (s << 19 | s >>> 13) ^ (s << 10 | s >>> 22),
  11855. v = d + ((a << 26 | a >>> 6) ^ (a << 21 | a >>> 11) ^ (a << 7 | a >>> 25)) + (a & h ^ ~a & l) + c[p] + u[p];
  11856. d = l, l = h, h = a, a = o + v | 0, o = i, i = r, r = s, s = v + (w + _) | 0;
  11857. }
  11858. n[0] = n[0] + s | 0, n[1] = n[1] + r | 0, n[2] = n[2] + i | 0, n[3] = n[3] + o | 0, n[4] = n[4] + a | 0, n[5] = n[5] + h | 0, n[6] = n[6] + l | 0, n[7] = n[7] + d | 0;
  11859. },
  11860. _doFinalize: function _doFinalize() {
  11861. var t = this._data,
  11862. n = t.words,
  11863. s = 8 * this._nDataBytes,
  11864. r = 8 * t.sigBytes;
  11865. return n[r >>> 5] |= 128 << 24 - r % 32, n[14 + (r + 64 >>> 9 << 4)] = e.floor(s / 4294967296), n[15 + (r + 64 >>> 9 << 4)] = s, t.sigBytes = 4 * n.length, this._process(), this._hash;
  11866. },
  11867. clone: function clone() {
  11868. var e = i.clone.call(this);
  11869. return e._hash = this._hash.clone(), e;
  11870. }
  11871. });
  11872. t.SHA256 = i._createHelper(h), t.HmacSHA256 = i._createHmacHelper(h);
  11873. }(Math), n.SHA256);
  11874. }),
  11875. _e = ye,
  11876. we = n(function (e, t) {
  11877. e.exports = r.HmacSHA256;
  11878. });
  11879. var ve = function ve() {
  11880. var e;
  11881. if (!Promise) {
  11882. e = function e() {}, e.promise = {};
  11883. var _t3 = function _t3() {
  11884. throw new te({
  11885. message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'
  11886. });
  11887. };
  11888. return Object.defineProperty(e.promise, "then", {
  11889. get: _t3
  11890. }), Object.defineProperty(e.promise, "catch", {
  11891. get: _t3
  11892. }), e;
  11893. }
  11894. var t = new Promise(function (t, n) {
  11895. e = function e(_e5, s) {
  11896. return _e5 ? n(_e5) : t(s);
  11897. };
  11898. });
  11899. return e.promise = t, e;
  11900. };
  11901. function Ie(e) {
  11902. return void 0 === e;
  11903. }
  11904. function Se(e) {
  11905. return "[object Null]" === Object.prototype.toString.call(e);
  11906. }
  11907. var be;
  11908. function ke(e) {
  11909. var t = (n = e, "[object Array]" === Object.prototype.toString.call(n) ? e : [e]);
  11910. var n;
  11911. var _iterator = _createForOfIteratorHelper(t),
  11912. _step;
  11913. try {
  11914. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  11915. var _e6 = _step.value;
  11916. var _t4 = _e6.isMatch,
  11917. _n5 = _e6.genAdapter,
  11918. _s4 = _e6.runtime;
  11919. if (_t4()) return {
  11920. adapter: _n5(),
  11921. runtime: _s4
  11922. };
  11923. }
  11924. } catch (err) {
  11925. _iterator.e(err);
  11926. } finally {
  11927. _iterator.f();
  11928. }
  11929. }
  11930. !function (e) {
  11931. e.WEB = "web", e.WX_MP = "wx_mp";
  11932. }(be || (be = {}));
  11933. var Ae = {
  11934. adapter: null,
  11935. runtime: void 0
  11936. },
  11937. Ce = ["anonymousUuidKey"];
  11938. var Pe = /*#__PURE__*/function (_me) {
  11939. (0, _inherits2.default)(Pe, _me);
  11940. var _super2 = _createSuper(Pe);
  11941. function Pe() {
  11942. var _this6;
  11943. (0, _classCallCheck2.default)(this, Pe);
  11944. _this6 = _super2.call(this), Ae.adapter.root.tcbObject || (Ae.adapter.root.tcbObject = {});
  11945. return _this6;
  11946. }
  11947. (0, _createClass2.default)(Pe, [{
  11948. key: "setItem",
  11949. value: function setItem(e, t) {
  11950. Ae.adapter.root.tcbObject[e] = t;
  11951. }
  11952. }, {
  11953. key: "getItem",
  11954. value: function getItem(e) {
  11955. return Ae.adapter.root.tcbObject[e];
  11956. }
  11957. }, {
  11958. key: "removeItem",
  11959. value: function removeItem(e) {
  11960. delete Ae.adapter.root.tcbObject[e];
  11961. }
  11962. }, {
  11963. key: "clear",
  11964. value: function clear() {
  11965. delete Ae.adapter.root.tcbObject;
  11966. }
  11967. }]);
  11968. return Pe;
  11969. }(me);
  11970. function Te(e, t) {
  11971. switch (e) {
  11972. case "local":
  11973. return t.localStorage || new Pe();
  11974. case "none":
  11975. return new Pe();
  11976. default:
  11977. return t.sessionStorage || new Pe();
  11978. }
  11979. }
  11980. var xe = /*#__PURE__*/function () {
  11981. function xe(e) {
  11982. (0, _classCallCheck2.default)(this, xe);
  11983. if (!this._storage) {
  11984. this._persistence = Ae.adapter.primaryStorage || e.persistence, this._storage = Te(this._persistence, Ae.adapter);
  11985. var _t5 = "access_token_".concat(e.env),
  11986. _n6 = "access_token_expire_".concat(e.env),
  11987. _s5 = "refresh_token_".concat(e.env),
  11988. _r2 = "anonymous_uuid_".concat(e.env),
  11989. _i = "login_type_".concat(e.env),
  11990. _o = "user_info_".concat(e.env);
  11991. this.keys = {
  11992. accessTokenKey: _t5,
  11993. accessTokenExpireKey: _n6,
  11994. refreshTokenKey: _s5,
  11995. anonymousUuidKey: _r2,
  11996. loginTypeKey: _i,
  11997. userInfoKey: _o
  11998. };
  11999. }
  12000. }
  12001. (0, _createClass2.default)(xe, [{
  12002. key: "updatePersistence",
  12003. value: function updatePersistence(e) {
  12004. if (e === this._persistence) return;
  12005. var t = "local" === this._persistence;
  12006. this._persistence = e;
  12007. var n = Te(e, Ae.adapter);
  12008. for (var _e7 in this.keys) {
  12009. var _s6 = this.keys[_e7];
  12010. if (t && Ce.includes(_e7)) continue;
  12011. var _r3 = this._storage.getItem(_s6);
  12012. Ie(_r3) || Se(_r3) || (n.setItem(_s6, _r3), this._storage.removeItem(_s6));
  12013. }
  12014. this._storage = n;
  12015. }
  12016. }, {
  12017. key: "setStore",
  12018. value: function setStore(e, t, n) {
  12019. if (!this._storage) return;
  12020. var s = {
  12021. version: n || "localCachev1",
  12022. content: t
  12023. },
  12024. r = JSON.stringify(s);
  12025. try {
  12026. this._storage.setItem(e, r);
  12027. } catch (e) {
  12028. throw e;
  12029. }
  12030. }
  12031. }, {
  12032. key: "getStore",
  12033. value: function getStore(e, t) {
  12034. try {
  12035. if (!this._storage) return;
  12036. } catch (e) {
  12037. return "";
  12038. }
  12039. t = t || "localCachev1";
  12040. var n = this._storage.getItem(e);
  12041. if (!n) return "";
  12042. if (n.indexOf(t) >= 0) {
  12043. return JSON.parse(n).content;
  12044. }
  12045. return "";
  12046. }
  12047. }, {
  12048. key: "removeStore",
  12049. value: function removeStore(e) {
  12050. this._storage.removeItem(e);
  12051. }
  12052. }]);
  12053. return xe;
  12054. }();
  12055. var Oe = {},
  12056. Ee = {};
  12057. function Le(e) {
  12058. return Oe[e];
  12059. }
  12060. var Re = /*#__PURE__*/(0, _createClass2.default)(function Re(e, t) {
  12061. (0, _classCallCheck2.default)(this, Re);
  12062. this.data = t || null, this.name = e;
  12063. });
  12064. var Ue = /*#__PURE__*/function (_Re) {
  12065. (0, _inherits2.default)(Ue, _Re);
  12066. var _super3 = _createSuper(Ue);
  12067. function Ue(e, t) {
  12068. var _this7;
  12069. (0, _classCallCheck2.default)(this, Ue);
  12070. _this7 = _super3.call(this, "error", {
  12071. error: e,
  12072. data: t
  12073. }), _this7.error = e;
  12074. return _this7;
  12075. }
  12076. return (0, _createClass2.default)(Ue);
  12077. }(Re);
  12078. var Ne = new ( /*#__PURE__*/function () {
  12079. function _class() {
  12080. (0, _classCallCheck2.default)(this, _class);
  12081. this._listeners = {};
  12082. }
  12083. (0, _createClass2.default)(_class, [{
  12084. key: "on",
  12085. value: function on(e, t) {
  12086. return function (e, t, n) {
  12087. n[e] = n[e] || [], n[e].push(t);
  12088. }(e, t, this._listeners), this;
  12089. }
  12090. }, {
  12091. key: "off",
  12092. value: function off(e, t) {
  12093. return function (e, t, n) {
  12094. if (n && n[e]) {
  12095. var _s7 = n[e].indexOf(t);
  12096. -1 !== _s7 && n[e].splice(_s7, 1);
  12097. }
  12098. }(e, t, this._listeners), this;
  12099. }
  12100. }, {
  12101. key: "fire",
  12102. value: function fire(e, t) {
  12103. if (e instanceof Ue) return console.error(e.error), this;
  12104. var n = "string" == typeof e ? new Re(e, t || {}) : e;
  12105. var s = n.name;
  12106. if (this._listens(s)) {
  12107. n.target = this;
  12108. var _e8 = this._listeners[s] ? (0, _toConsumableArray2.default)(this._listeners[s]) : [];
  12109. var _iterator2 = _createForOfIteratorHelper(_e8),
  12110. _step2;
  12111. try {
  12112. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  12113. var _t6 = _step2.value;
  12114. _t6.call(this, n);
  12115. }
  12116. } catch (err) {
  12117. _iterator2.e(err);
  12118. } finally {
  12119. _iterator2.f();
  12120. }
  12121. }
  12122. return this;
  12123. }
  12124. }, {
  12125. key: "_listens",
  12126. value: function _listens(e) {
  12127. return this._listeners[e] && this._listeners[e].length > 0;
  12128. }
  12129. }]);
  12130. return _class;
  12131. }())();
  12132. function De(e, t) {
  12133. Ne.on(e, t);
  12134. }
  12135. function Me(e) {
  12136. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  12137. Ne.fire(e, t);
  12138. }
  12139. function qe(e, t) {
  12140. Ne.off(e, t);
  12141. }
  12142. var Fe = "loginStateChanged",
  12143. Ke = "loginStateExpire",
  12144. je = "loginTypeChanged",
  12145. $e = "anonymousConverted",
  12146. Be = "refreshAccessToken";
  12147. var We;
  12148. !function (e) {
  12149. 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";
  12150. }(We || (We = {}));
  12151. var He = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"],
  12152. ze = {
  12153. "X-SDK-Version": "1.3.5"
  12154. };
  12155. function Je(e, t, n) {
  12156. var s = e[t];
  12157. e[t] = function (t) {
  12158. var r = {},
  12159. i = {};
  12160. n.forEach(function (n) {
  12161. var _n$call = n.call(e, t),
  12162. s = _n$call.data,
  12163. o = _n$call.headers;
  12164. Object.assign(r, s), Object.assign(i, o);
  12165. });
  12166. var o = t.data;
  12167. return o && function () {
  12168. var e;
  12169. if (e = o, "[object FormData]" !== Object.prototype.toString.call(e)) t.data = _objectSpread(_objectSpread({}, o), r);else for (var _e9 in r) {
  12170. o.append(_e9, r[_e9]);
  12171. }
  12172. }(), t.headers = _objectSpread(_objectSpread({}, t.headers || {}), i), s.call(e, t);
  12173. };
  12174. }
  12175. function Ve() {
  12176. var e = Math.random().toString(16).slice(2);
  12177. return {
  12178. data: {
  12179. seqId: e
  12180. },
  12181. headers: _objectSpread(_objectSpread({}, ze), {}, {
  12182. "x-seqid": e
  12183. })
  12184. };
  12185. }
  12186. var Ge = /*#__PURE__*/function () {
  12187. function Ge() {
  12188. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  12189. (0, _classCallCheck2.default)(this, Ge);
  12190. var t;
  12191. this.config = e, this._reqClass = new Ae.adapter.reqClass({
  12192. timeout: this.config.timeout,
  12193. timeoutMsg: "\u8BF7\u6C42\u5728".concat(this.config.timeout / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD"),
  12194. restrictedMethods: ["post"]
  12195. }), this._cache = Le(this.config.env), this._localCache = (t = this.config.env, Ee[t]), Je(this._reqClass, "post", [Ve]), Je(this._reqClass, "upload", [Ve]), Je(this._reqClass, "download", [Ve]);
  12196. }
  12197. (0, _createClass2.default)(Ge, [{
  12198. key: "post",
  12199. value: function () {
  12200. var _post = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(e) {
  12201. return _regenerator.default.wrap(function _callee4$(_context4) {
  12202. while (1) {
  12203. switch (_context4.prev = _context4.next) {
  12204. case 0:
  12205. _context4.next = 2;
  12206. return this._reqClass.post(e);
  12207. case 2:
  12208. return _context4.abrupt("return", _context4.sent);
  12209. case 3:
  12210. case "end":
  12211. return _context4.stop();
  12212. }
  12213. }
  12214. }, _callee4, this);
  12215. }));
  12216. function post(_x2) {
  12217. return _post.apply(this, arguments);
  12218. }
  12219. return post;
  12220. }()
  12221. }, {
  12222. key: "upload",
  12223. value: function () {
  12224. var _upload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(e) {
  12225. return _regenerator.default.wrap(function _callee5$(_context5) {
  12226. while (1) {
  12227. switch (_context5.prev = _context5.next) {
  12228. case 0:
  12229. _context5.next = 2;
  12230. return this._reqClass.upload(e);
  12231. case 2:
  12232. return _context5.abrupt("return", _context5.sent);
  12233. case 3:
  12234. case "end":
  12235. return _context5.stop();
  12236. }
  12237. }
  12238. }, _callee5, this);
  12239. }));
  12240. function upload(_x3) {
  12241. return _upload.apply(this, arguments);
  12242. }
  12243. return upload;
  12244. }()
  12245. }, {
  12246. key: "download",
  12247. value: function () {
  12248. var _download = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(e) {
  12249. return _regenerator.default.wrap(function _callee6$(_context6) {
  12250. while (1) {
  12251. switch (_context6.prev = _context6.next) {
  12252. case 0:
  12253. _context6.next = 2;
  12254. return this._reqClass.download(e);
  12255. case 2:
  12256. return _context6.abrupt("return", _context6.sent);
  12257. case 3:
  12258. case "end":
  12259. return _context6.stop();
  12260. }
  12261. }
  12262. }, _callee6, this);
  12263. }));
  12264. function download(_x4) {
  12265. return _download.apply(this, arguments);
  12266. }
  12267. return download;
  12268. }()
  12269. }, {
  12270. key: "refreshAccessToken",
  12271. value: function () {
  12272. var _refreshAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
  12273. var e, t;
  12274. return _regenerator.default.wrap(function _callee7$(_context7) {
  12275. while (1) {
  12276. switch (_context7.prev = _context7.next) {
  12277. case 0:
  12278. this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
  12279. _context7.prev = 1;
  12280. _context7.next = 4;
  12281. return this._refreshAccessTokenPromise;
  12282. case 4:
  12283. e = _context7.sent;
  12284. _context7.next = 10;
  12285. break;
  12286. case 7:
  12287. _context7.prev = 7;
  12288. _context7.t0 = _context7["catch"](1);
  12289. t = _context7.t0;
  12290. case 10:
  12291. if (!(this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t)) {
  12292. _context7.next = 12;
  12293. break;
  12294. }
  12295. throw t;
  12296. case 12:
  12297. return _context7.abrupt("return", e);
  12298. case 13:
  12299. case "end":
  12300. return _context7.stop();
  12301. }
  12302. }
  12303. }, _callee7, this, [[1, 7]]);
  12304. }));
  12305. function refreshAccessToken() {
  12306. return _refreshAccessToken2.apply(this, arguments);
  12307. }
  12308. return refreshAccessToken;
  12309. }()
  12310. }, {
  12311. key: "_refreshAccessToken",
  12312. value: function () {
  12313. var _refreshAccessToken3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
  12314. var _this$_cache$keys, e, t, n, s, r, i, o, a, _e10, _e11, _t7, _s8;
  12315. return _regenerator.default.wrap(function _callee8$(_context8) {
  12316. while (1) {
  12317. switch (_context8.prev = _context8.next) {
  12318. case 0:
  12319. _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;
  12320. this._cache.removeStore(e), this._cache.removeStore(t);
  12321. i = this._cache.getStore(n);
  12322. if (i) {
  12323. _context8.next = 5;
  12324. break;
  12325. }
  12326. throw new te({
  12327. message: "未登录CloudBase"
  12328. });
  12329. case 5:
  12330. o = {
  12331. refresh_token: i
  12332. };
  12333. _context8.next = 8;
  12334. return this.request("auth.fetchAccessTokenWithRefreshToken", o);
  12335. case 8:
  12336. a = _context8.sent;
  12337. if (!a.data.code) {
  12338. _context8.next = 21;
  12339. break;
  12340. }
  12341. _e10 = a.data.code;
  12342. if (!("SIGN_PARAM_INVALID" === _e10 || "REFRESH_TOKEN_EXPIRED" === _e10 || "INVALID_REFRESH_TOKEN" === _e10)) {
  12343. _context8.next = 20;
  12344. break;
  12345. }
  12346. if (!(this._cache.getStore(s) === We.ANONYMOUS && "INVALID_REFRESH_TOKEN" === _e10)) {
  12347. _context8.next = 19;
  12348. break;
  12349. }
  12350. _e11 = this._cache.getStore(r);
  12351. _t7 = this._cache.getStore(n);
  12352. _context8.next = 17;
  12353. return this.send("auth.signInAnonymously", {
  12354. anonymous_uuid: _e11,
  12355. refresh_token: _t7
  12356. });
  12357. case 17:
  12358. _s8 = _context8.sent;
  12359. return _context8.abrupt("return", (this.setRefreshToken(_s8.refresh_token), this._refreshAccessToken()));
  12360. case 19:
  12361. Me(Ke), this._cache.removeStore(n);
  12362. case 20:
  12363. throw new te({
  12364. code: a.data.code,
  12365. message: "\u5237\u65B0access token\u5931\u8D25\uFF1A".concat(a.data.code)
  12366. });
  12367. case 21:
  12368. if (!a.data.access_token) {
  12369. _context8.next = 23;
  12370. break;
  12371. }
  12372. return _context8.abrupt("return", (Me(Be), this._cache.setStore(e, a.data.access_token), this._cache.setStore(t, a.data.access_token_expire + Date.now()), {
  12373. accessToken: a.data.access_token,
  12374. accessTokenExpire: a.data.access_token_expire
  12375. }));
  12376. case 23:
  12377. a.data.refresh_token && (this._cache.removeStore(n), this._cache.setStore(n, a.data.refresh_token), this._refreshAccessToken());
  12378. case 24:
  12379. case "end":
  12380. return _context8.stop();
  12381. }
  12382. }
  12383. }, _callee8, this);
  12384. }));
  12385. function _refreshAccessToken() {
  12386. return _refreshAccessToken3.apply(this, arguments);
  12387. }
  12388. return _refreshAccessToken;
  12389. }()
  12390. }, {
  12391. key: "getAccessToken",
  12392. value: function () {
  12393. var _getAccessToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
  12394. var _this$_cache$keys2, e, t, n, s, r, i;
  12395. return _regenerator.default.wrap(function _callee9$(_context9) {
  12396. while (1) {
  12397. switch (_context9.prev = _context9.next) {
  12398. case 0:
  12399. _this$_cache$keys2 = this._cache.keys, e = _this$_cache$keys2.accessTokenKey, t = _this$_cache$keys2.accessTokenExpireKey, n = _this$_cache$keys2.refreshTokenKey;
  12400. if (this._cache.getStore(n)) {
  12401. _context9.next = 3;
  12402. break;
  12403. }
  12404. throw new te({
  12405. message: "refresh token不存在,登录状态异常"
  12406. });
  12407. case 3:
  12408. s = this._cache.getStore(e), r = this._cache.getStore(t), i = !0;
  12409. _context9.t0 = this._shouldRefreshAccessTokenHook;
  12410. if (!_context9.t0) {
  12411. _context9.next = 9;
  12412. break;
  12413. }
  12414. _context9.next = 8;
  12415. return this._shouldRefreshAccessTokenHook(s, r);
  12416. case 8:
  12417. _context9.t0 = !_context9.sent;
  12418. case 9:
  12419. _context9.t1 = _context9.t0;
  12420. if (!_context9.t1) {
  12421. _context9.next = 12;
  12422. break;
  12423. }
  12424. i = !1;
  12425. case 12:
  12426. return _context9.abrupt("return", (!s || !r || r < Date.now()) && i ? this.refreshAccessToken() : {
  12427. accessToken: s,
  12428. accessTokenExpire: r
  12429. });
  12430. case 13:
  12431. case "end":
  12432. return _context9.stop();
  12433. }
  12434. }
  12435. }, _callee9, this);
  12436. }));
  12437. function getAccessToken() {
  12438. return _getAccessToken.apply(this, arguments);
  12439. }
  12440. return getAccessToken;
  12441. }()
  12442. }, {
  12443. key: "request",
  12444. value: function () {
  12445. var _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(e, t, n) {
  12446. var s, r, i, _e12, o, _e13, _e14, a, c, u, h, l, d, p, f, g;
  12447. return _regenerator.default.wrap(function _callee10$(_context10) {
  12448. while (1) {
  12449. switch (_context10.prev = _context10.next) {
  12450. case 0:
  12451. s = "x-tcb-trace_".concat(this.config.env);
  12452. r = "application/x-www-form-urlencoded";
  12453. i = _objectSpread({
  12454. action: e,
  12455. env: this.config.env,
  12456. dataVersion: "2019-08-16"
  12457. }, t);
  12458. if (!(-1 === He.indexOf(e))) {
  12459. _context10.next = 10;
  12460. break;
  12461. }
  12462. _e12 = this._cache.keys.refreshTokenKey;
  12463. _context10.t0 = this._cache.getStore(_e12);
  12464. if (!_context10.t0) {
  12465. _context10.next = 10;
  12466. break;
  12467. }
  12468. _context10.next = 9;
  12469. return this.getAccessToken();
  12470. case 9:
  12471. i.access_token = _context10.sent.accessToken;
  12472. case 10:
  12473. if ("storage.uploadFile" === e) {
  12474. o = new FormData();
  12475. for (_e13 in o) {
  12476. o.hasOwnProperty(_e13) && void 0 !== o[_e13] && o.append(_e13, i[_e13]);
  12477. }
  12478. r = "multipart/form-data";
  12479. } else {
  12480. r = "application/json", o = {};
  12481. for (_e14 in i) {
  12482. void 0 !== i[_e14] && (o[_e14] = i[_e14]);
  12483. }
  12484. }
  12485. a = {
  12486. headers: {
  12487. "content-type": r
  12488. }
  12489. };
  12490. n && n.onUploadProgress && (a.onUploadProgress = n.onUploadProgress);
  12491. c = this._localCache.getStore(s);
  12492. c && (a.headers["X-TCB-Trace"] = c);
  12493. u = t.parse, h = t.inQuery, l = t.search;
  12494. d = {
  12495. env: this.config.env
  12496. };
  12497. u && (d.parse = !0), h && (d = _objectSpread(_objectSpread({}, h), d));
  12498. p = function (e, t) {
  12499. var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  12500. var s = /\?/.test(t);
  12501. var r = "";
  12502. for (var _e15 in n) {
  12503. "" === r ? !s && (t += "?") : r += "&", r += "".concat(_e15, "=").concat(encodeURIComponent(n[_e15]));
  12504. }
  12505. return /^http(s)?\:\/\//.test(t += r) ? t : "".concat(e).concat(t);
  12506. }(fe, "//tcb-api.tencentcloudapi.com/web", d);
  12507. l && (p += l);
  12508. _context10.next = 22;
  12509. return this.post(_objectSpread({
  12510. url: p,
  12511. data: o
  12512. }, a));
  12513. case 22:
  12514. f = _context10.sent;
  12515. g = f.header && f.header["x-tcb-trace"];
  12516. if (!(g && this._localCache.setStore(s, g), 200 !== Number(f.status) && 200 !== Number(f.statusCode) || !f.data)) {
  12517. _context10.next = 26;
  12518. break;
  12519. }
  12520. throw new te({
  12521. code: "NETWORK_ERROR",
  12522. message: "network request error"
  12523. });
  12524. case 26:
  12525. return _context10.abrupt("return", f);
  12526. case 27:
  12527. case "end":
  12528. return _context10.stop();
  12529. }
  12530. }
  12531. }, _callee10, this);
  12532. }));
  12533. function request(_x5, _x6, _x7) {
  12534. return _request.apply(this, arguments);
  12535. }
  12536. return request;
  12537. }()
  12538. }, {
  12539. key: "send",
  12540. value: function () {
  12541. var _send = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(e) {
  12542. var t,
  12543. n,
  12544. _n7,
  12545. _args11 = arguments;
  12546. return _regenerator.default.wrap(function _callee11$(_context11) {
  12547. while (1) {
  12548. switch (_context11.prev = _context11.next) {
  12549. case 0:
  12550. t = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : {};
  12551. _context11.next = 3;
  12552. return this.request(e, t, {
  12553. onUploadProgress: t.onUploadProgress
  12554. });
  12555. case 3:
  12556. n = _context11.sent;
  12557. if (!("ACCESS_TOKEN_EXPIRED" === n.data.code && -1 === He.indexOf(e))) {
  12558. _context11.next = 13;
  12559. break;
  12560. }
  12561. _context11.next = 7;
  12562. return this.refreshAccessToken();
  12563. case 7:
  12564. _context11.next = 9;
  12565. return this.request(e, t, {
  12566. onUploadProgress: t.onUploadProgress
  12567. });
  12568. case 9:
  12569. _n7 = _context11.sent;
  12570. if (!_n7.data.code) {
  12571. _context11.next = 12;
  12572. break;
  12573. }
  12574. throw new te({
  12575. code: _n7.data.code,
  12576. message: _n7.data.message
  12577. });
  12578. case 12:
  12579. return _context11.abrupt("return", _n7.data);
  12580. case 13:
  12581. if (!n.data.code) {
  12582. _context11.next = 15;
  12583. break;
  12584. }
  12585. throw new te({
  12586. code: n.data.code,
  12587. message: n.data.message
  12588. });
  12589. case 15:
  12590. return _context11.abrupt("return", n.data);
  12591. case 16:
  12592. case "end":
  12593. return _context11.stop();
  12594. }
  12595. }
  12596. }, _callee11, this);
  12597. }));
  12598. function send(_x8) {
  12599. return _send.apply(this, arguments);
  12600. }
  12601. return send;
  12602. }()
  12603. }, {
  12604. key: "setRefreshToken",
  12605. value: function setRefreshToken(e) {
  12606. var _this$_cache$keys3 = this._cache.keys,
  12607. t = _this$_cache$keys3.accessTokenKey,
  12608. n = _this$_cache$keys3.accessTokenExpireKey,
  12609. s = _this$_cache$keys3.refreshTokenKey;
  12610. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  12611. }
  12612. }]);
  12613. return Ge;
  12614. }();
  12615. var Ye = {};
  12616. function Qe(e) {
  12617. return Ye[e];
  12618. }
  12619. var Xe = /*#__PURE__*/function () {
  12620. function Xe(e) {
  12621. (0, _classCallCheck2.default)(this, Xe);
  12622. this.config = e, this._cache = Le(e.env), this._request = Qe(e.env);
  12623. }
  12624. (0, _createClass2.default)(Xe, [{
  12625. key: "setRefreshToken",
  12626. value: function setRefreshToken(e) {
  12627. var _this$_cache$keys4 = this._cache.keys,
  12628. t = _this$_cache$keys4.accessTokenKey,
  12629. n = _this$_cache$keys4.accessTokenExpireKey,
  12630. s = _this$_cache$keys4.refreshTokenKey;
  12631. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  12632. }
  12633. }, {
  12634. key: "setAccessToken",
  12635. value: function setAccessToken(e, t) {
  12636. var _this$_cache$keys5 = this._cache.keys,
  12637. n = _this$_cache$keys5.accessTokenKey,
  12638. s = _this$_cache$keys5.accessTokenExpireKey;
  12639. this._cache.setStore(n, e), this._cache.setStore(s, t);
  12640. }
  12641. }, {
  12642. key: "refreshUserInfo",
  12643. value: function () {
  12644. var _refreshUserInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
  12645. var _yield$this$_request$, e;
  12646. return _regenerator.default.wrap(function _callee12$(_context12) {
  12647. while (1) {
  12648. switch (_context12.prev = _context12.next) {
  12649. case 0:
  12650. _context12.next = 2;
  12651. return this._request.send("auth.getUserInfo", {});
  12652. case 2:
  12653. _yield$this$_request$ = _context12.sent;
  12654. e = _yield$this$_request$.data;
  12655. return _context12.abrupt("return", (this.setLocalUserInfo(e), e));
  12656. case 5:
  12657. case "end":
  12658. return _context12.stop();
  12659. }
  12660. }
  12661. }, _callee12, this);
  12662. }));
  12663. function refreshUserInfo() {
  12664. return _refreshUserInfo.apply(this, arguments);
  12665. }
  12666. return refreshUserInfo;
  12667. }()
  12668. }, {
  12669. key: "setLocalUserInfo",
  12670. value: function setLocalUserInfo(e) {
  12671. var t = this._cache.keys.userInfoKey;
  12672. this._cache.setStore(t, e);
  12673. }
  12674. }]);
  12675. return Xe;
  12676. }();
  12677. var Ze = /*#__PURE__*/function () {
  12678. function Ze(e) {
  12679. (0, _classCallCheck2.default)(this, Ze);
  12680. if (!e) throw new te({
  12681. code: "PARAM_ERROR",
  12682. message: "envId is not defined"
  12683. });
  12684. this._envId = e, this._cache = Le(this._envId), this._request = Qe(this._envId), this.setUserInfo();
  12685. }
  12686. (0, _createClass2.default)(Ze, [{
  12687. key: "linkWithTicket",
  12688. value: function linkWithTicket(e) {
  12689. if ("string" != typeof e) throw new te({
  12690. code: "PARAM_ERROR",
  12691. message: "ticket must be string"
  12692. });
  12693. return this._request.send("auth.linkWithTicket", {
  12694. ticket: e
  12695. });
  12696. }
  12697. }, {
  12698. key: "linkWithRedirect",
  12699. value: function linkWithRedirect(e) {
  12700. e.signInWithRedirect();
  12701. }
  12702. }, {
  12703. key: "updatePassword",
  12704. value: function updatePassword(e, t) {
  12705. return this._request.send("auth.updatePassword", {
  12706. oldPassword: t,
  12707. newPassword: e
  12708. });
  12709. }
  12710. }, {
  12711. key: "updateEmail",
  12712. value: function updateEmail(e) {
  12713. return this._request.send("auth.updateEmail", {
  12714. newEmail: e
  12715. });
  12716. }
  12717. }, {
  12718. key: "updateUsername",
  12719. value: function updateUsername(e) {
  12720. if ("string" != typeof e) throw new te({
  12721. code: "PARAM_ERROR",
  12722. message: "username must be a string"
  12723. });
  12724. return this._request.send("auth.updateUsername", {
  12725. username: e
  12726. });
  12727. }
  12728. }, {
  12729. key: "getLinkedUidList",
  12730. value: function () {
  12731. var _getLinkedUidList = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
  12732. var _yield$this$_request$2, e, t, n;
  12733. return _regenerator.default.wrap(function _callee13$(_context13) {
  12734. while (1) {
  12735. switch (_context13.prev = _context13.next) {
  12736. case 0:
  12737. _context13.next = 2;
  12738. return this._request.send("auth.getLinkedUidList", {});
  12739. case 2:
  12740. _yield$this$_request$2 = _context13.sent;
  12741. e = _yield$this$_request$2.data;
  12742. t = !1;
  12743. n = e.users;
  12744. return _context13.abrupt("return", (n.forEach(function (e) {
  12745. e.wxOpenId && e.wxPublicId && (t = !0);
  12746. }), {
  12747. users: n,
  12748. hasPrimaryUid: t
  12749. }));
  12750. case 7:
  12751. case "end":
  12752. return _context13.stop();
  12753. }
  12754. }
  12755. }, _callee13, this);
  12756. }));
  12757. function getLinkedUidList() {
  12758. return _getLinkedUidList.apply(this, arguments);
  12759. }
  12760. return getLinkedUidList;
  12761. }()
  12762. }, {
  12763. key: "setPrimaryUid",
  12764. value: function setPrimaryUid(e) {
  12765. return this._request.send("auth.setPrimaryUid", {
  12766. uid: e
  12767. });
  12768. }
  12769. }, {
  12770. key: "unlink",
  12771. value: function unlink(e) {
  12772. return this._request.send("auth.unlink", {
  12773. platform: e
  12774. });
  12775. }
  12776. }, {
  12777. key: "update",
  12778. value: function () {
  12779. var _update = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(e) {
  12780. var t, n, s, r, i, o, _yield$this$_request$3, a;
  12781. return _regenerator.default.wrap(function _callee14$(_context14) {
  12782. while (1) {
  12783. switch (_context14.prev = _context14.next) {
  12784. case 0:
  12785. t = e.nickName;
  12786. n = e.gender;
  12787. s = e.avatarUrl;
  12788. r = e.province;
  12789. i = e.country;
  12790. o = e.city;
  12791. _context14.next = 8;
  12792. return this._request.send("auth.updateUserInfo", {
  12793. nickName: t,
  12794. gender: n,
  12795. avatarUrl: s,
  12796. province: r,
  12797. country: i,
  12798. city: o
  12799. });
  12800. case 8:
  12801. _yield$this$_request$3 = _context14.sent;
  12802. a = _yield$this$_request$3.data;
  12803. this.setLocalUserInfo(a);
  12804. case 11:
  12805. case "end":
  12806. return _context14.stop();
  12807. }
  12808. }
  12809. }, _callee14, this);
  12810. }));
  12811. function update(_x9) {
  12812. return _update.apply(this, arguments);
  12813. }
  12814. return update;
  12815. }()
  12816. }, {
  12817. key: "refresh",
  12818. value: function () {
  12819. var _refresh = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
  12820. var _yield$this$_request$4, e;
  12821. return _regenerator.default.wrap(function _callee15$(_context15) {
  12822. while (1) {
  12823. switch (_context15.prev = _context15.next) {
  12824. case 0:
  12825. _context15.next = 2;
  12826. return this._request.send("auth.getUserInfo", {});
  12827. case 2:
  12828. _yield$this$_request$4 = _context15.sent;
  12829. e = _yield$this$_request$4.data;
  12830. return _context15.abrupt("return", (this.setLocalUserInfo(e), e));
  12831. case 5:
  12832. case "end":
  12833. return _context15.stop();
  12834. }
  12835. }
  12836. }, _callee15, this);
  12837. }));
  12838. function refresh() {
  12839. return _refresh.apply(this, arguments);
  12840. }
  12841. return refresh;
  12842. }()
  12843. }, {
  12844. key: "setUserInfo",
  12845. value: function setUserInfo() {
  12846. var _this8 = this;
  12847. var e = this._cache.keys.userInfoKey,
  12848. t = this._cache.getStore(e);
  12849. ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach(function (e) {
  12850. _this8[e] = t[e];
  12851. }), this.location = {
  12852. country: t.country,
  12853. province: t.province,
  12854. city: t.city
  12855. };
  12856. }
  12857. }, {
  12858. key: "setLocalUserInfo",
  12859. value: function setLocalUserInfo(e) {
  12860. var t = this._cache.keys.userInfoKey;
  12861. this._cache.setStore(t, e), this.setUserInfo();
  12862. }
  12863. }]);
  12864. return Ze;
  12865. }();
  12866. var et = /*#__PURE__*/function () {
  12867. function et(e) {
  12868. (0, _classCallCheck2.default)(this, et);
  12869. if (!e) throw new te({
  12870. code: "PARAM_ERROR",
  12871. message: "envId is not defined"
  12872. });
  12873. this._cache = Le(e);
  12874. var _this$_cache$keys6 = this._cache.keys,
  12875. t = _this$_cache$keys6.refreshTokenKey,
  12876. n = _this$_cache$keys6.accessTokenKey,
  12877. s = _this$_cache$keys6.accessTokenExpireKey,
  12878. r = this._cache.getStore(t),
  12879. i = this._cache.getStore(n),
  12880. o = this._cache.getStore(s);
  12881. this.credential = {
  12882. refreshToken: r,
  12883. accessToken: i,
  12884. accessTokenExpire: o
  12885. }, this.user = new Ze(e);
  12886. }
  12887. (0, _createClass2.default)(et, [{
  12888. key: "isAnonymousAuth",
  12889. get: function get() {
  12890. return this.loginType === We.ANONYMOUS;
  12891. }
  12892. }, {
  12893. key: "isCustomAuth",
  12894. get: function get() {
  12895. return this.loginType === We.CUSTOM;
  12896. }
  12897. }, {
  12898. key: "isWeixinAuth",
  12899. get: function get() {
  12900. return this.loginType === We.WECHAT || this.loginType === We.WECHAT_OPEN || this.loginType === We.WECHAT_PUBLIC;
  12901. }
  12902. }, {
  12903. key: "loginType",
  12904. get: function get() {
  12905. return this._cache.getStore(this._cache.keys.loginTypeKey);
  12906. }
  12907. }]);
  12908. return et;
  12909. }();
  12910. var tt = /*#__PURE__*/function (_Xe) {
  12911. (0, _inherits2.default)(tt, _Xe);
  12912. var _super4 = _createSuper(tt);
  12913. function tt() {
  12914. (0, _classCallCheck2.default)(this, tt);
  12915. return _super4.apply(this, arguments);
  12916. }
  12917. (0, _createClass2.default)(tt, [{
  12918. key: "signIn",
  12919. value: function () {
  12920. var _signIn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
  12921. var _this$_cache$keys7, e, t, n, s, r, _e16;
  12922. return _regenerator.default.wrap(function _callee16$(_context16) {
  12923. while (1) {
  12924. switch (_context16.prev = _context16.next) {
  12925. case 0:
  12926. this._cache.updatePersistence("local");
  12927. _this$_cache$keys7 = this._cache.keys;
  12928. e = _this$_cache$keys7.anonymousUuidKey;
  12929. t = _this$_cache$keys7.refreshTokenKey;
  12930. n = this._cache.getStore(e) || void 0;
  12931. s = this._cache.getStore(t) || void 0;
  12932. _context16.next = 8;
  12933. return this._request.send("auth.signInAnonymously", {
  12934. anonymous_uuid: n,
  12935. refresh_token: s
  12936. });
  12937. case 8:
  12938. r = _context16.sent;
  12939. if (!(r.uuid && r.refresh_token)) {
  12940. _context16.next = 20;
  12941. break;
  12942. }
  12943. this._setAnonymousUUID(r.uuid);
  12944. this.setRefreshToken(r.refresh_token);
  12945. _context16.next = 14;
  12946. return this._request.refreshAccessToken();
  12947. case 14:
  12948. Me(Fe);
  12949. Me(je, {
  12950. env: this.config.env,
  12951. loginType: We.ANONYMOUS,
  12952. persistence: "local"
  12953. });
  12954. _e16 = new et(this.config.env);
  12955. _context16.next = 19;
  12956. return _e16.user.refresh();
  12957. case 19:
  12958. return _context16.abrupt("return", _e16);
  12959. case 20:
  12960. throw new te({
  12961. message: "匿名登录失败"
  12962. });
  12963. case 21:
  12964. case "end":
  12965. return _context16.stop();
  12966. }
  12967. }
  12968. }, _callee16, this);
  12969. }));
  12970. function signIn() {
  12971. return _signIn.apply(this, arguments);
  12972. }
  12973. return signIn;
  12974. }()
  12975. }, {
  12976. key: "linkAndRetrieveDataWithTicket",
  12977. value: function () {
  12978. var _linkAndRetrieveDataWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(e) {
  12979. var _this$_cache$keys8, t, n, s, r, i;
  12980. return _regenerator.default.wrap(function _callee17$(_context17) {
  12981. while (1) {
  12982. switch (_context17.prev = _context17.next) {
  12983. case 0:
  12984. _this$_cache$keys8 = this._cache.keys;
  12985. t = _this$_cache$keys8.anonymousUuidKey;
  12986. n = _this$_cache$keys8.refreshTokenKey;
  12987. s = this._cache.getStore(t);
  12988. r = this._cache.getStore(n);
  12989. _context17.next = 7;
  12990. return this._request.send("auth.linkAndRetrieveDataWithTicket", {
  12991. anonymous_uuid: s,
  12992. refresh_token: r,
  12993. ticket: e
  12994. });
  12995. case 7:
  12996. i = _context17.sent;
  12997. if (!i.refresh_token) {
  12998. _context17.next = 16;
  12999. break;
  13000. }
  13001. this._clearAnonymousUUID();
  13002. this.setRefreshToken(i.refresh_token);
  13003. _context17.next = 13;
  13004. return this._request.refreshAccessToken();
  13005. case 13:
  13006. Me($e, {
  13007. env: this.config.env
  13008. });
  13009. Me(je, {
  13010. loginType: We.CUSTOM,
  13011. persistence: "local"
  13012. });
  13013. return _context17.abrupt("return", {
  13014. credential: {
  13015. refreshToken: i.refresh_token
  13016. }
  13017. });
  13018. case 16:
  13019. throw new te({
  13020. message: "匿名转化失败"
  13021. });
  13022. case 17:
  13023. case "end":
  13024. return _context17.stop();
  13025. }
  13026. }
  13027. }, _callee17, this);
  13028. }));
  13029. function linkAndRetrieveDataWithTicket(_x10) {
  13030. return _linkAndRetrieveDataWithTicket.apply(this, arguments);
  13031. }
  13032. return linkAndRetrieveDataWithTicket;
  13033. }()
  13034. }, {
  13035. key: "_setAnonymousUUID",
  13036. value: function _setAnonymousUUID(e) {
  13037. var _this$_cache$keys9 = this._cache.keys,
  13038. t = _this$_cache$keys9.anonymousUuidKey,
  13039. n = _this$_cache$keys9.loginTypeKey;
  13040. this._cache.removeStore(t), this._cache.setStore(t, e), this._cache.setStore(n, We.ANONYMOUS);
  13041. }
  13042. }, {
  13043. key: "_clearAnonymousUUID",
  13044. value: function _clearAnonymousUUID() {
  13045. this._cache.removeStore(this._cache.keys.anonymousUuidKey);
  13046. }
  13047. }]);
  13048. return tt;
  13049. }(Xe);
  13050. var nt = /*#__PURE__*/function (_Xe2) {
  13051. (0, _inherits2.default)(nt, _Xe2);
  13052. var _super5 = _createSuper(nt);
  13053. function nt() {
  13054. (0, _classCallCheck2.default)(this, nt);
  13055. return _super5.apply(this, arguments);
  13056. }
  13057. (0, _createClass2.default)(nt, [{
  13058. key: "signIn",
  13059. value: function () {
  13060. var _signIn2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(e) {
  13061. var t, n;
  13062. return _regenerator.default.wrap(function _callee18$(_context18) {
  13063. while (1) {
  13064. switch (_context18.prev = _context18.next) {
  13065. case 0:
  13066. if (!("string" != typeof e)) {
  13067. _context18.next = 2;
  13068. break;
  13069. }
  13070. throw new te({
  13071. code: "PARAM_ERROR",
  13072. message: "ticket must be a string"
  13073. });
  13074. case 2:
  13075. t = this._cache.keys.refreshTokenKey;
  13076. _context18.next = 5;
  13077. return this._request.send("auth.signInWithTicket", {
  13078. ticket: e,
  13079. refresh_token: this._cache.getStore(t) || ""
  13080. });
  13081. case 5:
  13082. n = _context18.sent;
  13083. if (!n.refresh_token) {
  13084. _context18.next = 15;
  13085. break;
  13086. }
  13087. this.setRefreshToken(n.refresh_token);
  13088. _context18.next = 10;
  13089. return this._request.refreshAccessToken();
  13090. case 10:
  13091. Me(Fe);
  13092. Me(je, {
  13093. env: this.config.env,
  13094. loginType: We.CUSTOM,
  13095. persistence: this.config.persistence
  13096. });
  13097. _context18.next = 14;
  13098. return this.refreshUserInfo();
  13099. case 14:
  13100. return _context18.abrupt("return", new et(this.config.env));
  13101. case 15:
  13102. throw new te({
  13103. message: "自定义登录失败"
  13104. });
  13105. case 16:
  13106. case "end":
  13107. return _context18.stop();
  13108. }
  13109. }
  13110. }, _callee18, this);
  13111. }));
  13112. function signIn(_x11) {
  13113. return _signIn2.apply(this, arguments);
  13114. }
  13115. return signIn;
  13116. }()
  13117. }]);
  13118. return nt;
  13119. }(Xe);
  13120. var st = /*#__PURE__*/function (_Xe3) {
  13121. (0, _inherits2.default)(st, _Xe3);
  13122. var _super6 = _createSuper(st);
  13123. function st() {
  13124. (0, _classCallCheck2.default)(this, st);
  13125. return _super6.apply(this, arguments);
  13126. }
  13127. (0, _createClass2.default)(st, [{
  13128. key: "signIn",
  13129. value: function () {
  13130. var _signIn3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(e, t) {
  13131. var n, s, r, i, o;
  13132. return _regenerator.default.wrap(function _callee19$(_context19) {
  13133. while (1) {
  13134. switch (_context19.prev = _context19.next) {
  13135. case 0:
  13136. if (!("string" != typeof e)) {
  13137. _context19.next = 2;
  13138. break;
  13139. }
  13140. throw new te({
  13141. code: "PARAM_ERROR",
  13142. message: "email must be a string"
  13143. });
  13144. case 2:
  13145. n = this._cache.keys.refreshTokenKey;
  13146. _context19.next = 5;
  13147. return this._request.send("auth.signIn", {
  13148. loginType: "EMAIL",
  13149. email: e,
  13150. password: t,
  13151. refresh_token: this._cache.getStore(n) || ""
  13152. });
  13153. case 5:
  13154. s = _context19.sent;
  13155. r = s.refresh_token;
  13156. i = s.access_token;
  13157. o = s.access_token_expire;
  13158. if (!r) {
  13159. _context19.next = 22;
  13160. break;
  13161. }
  13162. this.setRefreshToken(r);
  13163. if (!(i && o)) {
  13164. _context19.next = 15;
  13165. break;
  13166. }
  13167. this.setAccessToken(i, o);
  13168. _context19.next = 17;
  13169. break;
  13170. case 15:
  13171. _context19.next = 17;
  13172. return this._request.refreshAccessToken();
  13173. case 17:
  13174. _context19.next = 19;
  13175. return this.refreshUserInfo();
  13176. case 19:
  13177. Me(Fe);
  13178. Me(je, {
  13179. env: this.config.env,
  13180. loginType: We.EMAIL,
  13181. persistence: this.config.persistence
  13182. });
  13183. return _context19.abrupt("return", new et(this.config.env));
  13184. case 22:
  13185. throw s.code ? new te({
  13186. code: s.code,
  13187. message: "\u90AE\u7BB1\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  13188. }) : new te({
  13189. message: "邮箱登录失败"
  13190. });
  13191. case 23:
  13192. case "end":
  13193. return _context19.stop();
  13194. }
  13195. }
  13196. }, _callee19, this);
  13197. }));
  13198. function signIn(_x12, _x13) {
  13199. return _signIn3.apply(this, arguments);
  13200. }
  13201. return signIn;
  13202. }()
  13203. }, {
  13204. key: "activate",
  13205. value: function () {
  13206. var _activate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(e) {
  13207. return _regenerator.default.wrap(function _callee20$(_context20) {
  13208. while (1) {
  13209. switch (_context20.prev = _context20.next) {
  13210. case 0:
  13211. return _context20.abrupt("return", this._request.send("auth.activateEndUserMail", {
  13212. token: e
  13213. }));
  13214. case 1:
  13215. case "end":
  13216. return _context20.stop();
  13217. }
  13218. }
  13219. }, _callee20, this);
  13220. }));
  13221. function activate(_x14) {
  13222. return _activate.apply(this, arguments);
  13223. }
  13224. return activate;
  13225. }()
  13226. }, {
  13227. key: "resetPasswordWithToken",
  13228. value: function () {
  13229. var _resetPasswordWithToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(e, t) {
  13230. return _regenerator.default.wrap(function _callee21$(_context21) {
  13231. while (1) {
  13232. switch (_context21.prev = _context21.next) {
  13233. case 0:
  13234. return _context21.abrupt("return", this._request.send("auth.resetPasswordWithToken", {
  13235. token: e,
  13236. newPassword: t
  13237. }));
  13238. case 1:
  13239. case "end":
  13240. return _context21.stop();
  13241. }
  13242. }
  13243. }, _callee21, this);
  13244. }));
  13245. function resetPasswordWithToken(_x15, _x16) {
  13246. return _resetPasswordWithToken.apply(this, arguments);
  13247. }
  13248. return resetPasswordWithToken;
  13249. }()
  13250. }]);
  13251. return st;
  13252. }(Xe);
  13253. var rt = /*#__PURE__*/function (_Xe4) {
  13254. (0, _inherits2.default)(rt, _Xe4);
  13255. var _super7 = _createSuper(rt);
  13256. function rt() {
  13257. (0, _classCallCheck2.default)(this, rt);
  13258. return _super7.apply(this, arguments);
  13259. }
  13260. (0, _createClass2.default)(rt, [{
  13261. key: "signIn",
  13262. value: function () {
  13263. var _signIn4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22(e, t) {
  13264. var n, s, r, i, o;
  13265. return _regenerator.default.wrap(function _callee22$(_context22) {
  13266. while (1) {
  13267. switch (_context22.prev = _context22.next) {
  13268. case 0:
  13269. if (!("string" != typeof e)) {
  13270. _context22.next = 2;
  13271. break;
  13272. }
  13273. throw new te({
  13274. code: "PARAM_ERROR",
  13275. message: "username must be a string"
  13276. });
  13277. case 2:
  13278. "string" != typeof t && (t = "", console.warn("password is empty"));
  13279. n = this._cache.keys.refreshTokenKey;
  13280. _context22.next = 6;
  13281. return this._request.send("auth.signIn", {
  13282. loginType: We.USERNAME,
  13283. username: e,
  13284. password: t,
  13285. refresh_token: this._cache.getStore(n) || ""
  13286. });
  13287. case 6:
  13288. s = _context22.sent;
  13289. r = s.refresh_token;
  13290. i = s.access_token_expire;
  13291. o = s.access_token;
  13292. if (!r) {
  13293. _context22.next = 23;
  13294. break;
  13295. }
  13296. this.setRefreshToken(r);
  13297. if (!(o && i)) {
  13298. _context22.next = 16;
  13299. break;
  13300. }
  13301. this.setAccessToken(o, i);
  13302. _context22.next = 18;
  13303. break;
  13304. case 16:
  13305. _context22.next = 18;
  13306. return this._request.refreshAccessToken();
  13307. case 18:
  13308. _context22.next = 20;
  13309. return this.refreshUserInfo();
  13310. case 20:
  13311. Me(Fe);
  13312. Me(je, {
  13313. env: this.config.env,
  13314. loginType: We.USERNAME,
  13315. persistence: this.config.persistence
  13316. });
  13317. return _context22.abrupt("return", new et(this.config.env));
  13318. case 23:
  13319. throw s.code ? new te({
  13320. code: s.code,
  13321. message: "\u7528\u6237\u540D\u5BC6\u7801\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  13322. }) : new te({
  13323. message: "用户名密码登录失败"
  13324. });
  13325. case 24:
  13326. case "end":
  13327. return _context22.stop();
  13328. }
  13329. }
  13330. }, _callee22, this);
  13331. }));
  13332. function signIn(_x17, _x18) {
  13333. return _signIn4.apply(this, arguments);
  13334. }
  13335. return signIn;
  13336. }()
  13337. }]);
  13338. return rt;
  13339. }(Xe);
  13340. var it = /*#__PURE__*/function () {
  13341. function it(e) {
  13342. (0, _classCallCheck2.default)(this, it);
  13343. this.config = e, this._cache = Le(e.env), this._request = Qe(e.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), De(je, this._onLoginTypeChanged);
  13344. }
  13345. (0, _createClass2.default)(it, [{
  13346. key: "currentUser",
  13347. get: function get() {
  13348. var e = this.hasLoginState();
  13349. return e && e.user || null;
  13350. }
  13351. }, {
  13352. key: "loginType",
  13353. get: function get() {
  13354. return this._cache.getStore(this._cache.keys.loginTypeKey);
  13355. }
  13356. }, {
  13357. key: "anonymousAuthProvider",
  13358. value: function anonymousAuthProvider() {
  13359. return new tt(this.config);
  13360. }
  13361. }, {
  13362. key: "customAuthProvider",
  13363. value: function customAuthProvider() {
  13364. return new nt(this.config);
  13365. }
  13366. }, {
  13367. key: "emailAuthProvider",
  13368. value: function emailAuthProvider() {
  13369. return new st(this.config);
  13370. }
  13371. }, {
  13372. key: "usernameAuthProvider",
  13373. value: function usernameAuthProvider() {
  13374. return new rt(this.config);
  13375. }
  13376. }, {
  13377. key: "signInAnonymously",
  13378. value: function () {
  13379. var _signInAnonymously = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
  13380. return _regenerator.default.wrap(function _callee23$(_context23) {
  13381. while (1) {
  13382. switch (_context23.prev = _context23.next) {
  13383. case 0:
  13384. return _context23.abrupt("return", new tt(this.config).signIn());
  13385. case 1:
  13386. case "end":
  13387. return _context23.stop();
  13388. }
  13389. }
  13390. }, _callee23, this);
  13391. }));
  13392. function signInAnonymously() {
  13393. return _signInAnonymously.apply(this, arguments);
  13394. }
  13395. return signInAnonymously;
  13396. }()
  13397. }, {
  13398. key: "signInWithEmailAndPassword",
  13399. value: function () {
  13400. var _signInWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(e, t) {
  13401. return _regenerator.default.wrap(function _callee24$(_context24) {
  13402. while (1) {
  13403. switch (_context24.prev = _context24.next) {
  13404. case 0:
  13405. return _context24.abrupt("return", new st(this.config).signIn(e, t));
  13406. case 1:
  13407. case "end":
  13408. return _context24.stop();
  13409. }
  13410. }
  13411. }, _callee24, this);
  13412. }));
  13413. function signInWithEmailAndPassword(_x19, _x20) {
  13414. return _signInWithEmailAndPassword.apply(this, arguments);
  13415. }
  13416. return signInWithEmailAndPassword;
  13417. }()
  13418. }, {
  13419. key: "signInWithUsernameAndPassword",
  13420. value: function signInWithUsernameAndPassword(e, t) {
  13421. return new rt(this.config).signIn(e, t);
  13422. }
  13423. }, {
  13424. key: "linkAndRetrieveDataWithTicket",
  13425. value: function () {
  13426. var _linkAndRetrieveDataWithTicket2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25(e) {
  13427. return _regenerator.default.wrap(function _callee25$(_context25) {
  13428. while (1) {
  13429. switch (_context25.prev = _context25.next) {
  13430. case 0:
  13431. this._anonymousAuthProvider || (this._anonymousAuthProvider = new tt(this.config)), De($e, this._onAnonymousConverted);
  13432. _context25.next = 3;
  13433. return this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e);
  13434. case 3:
  13435. return _context25.abrupt("return", _context25.sent);
  13436. case 4:
  13437. case "end":
  13438. return _context25.stop();
  13439. }
  13440. }
  13441. }, _callee25, this);
  13442. }));
  13443. function linkAndRetrieveDataWithTicket(_x21) {
  13444. return _linkAndRetrieveDataWithTicket2.apply(this, arguments);
  13445. }
  13446. return linkAndRetrieveDataWithTicket;
  13447. }()
  13448. }, {
  13449. key: "signOut",
  13450. value: function () {
  13451. var _signOut = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
  13452. var _this$_cache$keys10, e, t, n, s, r;
  13453. return _regenerator.default.wrap(function _callee26$(_context26) {
  13454. while (1) {
  13455. switch (_context26.prev = _context26.next) {
  13456. case 0:
  13457. if (!(this.loginType === We.ANONYMOUS)) {
  13458. _context26.next = 2;
  13459. break;
  13460. }
  13461. throw new te({
  13462. message: "匿名用户不支持登出操作"
  13463. });
  13464. case 2:
  13465. _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);
  13466. if (s) {
  13467. _context26.next = 5;
  13468. break;
  13469. }
  13470. return _context26.abrupt("return");
  13471. case 5:
  13472. _context26.next = 7;
  13473. return this._request.send("auth.logout", {
  13474. refresh_token: s
  13475. });
  13476. case 7:
  13477. r = _context26.sent;
  13478. return _context26.abrupt("return", (this._cache.removeStore(e), this._cache.removeStore(t), this._cache.removeStore(n), Me(Fe), Me(je, {
  13479. env: this.config.env,
  13480. loginType: We.NULL,
  13481. persistence: this.config.persistence
  13482. }), r));
  13483. case 9:
  13484. case "end":
  13485. return _context26.stop();
  13486. }
  13487. }
  13488. }, _callee26, this);
  13489. }));
  13490. function signOut() {
  13491. return _signOut.apply(this, arguments);
  13492. }
  13493. return signOut;
  13494. }()
  13495. }, {
  13496. key: "signUpWithEmailAndPassword",
  13497. value: function () {
  13498. var _signUpWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27(e, t) {
  13499. return _regenerator.default.wrap(function _callee27$(_context27) {
  13500. while (1) {
  13501. switch (_context27.prev = _context27.next) {
  13502. case 0:
  13503. return _context27.abrupt("return", this._request.send("auth.signUpWithEmailAndPassword", {
  13504. email: e,
  13505. password: t
  13506. }));
  13507. case 1:
  13508. case "end":
  13509. return _context27.stop();
  13510. }
  13511. }
  13512. }, _callee27, this);
  13513. }));
  13514. function signUpWithEmailAndPassword(_x22, _x23) {
  13515. return _signUpWithEmailAndPassword.apply(this, arguments);
  13516. }
  13517. return signUpWithEmailAndPassword;
  13518. }()
  13519. }, {
  13520. key: "sendPasswordResetEmail",
  13521. value: function () {
  13522. var _sendPasswordResetEmail = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28(e) {
  13523. return _regenerator.default.wrap(function _callee28$(_context28) {
  13524. while (1) {
  13525. switch (_context28.prev = _context28.next) {
  13526. case 0:
  13527. return _context28.abrupt("return", this._request.send("auth.sendPasswordResetEmail", {
  13528. email: e
  13529. }));
  13530. case 1:
  13531. case "end":
  13532. return _context28.stop();
  13533. }
  13534. }
  13535. }, _callee28, this);
  13536. }));
  13537. function sendPasswordResetEmail(_x24) {
  13538. return _sendPasswordResetEmail.apply(this, arguments);
  13539. }
  13540. return sendPasswordResetEmail;
  13541. }()
  13542. }, {
  13543. key: "onLoginStateChanged",
  13544. value: function onLoginStateChanged(e) {
  13545. var _this9 = this;
  13546. De(Fe, function () {
  13547. var t = _this9.hasLoginState();
  13548. e.call(_this9, t);
  13549. });
  13550. var t = this.hasLoginState();
  13551. e.call(this, t);
  13552. }
  13553. }, {
  13554. key: "onLoginStateExpired",
  13555. value: function onLoginStateExpired(e) {
  13556. De(Ke, e.bind(this));
  13557. }
  13558. }, {
  13559. key: "onAccessTokenRefreshed",
  13560. value: function onAccessTokenRefreshed(e) {
  13561. De(Be, e.bind(this));
  13562. }
  13563. }, {
  13564. key: "onAnonymousConverted",
  13565. value: function onAnonymousConverted(e) {
  13566. De($e, e.bind(this));
  13567. }
  13568. }, {
  13569. key: "onLoginTypeChanged",
  13570. value: function onLoginTypeChanged(e) {
  13571. var _this10 = this;
  13572. De(je, function () {
  13573. var t = _this10.hasLoginState();
  13574. e.call(_this10, t);
  13575. });
  13576. }
  13577. }, {
  13578. key: "getAccessToken",
  13579. value: function () {
  13580. var _getAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
  13581. return _regenerator.default.wrap(function _callee29$(_context29) {
  13582. while (1) {
  13583. switch (_context29.prev = _context29.next) {
  13584. case 0:
  13585. _context29.next = 2;
  13586. return this._request.getAccessToken();
  13587. case 2:
  13588. _context29.t0 = _context29.sent.accessToken;
  13589. _context29.t1 = this.config.env;
  13590. return _context29.abrupt("return", {
  13591. accessToken: _context29.t0,
  13592. env: _context29.t1
  13593. });
  13594. case 5:
  13595. case "end":
  13596. return _context29.stop();
  13597. }
  13598. }
  13599. }, _callee29, this);
  13600. }));
  13601. function getAccessToken() {
  13602. return _getAccessToken2.apply(this, arguments);
  13603. }
  13604. return getAccessToken;
  13605. }()
  13606. }, {
  13607. key: "hasLoginState",
  13608. value: function hasLoginState() {
  13609. var e = this._cache.keys.refreshTokenKey;
  13610. return this._cache.getStore(e) ? new et(this.config.env) : null;
  13611. }
  13612. }, {
  13613. key: "isUsernameRegistered",
  13614. value: function () {
  13615. var _isUsernameRegistered = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(e) {
  13616. var _yield$this$_request$5, t;
  13617. return _regenerator.default.wrap(function _callee30$(_context30) {
  13618. while (1) {
  13619. switch (_context30.prev = _context30.next) {
  13620. case 0:
  13621. if (!("string" != typeof e)) {
  13622. _context30.next = 2;
  13623. break;
  13624. }
  13625. throw new te({
  13626. code: "PARAM_ERROR",
  13627. message: "username must be a string"
  13628. });
  13629. case 2:
  13630. _context30.next = 4;
  13631. return this._request.send("auth.isUsernameRegistered", {
  13632. username: e
  13633. });
  13634. case 4:
  13635. _yield$this$_request$5 = _context30.sent;
  13636. t = _yield$this$_request$5.data;
  13637. return _context30.abrupt("return", t && t.isRegistered);
  13638. case 7:
  13639. case "end":
  13640. return _context30.stop();
  13641. }
  13642. }
  13643. }, _callee30, this);
  13644. }));
  13645. function isUsernameRegistered(_x25) {
  13646. return _isUsernameRegistered.apply(this, arguments);
  13647. }
  13648. return isUsernameRegistered;
  13649. }()
  13650. }, {
  13651. key: "getLoginState",
  13652. value: function getLoginState() {
  13653. return Promise.resolve(this.hasLoginState());
  13654. }
  13655. }, {
  13656. key: "signInWithTicket",
  13657. value: function () {
  13658. var _signInWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(e) {
  13659. return _regenerator.default.wrap(function _callee31$(_context31) {
  13660. while (1) {
  13661. switch (_context31.prev = _context31.next) {
  13662. case 0:
  13663. return _context31.abrupt("return", new nt(this.config).signIn(e));
  13664. case 1:
  13665. case "end":
  13666. return _context31.stop();
  13667. }
  13668. }
  13669. }, _callee31, this);
  13670. }));
  13671. function signInWithTicket(_x26) {
  13672. return _signInWithTicket.apply(this, arguments);
  13673. }
  13674. return signInWithTicket;
  13675. }()
  13676. }, {
  13677. key: "shouldRefreshAccessToken",
  13678. value: function shouldRefreshAccessToken(e) {
  13679. this._request._shouldRefreshAccessTokenHook = e.bind(this);
  13680. }
  13681. }, {
  13682. key: "getUserInfo",
  13683. value: function getUserInfo() {
  13684. return this._request.send("auth.getUserInfo", {}).then(function (e) {
  13685. return e.code ? e : _objectSpread(_objectSpread({}, e.data), {}, {
  13686. requestId: e.seqId
  13687. });
  13688. });
  13689. }
  13690. }, {
  13691. key: "getAuthHeader",
  13692. value: function getAuthHeader() {
  13693. var _this$_cache$keys11 = this._cache.keys,
  13694. e = _this$_cache$keys11.refreshTokenKey,
  13695. t = _this$_cache$keys11.accessTokenKey,
  13696. n = this._cache.getStore(e);
  13697. return {
  13698. "x-cloudbase-credentials": this._cache.getStore(t) + "/@@/" + n
  13699. };
  13700. }
  13701. }, {
  13702. key: "_onAnonymousConverted",
  13703. value: function _onAnonymousConverted(e) {
  13704. var t = e.data.env;
  13705. t === this.config.env && this._cache.updatePersistence(this.config.persistence);
  13706. }
  13707. }, {
  13708. key: "_onLoginTypeChanged",
  13709. value: function _onLoginTypeChanged(e) {
  13710. var _e$data = e.data,
  13711. t = _e$data.loginType,
  13712. n = _e$data.persistence,
  13713. s = _e$data.env;
  13714. s === this.config.env && (this._cache.updatePersistence(n), this._cache.setStore(this._cache.keys.loginTypeKey, t));
  13715. }
  13716. }]);
  13717. return it;
  13718. }();
  13719. var ot = function ot(e, t) {
  13720. t = t || ve();
  13721. var n = Qe(this.config.env),
  13722. s = e.cloudPath,
  13723. r = e.filePath,
  13724. i = e.onUploadProgress,
  13725. _e$fileType = e.fileType,
  13726. o = _e$fileType === void 0 ? "image" : _e$fileType;
  13727. return n.send("storage.getUploadMetadata", {
  13728. path: s
  13729. }).then(function (e) {
  13730. var _e$data2 = e.data,
  13731. a = _e$data2.url,
  13732. c = _e$data2.authorization,
  13733. u = _e$data2.token,
  13734. h = _e$data2.fileId,
  13735. l = _e$data2.cosFileId,
  13736. d = e.requestId,
  13737. p = {
  13738. key: s,
  13739. signature: c,
  13740. "x-cos-meta-fileid": l,
  13741. success_action_status: "201",
  13742. "x-cos-security-token": u
  13743. };
  13744. n.upload({
  13745. url: a,
  13746. data: p,
  13747. file: r,
  13748. name: s,
  13749. fileType: o,
  13750. onUploadProgress: i
  13751. }).then(function (e) {
  13752. 201 === e.statusCode ? t(null, {
  13753. fileID: h,
  13754. requestId: d
  13755. }) : t(new te({
  13756. code: "STORAGE_REQUEST_FAIL",
  13757. message: "STORAGE_REQUEST_FAIL: ".concat(e.data)
  13758. }));
  13759. }).catch(function (e) {
  13760. t(e);
  13761. });
  13762. }).catch(function (e) {
  13763. t(e);
  13764. }), t.promise;
  13765. },
  13766. at = function at(e, t) {
  13767. t = t || ve();
  13768. var n = Qe(this.config.env),
  13769. s = e.cloudPath;
  13770. return n.send("storage.getUploadMetadata", {
  13771. path: s
  13772. }).then(function (e) {
  13773. t(null, e);
  13774. }).catch(function (e) {
  13775. t(e);
  13776. }), t.promise;
  13777. },
  13778. ct = function ct(_ref7, t) {
  13779. var e = _ref7.fileList;
  13780. if (t = t || ve(), !e || !Array.isArray(e)) return {
  13781. code: "INVALID_PARAM",
  13782. message: "fileList必须是非空的数组"
  13783. };
  13784. var _iterator3 = _createForOfIteratorHelper(e),
  13785. _step3;
  13786. try {
  13787. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  13788. var _t8 = _step3.value;
  13789. if (!_t8 || "string" != typeof _t8) return {
  13790. code: "INVALID_PARAM",
  13791. message: "fileList的元素必须是非空的字符串"
  13792. };
  13793. }
  13794. } catch (err) {
  13795. _iterator3.e(err);
  13796. } finally {
  13797. _iterator3.f();
  13798. }
  13799. var n = {
  13800. fileid_list: e
  13801. };
  13802. return Qe(this.config.env).send("storage.batchDeleteFile", n).then(function (e) {
  13803. e.code ? t(null, e) : t(null, {
  13804. fileList: e.data.delete_list,
  13805. requestId: e.requestId
  13806. });
  13807. }).catch(function (e) {
  13808. t(e);
  13809. }), t.promise;
  13810. },
  13811. ut = function ut(_ref8, t) {
  13812. var e = _ref8.fileList;
  13813. t = t || ve(), e && Array.isArray(e) || t(null, {
  13814. code: "INVALID_PARAM",
  13815. message: "fileList必须是非空的数组"
  13816. });
  13817. var n = [];
  13818. var _iterator4 = _createForOfIteratorHelper(e),
  13819. _step4;
  13820. try {
  13821. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  13822. var _s9 = _step4.value;
  13823. "object" == (0, _typeof2.default)(_s9) ? (_s9.hasOwnProperty("fileID") && _s9.hasOwnProperty("maxAge") || t(null, {
  13824. code: "INVALID_PARAM",
  13825. message: "fileList的元素必须是包含fileID和maxAge的对象"
  13826. }), n.push({
  13827. fileid: _s9.fileID,
  13828. max_age: _s9.maxAge
  13829. })) : "string" == typeof _s9 ? n.push({
  13830. fileid: _s9
  13831. }) : t(null, {
  13832. code: "INVALID_PARAM",
  13833. message: "fileList的元素必须是字符串"
  13834. });
  13835. }
  13836. } catch (err) {
  13837. _iterator4.e(err);
  13838. } finally {
  13839. _iterator4.f();
  13840. }
  13841. var s = {
  13842. file_list: n
  13843. };
  13844. return Qe(this.config.env).send("storage.batchGetDownloadUrl", s).then(function (e) {
  13845. e.code ? t(null, e) : t(null, {
  13846. fileList: e.data.download_list,
  13847. requestId: e.requestId
  13848. });
  13849. }).catch(function (e) {
  13850. t(e);
  13851. }), t.promise;
  13852. },
  13853. ht = /*#__PURE__*/function () {
  13854. var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(_ref9, t) {
  13855. var e, n, s, r;
  13856. return _regenerator.default.wrap(function _callee32$(_context32) {
  13857. while (1) {
  13858. switch (_context32.prev = _context32.next) {
  13859. case 0:
  13860. e = _ref9.fileID;
  13861. _context32.next = 3;
  13862. return ut.call(this, {
  13863. fileList: [{
  13864. fileID: e,
  13865. maxAge: 600
  13866. }]
  13867. });
  13868. case 3:
  13869. n = _context32.sent.fileList[0];
  13870. if (!("SUCCESS" !== n.code)) {
  13871. _context32.next = 6;
  13872. break;
  13873. }
  13874. return _context32.abrupt("return", t ? t(n) : new Promise(function (e) {
  13875. e(n);
  13876. }));
  13877. case 6:
  13878. s = Qe(this.config.env);
  13879. r = n.download_url;
  13880. if (!(r = encodeURI(r), !t)) {
  13881. _context32.next = 10;
  13882. break;
  13883. }
  13884. return _context32.abrupt("return", s.download({
  13885. url: r
  13886. }));
  13887. case 10:
  13888. _context32.t0 = t;
  13889. _context32.next = 13;
  13890. return s.download({
  13891. url: r
  13892. });
  13893. case 13:
  13894. _context32.t1 = _context32.sent;
  13895. (0, _context32.t0)(_context32.t1);
  13896. case 15:
  13897. case "end":
  13898. return _context32.stop();
  13899. }
  13900. }
  13901. }, _callee32, this);
  13902. }));
  13903. return function ht(_x27, _x28) {
  13904. return _ref10.apply(this, arguments);
  13905. };
  13906. }(),
  13907. lt = function lt(_ref11, i) {
  13908. var e = _ref11.name,
  13909. t = _ref11.data,
  13910. n = _ref11.query,
  13911. s = _ref11.parse,
  13912. r = _ref11.search;
  13913. var o = i || ve();
  13914. var a;
  13915. try {
  13916. a = t ? JSON.stringify(t) : "";
  13917. } catch (e) {
  13918. return Promise.reject(e);
  13919. }
  13920. if (!e) return Promise.reject(new te({
  13921. code: "PARAM_ERROR",
  13922. message: "函数名不能为空"
  13923. }));
  13924. var c = {
  13925. inQuery: n,
  13926. parse: s,
  13927. search: r,
  13928. function_name: e,
  13929. request_data: a
  13930. };
  13931. return Qe(this.config.env).send("functions.invokeFunction", c).then(function (e) {
  13932. if (e.code) o(null, e);else {
  13933. var _t9 = e.data.response_data;
  13934. if (s) o(null, {
  13935. result: _t9,
  13936. requestId: e.requestId
  13937. });else try {
  13938. _t9 = JSON.parse(e.data.response_data), o(null, {
  13939. result: _t9,
  13940. requestId: e.requestId
  13941. });
  13942. } catch (e) {
  13943. o(new te({
  13944. message: "response data must be json"
  13945. }));
  13946. }
  13947. }
  13948. return o.promise;
  13949. }).catch(function (e) {
  13950. o(e);
  13951. }), o.promise;
  13952. },
  13953. dt = {
  13954. timeout: 15e3,
  13955. persistence: "session"
  13956. },
  13957. pt = {};
  13958. var ft = /*#__PURE__*/function () {
  13959. function ft(e) {
  13960. (0, _classCallCheck2.default)(this, ft);
  13961. this.config = e || this.config, this.authObj = void 0;
  13962. }
  13963. (0, _createClass2.default)(ft, [{
  13964. key: "init",
  13965. value: function init(e) {
  13966. switch (Ae.adapter || (this.requestClient = new Ae.adapter.reqClass({
  13967. timeout: e.timeout || 5e3,
  13968. timeoutMsg: "\u8BF7\u6C42\u5728".concat((e.timeout || 5e3) / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD")
  13969. })), this.config = _objectSpread(_objectSpread({}, dt), e), !0) {
  13970. case this.config.timeout > 6e5:
  13971. console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
  13972. break;
  13973. case this.config.timeout < 100:
  13974. console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
  13975. }
  13976. return new ft(this.config);
  13977. }
  13978. }, {
  13979. key: "auth",
  13980. value: function auth() {
  13981. var _ref12 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13982. e = _ref12.persistence;
  13983. if (this.authObj) return this.authObj;
  13984. var t = e || Ae.adapter.primaryStorage || dt.persistence;
  13985. var n;
  13986. return t !== this.config.persistence && (this.config.persistence = t), function (e) {
  13987. var t = e.env;
  13988. Oe[t] = new xe(e), Ee[t] = new xe(_objectSpread(_objectSpread({}, e), {}, {
  13989. persistence: "local"
  13990. }));
  13991. }(this.config), n = this.config, Ye[n.env] = new Ge(n), this.authObj = new it(this.config), this.authObj;
  13992. }
  13993. }, {
  13994. key: "on",
  13995. value: function on(e, t) {
  13996. return De.apply(this, [e, t]);
  13997. }
  13998. }, {
  13999. key: "off",
  14000. value: function off(e, t) {
  14001. return qe.apply(this, [e, t]);
  14002. }
  14003. }, {
  14004. key: "callFunction",
  14005. value: function callFunction(e, t) {
  14006. return lt.apply(this, [e, t]);
  14007. }
  14008. }, {
  14009. key: "deleteFile",
  14010. value: function deleteFile(e, t) {
  14011. return ct.apply(this, [e, t]);
  14012. }
  14013. }, {
  14014. key: "getTempFileURL",
  14015. value: function getTempFileURL(e, t) {
  14016. return ut.apply(this, [e, t]);
  14017. }
  14018. }, {
  14019. key: "downloadFile",
  14020. value: function downloadFile(e, t) {
  14021. return ht.apply(this, [e, t]);
  14022. }
  14023. }, {
  14024. key: "uploadFile",
  14025. value: function uploadFile(e, t) {
  14026. return ot.apply(this, [e, t]);
  14027. }
  14028. }, {
  14029. key: "getUploadMetadata",
  14030. value: function getUploadMetadata(e, t) {
  14031. return at.apply(this, [e, t]);
  14032. }
  14033. }, {
  14034. key: "registerExtension",
  14035. value: function registerExtension(e) {
  14036. pt[e.name] = e;
  14037. }
  14038. }, {
  14039. key: "invokeExtension",
  14040. value: function () {
  14041. var _invokeExtension = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(e, t) {
  14042. var n;
  14043. return _regenerator.default.wrap(function _callee33$(_context33) {
  14044. while (1) {
  14045. switch (_context33.prev = _context33.next) {
  14046. case 0:
  14047. n = pt[e];
  14048. if (n) {
  14049. _context33.next = 3;
  14050. break;
  14051. }
  14052. throw new te({
  14053. message: "\u6269\u5C55".concat(e, " \u5FC5\u987B\u5148\u6CE8\u518C")
  14054. });
  14055. case 3:
  14056. _context33.next = 5;
  14057. return n.invoke(t, this);
  14058. case 5:
  14059. return _context33.abrupt("return", _context33.sent);
  14060. case 6:
  14061. case "end":
  14062. return _context33.stop();
  14063. }
  14064. }
  14065. }, _callee33, this);
  14066. }));
  14067. function invokeExtension(_x29, _x30) {
  14068. return _invokeExtension.apply(this, arguments);
  14069. }
  14070. return invokeExtension;
  14071. }()
  14072. }, {
  14073. key: "useAdapters",
  14074. value: function useAdapters(e) {
  14075. var _ref13 = ke(e) || {},
  14076. t = _ref13.adapter,
  14077. n = _ref13.runtime;
  14078. t && (Ae.adapter = t), n && (Ae.runtime = n);
  14079. }
  14080. }]);
  14081. return ft;
  14082. }();
  14083. var gt = new ft();
  14084. function mt(e, t, n) {
  14085. void 0 === n && (n = {});
  14086. var s = /\?/.test(t),
  14087. r = "";
  14088. for (var i in n) {
  14089. "" === r ? !s && (t += "?") : r += "&", r += i + "=" + encodeURIComponent(n[i]);
  14090. }
  14091. return /^http(s)?:\/\//.test(t += r) ? t : "" + e + t;
  14092. }
  14093. var yt = /*#__PURE__*/function () {
  14094. function yt() {
  14095. (0, _classCallCheck2.default)(this, yt);
  14096. }
  14097. (0, _createClass2.default)(yt, [{
  14098. key: "post",
  14099. value: function post(e) {
  14100. var t = e.url,
  14101. n = e.data,
  14102. s = e.headers;
  14103. return new Promise(function (e, r) {
  14104. ne.request({
  14105. url: mt("https:", t),
  14106. data: n,
  14107. method: "POST",
  14108. header: s,
  14109. success: function success(t) {
  14110. e(t);
  14111. },
  14112. fail: function fail(e) {
  14113. r(e);
  14114. }
  14115. });
  14116. });
  14117. }
  14118. }, {
  14119. key: "upload",
  14120. value: function upload(e) {
  14121. return new Promise(function (t, n) {
  14122. var s = e.url,
  14123. r = e.file,
  14124. i = e.data,
  14125. o = e.headers,
  14126. a = e.fileType,
  14127. c = ne.uploadFile({
  14128. url: mt("https:", s),
  14129. name: "file",
  14130. formData: Object.assign({}, i),
  14131. filePath: r,
  14132. fileType: a,
  14133. header: o,
  14134. success: function success(e) {
  14135. var n = {
  14136. statusCode: e.statusCode,
  14137. data: e.data || {}
  14138. };
  14139. 200 === e.statusCode && i.success_action_status && (n.statusCode = parseInt(i.success_action_status, 10)), t(n);
  14140. },
  14141. fail: function fail(e) {
  14142. n(new Error(e.errMsg || "uploadFile:fail"));
  14143. }
  14144. });
  14145. "function" == typeof e.onUploadProgress && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (t) {
  14146. e.onUploadProgress({
  14147. loaded: t.totalBytesSent,
  14148. total: t.totalBytesExpectedToSend
  14149. });
  14150. });
  14151. });
  14152. }
  14153. }]);
  14154. return yt;
  14155. }();
  14156. var _t = {
  14157. setItem: function setItem(e, t) {
  14158. ne.setStorageSync(e, t);
  14159. },
  14160. getItem: function getItem(e) {
  14161. return ne.getStorageSync(e);
  14162. },
  14163. removeItem: function removeItem(e) {
  14164. ne.removeStorageSync(e);
  14165. },
  14166. clear: function clear() {
  14167. ne.clearStorageSync();
  14168. }
  14169. };
  14170. var wt = {
  14171. genAdapter: function genAdapter() {
  14172. return {
  14173. root: {},
  14174. reqClass: yt,
  14175. localStorage: _t,
  14176. primaryStorage: "local"
  14177. };
  14178. },
  14179. isMatch: function isMatch() {
  14180. return !0;
  14181. },
  14182. runtime: "uni_app"
  14183. };
  14184. gt.useAdapters(wt);
  14185. var vt = gt,
  14186. It = vt.init;
  14187. vt.init = function (e) {
  14188. e.env = e.spaceId;
  14189. var t = It.call(this, e);
  14190. t.config.provider = "tencent", t.config.spaceId = e.spaceId;
  14191. var n = t.auth;
  14192. return t.auth = function (e) {
  14193. var t = n.call(this, e);
  14194. return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach(function (e) {
  14195. var n;
  14196. t[e] = (n = t[e], function (e) {
  14197. e = e || {};
  14198. var _ee = ee(e),
  14199. t = _ee.success,
  14200. s = _ee.fail,
  14201. r = _ee.complete;
  14202. if (!(t || s || r)) return n.call(this, e);
  14203. n.call(this, e).then(function (e) {
  14204. t && t(e), r && r(e);
  14205. }, function (e) {
  14206. s && s(e), r && r(e);
  14207. });
  14208. }).bind(t);
  14209. }), t;
  14210. }, t.customAuth = t.auth, t;
  14211. };
  14212. var St = vt;
  14213. var bt = /*#__PURE__*/function (_de) {
  14214. (0, _inherits2.default)(bt, _de);
  14215. var _super8 = _createSuper(bt);
  14216. function bt() {
  14217. (0, _classCallCheck2.default)(this, bt);
  14218. return _super8.apply(this, arguments);
  14219. }
  14220. (0, _createClass2.default)(bt, [{
  14221. key: "getAccessToken",
  14222. value: function getAccessToken() {
  14223. var _this11 = this;
  14224. return new Promise(function (e, t) {
  14225. var n = "Anonymous_Access_token";
  14226. _this11.setAccessToken(n), e(n);
  14227. });
  14228. }
  14229. }, {
  14230. key: "setupRequest",
  14231. value: function setupRequest(e, t) {
  14232. var n = Object.assign({}, e, {
  14233. spaceId: this.config.spaceId,
  14234. timestamp: Date.now()
  14235. }),
  14236. s = {
  14237. "Content-Type": "application/json"
  14238. };
  14239. "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = le.sign(n, this.config.clientSecret);
  14240. var r = he();
  14241. s["x-client-info"] = encodeURIComponent(JSON.stringify(r));
  14242. var _se = se(),
  14243. i = _se.token;
  14244. return s["x-client-token"] = i, {
  14245. url: this.config.requestUrl,
  14246. method: "POST",
  14247. data: n,
  14248. dataType: "json",
  14249. header: JSON.parse(JSON.stringify(s))
  14250. };
  14251. }
  14252. }, {
  14253. key: "uploadFileToOSS",
  14254. value: function uploadFileToOSS(_ref14) {
  14255. var _this12 = this;
  14256. var e = _ref14.url,
  14257. t = _ref14.formData,
  14258. n = _ref14.name,
  14259. s = _ref14.filePath,
  14260. r = _ref14.fileType,
  14261. i = _ref14.onUploadProgress;
  14262. return new Promise(function (o, a) {
  14263. var c = _this12.adapter.uploadFile({
  14264. url: e,
  14265. formData: t,
  14266. name: n,
  14267. filePath: s,
  14268. fileType: r,
  14269. success: function success(e) {
  14270. e && e.statusCode < 400 ? o(e) : a(new te({
  14271. code: "UPLOAD_FAILED",
  14272. message: "文件上传失败"
  14273. }));
  14274. },
  14275. fail: function fail(e) {
  14276. a(new te({
  14277. code: e.code || "UPLOAD_FAILED",
  14278. message: e.message || e.errMsg || "文件上传失败"
  14279. }));
  14280. }
  14281. });
  14282. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  14283. i({
  14284. loaded: e.totalBytesSent,
  14285. total: e.totalBytesExpectedToSend
  14286. });
  14287. });
  14288. });
  14289. }
  14290. }, {
  14291. key: "uploadFile",
  14292. value: function uploadFile(_ref15) {
  14293. var _this13 = this;
  14294. var e = _ref15.filePath,
  14295. t = _ref15.cloudPath,
  14296. _ref15$fileType = _ref15.fileType,
  14297. n = _ref15$fileType === void 0 ? "image" : _ref15$fileType,
  14298. s = _ref15.onUploadProgress;
  14299. if (!t) throw new te({
  14300. code: "CLOUDPATH_REQUIRED",
  14301. message: "cloudPath不可为空"
  14302. });
  14303. var r;
  14304. return this.getOSSUploadOptionsFromPath({
  14305. cloudPath: t
  14306. }).then(function (t) {
  14307. var _t$result = t.result,
  14308. i = _t$result.url,
  14309. o = _t$result.formData,
  14310. a = _t$result.name;
  14311. r = t.result.fileUrl;
  14312. var c = {
  14313. url: i,
  14314. formData: o,
  14315. name: a,
  14316. filePath: e,
  14317. fileType: n
  14318. };
  14319. return _this13.uploadFileToOSS(Object.assign({}, c, {
  14320. onUploadProgress: s
  14321. }));
  14322. }).then(function () {
  14323. return _this13.reportOSSUpload({
  14324. cloudPath: t
  14325. });
  14326. }).then(function (t) {
  14327. return new Promise(function (n, s) {
  14328. t.success ? n({
  14329. success: !0,
  14330. filePath: e,
  14331. fileID: r
  14332. }) : s(new te({
  14333. code: "UPLOAD_FAILED",
  14334. message: "文件上传失败"
  14335. }));
  14336. });
  14337. });
  14338. }
  14339. }, {
  14340. key: "deleteFile",
  14341. value: function deleteFile(_ref16) {
  14342. var e = _ref16.fileList;
  14343. var t = {
  14344. method: "serverless.file.resource.delete",
  14345. params: JSON.stringify({
  14346. fileList: e
  14347. })
  14348. };
  14349. return this.request(this.setupRequest(t)).then(function (e) {
  14350. if (e.success) return e.result;
  14351. throw new te({
  14352. code: "DELETE_FILE_FAILED",
  14353. message: "删除文件失败"
  14354. });
  14355. });
  14356. }
  14357. }, {
  14358. key: "getTempFileURL",
  14359. value: function getTempFileURL() {
  14360. var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14361. e = _ref17.fileList,
  14362. t = _ref17.maxAge;
  14363. if (!Array.isArray(e) || 0 === e.length) throw new te({
  14364. code: "INVALID_PARAM",
  14365. message: "fileList的元素必须是非空的字符串"
  14366. });
  14367. var n = {
  14368. method: "serverless.file.resource.getTempFileURL",
  14369. params: JSON.stringify({
  14370. fileList: e,
  14371. maxAge: t
  14372. })
  14373. };
  14374. return this.request(this.setupRequest(n)).then(function (e) {
  14375. if (e.success) return {
  14376. fileList: e.result.fileList.map(function (e) {
  14377. return {
  14378. fileID: e.fileID,
  14379. tempFileURL: e.tempFileURL
  14380. };
  14381. })
  14382. };
  14383. throw new te({
  14384. code: "GET_TEMP_FILE_URL_FAILED",
  14385. message: "获取临时文件链接失败"
  14386. });
  14387. });
  14388. }
  14389. }]);
  14390. return bt;
  14391. }(de);
  14392. var kt = {
  14393. init: function init(e) {
  14394. var t = new bt(e),
  14395. n = {
  14396. signInAnonymously: function signInAnonymously() {
  14397. return t.authorize();
  14398. },
  14399. getLoginState: function getLoginState() {
  14400. return Promise.resolve(!1);
  14401. }
  14402. };
  14403. return t.auth = function () {
  14404. return n;
  14405. }, t.customAuth = t.auth, t;
  14406. }
  14407. },
  14408. At = n(function (e, t) {
  14409. e.exports = r.enc.Hex;
  14410. });
  14411. function Ct() {
  14412. return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (e) {
  14413. var t = 16 * Math.random() | 0;
  14414. return ("x" === e ? t : 3 & t | 8).toString(16);
  14415. });
  14416. }
  14417. function Pt() {
  14418. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  14419. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  14420. var n = t.data,
  14421. s = t.functionName,
  14422. r = t.method,
  14423. i = t.headers,
  14424. _t$signHeaderKeys = t.signHeaderKeys,
  14425. o = _t$signHeaderKeys === void 0 ? [] : _t$signHeaderKeys,
  14426. a = t.config,
  14427. c = Date.now(),
  14428. u = Ct(),
  14429. h = Object.assign({}, i, {
  14430. "x-from-app-id": a.spaceAppId,
  14431. "x-from-env-id": a.spaceId,
  14432. "x-to-env-id": a.spaceId,
  14433. "x-from-instance-id": c,
  14434. "x-from-function-name": s,
  14435. "x-client-timestamp": c,
  14436. "x-alipay-source": "client",
  14437. "x-request-id": u,
  14438. "x-alipay-callid": u,
  14439. "x-trace-id": u
  14440. }),
  14441. l = ["x-from-app-id", "x-from-env-id", "x-to-env-id", "x-from-instance-id", "x-from-function-name", "x-client-timestamp"].concat(o),
  14442. _ref18 = e.split("?") || [],
  14443. _ref19 = (0, _slicedToArray2.default)(_ref18, 2),
  14444. _ref19$ = _ref19[0],
  14445. d = _ref19$ === void 0 ? "" : _ref19$,
  14446. _ref19$2 = _ref19[1],
  14447. p = _ref19$2 === void 0 ? "" : _ref19$2,
  14448. f = function (e) {
  14449. var t = e.signedHeaders.join(";"),
  14450. n = e.signedHeaders.map(function (t) {
  14451. return "".concat(t.toLowerCase(), ":").concat(e.headers[t], "\n");
  14452. }).join(""),
  14453. s = _e(e.body).toString(At),
  14454. r = "".concat(e.method.toUpperCase(), "\n").concat(e.path, "\n").concat(e.query, "\n").concat(n, "\n").concat(t, "\n").concat(s, "\n"),
  14455. i = _e(r).toString(At),
  14456. o = "HMAC-SHA256\n".concat(e.timestamp, "\n").concat(i, "\n"),
  14457. a = we(o, e.secretKey).toString(At);
  14458. return "HMAC-SHA256 Credential=".concat(e.secretId, ", SignedHeaders=").concat(t, ", Signature=").concat(a);
  14459. }({
  14460. path: d,
  14461. query: p,
  14462. method: r,
  14463. headers: h,
  14464. timestamp: c,
  14465. body: JSON.stringify(n),
  14466. secretId: a.accessKey,
  14467. secretKey: a.secretKey,
  14468. signedHeaders: l.sort()
  14469. });
  14470. return {
  14471. url: "".concat(a.endpoint).concat(e),
  14472. headers: Object.assign({}, h, {
  14473. Authorization: f
  14474. })
  14475. };
  14476. }
  14477. function Tt(_ref20) {
  14478. var e = _ref20.url,
  14479. t = _ref20.data,
  14480. _ref20$method = _ref20.method,
  14481. n = _ref20$method === void 0 ? "POST" : _ref20$method,
  14482. _ref20$headers = _ref20.headers,
  14483. s = _ref20$headers === void 0 ? {} : _ref20$headers;
  14484. return new Promise(function (r, i) {
  14485. ne.request({
  14486. url: e,
  14487. method: n,
  14488. data: "object" == (0, _typeof2.default)(t) ? JSON.stringify(t) : t,
  14489. header: s,
  14490. dataType: "json",
  14491. complete: function complete() {
  14492. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  14493. var t = s["x-trace-id"] || "";
  14494. if (!e.statusCode || e.statusCode >= 400) {
  14495. var _ref21 = e.data || {},
  14496. _n8 = _ref21.message,
  14497. _s10 = _ref21.errMsg,
  14498. _r4 = _ref21.trace_id;
  14499. return i(new te({
  14500. code: "SYS_ERR",
  14501. message: _n8 || _s10 || "request:fail",
  14502. requestId: _r4 || t
  14503. }));
  14504. }
  14505. r({
  14506. status: e.statusCode,
  14507. data: e.data,
  14508. headers: e.header,
  14509. requestId: t
  14510. });
  14511. }
  14512. });
  14513. });
  14514. }
  14515. function xt(e, t) {
  14516. var n = e.path,
  14517. s = e.data,
  14518. _e$method = e.method,
  14519. r = _e$method === void 0 ? "GET" : _e$method,
  14520. _Pt = Pt(n, {
  14521. functionName: "",
  14522. data: s,
  14523. method: r,
  14524. headers: {
  14525. "x-alipay-cloud-mode": "oss",
  14526. "x-data-api-type": "oss",
  14527. "x-expire-timestamp": Date.now() + 6e4
  14528. },
  14529. signHeaderKeys: ["x-data-api-type", "x-expire-timestamp"],
  14530. config: t
  14531. }),
  14532. i = _Pt.url,
  14533. o = _Pt.headers;
  14534. return Tt({
  14535. url: i,
  14536. data: s,
  14537. method: r,
  14538. headers: o
  14539. }).then(function (e) {
  14540. var t = e.data || {};
  14541. if (!t.success) throw new te({
  14542. code: e.errCode,
  14543. message: e.errMsg,
  14544. requestId: e.requestId
  14545. });
  14546. return t.data || {};
  14547. }).catch(function (e) {
  14548. throw new te({
  14549. code: e.errCode,
  14550. message: e.errMsg,
  14551. requestId: e.requestId
  14552. });
  14553. });
  14554. }
  14555. function Ot() {
  14556. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  14557. var t = e.trim().replace(/^cloud:\/\//, ""),
  14558. n = t.indexOf("/");
  14559. if (n <= 0) throw new te({
  14560. code: "INVALID_PARAM",
  14561. message: "fileID不合法"
  14562. });
  14563. var s = t.substring(0, n),
  14564. r = t.substring(n + 1);
  14565. return s !== this.config.spaceId && console.warn("file ".concat(e, " does not belong to env ").concat(this.config.spaceId)), r;
  14566. }
  14567. function Et() {
  14568. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  14569. return "cloud://".concat(this.config.spaceId, "/").concat(e.replace(/^\/+/, ""));
  14570. }
  14571. var Lt = /*#__PURE__*/function () {
  14572. function Lt(e) {
  14573. (0, _classCallCheck2.default)(this, Lt);
  14574. this.config = e;
  14575. }
  14576. (0, _createClass2.default)(Lt, [{
  14577. key: "signedURL",
  14578. value: function signedURL(e) {
  14579. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  14580. var n = "/ws/function/".concat(e),
  14581. s = this.config.wsEndpoint.replace(/^ws(s)?:\/\//, ""),
  14582. r = Object.assign({}, t, {
  14583. accessKeyId: this.config.accessKey,
  14584. signatureNonce: Ct(),
  14585. timestamp: "" + Date.now()
  14586. }),
  14587. i = [n, ["accessKeyId", "authorization", "signatureNonce", "timestamp"].sort().map(function (e) {
  14588. return r[e] ? "".concat(e, "=").concat(r[e]) : null;
  14589. }).filter(Boolean).join("&"), "host:".concat(s)].join("\n"),
  14590. o = ["HMAC-SHA256", _e(i).toString(At)].join("\n"),
  14591. a = we(o, this.config.secretKey).toString(At),
  14592. c = Object.keys(r).map(function (e) {
  14593. return "".concat(e, "=").concat(encodeURIComponent(r[e]));
  14594. }).join("&");
  14595. return "".concat(this.config.wsEndpoint).concat(n, "?").concat(c, "&signature=").concat(a);
  14596. }
  14597. }]);
  14598. return Lt;
  14599. }();
  14600. var Rt = /*#__PURE__*/function () {
  14601. function Rt(e) {
  14602. (0, _classCallCheck2.default)(this, Rt);
  14603. if (["spaceId", "spaceAppId", "accessKey", "secretKey"].forEach(function (t) {
  14604. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error("".concat(t, " required"));
  14605. }), e.endpoint) {
  14606. if ("string" != typeof e.endpoint) throw new Error("endpoint must be string");
  14607. if (!/^https:\/\//.test(e.endpoint)) throw new Error("endpoint must start with https://");
  14608. e.endpoint = e.endpoint.replace(/\/$/, "");
  14609. }
  14610. this.config = Object.assign({}, e, {
  14611. endpoint: e.endpoint || "https://".concat(e.spaceId, ".api-hz.cloudbasefunction.cn"),
  14612. wsEndpoint: e.wsEndpoint || "wss://".concat(e.spaceId, ".api-hz.cloudbasefunction.cn")
  14613. }), this._websocket = new Lt(this.config);
  14614. }
  14615. (0, _createClass2.default)(Rt, [{
  14616. key: "callFunction",
  14617. value: function callFunction(e) {
  14618. return function (e, t) {
  14619. var n = e.name,
  14620. s = e.data,
  14621. _e$async = e.async,
  14622. r = _e$async === void 0 ? !1 : _e$async,
  14623. i = "POST",
  14624. o = {
  14625. "x-to-function-name": n
  14626. };
  14627. r && (o["x-function-invoke-type"] = "async");
  14628. var _Pt2 = Pt("/functions/invokeFunction", {
  14629. functionName: n,
  14630. data: s,
  14631. method: i,
  14632. headers: o,
  14633. signHeaderKeys: ["x-to-function-name"],
  14634. config: t
  14635. }),
  14636. a = _Pt2.url,
  14637. c = _Pt2.headers;
  14638. return Tt({
  14639. url: a,
  14640. data: s,
  14641. method: i,
  14642. headers: c
  14643. }).then(function (e) {
  14644. var t = 0;
  14645. if (r) {
  14646. var _n9 = e.data || {};
  14647. t = "200" === _n9.errCode ? 0 : _n9.errCode, e.data = _n9.data || {}, e.errMsg = _n9.errMsg;
  14648. }
  14649. if (0 !== t) throw new te({
  14650. code: t,
  14651. message: e.errMsg,
  14652. requestId: e.requestId
  14653. });
  14654. return {
  14655. errCode: t,
  14656. success: 0 === t,
  14657. requestId: e.requestId,
  14658. result: e.data
  14659. };
  14660. }).catch(function (e) {
  14661. throw new te({
  14662. code: e.errCode,
  14663. message: e.errMsg,
  14664. requestId: e.requestId
  14665. });
  14666. });
  14667. }(e, this.config);
  14668. }
  14669. }, {
  14670. key: "uploadFileToOSS",
  14671. value: function uploadFileToOSS(_ref22) {
  14672. var e = _ref22.url,
  14673. t = _ref22.filePath,
  14674. n = _ref22.fileType,
  14675. s = _ref22.formData,
  14676. r = _ref22.onUploadProgress;
  14677. return new Promise(function (i, o) {
  14678. var a = ne.uploadFile({
  14679. url: e,
  14680. filePath: t,
  14681. fileType: n,
  14682. formData: s,
  14683. name: "file",
  14684. success: function success(e) {
  14685. e && e.statusCode < 400 ? i(e) : o(new te({
  14686. code: "UPLOAD_FAILED",
  14687. message: "文件上传失败"
  14688. }));
  14689. },
  14690. fail: function fail(e) {
  14691. o(new te({
  14692. code: e.code || "UPLOAD_FAILED",
  14693. message: e.message || e.errMsg || "文件上传失败"
  14694. }));
  14695. }
  14696. });
  14697. "function" == typeof r && a && "function" == typeof a.onProgressUpdate && a.onProgressUpdate(function (e) {
  14698. r({
  14699. loaded: e.totalBytesSent,
  14700. total: e.totalBytesExpectedToSend
  14701. });
  14702. });
  14703. });
  14704. }
  14705. }, {
  14706. key: "uploadFile",
  14707. value: function () {
  14708. var _uploadFile2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(_ref23) {
  14709. var e, _ref23$cloudPath, t, _ref23$fileType, n, s, r, i, o, a, c;
  14710. return _regenerator.default.wrap(function _callee34$(_context34) {
  14711. while (1) {
  14712. switch (_context34.prev = _context34.next) {
  14713. case 0:
  14714. e = _ref23.filePath, _ref23$cloudPath = _ref23.cloudPath, t = _ref23$cloudPath === void 0 ? "" : _ref23$cloudPath, _ref23$fileType = _ref23.fileType, n = _ref23$fileType === void 0 ? "image" : _ref23$fileType, s = _ref23.onUploadProgress;
  14715. if (!("string" !== f(t))) {
  14716. _context34.next = 3;
  14717. break;
  14718. }
  14719. throw new te({
  14720. code: "INVALID_PARAM",
  14721. message: "cloudPath必须为字符串类型"
  14722. });
  14723. case 3:
  14724. if (t = t.trim()) {
  14725. _context34.next = 5;
  14726. break;
  14727. }
  14728. throw new te({
  14729. code: "INVALID_PARAM",
  14730. message: "cloudPath不可为空"
  14731. });
  14732. case 5:
  14733. if (!/:\/\//.test(t)) {
  14734. _context34.next = 7;
  14735. break;
  14736. }
  14737. throw new te({
  14738. code: "INVALID_PARAM",
  14739. message: "cloudPath不合法"
  14740. });
  14741. case 7:
  14742. _context34.next = 9;
  14743. return xt({
  14744. path: "/".concat(t.replace(/^\//, ""), "?post_url")
  14745. }, this.config);
  14746. case 9:
  14747. r = _context34.sent;
  14748. i = r.file_id;
  14749. o = r.upload_url;
  14750. a = r.form_data;
  14751. c = a && a.reduce(function (e, t) {
  14752. return e[t.key] = t.value, e;
  14753. }, {});
  14754. return _context34.abrupt("return", this.uploadFileToOSS({
  14755. url: o,
  14756. filePath: e,
  14757. fileType: n,
  14758. formData: c,
  14759. onUploadProgress: s
  14760. }).then(function () {
  14761. return {
  14762. fileID: i
  14763. };
  14764. }));
  14765. case 15:
  14766. case "end":
  14767. return _context34.stop();
  14768. }
  14769. }
  14770. }, _callee34, this);
  14771. }));
  14772. function uploadFile(_x31) {
  14773. return _uploadFile2.apply(this, arguments);
  14774. }
  14775. return uploadFile;
  14776. }()
  14777. }, {
  14778. key: "getTempFileURL",
  14779. value: function () {
  14780. var _getTempFileURL = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(_ref24) {
  14781. var _this14 = this;
  14782. var e;
  14783. return _regenerator.default.wrap(function _callee35$(_context35) {
  14784. while (1) {
  14785. switch (_context35.prev = _context35.next) {
  14786. case 0:
  14787. e = _ref24.fileList;
  14788. return _context35.abrupt("return", new Promise(function (t, n) {
  14789. (!e || e.length < 0) && n(new te({
  14790. errCode: "INVALID_PARAM",
  14791. errMsg: "fileList不能为空数组"
  14792. })), e.length > 50 && n(new te({
  14793. errCode: "INVALID_PARAM",
  14794. errMsg: "fileList数组长度不能超过50"
  14795. }));
  14796. var s = [];
  14797. var _iterator5 = _createForOfIteratorHelper(e),
  14798. _step5;
  14799. try {
  14800. for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
  14801. var _t10 = _step5.value;
  14802. "string" !== f(_t10) && n(new te({
  14803. errCode: "INVALID_PARAM",
  14804. errMsg: "fileList的元素必须是非空的字符串"
  14805. }));
  14806. var _e17 = Ot.call(_this14, _t10);
  14807. s.push({
  14808. file_id: _e17,
  14809. expire: 600
  14810. });
  14811. }
  14812. } catch (err) {
  14813. _iterator5.e(err);
  14814. } finally {
  14815. _iterator5.f();
  14816. }
  14817. xt({
  14818. path: "/?download_url",
  14819. data: {
  14820. file_list: s
  14821. },
  14822. method: "POST"
  14823. }, _this14.config).then(function (e) {
  14824. var _e$file_list = e.file_list,
  14825. n = _e$file_list === void 0 ? [] : _e$file_list;
  14826. t({
  14827. fileList: n.map(function (e) {
  14828. return {
  14829. fileID: Et.call(_this14, e.file_id),
  14830. tempFileURL: e.download_url
  14831. };
  14832. })
  14833. });
  14834. }).catch(function (e) {
  14835. return n(e);
  14836. });
  14837. }));
  14838. case 2:
  14839. case "end":
  14840. return _context35.stop();
  14841. }
  14842. }
  14843. }, _callee35);
  14844. }));
  14845. function getTempFileURL(_x32) {
  14846. return _getTempFileURL.apply(this, arguments);
  14847. }
  14848. return getTempFileURL;
  14849. }()
  14850. }, {
  14851. key: "connectWebSocket",
  14852. value: function () {
  14853. var _connectWebSocket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36(e) {
  14854. var t, n;
  14855. return _regenerator.default.wrap(function _callee36$(_context36) {
  14856. while (1) {
  14857. switch (_context36.prev = _context36.next) {
  14858. case 0:
  14859. t = e.name, n = e.query;
  14860. return _context36.abrupt("return", ne.connectSocket({
  14861. url: this._websocket.signedURL(t, n),
  14862. complete: function complete() {}
  14863. }));
  14864. case 2:
  14865. case "end":
  14866. return _context36.stop();
  14867. }
  14868. }
  14869. }, _callee36, this);
  14870. }));
  14871. function connectWebSocket(_x33) {
  14872. return _connectWebSocket.apply(this, arguments);
  14873. }
  14874. return connectWebSocket;
  14875. }()
  14876. }]);
  14877. return Rt;
  14878. }();
  14879. var Ut = {
  14880. init: function init(e) {
  14881. e.provider = "alipay";
  14882. var t = new Rt(e);
  14883. return t.auth = function () {
  14884. return {
  14885. signInAnonymously: function signInAnonymously() {
  14886. return Promise.resolve();
  14887. },
  14888. getLoginState: function getLoginState() {
  14889. return Promise.resolve(!0);
  14890. }
  14891. };
  14892. }, t;
  14893. }
  14894. };
  14895. function Nt(_ref25) {
  14896. var e = _ref25.data;
  14897. var t;
  14898. t = he();
  14899. var n = JSON.parse(JSON.stringify(e || {}));
  14900. if (Object.assign(n, {
  14901. clientInfo: t
  14902. }), !n.uniIdToken) {
  14903. var _se2 = se(),
  14904. _e18 = _se2.token;
  14905. _e18 && (n.uniIdToken = _e18);
  14906. }
  14907. return n;
  14908. }
  14909. function Dt() {
  14910. return _Dt.apply(this, arguments);
  14911. }
  14912. function _Dt() {
  14913. _Dt = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57() {
  14914. var _this27 = this;
  14915. var _ref67,
  14916. e,
  14917. t,
  14918. _this$__dev__,
  14919. n,
  14920. s,
  14921. r,
  14922. i,
  14923. o,
  14924. a,
  14925. _args6 = arguments;
  14926. return _regenerator.default.wrap(function _callee57$(_context57) {
  14927. while (1) {
  14928. switch (_context57.prev = _context57.next) {
  14929. case 0:
  14930. _ref67 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, e = _ref67.name, t = _ref67.data;
  14931. _context57.next = 3;
  14932. return this.__dev__.initLocalNetwork();
  14933. case 3:
  14934. _this$__dev__ = this.__dev__, n = _this$__dev__.localAddress, s = _this$__dev__.localPort, r = {
  14935. aliyun: "aliyun",
  14936. tencent: "tcb",
  14937. alipay: "alipay"
  14938. }[this.config.provider], i = this.config.spaceId, o = "http://".concat(n, ":").concat(s, "/system/check-function"), a = "http://".concat(n, ":").concat(s, "/cloudfunctions/").concat(e);
  14939. return _context57.abrupt("return", new Promise(function (t, n) {
  14940. ne.request({
  14941. method: "POST",
  14942. url: o,
  14943. data: {
  14944. name: e,
  14945. platform: C,
  14946. provider: r,
  14947. spaceId: i
  14948. },
  14949. timeout: 3e3,
  14950. success: function success(e) {
  14951. t(e);
  14952. },
  14953. fail: function fail() {
  14954. t({
  14955. data: {
  14956. code: "NETWORK_ERROR",
  14957. message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。"
  14958. }
  14959. });
  14960. }
  14961. });
  14962. }).then(function () {
  14963. var _ref68 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14964. e = _ref68.data;
  14965. var _ref69 = e || {},
  14966. t = _ref69.code,
  14967. n = _ref69.message;
  14968. return {
  14969. code: 0 === t ? 0 : t || "SYS_ERR",
  14970. message: n || "SYS_ERR"
  14971. };
  14972. }).then(function (_ref70) {
  14973. var n = _ref70.code,
  14974. s = _ref70.message;
  14975. if (0 !== n) {
  14976. switch (n) {
  14977. case "MODULE_ENCRYPTED":
  14978. 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"));
  14979. break;
  14980. case "FUNCTION_ENCRYPTED":
  14981. 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"));
  14982. break;
  14983. case "ACTION_ENCRYPTED":
  14984. console.error(s || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
  14985. break;
  14986. case "NETWORK_ERROR":
  14987. console.error(s || "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下");
  14988. break;
  14989. case "SWITCH_TO_CLOUD":
  14990. break;
  14991. default:
  14992. {
  14993. var _e30 = "\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");
  14994. throw console.error(_e30), new Error(_e30);
  14995. }
  14996. }
  14997. return _this27._callCloudFunction({
  14998. name: e,
  14999. data: t
  15000. });
  15001. }
  15002. return new Promise(function (e, n) {
  15003. var s = Nt.call(_this27, {
  15004. data: t
  15005. });
  15006. ne.request({
  15007. method: "POST",
  15008. url: a,
  15009. data: {
  15010. provider: r,
  15011. platform: C,
  15012. param: s
  15013. },
  15014. success: function success() {
  15015. var _ref71 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15016. t = _ref71.statusCode,
  15017. s = _ref71.data;
  15018. return !t || t >= 400 ? n(new te({
  15019. code: s.code || "SYS_ERR",
  15020. message: s.message || "request:fail"
  15021. })) : e({
  15022. result: s
  15023. });
  15024. },
  15025. fail: function fail(e) {
  15026. n(new te({
  15027. code: e.code || e.errCode || "SYS_ERR",
  15028. message: e.message || e.errMsg || "request:fail"
  15029. }));
  15030. }
  15031. });
  15032. });
  15033. }));
  15034. case 5:
  15035. case "end":
  15036. return _context57.stop();
  15037. }
  15038. }
  15039. }, _callee57, this);
  15040. }));
  15041. return _Dt.apply(this, arguments);
  15042. }
  15043. var Mt = [{
  15044. rule: /fc_function_not_found|FUNCTION_NOT_FOUND/,
  15045. content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",
  15046. mode: "append"
  15047. }];
  15048. var qt = /[\\^$.*+?()[\]{}|]/g,
  15049. Ft = RegExp(qt.source);
  15050. function Kt(e, t, n) {
  15051. return e.replace(new RegExp((s = t) && Ft.test(s) ? s.replace(qt, "\\$&") : s, "g"), n);
  15052. var s;
  15053. }
  15054. var jt = "none",
  15055. $t = "request",
  15056. Bt = "response",
  15057. Wt = "both";
  15058. var Ht = /*#__PURE__*/function () {
  15059. function Ht() {
  15060. var _ref26 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15061. e = _ref26.secretType,
  15062. t = _ref26.uniCloudIns;
  15063. (0, _classCallCheck2.default)(this, Ht);
  15064. this.clientType = "", this.secretType = e || jt, this.uniCloudIns = t;
  15065. var _this$uniCloudIns$con = this.uniCloudIns.config,
  15066. n = _this$uniCloudIns$con.provider,
  15067. s = _this$uniCloudIns$con.spaceId;
  15068. var r;
  15069. this.provider = n, this.spaceId = s, this.scopedGlobalCache = (r = this.uniCloudIns, L("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", r.config.spaceId)));
  15070. }
  15071. (0, _createClass2.default)(Ht, [{
  15072. key: "getSystemInfo",
  15073. value: function getSystemInfo() {
  15074. return this._systemInfo || (this._systemInfo = ae()), this._systemInfo;
  15075. }
  15076. }, {
  15077. key: "appId",
  15078. get: function get() {
  15079. return this.getSystemInfo().appId;
  15080. }
  15081. }, {
  15082. key: "deviceId",
  15083. get: function get() {
  15084. return this.getSystemInfo().deviceId;
  15085. }
  15086. }, {
  15087. key: "encryptData",
  15088. value: function () {
  15089. var _encryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37(e) {
  15090. return _regenerator.default.wrap(function _callee37$(_context37) {
  15091. while (1) {
  15092. switch (_context37.prev = _context37.next) {
  15093. case 0:
  15094. return _context37.abrupt("return", this.secretType === jt ? e : this.platformEncryptData(e));
  15095. case 1:
  15096. case "end":
  15097. return _context37.stop();
  15098. }
  15099. }
  15100. }, _callee37, this);
  15101. }));
  15102. function encryptData(_x34) {
  15103. return _encryptData.apply(this, arguments);
  15104. }
  15105. return encryptData;
  15106. }()
  15107. }, {
  15108. key: "decryptResult",
  15109. value: function () {
  15110. var _decryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38(e) {
  15111. var _ref27, t, n;
  15112. return _regenerator.default.wrap(function _callee38$(_context38) {
  15113. while (1) {
  15114. switch (_context38.prev = _context38.next) {
  15115. case 0:
  15116. if (!(this.secretType === jt)) {
  15117. _context38.next = 2;
  15118. break;
  15119. }
  15120. return _context38.abrupt("return", e);
  15121. case 2:
  15122. _ref27 = e || {}, t = _ref27.errCode, n = _ref27.content;
  15123. return _context38.abrupt("return", t || !n ? e : this.secretType === $t ? n : this.platformDecryptResult(e));
  15124. case 4:
  15125. case "end":
  15126. return _context38.stop();
  15127. }
  15128. }
  15129. }, _callee38, this);
  15130. }));
  15131. function decryptResult(_x35) {
  15132. return _decryptResult.apply(this, arguments);
  15133. }
  15134. return decryptResult;
  15135. }()
  15136. }, {
  15137. key: "wrapVerifyClientCallFunction",
  15138. value: function wrapVerifyClientCallFunction(e) {
  15139. var t = this;
  15140. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39() {
  15141. var _ref29,
  15142. n,
  15143. _ref29$data,
  15144. s,
  15145. r,
  15146. _args39 = arguments;
  15147. return _regenerator.default.wrap(function _callee39$(_context39) {
  15148. while (1) {
  15149. switch (_context39.prev = _context39.next) {
  15150. case 0:
  15151. _ref29 = _args39.length > 0 && _args39[0] !== undefined ? _args39[0] : {}, n = _ref29.name, _ref29$data = _ref29.data, s = _ref29$data === void 0 ? {} : _ref29$data;
  15152. _context39.next = 3;
  15153. return t.prepare();
  15154. case 3:
  15155. _context39.next = 5;
  15156. return t.platformGetSignOption();
  15157. case 5:
  15158. (s = JSON.parse(JSON.stringify(s)))._uniCloudOptions = _context39.sent;
  15159. _context39.next = 8;
  15160. return e({
  15161. name: n,
  15162. data: s
  15163. });
  15164. case 8:
  15165. r = _context39.sent;
  15166. _context39.t0 = t.isClientKeyNotFound(r);
  15167. if (!_context39.t0) {
  15168. _context39.next = 19;
  15169. break;
  15170. }
  15171. _context39.next = 13;
  15172. return t.prepare({
  15173. forceUpdate: !0
  15174. });
  15175. case 13:
  15176. _context39.next = 15;
  15177. return t.platformGetSignOption();
  15178. case 15:
  15179. s._uniCloudOptions = _context39.sent;
  15180. _context39.next = 18;
  15181. return e({
  15182. name: n,
  15183. data: s
  15184. });
  15185. case 18:
  15186. r = _context39.sent;
  15187. case 19:
  15188. return _context39.abrupt("return", r);
  15189. case 20:
  15190. case "end":
  15191. return _context39.stop();
  15192. }
  15193. }
  15194. }, _callee39);
  15195. }));
  15196. }
  15197. }, {
  15198. key: "wrapEncryptDataCallFunction",
  15199. value: function wrapEncryptDataCallFunction(e) {
  15200. var t = this;
  15201. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40() {
  15202. var _ref31,
  15203. n,
  15204. _ref31$data,
  15205. s,
  15206. r,
  15207. i,
  15208. _r5,
  15209. _args40 = arguments;
  15210. return _regenerator.default.wrap(function _callee40$(_context40) {
  15211. while (1) {
  15212. switch (_context40.prev = _context40.next) {
  15213. case 0:
  15214. _ref31 = _args40.length > 0 && _args40[0] !== undefined ? _args40[0] : {}, n = _ref31.name, _ref31$data = _ref31.data, s = _ref31$data === void 0 ? {} : _ref31$data;
  15215. _context40.next = 3;
  15216. return t.prepare();
  15217. case 3:
  15218. _context40.next = 5;
  15219. return t.encryptData(s);
  15220. case 5:
  15221. r = _context40.sent;
  15222. _context40.next = 8;
  15223. return e({
  15224. name: n,
  15225. data: r
  15226. });
  15227. case 8:
  15228. i = _context40.sent;
  15229. if (!t.isClientKeyNotFound(i)) {
  15230. _context40.next = 21;
  15231. break;
  15232. }
  15233. _context40.next = 12;
  15234. return t.prepare({
  15235. forceUpdate: !0
  15236. });
  15237. case 12:
  15238. _context40.next = 14;
  15239. return t.encryptData(s);
  15240. case 14:
  15241. _r5 = _context40.sent;
  15242. _context40.next = 17;
  15243. return t.platformGetSignOption();
  15244. case 17:
  15245. s._uniCloudOptions = _context40.sent;
  15246. _context40.next = 20;
  15247. return e({
  15248. name: n,
  15249. data: _r5
  15250. });
  15251. case 20:
  15252. i = _context40.sent;
  15253. case 21:
  15254. _context40.next = 23;
  15255. return t.decryptResult(i.result);
  15256. case 23:
  15257. i.result = _context40.sent;
  15258. return _context40.abrupt("return", i);
  15259. case 25:
  15260. case "end":
  15261. return _context40.stop();
  15262. }
  15263. }
  15264. }, _callee40);
  15265. }));
  15266. }
  15267. }]);
  15268. return Ht;
  15269. }();
  15270. /*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */
  15271. function zt(e) {
  15272. return parseInt(e) === e;
  15273. }
  15274. function Jt(e) {
  15275. if (!zt(e.length)) return !1;
  15276. for (var t = 0; t < e.length; t++) {
  15277. if (!zt(e[t]) || e[t] < 0 || e[t] > 255) return !1;
  15278. }
  15279. return !0;
  15280. }
  15281. function Vt(e, t) {
  15282. if (e.buffer && "Uint8Array" === e.name) return t && (e = e.slice ? e.slice() : Array.prototype.slice.call(e)), e;
  15283. if (Array.isArray(e)) {
  15284. if (!Jt(e)) throw new Error("Array contains invalid value: " + e);
  15285. return new Uint8Array(e);
  15286. }
  15287. if (zt(e.length) && Jt(e)) return new Uint8Array(e);
  15288. throw new Error("unsupported array-like object");
  15289. }
  15290. function Gt(e) {
  15291. return new Uint8Array(e);
  15292. }
  15293. function Yt(e, t, n, s, r) {
  15294. null == s && null == r || (e = e.slice ? e.slice(s, r) : Array.prototype.slice.call(e, s, r)), t.set(e, n);
  15295. }
  15296. var Qt,
  15297. Xt = {
  15298. toBytes: function toBytes(e) {
  15299. var t = [],
  15300. n = 0;
  15301. for (e = encodeURI(e); n < e.length;) {
  15302. var s = e.charCodeAt(n++);
  15303. 37 === s ? (t.push(parseInt(e.substr(n, 2), 16)), n += 2) : t.push(s);
  15304. }
  15305. return Vt(t);
  15306. },
  15307. fromBytes: function fromBytes(e) {
  15308. for (var t = [], n = 0; n < e.length;) {
  15309. var s = e[n];
  15310. 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);
  15311. }
  15312. return t.join("");
  15313. }
  15314. },
  15315. Zt = (Qt = "0123456789abcdef", {
  15316. toBytes: function toBytes(e) {
  15317. for (var t = [], n = 0; n < e.length; n += 2) {
  15318. t.push(parseInt(e.substr(n, 2), 16));
  15319. }
  15320. return t;
  15321. },
  15322. fromBytes: function fromBytes(e) {
  15323. for (var t = [], n = 0; n < e.length; n++) {
  15324. var s = e[n];
  15325. t.push(Qt[(240 & s) >> 4] + Qt[15 & s]);
  15326. }
  15327. return t.join("");
  15328. }
  15329. }),
  15330. en = {
  15331. 16: 10,
  15332. 24: 12,
  15333. 32: 14
  15334. },
  15335. tn = [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],
  15336. nn = [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],
  15337. sn = [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],
  15338. rn = [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],
  15339. on = [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],
  15340. an = [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],
  15341. cn = [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],
  15342. un = [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],
  15343. hn = [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],
  15344. ln = [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],
  15345. dn = [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],
  15346. pn = [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],
  15347. fn = [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],
  15348. gn = [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],
  15349. mn = [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];
  15350. function yn(e) {
  15351. for (var t = [], n = 0; n < e.length; n += 4) {
  15352. t.push(e[n] << 24 | e[n + 1] << 16 | e[n + 2] << 8 | e[n + 3]);
  15353. }
  15354. return t;
  15355. }
  15356. var _n = /*#__PURE__*/function () {
  15357. function _n(e) {
  15358. (0, _classCallCheck2.default)(this, _n);
  15359. if (!(this instanceof _n)) throw Error("AES must be instanitated with `new`");
  15360. Object.defineProperty(this, "key", {
  15361. value: Vt(e, !0)
  15362. }), this._prepare();
  15363. }
  15364. (0, _createClass2.default)(_n, [{
  15365. key: "_prepare",
  15366. value: function _prepare() {
  15367. var e = en[this.key.length];
  15368. if (null == e) throw new Error("invalid key size (must be 16, 24 or 32 bytes)");
  15369. this._Ke = [], this._Kd = [];
  15370. for (var t = 0; t <= e; t++) {
  15371. this._Ke.push([0, 0, 0, 0]), this._Kd.push([0, 0, 0, 0]);
  15372. }
  15373. var n,
  15374. s = 4 * (e + 1),
  15375. r = this.key.length / 4,
  15376. i = yn(this.key);
  15377. for (t = 0; t < r; t++) {
  15378. n = t >> 2, this._Ke[n][t % 4] = i[t], this._Kd[e - n][t % 4] = i[t];
  15379. }
  15380. for (var o, a = 0, c = r; c < s;) {
  15381. if (o = i[r - 1], i[0] ^= nn[o >> 16 & 255] << 24 ^ nn[o >> 8 & 255] << 16 ^ nn[255 & o] << 8 ^ nn[o >> 24 & 255] ^ tn[a] << 24, a += 1, 8 != r) for (t = 1; t < r; t++) {
  15382. i[t] ^= i[t - 1];
  15383. } else {
  15384. for (t = 1; t < r / 2; t++) {
  15385. i[t] ^= i[t - 1];
  15386. }
  15387. o = i[r / 2 - 1], i[r / 2] ^= nn[255 & o] ^ nn[o >> 8 & 255] << 8 ^ nn[o >> 16 & 255] << 16 ^ nn[o >> 24 & 255] << 24;
  15388. for (t = r / 2 + 1; t < r; t++) {
  15389. i[t] ^= i[t - 1];
  15390. }
  15391. }
  15392. for (t = 0; t < r && c < s;) {
  15393. u = c >> 2, h = c % 4, this._Ke[u][h] = i[t], this._Kd[e - u][h] = i[t++], c++;
  15394. }
  15395. }
  15396. for (var u = 1; u < e; u++) {
  15397. for (var h = 0; h < 4; h++) {
  15398. o = this._Kd[u][h], this._Kd[u][h] = pn[o >> 24 & 255] ^ fn[o >> 16 & 255] ^ gn[o >> 8 & 255] ^ mn[255 & o];
  15399. }
  15400. }
  15401. }
  15402. }, {
  15403. key: "encrypt",
  15404. value: function encrypt(e) {
  15405. if (16 != e.length) throw new Error("invalid plaintext size (must be 16 bytes)");
  15406. for (var t = this._Ke.length - 1, n = [0, 0, 0, 0], s = yn(e), r = 0; r < 4; r++) {
  15407. s[r] ^= this._Ke[0][r];
  15408. }
  15409. for (var i = 1; i < t; i++) {
  15410. for (r = 0; r < 4; r++) {
  15411. n[r] = rn[s[r] >> 24 & 255] ^ on[s[(r + 1) % 4] >> 16 & 255] ^ an[s[(r + 2) % 4] >> 8 & 255] ^ cn[255 & s[(r + 3) % 4]] ^ this._Ke[i][r];
  15412. }
  15413. s = n.slice();
  15414. }
  15415. var o,
  15416. a = Gt(16);
  15417. for (r = 0; r < 4; r++) {
  15418. o = this._Ke[t][r], a[4 * r] = 255 & (nn[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (nn[s[(r + 1) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (nn[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (nn[255 & s[(r + 3) % 4]] ^ o);
  15419. }
  15420. return a;
  15421. }
  15422. }, {
  15423. key: "decrypt",
  15424. value: function decrypt(e) {
  15425. if (16 != e.length) throw new Error("invalid ciphertext size (must be 16 bytes)");
  15426. for (var t = this._Kd.length - 1, n = [0, 0, 0, 0], s = yn(e), r = 0; r < 4; r++) {
  15427. s[r] ^= this._Kd[0][r];
  15428. }
  15429. for (var i = 1; i < t; i++) {
  15430. for (r = 0; r < 4; r++) {
  15431. n[r] = un[s[r] >> 24 & 255] ^ hn[s[(r + 3) % 4] >> 16 & 255] ^ ln[s[(r + 2) % 4] >> 8 & 255] ^ dn[255 & s[(r + 1) % 4]] ^ this._Kd[i][r];
  15432. }
  15433. s = n.slice();
  15434. }
  15435. var o,
  15436. a = Gt(16);
  15437. for (r = 0; r < 4; r++) {
  15438. o = this._Kd[t][r], a[4 * r] = 255 & (sn[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (sn[s[(r + 3) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (sn[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (sn[255 & s[(r + 1) % 4]] ^ o);
  15439. }
  15440. return a;
  15441. }
  15442. }]);
  15443. return _n;
  15444. }();
  15445. var wn = /*#__PURE__*/function () {
  15446. function wn(e) {
  15447. (0, _classCallCheck2.default)(this, wn);
  15448. if (!(this instanceof wn)) throw Error("AES must be instanitated with `new`");
  15449. this.description = "Electronic Code Block", this.name = "ecb", this._aes = new _n(e);
  15450. }
  15451. (0, _createClass2.default)(wn, [{
  15452. key: "encrypt",
  15453. value: function encrypt(e) {
  15454. if ((e = Vt(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  15455. for (var t = Gt(e.length), n = Gt(16), s = 0; s < e.length; s += 16) {
  15456. Yt(e, n, 0, s, s + 16), Yt(n = this._aes.encrypt(n), t, s);
  15457. }
  15458. return t;
  15459. }
  15460. }, {
  15461. key: "decrypt",
  15462. value: function decrypt(e) {
  15463. if ((e = Vt(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  15464. for (var t = Gt(e.length), n = Gt(16), s = 0; s < e.length; s += 16) {
  15465. Yt(e, n, 0, s, s + 16), Yt(n = this._aes.decrypt(n), t, s);
  15466. }
  15467. return t;
  15468. }
  15469. }]);
  15470. return wn;
  15471. }();
  15472. var vn = /*#__PURE__*/function () {
  15473. function vn(e, t) {
  15474. (0, _classCallCheck2.default)(this, vn);
  15475. if (!(this instanceof vn)) throw Error("AES must be instanitated with `new`");
  15476. if (this.description = "Cipher Block Chaining", this.name = "cbc", t) {
  15477. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  15478. } else t = Gt(16);
  15479. this._lastCipherblock = Vt(t, !0), this._aes = new _n(e);
  15480. }
  15481. (0, _createClass2.default)(vn, [{
  15482. key: "encrypt",
  15483. value: function encrypt(e) {
  15484. if ((e = Vt(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  15485. for (var t = Gt(e.length), n = Gt(16), s = 0; s < e.length; s += 16) {
  15486. Yt(e, n, 0, s, s + 16);
  15487. for (var r = 0; r < 16; r++) {
  15488. n[r] ^= this._lastCipherblock[r];
  15489. }
  15490. this._lastCipherblock = this._aes.encrypt(n), Yt(this._lastCipherblock, t, s);
  15491. }
  15492. return t;
  15493. }
  15494. }, {
  15495. key: "decrypt",
  15496. value: function decrypt(e) {
  15497. if ((e = Vt(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  15498. for (var t = Gt(e.length), n = Gt(16), s = 0; s < e.length; s += 16) {
  15499. Yt(e, n, 0, s, s + 16), n = this._aes.decrypt(n);
  15500. for (var r = 0; r < 16; r++) {
  15501. t[s + r] = n[r] ^ this._lastCipherblock[r];
  15502. }
  15503. Yt(e, this._lastCipherblock, 0, s, s + 16);
  15504. }
  15505. return t;
  15506. }
  15507. }]);
  15508. return vn;
  15509. }();
  15510. var In = /*#__PURE__*/function () {
  15511. function In(e, t, n) {
  15512. (0, _classCallCheck2.default)(this, In);
  15513. if (!(this instanceof In)) throw Error("AES must be instanitated with `new`");
  15514. if (this.description = "Cipher Feedback", this.name = "cfb", t) {
  15515. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 size)");
  15516. } else t = Gt(16);
  15517. n || (n = 1), this.segmentSize = n, this._shiftRegister = Vt(t, !0), this._aes = new _n(e);
  15518. }
  15519. (0, _createClass2.default)(In, [{
  15520. key: "encrypt",
  15521. value: function encrypt(e) {
  15522. if (e.length % this.segmentSize != 0) throw new Error("invalid plaintext size (must be segmentSize bytes)");
  15523. for (var t, n = Vt(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  15524. t = this._aes.encrypt(this._shiftRegister);
  15525. for (var r = 0; r < this.segmentSize; r++) {
  15526. n[s + r] ^= t[r];
  15527. }
  15528. Yt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Yt(n, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  15529. }
  15530. return n;
  15531. }
  15532. }, {
  15533. key: "decrypt",
  15534. value: function decrypt(e) {
  15535. if (e.length % this.segmentSize != 0) throw new Error("invalid ciphertext size (must be segmentSize bytes)");
  15536. for (var t, n = Vt(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  15537. t = this._aes.encrypt(this._shiftRegister);
  15538. for (var r = 0; r < this.segmentSize; r++) {
  15539. n[s + r] ^= t[r];
  15540. }
  15541. Yt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Yt(e, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  15542. }
  15543. return n;
  15544. }
  15545. }]);
  15546. return In;
  15547. }();
  15548. var Sn = /*#__PURE__*/function () {
  15549. function Sn(e, t) {
  15550. (0, _classCallCheck2.default)(this, Sn);
  15551. if (!(this instanceof Sn)) throw Error("AES must be instanitated with `new`");
  15552. if (this.description = "Output Feedback", this.name = "ofb", t) {
  15553. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  15554. } else t = Gt(16);
  15555. this._lastPrecipher = Vt(t, !0), this._lastPrecipherIndex = 16, this._aes = new _n(e);
  15556. }
  15557. (0, _createClass2.default)(Sn, [{
  15558. key: "encrypt",
  15559. value: function encrypt(e) {
  15560. for (var t = Vt(e, !0), n = 0; n < t.length; n++) {
  15561. 16 === this._lastPrecipherIndex && (this._lastPrecipher = this._aes.encrypt(this._lastPrecipher), this._lastPrecipherIndex = 0), t[n] ^= this._lastPrecipher[this._lastPrecipherIndex++];
  15562. }
  15563. return t;
  15564. }
  15565. }, {
  15566. key: "decrypt",
  15567. value: function decrypt(e) {
  15568. return this.encrypt(e);
  15569. }
  15570. }]);
  15571. return Sn;
  15572. }();
  15573. var bn = /*#__PURE__*/function () {
  15574. function bn(e) {
  15575. (0, _classCallCheck2.default)(this, bn);
  15576. if (!(this instanceof bn)) throw Error("Counter must be instanitated with `new`");
  15577. 0 === e || e || (e = 1), "number" == typeof e ? (this._counter = Gt(16), this.setValue(e)) : this.setBytes(e);
  15578. }
  15579. (0, _createClass2.default)(bn, [{
  15580. key: "setValue",
  15581. value: function setValue(e) {
  15582. if ("number" != typeof e || parseInt(e) != e) throw new Error("invalid counter value (must be an integer)");
  15583. if (e > Number.MAX_SAFE_INTEGER) throw new Error("integer value out of safe range");
  15584. for (var t = 15; t >= 0; --t) {
  15585. this._counter[t] = e % 256, e = parseInt(e / 256);
  15586. }
  15587. }
  15588. }, {
  15589. key: "setBytes",
  15590. value: function setBytes(e) {
  15591. if (16 != (e = Vt(e, !0)).length) throw new Error("invalid counter bytes size (must be 16 bytes)");
  15592. this._counter = e;
  15593. }
  15594. }, {
  15595. key: "increment",
  15596. value: function increment() {
  15597. for (var e = 15; e >= 0; e--) {
  15598. if (255 !== this._counter[e]) {
  15599. this._counter[e]++;
  15600. break;
  15601. }
  15602. this._counter[e] = 0;
  15603. }
  15604. }
  15605. }]);
  15606. return bn;
  15607. }();
  15608. var kn = /*#__PURE__*/function () {
  15609. function kn(e, t) {
  15610. (0, _classCallCheck2.default)(this, kn);
  15611. if (!(this instanceof kn)) throw Error("AES must be instanitated with `new`");
  15612. this.description = "Counter", this.name = "ctr", t instanceof bn || (t = new bn(t)), this._counter = t, this._remainingCounter = null, this._remainingCounterIndex = 16, this._aes = new _n(e);
  15613. }
  15614. (0, _createClass2.default)(kn, [{
  15615. key: "encrypt",
  15616. value: function encrypt(e) {
  15617. for (var t = Vt(e, !0), n = 0; n < t.length; n++) {
  15618. 16 === this._remainingCounterIndex && (this._remainingCounter = this._aes.encrypt(this._counter._counter), this._remainingCounterIndex = 0, this._counter.increment()), t[n] ^= this._remainingCounter[this._remainingCounterIndex++];
  15619. }
  15620. return t;
  15621. }
  15622. }, {
  15623. key: "decrypt",
  15624. value: function decrypt(e) {
  15625. return this.encrypt(e);
  15626. }
  15627. }]);
  15628. return kn;
  15629. }();
  15630. var An = {
  15631. AES: _n,
  15632. Counter: bn,
  15633. ModeOfOperation: {
  15634. ecb: wn,
  15635. cbc: vn,
  15636. cfb: In,
  15637. ofb: Sn,
  15638. ctr: kn
  15639. },
  15640. utils: {
  15641. hex: Zt,
  15642. utf8: Xt
  15643. },
  15644. padding: {
  15645. pkcs7: {
  15646. pad: function pad(e) {
  15647. var t = 16 - (e = Vt(e, !0)).length % 16,
  15648. n = Gt(e.length + t);
  15649. Yt(e, n);
  15650. for (var s = e.length; s < n.length; s++) {
  15651. n[s] = t;
  15652. }
  15653. return n;
  15654. },
  15655. strip: function strip(e) {
  15656. if ((e = Vt(e, !0)).length < 16) throw new Error("PKCS#7 invalid length");
  15657. var t = e[e.length - 1];
  15658. if (t > 16) throw new Error("PKCS#7 padding byte out of range");
  15659. for (var n = e.length - t, s = 0; s < t; s++) {
  15660. if (e[n + s] !== t) throw new Error("PKCS#7 invalid padding byte");
  15661. }
  15662. var r = Gt(n);
  15663. return Yt(e, r, 0, 0, n), r;
  15664. }
  15665. }
  15666. },
  15667. _arrayTest: {
  15668. coerceArray: Vt,
  15669. createArray: Gt,
  15670. copyArray: Yt
  15671. }
  15672. };
  15673. function Cn(e, t, n) {
  15674. var s = new Uint8Array(uni.base64ToArrayBuffer(t)),
  15675. r = An.utils.utf8.toBytes(n),
  15676. i = An.utils.utf8.toBytes(e),
  15677. o = new An.ModeOfOperation.cbc(s, r),
  15678. a = An.padding.pkcs7.pad(i),
  15679. c = o.encrypt(a);
  15680. return uni.arrayBufferToBase64(c);
  15681. }
  15682. var Pn = {
  15683. code: 2e4,
  15684. message: "System error"
  15685. },
  15686. Tn = {
  15687. code: 20101,
  15688. message: "Invalid client"
  15689. },
  15690. xn = {
  15691. code: 20102,
  15692. message: "Get encrypt key failed"
  15693. },
  15694. On = {
  15695. 10001: "Secure network is not supported on current playground or unimpsdk",
  15696. 10003: "Config missing in current app. If the problem pesist, please contact DCloud.",
  15697. 10009: "Encrypt payload failed",
  15698. 10010: "Decrypt response failed"
  15699. };
  15700. function En(e) {
  15701. var _ref32 = e || {},
  15702. t = _ref32.errSubject,
  15703. n = _ref32.subject,
  15704. s = _ref32.errCode,
  15705. r = _ref32.errMsg,
  15706. i = _ref32.code,
  15707. o = _ref32.message,
  15708. a = _ref32.cause;
  15709. return new te({
  15710. subject: t || n || "uni-secure-network",
  15711. code: s || i || Pn.code,
  15712. message: r || o,
  15713. cause: a
  15714. });
  15715. }
  15716. var Ln,
  15717. Rn,
  15718. Un = null;
  15719. var Nn = /*#__PURE__*/function (_Ht) {
  15720. (0, _inherits2.default)(Nn, _Ht);
  15721. var _super9 = _createSuper(Nn);
  15722. function Nn(e) {
  15723. var _this15;
  15724. (0, _classCallCheck2.default)(this, Nn);
  15725. _this15 = _super9.call(this, e), _this15.clientType = "mp-weixin", _this15.userEncryptKey = null;
  15726. return _this15;
  15727. }
  15728. (0, _createClass2.default)(Nn, [{
  15729. key: "isLogin",
  15730. value: function isLogin() {
  15731. return !!this.scopedGlobalCache.mpWeixinCode || !!this.scopedGlobalCache.mpWeixinOpenid;
  15732. }
  15733. }, {
  15734. key: "prepare",
  15735. value: function () {
  15736. var _prepare2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41() {
  15737. return _regenerator.default.wrap(function _callee41$(_context41) {
  15738. while (1) {
  15739. switch (_context41.prev = _context41.next) {
  15740. case 0:
  15741. if (this.isLogin()) {
  15742. _context41.next = 7;
  15743. break;
  15744. }
  15745. if (this.scopedGlobalCache.initPromise) {
  15746. _context41.next = 3;
  15747. break;
  15748. }
  15749. throw new Error("`uniCloud.initSecureNetworkByWeixin` has not yet been called");
  15750. case 3:
  15751. _context41.next = 5;
  15752. return this.scopedGlobalCache.initPromise;
  15753. case 5:
  15754. if (this.isLogin()) {
  15755. _context41.next = 7;
  15756. break;
  15757. }
  15758. throw new Error("uniCloud.initSecureNetworkByWeixin` has not yet been called or successfully excuted");
  15759. case 7:
  15760. case "end":
  15761. return _context41.stop();
  15762. }
  15763. }
  15764. }, _callee41, this);
  15765. }));
  15766. function prepare() {
  15767. return _prepare2.apply(this, arguments);
  15768. }
  15769. return prepare;
  15770. }()
  15771. }, {
  15772. key: "getUserEncryptKey",
  15773. value: function () {
  15774. var _getUserEncryptKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42() {
  15775. var _this16 = this;
  15776. var e;
  15777. return _regenerator.default.wrap(function _callee42$(_context42) {
  15778. while (1) {
  15779. switch (_context42.prev = _context42.next) {
  15780. case 0:
  15781. if (!this.userEncryptKey) {
  15782. _context42.next = 2;
  15783. break;
  15784. }
  15785. return _context42.abrupt("return", this.userEncryptKey);
  15786. case 2:
  15787. if (!(Un && Un.expireTime)) {
  15788. _context42.next = 6;
  15789. break;
  15790. }
  15791. e = Date.now();
  15792. if (!(Un.expireTime - e > 0)) {
  15793. _context42.next = 6;
  15794. break;
  15795. }
  15796. return _context42.abrupt("return", (this.userEncryptKey = Un, this.userEncryptKey));
  15797. case 6:
  15798. return _context42.abrupt("return", new Promise(function (e, t) {
  15799. uni.getUserCryptoManager().getLatestUserKey({
  15800. success: function success(t) {
  15801. Un = t, _this16.userEncryptKey = t, e(_this16.userEncryptKey);
  15802. },
  15803. fail: function fail(e) {
  15804. t(En(_objectSpread(_objectSpread({}, xn), {}, {
  15805. cause: e
  15806. })));
  15807. }
  15808. });
  15809. }));
  15810. case 7:
  15811. case "end":
  15812. return _context42.stop();
  15813. }
  15814. }
  15815. }, _callee42, this);
  15816. }));
  15817. function getUserEncryptKey() {
  15818. return _getUserEncryptKey.apply(this, arguments);
  15819. }
  15820. return getUserEncryptKey;
  15821. }()
  15822. }, {
  15823. key: "getWxAppId",
  15824. value: function getWxAppId() {
  15825. return wx.getAccountInfoSync().miniProgram.appId;
  15826. }
  15827. }, {
  15828. key: "platformGetSignOption",
  15829. value: function () {
  15830. var _platformGetSignOption = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43() {
  15831. var _yield$this$getUserEn, e, t, n;
  15832. return _regenerator.default.wrap(function _callee43$(_context43) {
  15833. while (1) {
  15834. switch (_context43.prev = _context43.next) {
  15835. case 0:
  15836. _context43.next = 2;
  15837. return this.getUserEncryptKey();
  15838. case 2:
  15839. _yield$this$getUserEn = _context43.sent;
  15840. e = _yield$this$getUserEn.encryptKey;
  15841. t = _yield$this$getUserEn.iv;
  15842. n = _yield$this$getUserEn.version;
  15843. return _context43.abrupt("return", {
  15844. verifyClientSign: Cn(JSON.stringify({
  15845. data: JSON.stringify({}),
  15846. appId: this.appId,
  15847. deviceId: this.deviceId,
  15848. wxAppId: this.getWxAppId(),
  15849. simulator: "devtools" === ae().platform,
  15850. timestamp: Date.now()
  15851. }), e, t),
  15852. encryptKeyId: n,
  15853. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  15854. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  15855. });
  15856. case 7:
  15857. case "end":
  15858. return _context43.stop();
  15859. }
  15860. }
  15861. }, _callee43, this);
  15862. }));
  15863. function platformGetSignOption() {
  15864. return _platformGetSignOption.apply(this, arguments);
  15865. }
  15866. return platformGetSignOption;
  15867. }()
  15868. }, {
  15869. key: "platformEncryptData",
  15870. value: function () {
  15871. var _platformEncryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44(e) {
  15872. var _yield$this$getUserEn2, t, n, s, r;
  15873. return _regenerator.default.wrap(function _callee44$(_context44) {
  15874. while (1) {
  15875. switch (_context44.prev = _context44.next) {
  15876. case 0:
  15877. _context44.next = 2;
  15878. return this.getUserEncryptKey();
  15879. case 2:
  15880. _yield$this$getUserEn2 = _context44.sent;
  15881. t = _yield$this$getUserEn2.encryptKey;
  15882. n = _yield$this$getUserEn2.iv;
  15883. s = _yield$this$getUserEn2.version;
  15884. r = {
  15885. secretType: this.secretType,
  15886. encryptKeyId: s,
  15887. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  15888. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  15889. };
  15890. return _context44.abrupt("return", this.secretType === Bt ? {
  15891. content: e,
  15892. _uniCloudOptions: r
  15893. } : {
  15894. content: Cn(JSON.stringify({
  15895. data: JSON.stringify(e),
  15896. appId: this.appId,
  15897. deviceId: this.deviceId,
  15898. wxAppId: this.getWxAppId(),
  15899. simulator: "devtools" === ae().platform,
  15900. timestamp: Date.now()
  15901. }), t, n),
  15902. _uniCloudOptions: r
  15903. });
  15904. case 8:
  15905. case "end":
  15906. return _context44.stop();
  15907. }
  15908. }
  15909. }, _callee44, this);
  15910. }));
  15911. function platformEncryptData(_x36) {
  15912. return _platformEncryptData.apply(this, arguments);
  15913. }
  15914. return platformEncryptData;
  15915. }()
  15916. }, {
  15917. key: "platformDecryptResult",
  15918. value: function () {
  15919. var _platformDecryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45(e) {
  15920. var t, _yield$this$getUserEn3, n, s;
  15921. return _regenerator.default.wrap(function _callee45$(_context45) {
  15922. while (1) {
  15923. switch (_context45.prev = _context45.next) {
  15924. case 0:
  15925. t = e.content;
  15926. _context45.next = 3;
  15927. return this.getUserEncryptKey();
  15928. case 3:
  15929. _yield$this$getUserEn3 = _context45.sent;
  15930. n = _yield$this$getUserEn3.encryptKey;
  15931. s = _yield$this$getUserEn3.iv;
  15932. return _context45.abrupt("return", JSON.parse(function (e, t, n) {
  15933. var s = new Uint8Array(uni.base64ToArrayBuffer(e)),
  15934. r = new Uint8Array(uni.base64ToArrayBuffer(t)),
  15935. i = An.utils.utf8.toBytes(n),
  15936. o = new An.ModeOfOperation.cbc(r, i),
  15937. a = An.padding.pkcs7.strip(o.decrypt(s));
  15938. return An.utils.utf8.fromBytes(a);
  15939. }(t, n, s)));
  15940. case 7:
  15941. case "end":
  15942. return _context45.stop();
  15943. }
  15944. }
  15945. }, _callee45, this);
  15946. }));
  15947. function platformDecryptResult(_x37) {
  15948. return _platformDecryptResult.apply(this, arguments);
  15949. }
  15950. return platformDecryptResult;
  15951. }()
  15952. }, {
  15953. key: "isClientKeyNotFound",
  15954. value: function isClientKeyNotFound() {
  15955. return !1;
  15956. }
  15957. }]);
  15958. return Nn;
  15959. }(Ht);
  15960. function Dn(e) {
  15961. var t = ["hasClientKey", "encryptGetClientKeyPayload", "setClientKey", "encrypt", "decrypt"],
  15962. n = {};
  15963. var _loop = function _loop(_s11) {
  15964. var r = t[_s11];
  15965. n[r] = function () {
  15966. for (var _len = arguments.length, t = new Array(_len), _key = 0; _key < _len; _key++) {
  15967. t[_key] = arguments[_key];
  15968. }
  15969. return new Promise(function (n, s) {
  15970. "function" == typeof e[r] ? e[r].apply(e, t.concat([function () {
  15971. var _ref33 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15972. e = _ref33.type,
  15973. t = _ref33.data,
  15974. r = _ref33.errCode,
  15975. i = _ref33.errMsg,
  15976. o = _ref33.errSubject,
  15977. a = _ref33.message;
  15978. "success" === e ? n(t) : s(En({
  15979. errCode: r,
  15980. errMsg: On[r] || i || a,
  15981. errSubject: o
  15982. }));
  15983. }])) : s(En({
  15984. message: "请检查manifest.json内是否开启安全网络模块,另外注意标准基座不支持安全网络模块"
  15985. }));
  15986. });
  15987. };
  15988. };
  15989. for (var _s11 = 0; _s11 < t.length; _s11++) {
  15990. _loop(_s11);
  15991. }
  15992. return n;
  15993. }
  15994. var Mn = /*#__PURE__*/function (_Ht2) {
  15995. (0, _inherits2.default)(Mn, _Ht2);
  15996. var _super10 = _createSuper(Mn);
  15997. function Mn(e) {
  15998. var _this17;
  15999. (0, _classCallCheck2.default)(this, Mn);
  16000. _this17 = _super10.call(this, e), _this17.clientType = "app", _this17.appUtils = _objectSpread({}, Dn(uni.requireNativePlugin("plus"))), _this17.systemInfo = Ln || (Ln = ae());
  16001. return _this17;
  16002. }
  16003. (0, _createClass2.default)(Mn, [{
  16004. key: "hasClientKey",
  16005. value: function () {
  16006. var _hasClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46() {
  16007. return _regenerator.default.wrap(function _callee46$(_context46) {
  16008. while (1) {
  16009. switch (_context46.prev = _context46.next) {
  16010. case 0:
  16011. _context46.next = 2;
  16012. return this.appUtils.hasClientKey({
  16013. provider: this.provider,
  16014. spaceId: this.spaceId
  16015. });
  16016. case 2:
  16017. this._hasClientKey = _context46.sent;
  16018. return _context46.abrupt("return", this._hasClientKey);
  16019. case 4:
  16020. case "end":
  16021. return _context46.stop();
  16022. }
  16023. }
  16024. }, _callee46, this);
  16025. }));
  16026. function hasClientKey() {
  16027. return _hasClientKey.apply(this, arguments);
  16028. }
  16029. return hasClientKey;
  16030. }()
  16031. }, {
  16032. key: "getAppClientKey",
  16033. value: function () {
  16034. var _getAppClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47() {
  16035. var _yield$this$appUtils$, e, t, n, s, r;
  16036. return _regenerator.default.wrap(function _callee47$(_context47) {
  16037. while (1) {
  16038. switch (_context47.prev = _context47.next) {
  16039. case 0:
  16040. _context47.next = 2;
  16041. return this.appUtils.encryptGetClientKeyPayload({
  16042. data: JSON.stringify({})
  16043. });
  16044. case 2:
  16045. _yield$this$appUtils$ = _context47.sent;
  16046. e = _yield$this$appUtils$.data;
  16047. t = _yield$this$appUtils$.key;
  16048. _context47.next = 7;
  16049. return this.uniCloudIns.callFunction({
  16050. name: "DCloud-clientDB",
  16051. data: {
  16052. redirectTo: "encryption",
  16053. action: "getAppClientKey",
  16054. data: e,
  16055. key: t
  16056. }
  16057. });
  16058. case 7:
  16059. _context47.t0 = _context47.sent.result;
  16060. if (_context47.t0) {
  16061. _context47.next = 10;
  16062. break;
  16063. }
  16064. _context47.t0 = {};
  16065. case 10:
  16066. n = _context47.t0;
  16067. if (!(0 !== n.errCode)) {
  16068. _context47.next = 13;
  16069. break;
  16070. }
  16071. throw function (e) {
  16072. return new te({
  16073. subject: e.errSubject || "uni-secure-network",
  16074. code: e.errCode || e.code || Pn.code,
  16075. message: e.errMsg || e.message
  16076. });
  16077. }(n);
  16078. case 13:
  16079. s = n.clientKey, r = n.key;
  16080. _context47.next = 16;
  16081. return this.appUtils.setClientKey({
  16082. provider: this.provider,
  16083. spaceId: this.spaceId,
  16084. clientKey: s,
  16085. key: r
  16086. });
  16087. case 16:
  16088. case "end":
  16089. return _context47.stop();
  16090. }
  16091. }
  16092. }, _callee47, this);
  16093. }));
  16094. function getAppClientKey() {
  16095. return _getAppClientKey.apply(this, arguments);
  16096. }
  16097. return getAppClientKey;
  16098. }()
  16099. }, {
  16100. key: "ensureClientKey",
  16101. value: function () {
  16102. var _ensureClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48() {
  16103. var _this18 = this;
  16104. var _ref34,
  16105. _ref34$forceUpdate,
  16106. e,
  16107. _args48 = arguments;
  16108. return _regenerator.default.wrap(function _callee48$(_context48) {
  16109. while (1) {
  16110. switch (_context48.prev = _context48.next) {
  16111. case 0:
  16112. _ref34 = _args48.length > 0 && _args48[0] !== undefined ? _args48[0] : {}, _ref34$forceUpdate = _ref34.forceUpdate, e = _ref34$forceUpdate === void 0 ? !1 : _ref34$forceUpdate;
  16113. _context48.t1 = !0;
  16114. _context48.next = 4;
  16115. return this.hasClientKey();
  16116. case 4:
  16117. _context48.t2 = _context48.sent;
  16118. _context48.t0 = _context48.t1 !== _context48.t2;
  16119. if (_context48.t0) {
  16120. _context48.next = 8;
  16121. break;
  16122. }
  16123. _context48.t0 = e;
  16124. case 8:
  16125. if (!_context48.t0) {
  16126. _context48.next = 10;
  16127. break;
  16128. }
  16129. return _context48.abrupt("return", (e && this.scopedGlobalCache.initPromise && this.scopedGlobalCache.initStatus === l || !e && this.scopedGlobalCache.initPromise && this.scopedGlobalCache.initStatus !== p || (this.scopedGlobalCache.initPromise = this.getAppClientKey(), this.scopedGlobalCache.initPromise.then(function (e) {
  16130. _this18.scopedGlobalCache.initStatus = d;
  16131. }).catch(function (e) {
  16132. throw _this18.scopedGlobalCache.initStatus = p, e;
  16133. }), this.scopedGlobalCache.initStatus = l), this.scopedGlobalCache.initPromise));
  16134. case 10:
  16135. case "end":
  16136. return _context48.stop();
  16137. }
  16138. }
  16139. }, _callee48, this);
  16140. }));
  16141. function ensureClientKey() {
  16142. return _ensureClientKey.apply(this, arguments);
  16143. }
  16144. return ensureClientKey;
  16145. }()
  16146. }, {
  16147. key: "prepare",
  16148. value: function () {
  16149. var _prepare3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49() {
  16150. var _ref35,
  16151. _ref35$forceUpdate,
  16152. e,
  16153. _args49 = arguments;
  16154. return _regenerator.default.wrap(function _callee49$(_context49) {
  16155. while (1) {
  16156. switch (_context49.prev = _context49.next) {
  16157. case 0:
  16158. _ref35 = _args49.length > 0 && _args49[0] !== undefined ? _args49[0] : {}, _ref35$forceUpdate = _ref35.forceUpdate, e = _ref35$forceUpdate === void 0 ? !1 : _ref35$forceUpdate;
  16159. _context49.next = 3;
  16160. return this.ensureClientKey({
  16161. forceUpdate: e
  16162. });
  16163. case 3:
  16164. case "end":
  16165. return _context49.stop();
  16166. }
  16167. }
  16168. }, _callee49, this);
  16169. }));
  16170. function prepare() {
  16171. return _prepare3.apply(this, arguments);
  16172. }
  16173. return prepare;
  16174. }()
  16175. }, {
  16176. key: "platformGetSignOption",
  16177. value: function () {
  16178. var _platformGetSignOption2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50() {
  16179. var _yield$this$appUtils$2, e, t;
  16180. return _regenerator.default.wrap(function _callee50$(_context50) {
  16181. while (1) {
  16182. switch (_context50.prev = _context50.next) {
  16183. case 0:
  16184. _context50.next = 2;
  16185. return this.appUtils.encrypt({
  16186. provider: this.provider,
  16187. spaceId: this.spaceId,
  16188. data: JSON.stringify({})
  16189. });
  16190. case 2:
  16191. _yield$this$appUtils$2 = _context50.sent;
  16192. e = _yield$this$appUtils$2.data;
  16193. t = _yield$this$appUtils$2.key;
  16194. return _context50.abrupt("return", {
  16195. verifyClientSign: e,
  16196. encryptKeyId: t
  16197. });
  16198. case 6:
  16199. case "end":
  16200. return _context50.stop();
  16201. }
  16202. }
  16203. }, _callee50, this);
  16204. }));
  16205. function platformGetSignOption() {
  16206. return _platformGetSignOption2.apply(this, arguments);
  16207. }
  16208. return platformGetSignOption;
  16209. }()
  16210. }, {
  16211. key: "platformEncryptData",
  16212. value: function () {
  16213. var _platformEncryptData2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51(e) {
  16214. var _yield$this$appUtils$3, t, n, s;
  16215. return _regenerator.default.wrap(function _callee51$(_context51) {
  16216. while (1) {
  16217. switch (_context51.prev = _context51.next) {
  16218. case 0:
  16219. _context51.next = 2;
  16220. return this.appUtils.encrypt({
  16221. provider: this.provider,
  16222. spaceId: this.spaceId,
  16223. data: JSON.stringify(e)
  16224. });
  16225. case 2:
  16226. _yield$this$appUtils$3 = _context51.sent;
  16227. t = _yield$this$appUtils$3.data;
  16228. n = _yield$this$appUtils$3.key;
  16229. s = {
  16230. secretType: this.secretType,
  16231. encryptKeyId: n
  16232. };
  16233. return _context51.abrupt("return", this.secretType === Bt ? {
  16234. content: e,
  16235. _uniCloudOptions: s
  16236. } : {
  16237. content: t,
  16238. _uniCloudOptions: s
  16239. });
  16240. case 7:
  16241. case "end":
  16242. return _context51.stop();
  16243. }
  16244. }
  16245. }, _callee51, this);
  16246. }));
  16247. function platformEncryptData(_x38) {
  16248. return _platformEncryptData2.apply(this, arguments);
  16249. }
  16250. return platformEncryptData;
  16251. }()
  16252. }, {
  16253. key: "platformDecryptResult",
  16254. value: function () {
  16255. var _platformDecryptResult2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52(e) {
  16256. var t, _e$_uniCloudOptions, n, s, r;
  16257. return _regenerator.default.wrap(function _callee52$(_context52) {
  16258. while (1) {
  16259. switch (_context52.prev = _context52.next) {
  16260. case 0:
  16261. t = e.content;
  16262. _e$_uniCloudOptions = e._uniCloudOptions;
  16263. n = _e$_uniCloudOptions === void 0 ? {} : _e$_uniCloudOptions;
  16264. s = n.encryptKeyId;
  16265. _context52.next = 6;
  16266. return this.appUtils.decrypt({
  16267. provider: this.provider,
  16268. spaceId: this.spaceId,
  16269. data: t,
  16270. key: s
  16271. });
  16272. case 6:
  16273. r = _context52.sent;
  16274. return _context52.abrupt("return", JSON.parse(r.data));
  16275. case 8:
  16276. case "end":
  16277. return _context52.stop();
  16278. }
  16279. }
  16280. }, _callee52, this);
  16281. }));
  16282. function platformDecryptResult(_x39) {
  16283. return _platformDecryptResult2.apply(this, arguments);
  16284. }
  16285. return platformDecryptResult;
  16286. }()
  16287. }, {
  16288. key: "isClientKeyNotFound",
  16289. value: function isClientKeyNotFound() {
  16290. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  16291. var t = e.result || {};
  16292. return 70009 === t.errCode && "uni-secure-network" === t.errSubject;
  16293. }
  16294. }]);
  16295. return Mn;
  16296. }(Ht);
  16297. function qn() {
  16298. var _ref36 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16299. e = _ref36.secretType;
  16300. return e === $t || e === Bt || e === Wt;
  16301. }
  16302. function Fn() {
  16303. var _ref37 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16304. e = _ref37.name,
  16305. _ref37$data = _ref37.data,
  16306. t = _ref37$data === void 0 ? {} : _ref37$data;
  16307. return "app" === C && "DCloud-clientDB" === e && "encryption" === t.redirectTo && "getAppClientKey" === t.action;
  16308. }
  16309. function Kn() {
  16310. var _ref38 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16311. e = _ref38.provider,
  16312. t = _ref38.spaceId,
  16313. n = _ref38.functionName;
  16314. var _ae = ae(),
  16315. s = _ae.appId,
  16316. r = _ae.uniPlatform,
  16317. i = _ae.osName;
  16318. var o = r;
  16319. "app" === r && (o = i);
  16320. var a = function () {
  16321. var _ref39 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16322. e = _ref39.provider,
  16323. t = _ref39.spaceId;
  16324. var n = A;
  16325. if (!n) return {};
  16326. e = function (e) {
  16327. return "tencent" === e ? "tcb" : e;
  16328. }(e);
  16329. var s = n.find(function (n) {
  16330. return n.provider === e && n.spaceId === t;
  16331. });
  16332. return s && s.config;
  16333. }({
  16334. provider: e,
  16335. spaceId: t
  16336. });
  16337. if (!a || !a.accessControl || !a.accessControl.enable) return !1;
  16338. var c = a.accessControl.function || {},
  16339. u = Object.keys(c);
  16340. if (0 === u.length) return !0;
  16341. var h = function (e, t) {
  16342. var n, s, r;
  16343. for (var _i2 = 0; _i2 < e.length; _i2++) {
  16344. var _o2 = e[_i2];
  16345. _o2 !== t ? "*" !== _o2 ? _o2.split(",").map(function (e) {
  16346. return e.trim();
  16347. }).indexOf(t) > -1 && (s = _o2) : r = _o2 : n = _o2;
  16348. }
  16349. return n || s || r;
  16350. }(u, n);
  16351. if (!h) return !1;
  16352. if ((c[h] || []).find(function () {
  16353. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  16354. return e.appId === s && (e.platform || "").toLowerCase() === o.toLowerCase();
  16355. })) return !0;
  16356. 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")), En(Tn);
  16357. }
  16358. function jn(_ref40) {
  16359. var e = _ref40.functionName,
  16360. t = _ref40.result,
  16361. n = _ref40.logPvd;
  16362. if (S && this.__dev__.debugLog && t && t.requestId) {
  16363. var _s12 = JSON.stringify({
  16364. spaceId: this.config.spaceId,
  16365. functionName: e,
  16366. requestId: t.requestId
  16367. });
  16368. console.log("[".concat(n, "-request]").concat(_s12, "[/").concat(n, "-request]"));
  16369. }
  16370. }
  16371. function $n(e) {
  16372. var t = e.callFunction,
  16373. n = function n(_n10) {
  16374. var _this19 = this;
  16375. var s = _n10.name;
  16376. _n10.data = Nt.call(e, {
  16377. data: _n10.data
  16378. });
  16379. var r = {
  16380. aliyun: "aliyun",
  16381. tencent: "tcb",
  16382. tcb: "tcb",
  16383. alipay: "alipay"
  16384. }[this.config.provider],
  16385. i = qn(_n10),
  16386. o = Fn(_n10),
  16387. a = i || o;
  16388. return t.call(this, _n10).then(function (e) {
  16389. return e.errCode = 0, !a && jn.call(_this19, {
  16390. functionName: s,
  16391. result: e,
  16392. logPvd: r
  16393. }), Promise.resolve(e);
  16394. }, function (e) {
  16395. return !a && jn.call(_this19, {
  16396. functionName: s,
  16397. result: e,
  16398. logPvd: r
  16399. }), e && e.message && (e.message = function () {
  16400. var _ref41 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16401. _ref41$message = _ref41.message,
  16402. e = _ref41$message === void 0 ? "" : _ref41$message,
  16403. _ref41$extraInfo = _ref41.extraInfo,
  16404. t = _ref41$extraInfo === void 0 ? {} : _ref41$extraInfo,
  16405. _ref41$formatter = _ref41.formatter,
  16406. n = _ref41$formatter === void 0 ? [] : _ref41$formatter;
  16407. for (var _s13 = 0; _s13 < n.length; _s13++) {
  16408. var _n$_s = n[_s13],
  16409. _r6 = _n$_s.rule,
  16410. _i3 = _n$_s.content,
  16411. _o3 = _n$_s.mode,
  16412. _a = e.match(_r6);
  16413. if (!_a) continue;
  16414. var _c = _i3;
  16415. for (var _e19 = 1; _e19 < _a.length; _e19++) {
  16416. _c = Kt(_c, "{$".concat(_e19, "}"), _a[_e19]);
  16417. }
  16418. for (var _e20 in t) {
  16419. _c = Kt(_c, "{".concat(_e20, "}"), t[_e20]);
  16420. }
  16421. return "replace" === _o3 ? _c : e + _c;
  16422. }
  16423. return e;
  16424. }({
  16425. message: "[".concat(_n10.name, "]: ").concat(e.message),
  16426. formatter: Mt,
  16427. extraInfo: {
  16428. functionName: s
  16429. }
  16430. })), Promise.reject(e);
  16431. });
  16432. };
  16433. e.callFunction = function (t) {
  16434. var _e$config = e.config,
  16435. s = _e$config.provider,
  16436. r = _e$config.spaceId,
  16437. i = t.name;
  16438. var o, a;
  16439. if (t.data = t.data || {}, S && e.__dev__.debugInfo && !e.__dev__.debugInfo.forceRemote && T ? (e._callCloudFunction || (e._callCloudFunction = n, e._callLocalFunction = Dt), o = Dt) : o = n, o = o.bind(e), Fn(t)) a = n.call(e, t);else if (function (_ref42) {
  16440. var e = _ref42.name,
  16441. _ref42$data = _ref42.data,
  16442. t = _ref42$data === void 0 ? {} : _ref42$data;
  16443. return "mp-weixin" === C && "uni-id-co" === e && "secureNetworkHandshakeByWeixin" === t.method;
  16444. }(t)) a = o.call(e, t);else if (qn(t)) {
  16445. a = new Rn({
  16446. secretType: t.secretType,
  16447. uniCloudIns: e
  16448. }).wrapEncryptDataCallFunction(n.bind(e))(t);
  16449. } else if (Kn({
  16450. provider: s,
  16451. spaceId: r,
  16452. functionName: i
  16453. })) {
  16454. a = new Rn({
  16455. secretType: t.secretType,
  16456. uniCloudIns: e
  16457. }).wrapVerifyClientCallFunction(n.bind(e))(t);
  16458. } else a = o(t);
  16459. return Object.defineProperty(a, "result", {
  16460. get: function get() {
  16461. return console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {};
  16462. }
  16463. }), a.then(function (e) {
  16464. return "undefined" != typeof UTSJSONObject && (e.result = new UTSJSONObject(e.result)), e;
  16465. });
  16466. };
  16467. }
  16468. Rn = "mp-weixin" !== C && "app" !== C ? /*#__PURE__*/function () {
  16469. function _class2() {
  16470. (0, _classCallCheck2.default)(this, _class2);
  16471. throw En({
  16472. message: "Platform ".concat(C, " is not supported by secure network")
  16473. });
  16474. }
  16475. return (0, _createClass2.default)(_class2);
  16476. }() : k ? "mp-weixin" === C ? Nn : Mn : /*#__PURE__*/function () {
  16477. function _class3() {
  16478. (0, _classCallCheck2.default)(this, _class3);
  16479. throw En({
  16480. message: "Platform ".concat(C, " is not enabled, please check whether secure network module is enabled in your manifest.json")
  16481. });
  16482. }
  16483. return (0, _createClass2.default)(_class3);
  16484. }();
  16485. var Bn = Symbol("CLIENT_DB_INTERNAL");
  16486. function Wn(e, t) {
  16487. return e.then = "DoNotReturnProxyWithAFunctionNamedThen", e._internalType = Bn, e.inspect = null, e.__ob__ = void 0, new Proxy(e, {
  16488. get: function get(e, n, s) {
  16489. if ("_uniClient" === n) return null;
  16490. if ("symbol" == (0, _typeof2.default)(n)) return e[n];
  16491. if (n in e || "string" != typeof n) {
  16492. var _t11 = e[n];
  16493. return "function" == typeof _t11 ? _t11.bind(e) : _t11;
  16494. }
  16495. return t.get(e, n, s);
  16496. }
  16497. });
  16498. }
  16499. function Hn(e) {
  16500. return {
  16501. on: function on(t, n) {
  16502. e[t] = e[t] || [], e[t].indexOf(n) > -1 || e[t].push(n);
  16503. },
  16504. off: function off(t, n) {
  16505. e[t] = e[t] || [];
  16506. var s = e[t].indexOf(n);
  16507. -1 !== s && e[t].splice(s, 1);
  16508. }
  16509. };
  16510. }
  16511. var zn = ["db.Geo", "db.command", "command.aggregate"];
  16512. function Jn(e, t) {
  16513. return zn.indexOf("".concat(e, ".").concat(t)) > -1;
  16514. }
  16515. function Vn(e) {
  16516. switch (f(e)) {
  16517. case "array":
  16518. return e.map(function (e) {
  16519. return Vn(e);
  16520. });
  16521. case "object":
  16522. return e._internalType === Bn || Object.keys(e).forEach(function (t) {
  16523. e[t] = Vn(e[t]);
  16524. }), e;
  16525. case "regexp":
  16526. return {
  16527. $regexp: {
  16528. source: e.source,
  16529. flags: e.flags
  16530. }
  16531. };
  16532. case "date":
  16533. return {
  16534. $date: e.toISOString()
  16535. };
  16536. default:
  16537. return e;
  16538. }
  16539. }
  16540. function Gn(e) {
  16541. return e && e.content && e.content.$method;
  16542. }
  16543. var Yn = /*#__PURE__*/function () {
  16544. function Yn(e, t, n) {
  16545. (0, _classCallCheck2.default)(this, Yn);
  16546. this.content = e, this.prevStage = t || null, this.udb = null, this._database = n;
  16547. }
  16548. (0, _createClass2.default)(Yn, [{
  16549. key: "toJSON",
  16550. value: function toJSON() {
  16551. var e = this;
  16552. var t = [e.content];
  16553. for (; e.prevStage;) {
  16554. e = e.prevStage, t.push(e.content);
  16555. }
  16556. return {
  16557. $db: t.reverse().map(function (e) {
  16558. return {
  16559. $method: e.$method,
  16560. $param: Vn(e.$param)
  16561. };
  16562. })
  16563. };
  16564. }
  16565. }, {
  16566. key: "toString",
  16567. value: function toString() {
  16568. return JSON.stringify(this.toJSON());
  16569. }
  16570. }, {
  16571. key: "getAction",
  16572. value: function getAction() {
  16573. var e = this.toJSON().$db.find(function (e) {
  16574. return "action" === e.$method;
  16575. });
  16576. return e && e.$param && e.$param[0];
  16577. }
  16578. }, {
  16579. key: "getCommand",
  16580. value: function getCommand() {
  16581. return {
  16582. $db: this.toJSON().$db.filter(function (e) {
  16583. return "action" !== e.$method;
  16584. })
  16585. };
  16586. }
  16587. }, {
  16588. key: "isAggregate",
  16589. get: function get() {
  16590. var e = this;
  16591. for (; e;) {
  16592. var t = Gn(e),
  16593. _n11 = Gn(e.prevStage);
  16594. if ("aggregate" === t && "collection" === _n11 || "pipeline" === t) return !0;
  16595. e = e.prevStage;
  16596. }
  16597. return !1;
  16598. }
  16599. }, {
  16600. key: "isCommand",
  16601. get: function get() {
  16602. var e = this;
  16603. for (; e;) {
  16604. if ("command" === Gn(e)) return !0;
  16605. e = e.prevStage;
  16606. }
  16607. return !1;
  16608. }
  16609. }, {
  16610. key: "isAggregateCommand",
  16611. get: function get() {
  16612. var e = this;
  16613. for (; e;) {
  16614. var t = Gn(e),
  16615. _n12 = Gn(e.prevStage);
  16616. if ("aggregate" === t && "command" === _n12) return !0;
  16617. e = e.prevStage;
  16618. }
  16619. return !1;
  16620. }
  16621. }, {
  16622. key: "getNextStageFn",
  16623. value: function getNextStageFn(e) {
  16624. var t = this;
  16625. return function () {
  16626. return Qn({
  16627. $method: e,
  16628. $param: Vn(Array.from(arguments))
  16629. }, t, t._database);
  16630. };
  16631. }
  16632. }, {
  16633. key: "count",
  16634. get: function get() {
  16635. return this.isAggregate ? this.getNextStageFn("count") : function () {
  16636. return this._send("count", Array.from(arguments));
  16637. };
  16638. }
  16639. }, {
  16640. key: "remove",
  16641. get: function get() {
  16642. return this.isCommand ? this.getNextStageFn("remove") : function () {
  16643. return this._send("remove", Array.from(arguments));
  16644. };
  16645. }
  16646. }, {
  16647. key: "get",
  16648. value: function get() {
  16649. return this._send("get", Array.from(arguments));
  16650. }
  16651. }, {
  16652. key: "add",
  16653. get: function get() {
  16654. return this.isCommand ? this.getNextStageFn("add") : function () {
  16655. return this._send("add", Array.from(arguments));
  16656. };
  16657. }
  16658. }, {
  16659. key: "update",
  16660. value: function update() {
  16661. return this._send("update", Array.from(arguments));
  16662. }
  16663. }, {
  16664. key: "end",
  16665. value: function end() {
  16666. return this._send("end", Array.from(arguments));
  16667. }
  16668. }, {
  16669. key: "set",
  16670. get: function get() {
  16671. return this.isCommand ? this.getNextStageFn("set") : function () {
  16672. throw new Error("JQL禁止使用set方法");
  16673. };
  16674. }
  16675. }, {
  16676. key: "_send",
  16677. value: function _send(e, t) {
  16678. var n = this.getAction(),
  16679. s = this.getCommand();
  16680. if (s.$db.push({
  16681. $method: e,
  16682. $param: Vn(t)
  16683. }), S) {
  16684. var _e21 = s.$db.find(function (e) {
  16685. return "collection" === e.$method;
  16686. }),
  16687. _t12 = _e21 && _e21.$param;
  16688. _t12 && 1 === _t12.length && "string" == typeof _e21.$param[0] && _e21.$param[0].indexOf(",") > -1 && console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
  16689. }
  16690. return this._database._callCloudFunction({
  16691. action: n,
  16692. command: s
  16693. });
  16694. }
  16695. }]);
  16696. return Yn;
  16697. }();
  16698. function Qn(e, t, n) {
  16699. return Wn(new Yn(e, t, n), {
  16700. get: function get(e, t) {
  16701. var s = "db";
  16702. return e && e.content && (s = e.content.$method), Jn(s, t) ? Qn({
  16703. $method: t
  16704. }, e, n) : function () {
  16705. return Qn({
  16706. $method: t,
  16707. $param: Vn(Array.from(arguments))
  16708. }, e, n);
  16709. };
  16710. }
  16711. });
  16712. }
  16713. function Xn(_ref43) {
  16714. var e = _ref43.path,
  16715. t = _ref43.method;
  16716. return /*#__PURE__*/function () {
  16717. function _class4() {
  16718. (0, _classCallCheck2.default)(this, _class4);
  16719. this.param = Array.from(arguments);
  16720. }
  16721. (0, _createClass2.default)(_class4, [{
  16722. key: "toJSON",
  16723. value: function toJSON() {
  16724. return {
  16725. $newDb: [].concat((0, _toConsumableArray2.default)(e.map(function (e) {
  16726. return {
  16727. $method: e
  16728. };
  16729. })), [{
  16730. $method: t,
  16731. $param: this.param
  16732. }])
  16733. };
  16734. }
  16735. }, {
  16736. key: "toString",
  16737. value: function toString() {
  16738. return JSON.stringify(this.toJSON());
  16739. }
  16740. }]);
  16741. return _class4;
  16742. }();
  16743. }
  16744. function Zn(e) {
  16745. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16746. return Wn(new e(t), {
  16747. get: function get(e, t) {
  16748. return Jn("db", t) ? Qn({
  16749. $method: t
  16750. }, null, e) : function () {
  16751. return Qn({
  16752. $method: t,
  16753. $param: Vn(Array.from(arguments))
  16754. }, null, e);
  16755. };
  16756. }
  16757. });
  16758. }
  16759. var es = /*#__PURE__*/function (_ref44) {
  16760. (0, _inherits2.default)(es, _ref44);
  16761. var _super11 = _createSuper(es);
  16762. function es() {
  16763. (0, _classCallCheck2.default)(this, es);
  16764. return _super11.apply(this, arguments);
  16765. }
  16766. (0, _createClass2.default)(es, [{
  16767. key: "_parseResult",
  16768. value: function _parseResult(e) {
  16769. return this._isJQL ? e.result : e;
  16770. }
  16771. }, {
  16772. key: "_callCloudFunction",
  16773. value: function _callCloudFunction(_ref45) {
  16774. var _this20 = this;
  16775. var e = _ref45.action,
  16776. t = _ref45.command,
  16777. n = _ref45.multiCommand,
  16778. s = _ref45.queryList;
  16779. function r(e, t) {
  16780. if (n && s) for (var _n13 = 0; _n13 < s.length; _n13++) {
  16781. var _r7 = s[_n13];
  16782. _r7.udb && "function" == typeof _r7.udb.setResult && (t ? _r7.udb.setResult(t) : _r7.udb.setResult(e.result.dataList[_n13]));
  16783. }
  16784. }
  16785. var i = this,
  16786. o = this._isJQL ? "databaseForJQL" : "database";
  16787. function a(e) {
  16788. return i._callback("error", [e]), M(q(o, "fail"), e).then(function () {
  16789. return M(q(o, "complete"), e);
  16790. }).then(function () {
  16791. return r(null, e), Y(j, {
  16792. type: W,
  16793. content: e
  16794. }), Promise.reject(e);
  16795. });
  16796. }
  16797. var c = M(q(o, "invoke")),
  16798. u = this._uniClient;
  16799. return c.then(function () {
  16800. return u.callFunction({
  16801. name: "DCloud-clientDB",
  16802. type: h,
  16803. data: {
  16804. action: e,
  16805. command: t,
  16806. multiCommand: n
  16807. }
  16808. });
  16809. }).then(function (e) {
  16810. var _e$result = e.result,
  16811. t = _e$result.code,
  16812. n = _e$result.message,
  16813. s = _e$result.token,
  16814. c = _e$result.tokenExpired,
  16815. _e$result$systemInfo = _e$result.systemInfo,
  16816. u = _e$result$systemInfo === void 0 ? [] : _e$result$systemInfo;
  16817. if (u) for (var _e22 = 0; _e22 < u.length; _e22++) {
  16818. var _u$_e = u[_e22],
  16819. _t13 = _u$_e.level,
  16820. _n14 = _u$_e.message,
  16821. _s14 = _u$_e.detail,
  16822. _r8 = console["app" === C && "warn" === _t13 ? "error" : _t13] || console.log;
  16823. var _i4 = "[System Info]" + _n14;
  16824. _s14 && (_i4 = "".concat(_i4, "\n\u8BE6\u7EC6\u4FE1\u606F\uFF1A").concat(_s14)), _r8(_i4);
  16825. }
  16826. if (t) {
  16827. return a(new te({
  16828. code: t,
  16829. message: n,
  16830. requestId: e.requestId
  16831. }));
  16832. }
  16833. e.result.errCode = e.result.errCode || e.result.code, e.result.errMsg = e.result.errMsg || e.result.message, s && c && (re({
  16834. token: s,
  16835. tokenExpired: c
  16836. }), _this20._callbackAuth("refreshToken", [{
  16837. token: s,
  16838. tokenExpired: c
  16839. }]), _this20._callback("refreshToken", [{
  16840. token: s,
  16841. tokenExpired: c
  16842. }]), Y(B, {
  16843. token: s,
  16844. tokenExpired: c
  16845. }));
  16846. var h = [{
  16847. prop: "affectedDocs",
  16848. tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"
  16849. }, {
  16850. prop: "code",
  16851. tips: "code不再推荐使用,请使用errCode替代"
  16852. }, {
  16853. prop: "message",
  16854. tips: "message不再推荐使用,请使用errMsg替代"
  16855. }];
  16856. var _loop2 = function _loop2(_t14) {
  16857. var _h$_t = h[_t14],
  16858. n = _h$_t.prop,
  16859. s = _h$_t.tips;
  16860. if (n in e.result) {
  16861. var _t15 = e.result[n];
  16862. Object.defineProperty(e.result, n, {
  16863. get: function get() {
  16864. return console.warn(s), _t15;
  16865. }
  16866. });
  16867. }
  16868. };
  16869. for (var _t14 = 0; _t14 < h.length; _t14++) {
  16870. _loop2(_t14);
  16871. }
  16872. return function (e) {
  16873. return M(q(o, "success"), e).then(function () {
  16874. return M(q(o, "complete"), e);
  16875. }).then(function () {
  16876. r(e, null);
  16877. var t = i._parseResult(e);
  16878. return Y(j, {
  16879. type: W,
  16880. content: t
  16881. }), Promise.resolve(t);
  16882. });
  16883. }(e);
  16884. }, function (e) {
  16885. /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
  16886. return a(new te({
  16887. code: e.code || "SYSTEM_ERROR",
  16888. message: e.message,
  16889. requestId: e.requestId
  16890. }));
  16891. });
  16892. }
  16893. }]);
  16894. return es;
  16895. }( /*#__PURE__*/function () {
  16896. function _class5() {
  16897. var _ref46 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16898. _ref46$uniClient = _ref46.uniClient,
  16899. e = _ref46$uniClient === void 0 ? {} : _ref46$uniClient,
  16900. _ref46$isJQL = _ref46.isJQL,
  16901. t = _ref46$isJQL === void 0 ? !1 : _ref46$isJQL;
  16902. (0, _classCallCheck2.default)(this, _class5);
  16903. this._uniClient = e, this._authCallBacks = {}, this._dbCallBacks = {}, e._isDefault && (this._dbCallBacks = L("_globalUniCloudDatabaseCallback")), t || (this.auth = Hn(this._authCallBacks)), this._isJQL = t, Object.assign(this, Hn(this._dbCallBacks)), this.env = Wn({}, {
  16904. get: function get(e, t) {
  16905. return {
  16906. $env: t
  16907. };
  16908. }
  16909. }), this.Geo = Wn({}, {
  16910. get: function get(e, t) {
  16911. return Xn({
  16912. path: ["Geo"],
  16913. method: t
  16914. });
  16915. }
  16916. }), this.serverDate = Xn({
  16917. path: [],
  16918. method: "serverDate"
  16919. }), this.RegExp = Xn({
  16920. path: [],
  16921. method: "RegExp"
  16922. });
  16923. }
  16924. (0, _createClass2.default)(_class5, [{
  16925. key: "getCloudEnv",
  16926. value: function getCloudEnv(e) {
  16927. if ("string" != typeof e || !e.trim()) throw new Error("getCloudEnv参数错误");
  16928. return {
  16929. $env: e.replace("$cloudEnv_", "")
  16930. };
  16931. }
  16932. }, {
  16933. key: "_callback",
  16934. value: function _callback(e, t) {
  16935. var n = this._dbCallBacks;
  16936. n[e] && n[e].forEach(function (e) {
  16937. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  16938. });
  16939. }
  16940. }, {
  16941. key: "_callbackAuth",
  16942. value: function _callbackAuth(e, t) {
  16943. var n = this._authCallBacks;
  16944. n[e] && n[e].forEach(function (e) {
  16945. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  16946. });
  16947. }
  16948. }, {
  16949. key: "multiSend",
  16950. value: function multiSend() {
  16951. var e = Array.from(arguments),
  16952. t = e.map(function (e) {
  16953. var t = e.getAction(),
  16954. n = e.getCommand();
  16955. if ("getTemp" !== n.$db[n.$db.length - 1].$method) throw new Error("multiSend只支持子命令内使用getTemp");
  16956. return {
  16957. action: t,
  16958. command: n
  16959. };
  16960. });
  16961. return this._callCloudFunction({
  16962. multiCommand: t,
  16963. queryList: e
  16964. });
  16965. }
  16966. }]);
  16967. return _class5;
  16968. }());
  16969. var ts = "token无效,跳转登录页面",
  16970. ns = "token过期,跳转登录页面",
  16971. ss = {
  16972. TOKEN_INVALID_TOKEN_EXPIRED: ns,
  16973. TOKEN_INVALID_INVALID_CLIENTID: ts,
  16974. TOKEN_INVALID: ts,
  16975. TOKEN_INVALID_WRONG_TOKEN: ts,
  16976. TOKEN_INVALID_ANONYMOUS_USER: ts
  16977. },
  16978. rs = {
  16979. "uni-id-token-expired": ns,
  16980. "uni-id-check-token-failed": ts,
  16981. "uni-id-token-not-exist": ts,
  16982. "uni-id-check-device-feature-failed": ts
  16983. };
  16984. function is(e, t) {
  16985. var n = "";
  16986. return n = e ? "".concat(e, "/").concat(t) : t, n.replace(/^\//, "");
  16987. }
  16988. function os() {
  16989. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  16990. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
  16991. var n = [],
  16992. s = [];
  16993. return e.forEach(function (e) {
  16994. !0 === e.needLogin ? n.push(is(t, e.path)) : !1 === e.needLogin && s.push(is(t, e.path));
  16995. }), {
  16996. needLoginPage: n,
  16997. notNeedLoginPage: s
  16998. };
  16999. }
  17000. function as(e) {
  17001. return e.split("?")[0].replace(/^\//, "");
  17002. }
  17003. function cs() {
  17004. return function (e) {
  17005. var t = e && e.$page && e.$page.fullPath || "";
  17006. return t ? ("/" !== t.charAt(0) && (t = "/" + t), t) : t;
  17007. }(function () {
  17008. var e = getCurrentPages();
  17009. return e[e.length - 1];
  17010. }());
  17011. }
  17012. function us() {
  17013. return as(cs());
  17014. }
  17015. function hs() {
  17016. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  17017. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17018. if (!e) return !1;
  17019. if (!(t && t.list && t.list.length)) return !1;
  17020. var n = t.list,
  17021. s = as(e);
  17022. return n.some(function (e) {
  17023. return e.pagePath === s;
  17024. });
  17025. }
  17026. var ls = !!_pages.default.uniIdRouter;
  17027. var _ref47 = function () {
  17028. var _ref28 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _pages.default,
  17029. _ref28$pages = _ref28.pages,
  17030. t = _ref28$pages === void 0 ? [] : _ref28$pages,
  17031. _ref28$subPackages = _ref28.subPackages,
  17032. n = _ref28$subPackages === void 0 ? [] : _ref28$subPackages,
  17033. _ref28$uniIdRouter = _ref28.uniIdRouter,
  17034. s = _ref28$uniIdRouter === void 0 ? {} : _ref28$uniIdRouter,
  17035. _ref28$tabBar = _ref28.tabBar,
  17036. r = _ref28$tabBar === void 0 ? {} : _ref28$tabBar;
  17037. var i = s.loginPage,
  17038. _s$needLogin = s.needLogin,
  17039. o = _s$needLogin === void 0 ? [] : _s$needLogin,
  17040. _s$resToLogin = s.resToLogin,
  17041. a = _s$resToLogin === void 0 ? !0 : _s$resToLogin,
  17042. _os = os(t),
  17043. c = _os.needLoginPage,
  17044. u = _os.notNeedLoginPage,
  17045. _ref30 = function () {
  17046. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  17047. var t = [],
  17048. n = [];
  17049. return e.forEach(function (e) {
  17050. var s = e.root,
  17051. _e$pages = e.pages,
  17052. r = _e$pages === void 0 ? [] : _e$pages,
  17053. _os2 = os(r, s),
  17054. i = _os2.needLoginPage,
  17055. o = _os2.notNeedLoginPage;
  17056. t.push.apply(t, (0, _toConsumableArray2.default)(i)), n.push.apply(n, (0, _toConsumableArray2.default)(o));
  17057. }), {
  17058. needLoginPage: t,
  17059. notNeedLoginPage: n
  17060. };
  17061. }(n),
  17062. h = _ref30.needLoginPage,
  17063. l = _ref30.notNeedLoginPage;
  17064. return {
  17065. loginPage: i,
  17066. routerNeedLogin: o,
  17067. resToLogin: a,
  17068. needLoginPage: [].concat((0, _toConsumableArray2.default)(c), (0, _toConsumableArray2.default)(h)),
  17069. notNeedLoginPage: [].concat((0, _toConsumableArray2.default)(u), (0, _toConsumableArray2.default)(l)),
  17070. loginPageInTabBar: hs(i, r)
  17071. };
  17072. }(),
  17073. ds = _ref47.loginPage,
  17074. ps = _ref47.routerNeedLogin,
  17075. fs = _ref47.resToLogin,
  17076. gs = _ref47.needLoginPage,
  17077. ms = _ref47.notNeedLoginPage,
  17078. ys = _ref47.loginPageInTabBar;
  17079. if (gs.indexOf(ds) > -1) throw new Error("Login page [".concat(ds, "] should not be \"needLogin\", please check your pages.json"));
  17080. function _s(e) {
  17081. var t = us();
  17082. if ("/" === e.charAt(0)) return e;
  17083. var _e$split = e.split("?"),
  17084. _e$split2 = (0, _slicedToArray2.default)(_e$split, 2),
  17085. n = _e$split2[0],
  17086. s = _e$split2[1],
  17087. r = n.replace(/^\//, "").split("/"),
  17088. i = t.split("/");
  17089. i.pop();
  17090. for (var _e23 = 0; _e23 < r.length; _e23++) {
  17091. var _t16 = r[_e23];
  17092. ".." === _t16 ? i.pop() : "." !== _t16 && i.push(_t16);
  17093. }
  17094. return "" === i[0] && i.shift(), "/" + i.join("/") + (s ? "?" + s : "");
  17095. }
  17096. function ws(e) {
  17097. var t = as(_s(e));
  17098. return !(ms.indexOf(t) > -1) && (gs.indexOf(t) > -1 || ps.some(function (t) {
  17099. return function (e, t) {
  17100. return new RegExp(t).test(e);
  17101. }(e, t);
  17102. }));
  17103. }
  17104. function vs(_ref48) {
  17105. var e = _ref48.redirect;
  17106. var t = as(e),
  17107. n = as(ds);
  17108. return us() !== n && t !== n;
  17109. }
  17110. function Is() {
  17111. var _ref49 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17112. e = _ref49.api,
  17113. t = _ref49.redirect;
  17114. if (!t || !vs({
  17115. redirect: t
  17116. })) return;
  17117. var n = function (e, t) {
  17118. return "/" !== e.charAt(0) && (e = "/" + e), t ? e.indexOf("?") > -1 ? e + "&uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e + "?uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e;
  17119. }(ds, t);
  17120. ys ? "navigateTo" !== e && "redirectTo" !== e || (e = "switchTab") : "switchTab" === e && (e = "navigateTo");
  17121. var s = {
  17122. navigateTo: uni.navigateTo,
  17123. redirectTo: uni.redirectTo,
  17124. switchTab: uni.switchTab,
  17125. reLaunch: uni.reLaunch
  17126. };
  17127. setTimeout(function () {
  17128. s[e]({
  17129. url: n
  17130. });
  17131. }, 0);
  17132. }
  17133. function Ss() {
  17134. var _ref50 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17135. e = _ref50.url;
  17136. var t = {
  17137. abortLoginPageJump: !1,
  17138. autoToLoginPage: !1
  17139. },
  17140. n = function () {
  17141. var _se3 = se(),
  17142. e = _se3.token,
  17143. t = _se3.tokenExpired;
  17144. var n;
  17145. if (e) {
  17146. if (t < Date.now()) {
  17147. var _e24 = "uni-id-token-expired";
  17148. n = {
  17149. errCode: _e24,
  17150. errMsg: rs[_e24]
  17151. };
  17152. }
  17153. } else {
  17154. var _e25 = "uni-id-check-token-failed";
  17155. n = {
  17156. errCode: _e25,
  17157. errMsg: rs[_e25]
  17158. };
  17159. }
  17160. return n;
  17161. }();
  17162. if (ws(e) && n) {
  17163. n.uniIdRedirectUrl = e;
  17164. if (J($).length > 0) return setTimeout(function () {
  17165. Y($, n);
  17166. }, 0), t.abortLoginPageJump = !0, t;
  17167. t.autoToLoginPage = !0;
  17168. }
  17169. return t;
  17170. }
  17171. function bs() {
  17172. !function () {
  17173. var e = cs(),
  17174. _Ss = Ss({
  17175. url: e
  17176. }),
  17177. t = _Ss.abortLoginPageJump,
  17178. n = _Ss.autoToLoginPage;
  17179. t || n && Is({
  17180. api: "redirectTo",
  17181. redirect: e
  17182. });
  17183. }();
  17184. var e = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
  17185. var _loop3 = function _loop3(_t17) {
  17186. var n = e[_t17];
  17187. uni.addInterceptor(n, {
  17188. invoke: function invoke(e) {
  17189. var _Ss2 = Ss({
  17190. url: e.url
  17191. }),
  17192. t = _Ss2.abortLoginPageJump,
  17193. s = _Ss2.autoToLoginPage;
  17194. return t ? e : s ? (Is({
  17195. api: n,
  17196. redirect: _s(e.url)
  17197. }), !1) : e;
  17198. }
  17199. });
  17200. };
  17201. for (var _t17 = 0; _t17 < e.length; _t17++) {
  17202. _loop3(_t17);
  17203. }
  17204. }
  17205. function ks() {
  17206. this.onResponse(function (e) {
  17207. var t = e.type,
  17208. n = e.content;
  17209. var s = !1;
  17210. switch (t) {
  17211. case "cloudobject":
  17212. s = function (e) {
  17213. if ("object" != (0, _typeof2.default)(e)) return !1;
  17214. var _ref51 = e || {},
  17215. t = _ref51.errCode;
  17216. return t in rs;
  17217. }(n);
  17218. break;
  17219. case "clientdb":
  17220. s = function (e) {
  17221. if ("object" != (0, _typeof2.default)(e)) return !1;
  17222. var _ref52 = e || {},
  17223. t = _ref52.errCode;
  17224. return t in ss;
  17225. }(n);
  17226. }
  17227. s && function () {
  17228. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  17229. var t = J($);
  17230. Z().then(function () {
  17231. var n = cs();
  17232. if (n && vs({
  17233. redirect: n
  17234. })) return t.length > 0 ? Y($, Object.assign({
  17235. uniIdRedirectUrl: n
  17236. }, e)) : void (ds && Is({
  17237. api: "navigateTo",
  17238. redirect: n
  17239. }));
  17240. });
  17241. }(n);
  17242. });
  17243. }
  17244. function As(e) {
  17245. !function (e) {
  17246. e.onResponse = function (e) {
  17247. V(j, e);
  17248. }, e.offResponse = function (e) {
  17249. G(j, e);
  17250. };
  17251. }(e), function (e) {
  17252. e.onNeedLogin = function (e) {
  17253. V($, e);
  17254. }, e.offNeedLogin = function (e) {
  17255. G($, e);
  17256. }, ls && (L("_globalUniCloudStatus").needLoginInit || (L("_globalUniCloudStatus").needLoginInit = !0, Z().then(function () {
  17257. bs.call(e);
  17258. }), fs && ks.call(e)));
  17259. }(e), function (e) {
  17260. e.onRefreshToken = function (e) {
  17261. V(B, e);
  17262. }, e.offRefreshToken = function (e) {
  17263. G(B, e);
  17264. };
  17265. }(e);
  17266. }
  17267. var Cs;
  17268. var Ps = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  17269. Ts = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  17270. function xs() {
  17271. var e = se().token || "",
  17272. t = e.split(".");
  17273. if (!e || 3 !== t.length) return {
  17274. uid: null,
  17275. role: [],
  17276. permission: [],
  17277. tokenExpired: 0
  17278. };
  17279. var n;
  17280. try {
  17281. n = JSON.parse((s = t[1], decodeURIComponent(Cs(s).split("").map(function (e) {
  17282. return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2);
  17283. }).join(""))));
  17284. } catch (e) {
  17285. throw new Error("获取当前用户信息出错,详细错误信息为:" + e.message);
  17286. }
  17287. var s;
  17288. return n.tokenExpired = 1e3 * n.exp, delete n.exp, delete n.iat, n;
  17289. }
  17290. Cs = "function" != typeof atob ? function (e) {
  17291. if (e = String(e).replace(/[\t\n\f\r ]+/g, ""), !Ts.test(e)) throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  17292. var t;
  17293. e += "==".slice(2 - (3 & e.length));
  17294. for (var n, s, r = "", i = 0; i < e.length;) {
  17295. t = Ps.indexOf(e.charAt(i++)) << 18 | Ps.indexOf(e.charAt(i++)) << 12 | (n = Ps.indexOf(e.charAt(i++))) << 6 | (s = Ps.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);
  17296. }
  17297. return r;
  17298. } : atob;
  17299. var Os = n(function (e, t) {
  17300. Object.defineProperty(t, "__esModule", {
  17301. value: !0
  17302. });
  17303. var n = "chooseAndUploadFile:ok",
  17304. s = "chooseAndUploadFile:fail";
  17305. function r(e, t) {
  17306. return e.tempFiles.forEach(function (e, n) {
  17307. 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("."));
  17308. }), e.tempFilePaths || (e.tempFilePaths = e.tempFiles.map(function (e) {
  17309. return e.path;
  17310. })), e;
  17311. }
  17312. function i(e, t, _ref53) {
  17313. var s = _ref53.onChooseFile,
  17314. r = _ref53.onUploadProgress;
  17315. return t.then(function (e) {
  17316. if (s) {
  17317. var _t18 = s(e);
  17318. if (void 0 !== _t18) return Promise.resolve(_t18).then(function (t) {
  17319. return void 0 === t ? e : t;
  17320. });
  17321. }
  17322. return e;
  17323. }).then(function (t) {
  17324. return !1 === t ? {
  17325. errMsg: n,
  17326. tempFilePaths: [],
  17327. tempFiles: []
  17328. } : function (e, t) {
  17329. var s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;
  17330. var r = arguments.length > 3 ? arguments[3] : undefined;
  17331. (t = Object.assign({}, t)).errMsg = n;
  17332. var i = t.tempFiles,
  17333. o = i.length;
  17334. var a = 0;
  17335. return new Promise(function (n) {
  17336. for (; a < s;) {
  17337. c();
  17338. }
  17339. function c() {
  17340. var s = a++;
  17341. if (s >= o) return void (!i.find(function (e) {
  17342. return !e.url && !e.errMsg;
  17343. }) && n(t));
  17344. var u = i[s];
  17345. e.uploadFile({
  17346. provider: u.provider,
  17347. filePath: u.path,
  17348. cloudPath: u.cloudPath,
  17349. fileType: u.fileType,
  17350. cloudPathAsRealPath: u.cloudPathAsRealPath,
  17351. onUploadProgress: function onUploadProgress(e) {
  17352. e.index = s, e.tempFile = u, e.tempFilePath = u.path, r && r(e);
  17353. }
  17354. }).then(function (e) {
  17355. u.url = e.fileID, s < o && c();
  17356. }).catch(function (e) {
  17357. u.errMsg = e.errMsg || e.message, s < o && c();
  17358. });
  17359. }
  17360. });
  17361. }(e, t, 5, r);
  17362. });
  17363. }
  17364. t.initChooseAndUploadFile = function (e) {
  17365. return function () {
  17366. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  17367. type: "all"
  17368. };
  17369. return "image" === t.type ? i(e, function (e) {
  17370. var t = e.count,
  17371. n = e.sizeType,
  17372. _e$sourceType = e.sourceType,
  17373. i = _e$sourceType === void 0 ? ["album", "camera"] : _e$sourceType,
  17374. o = e.extension;
  17375. return new Promise(function (e, a) {
  17376. uni.chooseImage({
  17377. count: t,
  17378. sizeType: n,
  17379. sourceType: i,
  17380. extension: o,
  17381. success: function success(t) {
  17382. e(r(t, "image"));
  17383. },
  17384. fail: function fail(e) {
  17385. a({
  17386. errMsg: e.errMsg.replace("chooseImage:fail", s)
  17387. });
  17388. }
  17389. });
  17390. });
  17391. }(t), t) : "video" === t.type ? i(e, function (e) {
  17392. var t = e.camera,
  17393. n = e.compressed,
  17394. i = e.maxDuration,
  17395. _e$sourceType2 = e.sourceType,
  17396. o = _e$sourceType2 === void 0 ? ["album", "camera"] : _e$sourceType2,
  17397. a = e.extension;
  17398. return new Promise(function (e, c) {
  17399. uni.chooseVideo({
  17400. camera: t,
  17401. compressed: n,
  17402. maxDuration: i,
  17403. sourceType: o,
  17404. extension: a,
  17405. success: function success(t) {
  17406. var n = t.tempFilePath,
  17407. s = t.duration,
  17408. i = t.size,
  17409. o = t.height,
  17410. a = t.width;
  17411. e(r({
  17412. errMsg: "chooseVideo:ok",
  17413. tempFilePaths: [n],
  17414. tempFiles: [{
  17415. name: t.tempFile && t.tempFile.name || "",
  17416. path: n,
  17417. size: i,
  17418. type: t.tempFile && t.tempFile.type || "",
  17419. width: a,
  17420. height: o,
  17421. duration: s,
  17422. fileType: "video",
  17423. cloudPath: ""
  17424. }]
  17425. }, "video"));
  17426. },
  17427. fail: function fail(e) {
  17428. c({
  17429. errMsg: e.errMsg.replace("chooseVideo:fail", s)
  17430. });
  17431. }
  17432. });
  17433. });
  17434. }(t), t) : i(e, function (e) {
  17435. var t = e.count,
  17436. n = e.extension;
  17437. return new Promise(function (e, i) {
  17438. var o = uni.chooseFile;
  17439. if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (o = wx.chooseMessageFile), "function" != typeof o) return i({
  17440. errMsg: s + " 请指定 type 类型,该平台仅支持选择 image 或 video。"
  17441. });
  17442. o({
  17443. type: "all",
  17444. count: t,
  17445. extension: n,
  17446. success: function success(t) {
  17447. e(r(t));
  17448. },
  17449. fail: function fail(e) {
  17450. i({
  17451. errMsg: e.errMsg.replace("chooseFile:fail", s)
  17452. });
  17453. }
  17454. });
  17455. });
  17456. }(t), t);
  17457. };
  17458. };
  17459. }),
  17460. Es = t(Os);
  17461. var Ls = "manual";
  17462. function Rs(e) {
  17463. return {
  17464. props: {
  17465. localdata: {
  17466. type: Array,
  17467. default: function _default() {
  17468. return [];
  17469. }
  17470. },
  17471. options: {
  17472. type: [Object, Array],
  17473. default: function _default() {
  17474. return {};
  17475. }
  17476. },
  17477. spaceInfo: {
  17478. type: Object,
  17479. default: function _default() {
  17480. return {};
  17481. }
  17482. },
  17483. collection: {
  17484. type: [String, Array],
  17485. default: ""
  17486. },
  17487. action: {
  17488. type: String,
  17489. default: ""
  17490. },
  17491. field: {
  17492. type: String,
  17493. default: ""
  17494. },
  17495. orderby: {
  17496. type: String,
  17497. default: ""
  17498. },
  17499. where: {
  17500. type: [String, Object],
  17501. default: ""
  17502. },
  17503. pageData: {
  17504. type: String,
  17505. default: "add"
  17506. },
  17507. pageCurrent: {
  17508. type: Number,
  17509. default: 1
  17510. },
  17511. pageSize: {
  17512. type: Number,
  17513. default: 20
  17514. },
  17515. getcount: {
  17516. type: [Boolean, String],
  17517. default: !1
  17518. },
  17519. gettree: {
  17520. type: [Boolean, String],
  17521. default: !1
  17522. },
  17523. gettreepath: {
  17524. type: [Boolean, String],
  17525. default: !1
  17526. },
  17527. startwith: {
  17528. type: String,
  17529. default: ""
  17530. },
  17531. limitlevel: {
  17532. type: Number,
  17533. default: 10
  17534. },
  17535. groupby: {
  17536. type: String,
  17537. default: ""
  17538. },
  17539. groupField: {
  17540. type: String,
  17541. default: ""
  17542. },
  17543. distinct: {
  17544. type: [Boolean, String],
  17545. default: !1
  17546. },
  17547. foreignKey: {
  17548. type: String,
  17549. default: ""
  17550. },
  17551. loadtime: {
  17552. type: String,
  17553. default: "auto"
  17554. },
  17555. manual: {
  17556. type: Boolean,
  17557. default: !1
  17558. }
  17559. },
  17560. data: function data() {
  17561. return {
  17562. mixinDatacomLoading: !1,
  17563. mixinDatacomHasMore: !1,
  17564. mixinDatacomResData: [],
  17565. mixinDatacomErrorMessage: "",
  17566. mixinDatacomPage: {},
  17567. mixinDatacomError: null
  17568. };
  17569. },
  17570. created: function created() {
  17571. var _this21 = this;
  17572. this.mixinDatacomPage = {
  17573. current: this.pageCurrent,
  17574. size: this.pageSize,
  17575. count: 0
  17576. }, this.$watch(function () {
  17577. var e = [];
  17578. return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach(function (t) {
  17579. e.push(_this21[t]);
  17580. }), e;
  17581. }, function (e, t) {
  17582. if (_this21.loadtime === Ls) return;
  17583. var n = !1;
  17584. var s = [];
  17585. for (var _r9 = 2; _r9 < e.length; _r9++) {
  17586. e[_r9] !== t[_r9] && (s.push(e[_r9]), n = !0);
  17587. }
  17588. e[0] !== t[0] && (_this21.mixinDatacomPage.current = _this21.pageCurrent), _this21.mixinDatacomPage.size = _this21.pageSize, _this21.onMixinDatacomPropsChange(n, s);
  17589. });
  17590. },
  17591. methods: {
  17592. onMixinDatacomPropsChange: function onMixinDatacomPropsChange(e, t) {},
  17593. mixinDatacomEasyGet: function mixinDatacomEasyGet() {
  17594. var _this22 = this;
  17595. var _ref54 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17596. _ref54$getone = _ref54.getone,
  17597. e = _ref54$getone === void 0 ? !1 : _ref54$getone,
  17598. t = _ref54.success,
  17599. n = _ref54.fail;
  17600. this.mixinDatacomLoading || (this.mixinDatacomLoading = !0, this.mixinDatacomErrorMessage = "", this.mixinDatacomError = null, this.mixinDatacomGet().then(function (n) {
  17601. _this22.mixinDatacomLoading = !1;
  17602. var _n$result = n.result,
  17603. s = _n$result.data,
  17604. r = _n$result.count;
  17605. _this22.getcount && (_this22.mixinDatacomPage.count = r), _this22.mixinDatacomHasMore = s.length < _this22.pageSize;
  17606. var i = e ? s.length ? s[0] : void 0 : s;
  17607. _this22.mixinDatacomResData = i, t && t(i);
  17608. }).catch(function (e) {
  17609. _this22.mixinDatacomLoading = !1, _this22.mixinDatacomErrorMessage = e, _this22.mixinDatacomError = e, n && n(e);
  17610. }));
  17611. },
  17612. mixinDatacomGet: function mixinDatacomGet() {
  17613. var _n15;
  17614. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  17615. var n;
  17616. t = t || {}, n = "undefined" != typeof __uniX && __uniX ? e.databaseForJQL(this.spaceInfo) : e.database(this.spaceInfo);
  17617. var s = t.action || this.action;
  17618. s && (n = n.action(s));
  17619. var r = t.collection || this.collection;
  17620. n = Array.isArray(r) ? (_n15 = n).collection.apply(_n15, (0, _toConsumableArray2.default)(r)) : n.collection(r);
  17621. var i = t.where || this.where;
  17622. i && Object.keys(i).length && (n = n.where(i));
  17623. var o = t.field || this.field;
  17624. o && (n = n.field(o));
  17625. var a = t.foreignKey || this.foreignKey;
  17626. a && (n = n.foreignKey(a));
  17627. var c = t.groupby || this.groupby;
  17628. c && (n = n.groupBy(c));
  17629. var u = t.groupField || this.groupField;
  17630. u && (n = n.groupField(u));
  17631. !0 === (void 0 !== t.distinct ? t.distinct : this.distinct) && (n = n.distinct());
  17632. var h = t.orderby || this.orderby;
  17633. h && (n = n.orderBy(h));
  17634. var l = void 0 !== t.pageCurrent ? t.pageCurrent : this.mixinDatacomPage.current,
  17635. d = void 0 !== t.pageSize ? t.pageSize : this.mixinDatacomPage.size,
  17636. p = void 0 !== t.getcount ? t.getcount : this.getcount,
  17637. f = void 0 !== t.gettree ? t.gettree : this.gettree,
  17638. g = void 0 !== t.gettreepath ? t.gettreepath : this.gettreepath,
  17639. m = {
  17640. getCount: p
  17641. },
  17642. y = {
  17643. limitLevel: void 0 !== t.limitlevel ? t.limitlevel : this.limitlevel,
  17644. startWith: void 0 !== t.startwith ? t.startwith : this.startwith
  17645. };
  17646. return f && (m.getTree = y), g && (m.getTreePath = y), n = n.skip(d * (l - 1)).limit(d).get(m), n;
  17647. }
  17648. }
  17649. };
  17650. }
  17651. function Us(e) {
  17652. return function (t) {
  17653. var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17654. n = function (e) {
  17655. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17656. 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;
  17657. }({
  17658. customUI: !1,
  17659. loadingOptions: {
  17660. title: "加载中...",
  17661. mask: !0
  17662. },
  17663. errorOptions: {
  17664. type: "modal",
  17665. retry: !1
  17666. }
  17667. }, n);
  17668. var _n16 = n,
  17669. s = _n16.customUI,
  17670. r = _n16.loadingOptions,
  17671. i = _n16.errorOptions,
  17672. o = _n16.parseSystemError,
  17673. a = !s;
  17674. return new Proxy({}, {
  17675. get: function get(s, c) {
  17676. switch (c) {
  17677. case "toString":
  17678. return "[object UniCloudObject]";
  17679. case "toJSON":
  17680. return {};
  17681. }
  17682. return function () {
  17683. var _ref55 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17684. e = _ref55.fn,
  17685. t = _ref55.interceptorName,
  17686. n = _ref55.getCallbackArgs;
  17687. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53() {
  17688. var _len2,
  17689. s,
  17690. _key2,
  17691. r,
  17692. i,
  17693. o,
  17694. _args = arguments;
  17695. return _regenerator.default.wrap(function _callee53$(_context53) {
  17696. while (1) {
  17697. switch (_context53.prev = _context53.next) {
  17698. case 0:
  17699. for (_len2 = _args.length, s = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  17700. s[_key2] = _args[_key2];
  17701. }
  17702. r = n ? n({
  17703. params: s
  17704. }) : {};
  17705. _context53.prev = 2;
  17706. _context53.next = 5;
  17707. return M(q(t, "invoke"), _objectSpread({}, r));
  17708. case 5:
  17709. _context53.next = 7;
  17710. return e.apply(void 0, s);
  17711. case 7:
  17712. i = _context53.sent;
  17713. _context53.next = 10;
  17714. return M(q(t, "success"), _objectSpread(_objectSpread({}, r), {}, {
  17715. result: i
  17716. }));
  17717. case 10:
  17718. return _context53.abrupt("return", i);
  17719. case 13:
  17720. _context53.prev = 13;
  17721. _context53.t0 = _context53["catch"](2);
  17722. o = _context53.t0;
  17723. _context53.next = 18;
  17724. return M(q(t, "fail"), _objectSpread(_objectSpread({}, r), {}, {
  17725. error: o
  17726. }));
  17727. case 18:
  17728. throw o;
  17729. case 19:
  17730. _context53.prev = 19;
  17731. _context53.next = 22;
  17732. return M(q(t, "complete"), o ? _objectSpread(_objectSpread({}, r), {}, {
  17733. error: o
  17734. }) : _objectSpread(_objectSpread({}, r), {}, {
  17735. result: i
  17736. }));
  17737. case 22:
  17738. return _context53.finish(19);
  17739. case 23:
  17740. case "end":
  17741. return _context53.stop();
  17742. }
  17743. }
  17744. }, _callee53, null, [[2, 13, 19, 23]]);
  17745. }));
  17746. }({
  17747. fn: function () {
  17748. var _s15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55() {
  17749. var l,
  17750. _len3,
  17751. h,
  17752. _key3,
  17753. d,
  17754. p,
  17755. _ref57,
  17756. f,
  17757. g,
  17758. m,
  17759. y,
  17760. _e26,
  17761. _yield,
  17762. _t19,
  17763. _n17,
  17764. _args4 = arguments;
  17765. return _regenerator.default.wrap(function _callee55$(_context55) {
  17766. while (1) {
  17767. switch (_context55.prev = _context55.next) {
  17768. case 0:
  17769. a && uni.showLoading({
  17770. title: r.title,
  17771. mask: r.mask
  17772. });
  17773. for (_len3 = _args4.length, h = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  17774. h[_key3] = _args4[_key3];
  17775. }
  17776. d = {
  17777. name: t,
  17778. type: u,
  17779. data: {
  17780. method: c,
  17781. params: h
  17782. }
  17783. };
  17784. "object" == (0, _typeof2.default)(n.secretMethods) && function (e, t) {
  17785. var n = t.data.method,
  17786. s = e.secretMethods || {},
  17787. r = s[n] || s["*"];
  17788. r && (t.secretType = r);
  17789. }(n, d);
  17790. p = !1;
  17791. _context55.prev = 5;
  17792. _context55.next = 8;
  17793. return e.callFunction(d);
  17794. case 8:
  17795. l = _context55.sent;
  17796. _context55.next = 14;
  17797. break;
  17798. case 11:
  17799. _context55.prev = 11;
  17800. _context55.t0 = _context55["catch"](5);
  17801. p = !0, l = {
  17802. result: new te(_context55.t0)
  17803. };
  17804. case 14:
  17805. _ref57 = l.result || {}, f = _ref57.errSubject, g = _ref57.errCode, m = _ref57.errMsg, y = _ref57.newToken;
  17806. if (!(a && uni.hideLoading(), y && y.token && y.tokenExpired && (re(y), Y(B, _objectSpread({}, y))), g)) {
  17807. _context55.next = 39;
  17808. break;
  17809. }
  17810. _e26 = m;
  17811. if (!(p && o)) {
  17812. _context55.next = 24;
  17813. break;
  17814. }
  17815. _context55.next = 20;
  17816. return o({
  17817. objectName: t,
  17818. methodName: c,
  17819. params: h,
  17820. errSubject: f,
  17821. errCode: g,
  17822. errMsg: m
  17823. });
  17824. case 20:
  17825. _context55.t1 = _context55.sent.errMsg;
  17826. if (_context55.t1) {
  17827. _context55.next = 23;
  17828. break;
  17829. }
  17830. _context55.t1 = m;
  17831. case 23:
  17832. _e26 = _context55.t1;
  17833. case 24:
  17834. if (!a) {
  17835. _context55.next = 37;
  17836. break;
  17837. }
  17838. if (!("toast" === i.type)) {
  17839. _context55.next = 29;
  17840. break;
  17841. }
  17842. uni.showToast({
  17843. title: _e26,
  17844. icon: "none"
  17845. });
  17846. _context55.next = 37;
  17847. break;
  17848. case 29:
  17849. if (!("modal" !== i.type)) {
  17850. _context55.next = 31;
  17851. break;
  17852. }
  17853. throw new Error("Invalid errorOptions.type: ".concat(i.type));
  17854. case 31:
  17855. _context55.next = 33;
  17856. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54() {
  17857. var _ref59,
  17858. e,
  17859. t,
  17860. n,
  17861. s,
  17862. r,
  17863. _args2 = arguments;
  17864. return _regenerator.default.wrap(function _callee54$(_context54) {
  17865. while (1) {
  17866. switch (_context54.prev = _context54.next) {
  17867. case 0:
  17868. _ref59 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, e = _ref59.title, t = _ref59.content, n = _ref59.showCancel, s = _ref59.cancelText, r = _ref59.confirmText;
  17869. return _context54.abrupt("return", new Promise(function (i, o) {
  17870. uni.showModal({
  17871. title: e,
  17872. content: t,
  17873. showCancel: n,
  17874. cancelText: s,
  17875. confirmText: r,
  17876. success: function success(e) {
  17877. i(e);
  17878. },
  17879. fail: function fail() {
  17880. i({
  17881. confirm: !1,
  17882. cancel: !0
  17883. });
  17884. }
  17885. });
  17886. }));
  17887. case 2:
  17888. case "end":
  17889. return _context54.stop();
  17890. }
  17891. }
  17892. }, _callee54);
  17893. }))({
  17894. title: "提示",
  17895. content: _e26,
  17896. showCancel: i.retry,
  17897. cancelText: "取消",
  17898. confirmText: i.retry ? "重试" : "确定"
  17899. });
  17900. case 33:
  17901. _yield = _context55.sent;
  17902. _t19 = _yield.confirm;
  17903. if (!(i.retry && _t19)) {
  17904. _context55.next = 37;
  17905. break;
  17906. }
  17907. return _context55.abrupt("return", s.apply(void 0, h));
  17908. case 37:
  17909. _n17 = new te({
  17910. subject: f,
  17911. code: g,
  17912. message: m,
  17913. requestId: l.requestId
  17914. });
  17915. throw _n17.detail = l.result, Y(j, {
  17916. type: z,
  17917. content: _n17
  17918. }), _n17;
  17919. case 39:
  17920. return _context55.abrupt("return", (Y(j, {
  17921. type: z,
  17922. content: l.result
  17923. }), l.result));
  17924. case 40:
  17925. case "end":
  17926. return _context55.stop();
  17927. }
  17928. }
  17929. }, _callee55, null, [[5, 11]]);
  17930. }));
  17931. function s() {
  17932. return _s15.apply(this, arguments);
  17933. }
  17934. return s;
  17935. }(),
  17936. interceptorName: "callObject",
  17937. getCallbackArgs: function getCallbackArgs() {
  17938. var _ref60 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17939. e = _ref60.params;
  17940. return {
  17941. objectName: t,
  17942. methodName: c,
  17943. params: e
  17944. };
  17945. }
  17946. });
  17947. }
  17948. });
  17949. };
  17950. }
  17951. function Ns(e) {
  17952. return L("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e.config.spaceId));
  17953. }
  17954. function Ds() {
  17955. return _Ds.apply(this, arguments);
  17956. }
  17957. function _Ds() {
  17958. _Ds = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58() {
  17959. var _ref72,
  17960. e,
  17961. _ref72$callLoginByWei,
  17962. t,
  17963. n,
  17964. s,
  17965. r,
  17966. _args7 = arguments;
  17967. return _regenerator.default.wrap(function _callee58$(_context58) {
  17968. while (1) {
  17969. switch (_context58.prev = _context58.next) {
  17970. case 0:
  17971. _ref72 = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {}, e = _ref72.openid, _ref72$callLoginByWei = _ref72.callLoginByWeixin, t = _ref72$callLoginByWei === void 0 ? !1 : _ref72$callLoginByWei;
  17972. n = Ns(this);
  17973. if (!("mp-weixin" !== C)) {
  17974. _context58.next = 4;
  17975. break;
  17976. }
  17977. throw new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `".concat(C, "`"));
  17978. case 4:
  17979. if (!(e && t)) {
  17980. _context58.next = 6;
  17981. break;
  17982. }
  17983. throw new Error("[SecureNetwork] openid and callLoginByWeixin cannot be passed at the same time");
  17984. case 6:
  17985. if (!e) {
  17986. _context58.next = 8;
  17987. break;
  17988. }
  17989. return _context58.abrupt("return", (n.mpWeixinOpenid = e, {}));
  17990. case 8:
  17991. _context58.next = 10;
  17992. return new Promise(function (e, t) {
  17993. uni.login({
  17994. success: function success(t) {
  17995. e(t.code);
  17996. },
  17997. fail: function fail(e) {
  17998. t(new Error(e.errMsg));
  17999. }
  18000. });
  18001. });
  18002. case 10:
  18003. s = _context58.sent;
  18004. r = this.importObject("uni-id-co", {
  18005. customUI: !0
  18006. });
  18007. _context58.next = 14;
  18008. return r.secureNetworkHandshakeByWeixin({
  18009. code: s,
  18010. callLoginByWeixin: t
  18011. });
  18012. case 14:
  18013. n.mpWeixinCode = s;
  18014. return _context58.abrupt("return", {
  18015. code: s
  18016. });
  18017. case 16:
  18018. case "end":
  18019. return _context58.stop();
  18020. }
  18021. }
  18022. }, _callee58, this);
  18023. }));
  18024. return _Ds.apply(this, arguments);
  18025. }
  18026. function Ms(_x40) {
  18027. return _Ms.apply(this, arguments);
  18028. }
  18029. function _Ms() {
  18030. _Ms = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee59(e) {
  18031. var t;
  18032. return _regenerator.default.wrap(function _callee59$(_context59) {
  18033. while (1) {
  18034. switch (_context59.prev = _context59.next) {
  18035. case 0:
  18036. t = Ns(this);
  18037. return _context59.abrupt("return", (t.initPromise || (t.initPromise = Ds.call(this, e).then(function (e) {
  18038. return e;
  18039. }).catch(function (e) {
  18040. throw delete t.initPromise, e;
  18041. })), t.initPromise));
  18042. case 2:
  18043. case "end":
  18044. return _context59.stop();
  18045. }
  18046. }
  18047. }, _callee59, this);
  18048. }));
  18049. return _Ms.apply(this, arguments);
  18050. }
  18051. function qs(e) {
  18052. return function () {
  18053. var _ref61 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18054. t = _ref61.openid,
  18055. _ref61$callLoginByWei = _ref61.callLoginByWeixin,
  18056. n = _ref61$callLoginByWei === void 0 ? !1 : _ref61$callLoginByWei;
  18057. return Ms.call(e, {
  18058. openid: t,
  18059. callLoginByWeixin: n
  18060. });
  18061. };
  18062. }
  18063. function Fs(e) {
  18064. !function (e) {
  18065. ue = e;
  18066. }(e);
  18067. }
  18068. function Ks(e) {
  18069. var t = {
  18070. getSystemInfo: uni.getSystemInfo,
  18071. getPushClientId: uni.getPushClientId
  18072. };
  18073. return function (n) {
  18074. return new Promise(function (s, r) {
  18075. t[e](_objectSpread(_objectSpread({}, n), {}, {
  18076. success: function success(e) {
  18077. s(e);
  18078. },
  18079. fail: function fail(e) {
  18080. r(e);
  18081. }
  18082. }));
  18083. });
  18084. };
  18085. }
  18086. var js = /*#__PURE__*/function (_ref62) {
  18087. (0, _inherits2.default)(js, _ref62);
  18088. var _super12 = _createSuper(js);
  18089. function js() {
  18090. var _this23;
  18091. (0, _classCallCheck2.default)(this, js);
  18092. _this23 = _super12.call(this), _this23._uniPushMessageCallback = _this23._receivePushMessage.bind((0, _assertThisInitialized2.default)(_this23)), _this23._currentMessageId = -1, _this23._payloadQueue = [];
  18093. return _this23;
  18094. }
  18095. (0, _createClass2.default)(js, [{
  18096. key: "init",
  18097. value: function init() {
  18098. var _this24 = this;
  18099. return Promise.all([Ks("getSystemInfo")(), Ks("getPushClientId")()]).then(function () {
  18100. var _ref63 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [],
  18101. _ref64 = (0, _slicedToArray2.default)(_ref63, 2),
  18102. _ref64$ = _ref64[0];
  18103. _ref64$ = _ref64$ === void 0 ? {} : _ref64$;
  18104. var e = _ref64$.appId,
  18105. _ref64$2 = _ref64[1];
  18106. _ref64$2 = _ref64$2 === void 0 ? {} : _ref64$2;
  18107. var t = _ref64$2.cid;
  18108. if (!e) throw new Error("Invalid appId, please check the manifest.json file");
  18109. if (!t) throw new Error("Invalid push client id");
  18110. _this24._appId = e, _this24._pushClientId = t, _this24._seqId = Date.now() + "-" + Math.floor(9e5 * Math.random() + 1e5), _this24.emit("open"), _this24._initMessageListener();
  18111. }, function (e) {
  18112. throw _this24.emit("error", e), _this24.close(), e;
  18113. });
  18114. }
  18115. }, {
  18116. key: "open",
  18117. value: function () {
  18118. var _open = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee56() {
  18119. return _regenerator.default.wrap(function _callee56$(_context56) {
  18120. while (1) {
  18121. switch (_context56.prev = _context56.next) {
  18122. case 0:
  18123. return _context56.abrupt("return", this.init());
  18124. case 1:
  18125. case "end":
  18126. return _context56.stop();
  18127. }
  18128. }
  18129. }, _callee56, this);
  18130. }));
  18131. function open() {
  18132. return _open.apply(this, arguments);
  18133. }
  18134. return open;
  18135. }()
  18136. }, {
  18137. key: "_isUniCloudSSE",
  18138. value: function _isUniCloudSSE(e) {
  18139. if ("receive" !== e.type) return !1;
  18140. var t = e && e.data && e.data.payload;
  18141. return !(!t || "UNI_CLOUD_SSE" !== t.channel || t.seqId !== this._seqId);
  18142. }
  18143. }, {
  18144. key: "_receivePushMessage",
  18145. value: function _receivePushMessage(e) {
  18146. if (!this._isUniCloudSSE(e)) return;
  18147. var t = e && e.data && e.data.payload,
  18148. n = t.action,
  18149. s = t.messageId,
  18150. r = t.message;
  18151. this._payloadQueue.push({
  18152. action: n,
  18153. messageId: s,
  18154. message: r
  18155. }), this._consumMessage();
  18156. }
  18157. }, {
  18158. key: "_consumMessage",
  18159. value: function _consumMessage() {
  18160. var _this25 = this;
  18161. for (;;) {
  18162. var _e27 = this._payloadQueue.find(function (e) {
  18163. return e.messageId === _this25._currentMessageId + 1;
  18164. });
  18165. if (!_e27) break;
  18166. this._currentMessageId++, this._parseMessagePayload(_e27);
  18167. }
  18168. }
  18169. }, {
  18170. key: "_parseMessagePayload",
  18171. value: function _parseMessagePayload(e) {
  18172. var t = e.action,
  18173. n = e.messageId,
  18174. s = e.message;
  18175. "end" === t ? this._end({
  18176. messageId: n,
  18177. message: s
  18178. }) : "message" === t && this._appendMessage({
  18179. messageId: n,
  18180. message: s
  18181. });
  18182. }
  18183. }, {
  18184. key: "_appendMessage",
  18185. value: function _appendMessage() {
  18186. var _ref65 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18187. e = _ref65.messageId,
  18188. t = _ref65.message;
  18189. this.emit("message", t);
  18190. }
  18191. }, {
  18192. key: "_end",
  18193. value: function _end() {
  18194. var _ref66 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18195. e = _ref66.messageId,
  18196. t = _ref66.message;
  18197. this.emit("end", t), this.close();
  18198. }
  18199. }, {
  18200. key: "_initMessageListener",
  18201. value: function _initMessageListener() {
  18202. uni.onPushMessage(this._uniPushMessageCallback);
  18203. }
  18204. }, {
  18205. key: "_destroy",
  18206. value: function _destroy() {
  18207. uni.offPushMessage(this._uniPushMessageCallback);
  18208. }
  18209. }, {
  18210. key: "toJSON",
  18211. value: function toJSON() {
  18212. return {
  18213. appId: this._appId,
  18214. pushClientId: this._pushClientId,
  18215. seqId: this._seqId
  18216. };
  18217. }
  18218. }, {
  18219. key: "close",
  18220. value: function close() {
  18221. this._destroy(), this.emit("close");
  18222. }
  18223. }]);
  18224. return js;
  18225. }( /*#__PURE__*/function () {
  18226. function _class6() {
  18227. (0, _classCallCheck2.default)(this, _class6);
  18228. this._callback = {};
  18229. }
  18230. (0, _createClass2.default)(_class6, [{
  18231. key: "addListener",
  18232. value: function addListener(e, t) {
  18233. this._callback[e] || (this._callback[e] = []), this._callback[e].push(t);
  18234. }
  18235. }, {
  18236. key: "on",
  18237. value: function on(e, t) {
  18238. return this.addListener(e, t);
  18239. }
  18240. }, {
  18241. key: "removeListener",
  18242. value: function removeListener(e, t) {
  18243. if (!t) throw new Error('The "listener" argument must be of type function. Received undefined');
  18244. var n = this._callback[e];
  18245. if (!n) return;
  18246. var s = function (e, t) {
  18247. for (var _n18 = e.length - 1; _n18 >= 0; _n18--) {
  18248. if (e[_n18] === t) return _n18;
  18249. }
  18250. return -1;
  18251. }(n, t);
  18252. n.splice(s, 1);
  18253. }
  18254. }, {
  18255. key: "off",
  18256. value: function off(e, t) {
  18257. return this.removeListener(e, t);
  18258. }
  18259. }, {
  18260. key: "removeAllListener",
  18261. value: function removeAllListener(e) {
  18262. delete this._callback[e];
  18263. }
  18264. }, {
  18265. key: "emit",
  18266. value: function emit(e) {
  18267. var n = this._callback[e];
  18268. for (var _len4 = arguments.length, t = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
  18269. t[_key4 - 1] = arguments[_key4];
  18270. }
  18271. if (n) for (var _e28 = 0; _e28 < n.length; _e28++) {
  18272. n[_e28].apply(n, t);
  18273. }
  18274. }
  18275. }]);
  18276. return _class6;
  18277. }());
  18278. function $s(_x41, _x42) {
  18279. return _$s.apply(this, arguments);
  18280. }
  18281. function _$s() {
  18282. _$s = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee60(e, t) {
  18283. var n, _e31, s;
  18284. return _regenerator.default.wrap(function _callee60$(_context60) {
  18285. while (1) {
  18286. switch (_context60.prev = _context60.next) {
  18287. case 0:
  18288. n = "http://".concat(e, ":").concat(t, "/system/ping");
  18289. _context60.prev = 1;
  18290. _context60.next = 4;
  18291. return s = {
  18292. url: n,
  18293. timeout: 500
  18294. }, new Promise(function (e, t) {
  18295. ne.request(_objectSpread(_objectSpread({}, s), {}, {
  18296. success: function success(t) {
  18297. e(t);
  18298. },
  18299. fail: function fail(e) {
  18300. t(e);
  18301. }
  18302. }));
  18303. });
  18304. case 4:
  18305. _e31 = _context60.sent;
  18306. return _context60.abrupt("return", !(!_e31.data || 0 !== _e31.data.code));
  18307. case 8:
  18308. _context60.prev = 8;
  18309. _context60.t0 = _context60["catch"](1);
  18310. return _context60.abrupt("return", !1);
  18311. case 11:
  18312. case "end":
  18313. return _context60.stop();
  18314. }
  18315. }
  18316. }, _callee60, null, [[1, 8]]);
  18317. }));
  18318. return _$s.apply(this, arguments);
  18319. }
  18320. function Bs(_x43) {
  18321. return _Bs.apply(this, arguments);
  18322. }
  18323. function _Bs() {
  18324. _Bs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee62(e) {
  18325. var _ae2, _e32, _t21, t, _t$debugInfo, n, s, _yield2, r, i, o;
  18326. return _regenerator.default.wrap(function _callee62$(_context62) {
  18327. while (1) {
  18328. switch (_context62.prev = _context62.next) {
  18329. case 0:
  18330. if (S) {
  18331. _context62.next = 2;
  18332. break;
  18333. }
  18334. return _context62.abrupt("return", Promise.resolve());
  18335. case 2:
  18336. if ("app" === C) {
  18337. _ae2 = ae(), _e32 = _ae2.osName, _t21 = _ae2.osVersion;
  18338. "ios" === _e32 && function (e) {
  18339. if (!e || "string" != typeof e) return 0;
  18340. var t = e.match(/^(\d+)./);
  18341. return t && t[1] ? parseInt(t[1]) : 0;
  18342. }(_t21) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发期间需要,发行后不需要)");
  18343. }
  18344. t = e.__dev__;
  18345. if (t.debugInfo) {
  18346. _context62.next = 6;
  18347. break;
  18348. }
  18349. return _context62.abrupt("return");
  18350. case 6:
  18351. _t$debugInfo = t.debugInfo;
  18352. n = _t$debugInfo.address;
  18353. s = _t$debugInfo.servePort;
  18354. _context62.next = 11;
  18355. return function () {
  18356. var _ref73 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee61(e, t) {
  18357. var n, _s16, _r10;
  18358. return _regenerator.default.wrap(function _callee61$(_context61) {
  18359. while (1) {
  18360. switch (_context61.prev = _context61.next) {
  18361. case 0:
  18362. _s16 = 0;
  18363. case 1:
  18364. if (!(_s16 < e.length)) {
  18365. _context61.next = 11;
  18366. break;
  18367. }
  18368. _r10 = e[_s16];
  18369. _context61.next = 5;
  18370. return $s(_r10, t);
  18371. case 5:
  18372. if (!_context61.sent) {
  18373. _context61.next = 8;
  18374. break;
  18375. }
  18376. n = _r10;
  18377. return _context61.abrupt("break", 11);
  18378. case 8:
  18379. _s16++;
  18380. _context61.next = 1;
  18381. break;
  18382. case 11:
  18383. return _context61.abrupt("return", {
  18384. address: n,
  18385. port: t
  18386. });
  18387. case 12:
  18388. case "end":
  18389. return _context61.stop();
  18390. }
  18391. }
  18392. }, _callee61);
  18393. }));
  18394. return function (_x44, _x45) {
  18395. return _ref73.apply(this, arguments);
  18396. };
  18397. }()(n, s);
  18398. case 11:
  18399. _yield2 = _context62.sent;
  18400. r = _yield2.address;
  18401. if (!r) {
  18402. _context62.next = 15;
  18403. break;
  18404. }
  18405. return _context62.abrupt("return", (t.localAddress = r, void (t.localPort = s)));
  18406. case 15:
  18407. i = console["app" === C ? "error" : "warn"];
  18408. o = "";
  18409. if (!("remote" === t.debugInfo.initialLaunchType ? (t.debugInfo.forceRemote = !0, o = "当前客户端和HBuilderX不在同一局域网下(或其他网络原因无法连接HBuilderX),uniCloud本地调试服务不对当前客户端生效。\n- 如果不使用uniCloud本地调试服务,请直接忽略此信息。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。") : o = "无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。", o += "\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs\n- 检查是否错误的使用拦截器修改uni.request方法的参数", "web" === C && (o += "\n- 部分浏览器开启节流模式之后访问本地地址受限,请检查是否启用了节流模式"), 0 === C.indexOf("mp-") && (o += "\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"), !t.debugInfo.forceRemote)) {
  18410. _context62.next = 19;
  18411. break;
  18412. }
  18413. throw new Error(o);
  18414. case 19:
  18415. i(o);
  18416. case 20:
  18417. case "end":
  18418. return _context62.stop();
  18419. }
  18420. }
  18421. }, _callee62);
  18422. }));
  18423. return _Bs.apply(this, arguments);
  18424. }
  18425. function Ws(e) {
  18426. e._initPromiseHub || (e._initPromiseHub = new v({
  18427. createPromise: function createPromise() {
  18428. var t = Promise.resolve();
  18429. var n;
  18430. n = 1, t = new Promise(function (e) {
  18431. setTimeout(function () {
  18432. e();
  18433. }, n);
  18434. });
  18435. var s = e.auth();
  18436. return t.then(function () {
  18437. return s.getLoginState();
  18438. }).then(function (e) {
  18439. return e ? Promise.resolve() : s.signInAnonymously();
  18440. });
  18441. }
  18442. }));
  18443. }
  18444. var Hs = {
  18445. tcb: St,
  18446. tencent: St,
  18447. aliyun: pe,
  18448. private: kt,
  18449. alipay: Ut
  18450. };
  18451. var zs = new ( /*#__PURE__*/function () {
  18452. function _class7() {
  18453. (0, _classCallCheck2.default)(this, _class7);
  18454. }
  18455. (0, _createClass2.default)(_class7, [{
  18456. key: "init",
  18457. value: function init(e) {
  18458. var t = {};
  18459. var n = Hs[e.provider];
  18460. if (!n) throw new Error("未提供正确的provider参数");
  18461. t = n.init(e), S && function (e) {
  18462. if (!S) return;
  18463. var t = {};
  18464. e.__dev__ = t, t.debugLog = S && ("web" === C && navigator.userAgent.indexOf("HBuilderX") > 0 || "app" === C);
  18465. var n = P;
  18466. n && !n.code && (t.debugInfo = n);
  18467. var s = new v({
  18468. createPromise: function createPromise() {
  18469. return Bs(e);
  18470. }
  18471. });
  18472. t.initLocalNetwork = function () {
  18473. return s.exec();
  18474. };
  18475. }(t), Ws(t), $n(t), function (e) {
  18476. var t = e.uploadFile;
  18477. e.uploadFile = function (e) {
  18478. return t.call(this, e);
  18479. };
  18480. }(t), function (e) {
  18481. e.database = function (t) {
  18482. if (t && Object.keys(t).length > 0) return e.init(t).database();
  18483. if (this._database) return this._database;
  18484. var n = Zn(es, {
  18485. uniClient: e
  18486. });
  18487. return this._database = n, n;
  18488. }, e.databaseForJQL = function (t) {
  18489. if (t && Object.keys(t).length > 0) return e.init(t).databaseForJQL();
  18490. if (this._databaseForJQL) return this._databaseForJQL;
  18491. var n = Zn(es, {
  18492. uniClient: e,
  18493. isJQL: !0
  18494. });
  18495. return this._databaseForJQL = n, n;
  18496. };
  18497. }(t), function (e) {
  18498. e.getCurrentUserInfo = xs, e.chooseAndUploadFile = Es.initChooseAndUploadFile(e), Object.assign(e, {
  18499. get mixinDatacom() {
  18500. return Rs(e);
  18501. }
  18502. }), e.SSEChannel = js, e.initSecureNetworkByWeixin = qs(e), e.setCustomClientInfo = Fs, e.importObject = Us(e);
  18503. }(t);
  18504. return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach(function (e) {
  18505. if (!t[e]) return;
  18506. var n = t[e];
  18507. t[e] = function () {
  18508. return n.apply(t, Array.from(arguments));
  18509. }, t[e] = function (e, t) {
  18510. return function (n) {
  18511. var _this26 = this;
  18512. var s = !1;
  18513. if ("callFunction" === t) {
  18514. var _e29 = n && n.type || c;
  18515. s = _e29 !== c;
  18516. }
  18517. var r = "callFunction" === t && !s,
  18518. i = this._initPromiseHub.exec();
  18519. n = n || {};
  18520. var _ee2 = ee(n),
  18521. o = _ee2.success,
  18522. a = _ee2.fail,
  18523. u = _ee2.complete,
  18524. h = i.then(function () {
  18525. return s ? Promise.resolve() : M(q(t, "invoke"), n);
  18526. }).then(function () {
  18527. return e.call(_this26, n);
  18528. }).then(function (e) {
  18529. return s ? Promise.resolve(e) : M(q(t, "success"), e).then(function () {
  18530. return M(q(t, "complete"), e);
  18531. }).then(function () {
  18532. return r && Y(j, {
  18533. type: H,
  18534. content: e
  18535. }), Promise.resolve(e);
  18536. });
  18537. }, function (e) {
  18538. return s ? Promise.reject(e) : M(q(t, "fail"), e).then(function () {
  18539. return M(q(t, "complete"), e);
  18540. }).then(function () {
  18541. return Y(j, {
  18542. type: H,
  18543. content: e
  18544. }), Promise.reject(e);
  18545. });
  18546. });
  18547. if (!(o || a || u)) return h;
  18548. h.then(function (e) {
  18549. o && o(e), u && u(e), r && Y(j, {
  18550. type: H,
  18551. content: e
  18552. });
  18553. }, function (e) {
  18554. a && a(e), u && u(e), r && Y(j, {
  18555. type: H,
  18556. content: e
  18557. });
  18558. });
  18559. };
  18560. }(t[e], e).bind(t);
  18561. }), t.init = this.init, t;
  18562. }
  18563. }]);
  18564. return _class7;
  18565. }())();
  18566. (function () {
  18567. var e = T;
  18568. var t = {};
  18569. if (e && 1 === e.length) t = e[0], zs = zs.init(t), zs._isDefault = !0;else {
  18570. var _t20 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
  18571. var _n19;
  18572. _n19 = e && e.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : x ? "应用未关联服务空间,请在uniCloud目录右键关联服务空间" : "uni-app cli项目内使用uniCloud需要使用HBuilderX的运行菜单运行项目,且需要在uniCloud目录关联服务空间", _t20.forEach(function (e) {
  18573. zs[e] = function () {
  18574. return console.error(_n19), Promise.reject(new te({
  18575. code: "SYS_ERR",
  18576. message: _n19
  18577. }));
  18578. };
  18579. });
  18580. }
  18581. Object.assign(zs, {
  18582. get mixinDatacom() {
  18583. return Rs(zs);
  18584. }
  18585. }), As(zs), zs.addInterceptor = N, zs.removeInterceptor = D, zs.interceptObject = F, S && "web" === C && (window.uniCloud = zs);
  18586. })();
  18587. var Js = zs;
  18588. exports.default = Js;
  18589. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3), __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  18590. /***/ }),
  18591. /***/ 253:
  18592. /*!****************************************************************!*\
  18593. !*** ./node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
  18594. \****************************************************************/
  18595. /*! no static exports found */
  18596. /***/ (function(module, exports, __webpack_require__) {
  18597. var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ 215);
  18598. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  18599. var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ 254);
  18600. var construct = __webpack_require__(/*! ./construct.js */ 15);
  18601. function _wrapNativeSuper(Class) {
  18602. var _cache = typeof Map === "function" ? new Map() : undefined;
  18603. module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
  18604. if (Class === null || !isNativeFunction(Class)) return Class;
  18605. if (typeof Class !== "function") {
  18606. throw new TypeError("Super expression must either be null or a function");
  18607. }
  18608. if (typeof _cache !== "undefined") {
  18609. if (_cache.has(Class)) return _cache.get(Class);
  18610. _cache.set(Class, Wrapper);
  18611. }
  18612. function Wrapper() {
  18613. return construct(Class, arguments, getPrototypeOf(this).constructor);
  18614. }
  18615. Wrapper.prototype = Object.create(Class.prototype, {
  18616. constructor: {
  18617. value: Wrapper,
  18618. enumerable: false,
  18619. writable: true,
  18620. configurable: true
  18621. }
  18622. });
  18623. return setPrototypeOf(Wrapper, Class);
  18624. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18625. return _wrapNativeSuper(Class);
  18626. }
  18627. module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18628. /***/ }),
  18629. /***/ 254:
  18630. /*!*****************************************************************!*\
  18631. !*** ./node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
  18632. \*****************************************************************/
  18633. /*! no static exports found */
  18634. /***/ (function(module, exports) {
  18635. function _isNativeFunction(fn) {
  18636. try {
  18637. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  18638. } catch (e) {
  18639. return typeof fn === "function";
  18640. }
  18641. }
  18642. module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18643. /***/ }),
  18644. /***/ 255:
  18645. /*!***************************************************************************************!*\
  18646. !*** D:/A_GraduationDesign/errand/errand_app/pages.json?{"type":"origin-pages-json"} ***!
  18647. \***************************************************************************************/
  18648. /*! no static exports found */
  18649. /***/ (function(module, exports, __webpack_require__) {
  18650. "use strict";
  18651. Object.defineProperty(exports, "__esModule", {
  18652. value: true
  18653. });
  18654. exports.default = void 0;
  18655. var _default = {
  18656. "pages": [{
  18657. "path": "pages/index/index",
  18658. "style": {
  18659. "navigationBarTitleText": "校园综合服务平台"
  18660. }
  18661. }, {
  18662. "path": "pages/orders/orders",
  18663. "style": {
  18664. "navigationBarTitleText": "订 单",
  18665. "enablePullDownRefresh": false
  18666. }
  18667. }, {
  18668. "path": "pages/me/me",
  18669. "style": {
  18670. "navigationBarTitleText": "我 的",
  18671. "enablePullDownRefresh": false
  18672. }
  18673. }, {
  18674. "path": "pages/login/login",
  18675. "style": {
  18676. "navigationBarTitleText": "登 录"
  18677. }
  18678. }, {
  18679. "path": "pages/register/register",
  18680. "style": {
  18681. "navigationBarTitleText": "注 册"
  18682. }
  18683. }, {
  18684. "path": "pages/preOrder/preOrder",
  18685. "style": {
  18686. "navigationBarTitleText": "下单"
  18687. }
  18688. }, {
  18689. "path": "pages/address/address",
  18690. "style": {
  18691. "navigationBarTitleText": "我的地址"
  18692. }
  18693. }, {
  18694. "path": "pages/detail/detail",
  18695. "style": {
  18696. "navigationBarTitleText": "订单详情"
  18697. }
  18698. }, {
  18699. "path": "pages/introduce/introduce",
  18700. "style": {
  18701. "navigationBarTitleText": "平台介绍"
  18702. }
  18703. }, {
  18704. "path": "pages/agreement/agreement",
  18705. "style": {
  18706. "navigationBarTitleText": "用户协议"
  18707. }
  18708. }, {
  18709. "path": "pages/person/person",
  18710. "style": {
  18711. "navigationBarTitleText": "个人介绍"
  18712. }
  18713. }, {
  18714. "path": "pages/certification/certification",
  18715. "style": {
  18716. "navigationBarTitleText": "骑手认证"
  18717. }
  18718. }, {
  18719. "path": "pages/acceptOrders/acceptOrders",
  18720. "style": {
  18721. "navigationBarTitleText": "骑手订单"
  18722. }
  18723. }, {
  18724. "path": "pages/records/records",
  18725. "style": {
  18726. "navigationBarTitleText": "收支明细"
  18727. }
  18728. }, {
  18729. "path": "pages/wallet/wallet",
  18730. "style": {
  18731. "navigationBarTitleText": "钱 包"
  18732. }
  18733. }, {
  18734. "path": "pages/charge/charge",
  18735. "style": {
  18736. "navigationBarTitleText": "充 值"
  18737. }
  18738. }, {
  18739. "path": "pages/comment/comment",
  18740. "style": {
  18741. "navigationBarTitleText": "订单评价"
  18742. }
  18743. }, {
  18744. "path": "pages/myComment/myComment",
  18745. "style": {
  18746. "navigationBarTitleText": "评价中心"
  18747. }
  18748. }],
  18749. "globalStyle": {
  18750. "navigationBarTextStyle": "white",
  18751. "navigationBarTitleText": "校园综合服务平台",
  18752. "navigationBarBackgroundColor": "#006eff",
  18753. "backgroundColor": "#F8F8F8"
  18754. },
  18755. "tabBar": {
  18756. "backgroundColor": "#fff",
  18757. "selectedColor": "#006eff",
  18758. "color": "#666",
  18759. "list": [{
  18760. "iconPath": "/static/icons/home.png",
  18761. "selectedIconPath": "static/icons/home-active.png",
  18762. "text": "首页",
  18763. "pagePath": "pages/index/index"
  18764. }, {
  18765. "iconPath": "/static/icons/orders.png",
  18766. "selectedIconPath": "static/icons/orders-active.png",
  18767. "text": "订单",
  18768. "pagePath": "pages/orders/orders"
  18769. }, {
  18770. "iconPath": "/static/icons/me.png",
  18771. "selectedIconPath": "static/icons/me-active.png",
  18772. "text": "我的",
  18773. "pagePath": "pages/me/me"
  18774. }]
  18775. },
  18776. "uniIdRouter": {}
  18777. };
  18778. exports.default = _default;
  18779. /***/ }),
  18780. /***/ 256:
  18781. /*!**************************************************************************!*\
  18782. !*** D:/A_GraduationDesign/errand/errand_app/pages.json?{"type":"stat"} ***!
  18783. \**************************************************************************/
  18784. /*! no static exports found */
  18785. /***/ (function(module, exports, __webpack_require__) {
  18786. "use strict";
  18787. Object.defineProperty(exports, "__esModule", {
  18788. value: true
  18789. });
  18790. exports.default = void 0;
  18791. var _default = {
  18792. "appid": "__UNI__DBC0602"
  18793. };
  18794. exports.default = _default;
  18795. /***/ }),
  18796. /***/ 26:
  18797. /*!**********************************************************!*\
  18798. !*** D:/A_GraduationDesign/errand/errand_app/pages.json ***!
  18799. \**********************************************************/
  18800. /*! no static exports found */
  18801. /***/ (function(module, exports) {
  18802. /***/ }),
  18803. /***/ 264:
  18804. /*!********************************************************************************************************************************!*\
  18805. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js ***!
  18806. \********************************************************************************************************************************/
  18807. /*! no static exports found */
  18808. /***/ (function(module, exports, __webpack_require__) {
  18809. "use strict";
  18810. /* WEBPACK VAR INJECTION */(function(uni, wx, uniCloud) {
  18811. Object.defineProperty(exports, "__esModule", {
  18812. value: true
  18813. });
  18814. exports.chooseAndUploadFile = chooseAndUploadFile;
  18815. exports.uploadCloudFiles = uploadCloudFiles;
  18816. var ERR_MSG_OK = 'chooseAndUploadFile:ok';
  18817. var ERR_MSG_FAIL = 'chooseAndUploadFile:fail';
  18818. function chooseImage(opts) {
  18819. var count = opts.count,
  18820. _opts$sizeType = opts.sizeType,
  18821. sizeType = _opts$sizeType === void 0 ? ['original', 'compressed'] : _opts$sizeType,
  18822. sourceType = opts.sourceType,
  18823. extension = opts.extension;
  18824. return new Promise(function (resolve, reject) {
  18825. uni.chooseImage({
  18826. count: count,
  18827. sizeType: sizeType,
  18828. sourceType: sourceType,
  18829. extension: extension,
  18830. success: function success(res) {
  18831. resolve(normalizeChooseAndUploadFileRes(res, 'image'));
  18832. },
  18833. fail: function fail(res) {
  18834. reject({
  18835. errMsg: res.errMsg.replace('chooseImage:fail', ERR_MSG_FAIL)
  18836. });
  18837. }
  18838. });
  18839. });
  18840. }
  18841. function chooseVideo(opts) {
  18842. var camera = opts.camera,
  18843. compressed = opts.compressed,
  18844. maxDuration = opts.maxDuration,
  18845. sourceType = opts.sourceType,
  18846. extension = opts.extension;
  18847. return new Promise(function (resolve, reject) {
  18848. uni.chooseVideo({
  18849. camera: camera,
  18850. compressed: compressed,
  18851. maxDuration: maxDuration,
  18852. sourceType: sourceType,
  18853. extension: extension,
  18854. success: function success(res) {
  18855. var tempFilePath = res.tempFilePath,
  18856. duration = res.duration,
  18857. size = res.size,
  18858. height = res.height,
  18859. width = res.width;
  18860. resolve(normalizeChooseAndUploadFileRes({
  18861. errMsg: 'chooseVideo:ok',
  18862. tempFilePaths: [tempFilePath],
  18863. tempFiles: [{
  18864. name: res.tempFile && res.tempFile.name || '',
  18865. path: tempFilePath,
  18866. size: size,
  18867. type: res.tempFile && res.tempFile.type || '',
  18868. width: width,
  18869. height: height,
  18870. duration: duration,
  18871. fileType: 'video',
  18872. cloudPath: ''
  18873. }]
  18874. }, 'video'));
  18875. },
  18876. fail: function fail(res) {
  18877. reject({
  18878. errMsg: res.errMsg.replace('chooseVideo:fail', ERR_MSG_FAIL)
  18879. });
  18880. }
  18881. });
  18882. });
  18883. }
  18884. function chooseAll(opts) {
  18885. var count = opts.count,
  18886. extension = opts.extension;
  18887. return new Promise(function (resolve, reject) {
  18888. var chooseFile = uni.chooseFile;
  18889. if (typeof wx !== 'undefined' && typeof wx.chooseMessageFile === 'function') {
  18890. chooseFile = wx.chooseMessageFile;
  18891. }
  18892. if (typeof chooseFile !== 'function') {
  18893. return reject({
  18894. errMsg: ERR_MSG_FAIL + ' 请指定 type 类型,该平台仅支持选择 image 或 video。'
  18895. });
  18896. }
  18897. chooseFile({
  18898. type: 'all',
  18899. count: count,
  18900. extension: extension,
  18901. success: function success(res) {
  18902. resolve(normalizeChooseAndUploadFileRes(res));
  18903. },
  18904. fail: function fail(res) {
  18905. reject({
  18906. errMsg: res.errMsg.replace('chooseFile:fail', ERR_MSG_FAIL)
  18907. });
  18908. }
  18909. });
  18910. });
  18911. }
  18912. function normalizeChooseAndUploadFileRes(res, fileType) {
  18913. res.tempFiles.forEach(function (item, index) {
  18914. if (!item.name) {
  18915. item.name = item.path.substring(item.path.lastIndexOf('/') + 1);
  18916. }
  18917. if (fileType) {
  18918. item.fileType = fileType;
  18919. }
  18920. item.cloudPath = Date.now() + '_' + index + item.name.substring(item.name.lastIndexOf('.'));
  18921. });
  18922. if (!res.tempFilePaths) {
  18923. res.tempFilePaths = res.tempFiles.map(function (file) {
  18924. return file.path;
  18925. });
  18926. }
  18927. return res;
  18928. }
  18929. function uploadCloudFiles(files) {
  18930. var max = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
  18931. var _onUploadProgress = arguments.length > 2 ? arguments[2] : undefined;
  18932. files = JSON.parse(JSON.stringify(files));
  18933. var len = files.length;
  18934. var count = 0;
  18935. var self = this;
  18936. return new Promise(function (resolve) {
  18937. while (count < max) {
  18938. next();
  18939. }
  18940. function next() {
  18941. var cur = count++;
  18942. if (cur >= len) {
  18943. !files.find(function (item) {
  18944. return !item.url && !item.errMsg;
  18945. }) && resolve(files);
  18946. return;
  18947. }
  18948. var fileItem = files[cur];
  18949. var index = self.files.findIndex(function (v) {
  18950. return v.uuid === fileItem.uuid;
  18951. });
  18952. fileItem.url = '';
  18953. delete fileItem.errMsg;
  18954. uniCloud.uploadFile({
  18955. filePath: fileItem.path,
  18956. cloudPath: fileItem.cloudPath,
  18957. fileType: fileItem.fileType,
  18958. onUploadProgress: function onUploadProgress(res) {
  18959. res.index = index;
  18960. _onUploadProgress && _onUploadProgress(res);
  18961. }
  18962. }).then(function (res) {
  18963. fileItem.url = res.fileID;
  18964. fileItem.index = index;
  18965. if (cur < len) {
  18966. next();
  18967. }
  18968. }).catch(function (res) {
  18969. fileItem.errMsg = res.errMsg || res.message;
  18970. fileItem.index = index;
  18971. if (cur < len) {
  18972. next();
  18973. }
  18974. });
  18975. }
  18976. });
  18977. }
  18978. function uploadFiles(choosePromise, _ref) {
  18979. var onChooseFile = _ref.onChooseFile,
  18980. onUploadProgress = _ref.onUploadProgress;
  18981. return choosePromise.then(function (res) {
  18982. if (onChooseFile) {
  18983. var customChooseRes = onChooseFile(res);
  18984. if (typeof customChooseRes !== 'undefined') {
  18985. return Promise.resolve(customChooseRes).then(function (chooseRes) {
  18986. return typeof chooseRes === 'undefined' ? res : chooseRes;
  18987. });
  18988. }
  18989. }
  18990. return res;
  18991. }).then(function (res) {
  18992. if (res === false) {
  18993. return {
  18994. errMsg: ERR_MSG_OK,
  18995. tempFilePaths: [],
  18996. tempFiles: []
  18997. };
  18998. }
  18999. return res;
  19000. });
  19001. }
  19002. function chooseAndUploadFile() {
  19003. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  19004. type: 'all'
  19005. };
  19006. if (opts.type === 'image') {
  19007. return uploadFiles(chooseImage(opts), opts);
  19008. } else if (opts.type === 'video') {
  19009. return uploadFiles(chooseVideo(opts), opts);
  19010. }
  19011. return uploadFiles(chooseAll(opts), opts);
  19012. }
  19013. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js */ 252)["default"]))
  19014. /***/ }),
  19015. /***/ 265:
  19016. /*!***************************************************************************************************************!*\
  19017. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-file-picker/components/uni-file-picker/utils.js ***!
  19018. \***************************************************************************************************************/
  19019. /*! no static exports found */
  19020. /***/ (function(module, exports, __webpack_require__) {
  19021. "use strict";
  19022. /* WEBPACK VAR INJECTION */(function(uni) {
  19023. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  19024. Object.defineProperty(exports, "__esModule", {
  19025. value: true
  19026. });
  19027. exports.get_files_and_is_max = exports.get_file_info = exports.get_file_ext = exports.get_file_data = exports.get_extname = void 0;
  19028. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 208));
  19029. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 210));
  19030. /**
  19031. * 获取文件名和后缀
  19032. * @param {String} name
  19033. */
  19034. var get_file_ext = function get_file_ext(name) {
  19035. var last_len = name.lastIndexOf('.');
  19036. var len = name.length;
  19037. return {
  19038. name: name.substring(0, last_len),
  19039. ext: name.substring(last_len + 1, len)
  19040. };
  19041. };
  19042. /**
  19043. * 获取扩展名
  19044. * @param {Array} fileExtname
  19045. */
  19046. exports.get_file_ext = get_file_ext;
  19047. var get_extname = function get_extname(fileExtname) {
  19048. if (!Array.isArray(fileExtname)) {
  19049. var extname = fileExtname.replace(/(\[|\])/g, '');
  19050. return extname.split(',');
  19051. } else {
  19052. return fileExtname;
  19053. }
  19054. return [];
  19055. };
  19056. /**
  19057. * 获取文件和检测是否可选
  19058. */
  19059. exports.get_extname = get_extname;
  19060. var get_files_and_is_max = function get_files_and_is_max(res, _extname) {
  19061. var filePaths = [];
  19062. var files = [];
  19063. if (!_extname || _extname.length === 0) {
  19064. return {
  19065. filePaths: filePaths,
  19066. files: files
  19067. };
  19068. }
  19069. res.tempFiles.forEach(function (v) {
  19070. var fileFullName = get_file_ext(v.name);
  19071. var extname = fileFullName.ext.toLowerCase();
  19072. if (_extname.indexOf(extname) !== -1) {
  19073. files.push(v);
  19074. filePaths.push(v.path);
  19075. }
  19076. });
  19077. if (files.length !== res.tempFiles.length) {
  19078. uni.showToast({
  19079. title: "\u5F53\u524D\u9009\u62E9\u4E86".concat(res.tempFiles.length, "\u4E2A\u6587\u4EF6 \uFF0C").concat(res.tempFiles.length - files.length, " \u4E2A\u6587\u4EF6\u683C\u5F0F\u4E0D\u6B63\u786E"),
  19080. icon: 'none',
  19081. duration: 5000
  19082. });
  19083. }
  19084. return {
  19085. filePaths: filePaths,
  19086. files: files
  19087. };
  19088. };
  19089. /**
  19090. * 获取图片信息
  19091. * @param {Object} filepath
  19092. */
  19093. exports.get_files_and_is_max = get_files_and_is_max;
  19094. var get_file_info = function get_file_info(filepath) {
  19095. return new Promise(function (resolve, reject) {
  19096. uni.getImageInfo({
  19097. src: filepath,
  19098. success: function success(res) {
  19099. resolve(res);
  19100. },
  19101. fail: function fail(err) {
  19102. reject(err);
  19103. }
  19104. });
  19105. });
  19106. };
  19107. /**
  19108. * 获取封装数据
  19109. */
  19110. exports.get_file_info = get_file_info;
  19111. var get_file_data = /*#__PURE__*/function () {
  19112. var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(files) {
  19113. var type,
  19114. fileFullName,
  19115. extname,
  19116. filedata,
  19117. imageinfo,
  19118. _args = arguments;
  19119. return _regenerator.default.wrap(function _callee$(_context) {
  19120. while (1) {
  19121. switch (_context.prev = _context.next) {
  19122. case 0:
  19123. type = _args.length > 1 && _args[1] !== undefined ? _args[1] : 'image';
  19124. // 最终需要上传数据库的数据
  19125. fileFullName = get_file_ext(files.name);
  19126. extname = fileFullName.ext.toLowerCase();
  19127. filedata = {
  19128. name: files.name,
  19129. uuid: files.uuid,
  19130. extname: extname || '',
  19131. cloudPath: files.cloudPath,
  19132. fileType: files.fileType,
  19133. url: files.path || files.path,
  19134. size: files.size,
  19135. //单位是字节
  19136. image: {},
  19137. path: files.path,
  19138. video: {}
  19139. };
  19140. if (!(type === 'image')) {
  19141. _context.next = 14;
  19142. break;
  19143. }
  19144. _context.next = 7;
  19145. return get_file_info(files.path);
  19146. case 7:
  19147. imageinfo = _context.sent;
  19148. delete filedata.video;
  19149. filedata.image.width = imageinfo.width;
  19150. filedata.image.height = imageinfo.height;
  19151. filedata.image.location = imageinfo.path;
  19152. _context.next = 15;
  19153. break;
  19154. case 14:
  19155. delete filedata.image;
  19156. case 15:
  19157. return _context.abrupt("return", filedata);
  19158. case 16:
  19159. case "end":
  19160. return _context.stop();
  19161. }
  19162. }
  19163. }, _callee);
  19164. }));
  19165. return function get_file_data(_x) {
  19166. return _ref.apply(this, arguments);
  19167. };
  19168. }();
  19169. exports.get_file_data = get_file_data;
  19170. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  19171. /***/ }),
  19172. /***/ 3:
  19173. /*!***********************************!*\
  19174. !*** (webpack)/buildin/global.js ***!
  19175. \***********************************/
  19176. /*! no static exports found */
  19177. /***/ (function(module, exports) {
  19178. var g;
  19179. // This works in non-strict mode
  19180. g = (function() {
  19181. return this;
  19182. })();
  19183. try {
  19184. // This works if eval is allowed (see CSP)
  19185. g = g || new Function("return this")();
  19186. } catch (e) {
  19187. // This works if the window reference is available
  19188. if (typeof window === "object") g = window;
  19189. }
  19190. // g can still be undefined, but nothing to do about it...
  19191. // We return undefined, instead of nothing here, so it's
  19192. // easier to handle this case. if(!global) { ...}
  19193. module.exports = g;
  19194. /***/ }),
  19195. /***/ 301:
  19196. /*!***********************************************************************************************************************!*\
  19197. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-transition/components/uni-transition/createAnimation.js ***!
  19198. \***********************************************************************************************************************/
  19199. /*! no static exports found */
  19200. /***/ (function(module, exports, __webpack_require__) {
  19201. "use strict";
  19202. /* WEBPACK VAR INJECTION */(function(uni) {
  19203. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  19204. Object.defineProperty(exports, "__esModule", {
  19205. value: true
  19206. });
  19207. exports.createAnimation = createAnimation;
  19208. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  19209. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  19210. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  19211. 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; }
  19212. 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; }
  19213. // const defaultOption = {
  19214. // duration: 300,
  19215. // timingFunction: 'linear',
  19216. // delay: 0,
  19217. // transformOrigin: '50% 50% 0'
  19218. // }
  19219. var MPAnimation = /*#__PURE__*/function () {
  19220. function MPAnimation(options, _this) {
  19221. (0, _classCallCheck2.default)(this, MPAnimation);
  19222. this.options = options;
  19223. // 在iOS10+QQ小程序平台下,传给原生的对象一定是个普通对象而不是Proxy对象,否则会报parameter should be Object instead of ProxyObject的错误
  19224. this.animation = uni.createAnimation(_objectSpread({}, options));
  19225. this.currentStepAnimates = {};
  19226. this.next = 0;
  19227. this.$ = _this;
  19228. }
  19229. (0, _createClass2.default)(MPAnimation, [{
  19230. key: "_nvuePushAnimates",
  19231. value: function _nvuePushAnimates(type, args) {
  19232. var aniObj = this.currentStepAnimates[this.next];
  19233. var styles = {};
  19234. if (!aniObj) {
  19235. styles = {
  19236. styles: {},
  19237. config: {}
  19238. };
  19239. } else {
  19240. styles = aniObj;
  19241. }
  19242. if (animateTypes1.includes(type)) {
  19243. if (!styles.styles.transform) {
  19244. styles.styles.transform = '';
  19245. }
  19246. var unit = '';
  19247. if (type === 'rotate') {
  19248. unit = 'deg';
  19249. }
  19250. styles.styles.transform += "".concat(type, "(").concat(args + unit, ") ");
  19251. } else {
  19252. styles.styles[type] = "".concat(args);
  19253. }
  19254. this.currentStepAnimates[this.next] = styles;
  19255. }
  19256. }, {
  19257. key: "_animateRun",
  19258. value: function _animateRun() {
  19259. var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  19260. var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  19261. var ref = this.$.$refs['ani'].ref;
  19262. if (!ref) return;
  19263. return new Promise(function (resolve, reject) {
  19264. nvueAnimation.transition(ref, _objectSpread({
  19265. styles: styles
  19266. }, config), function (res) {
  19267. resolve();
  19268. });
  19269. });
  19270. }
  19271. }, {
  19272. key: "_nvueNextAnimate",
  19273. value: function _nvueNextAnimate(animates) {
  19274. var _this2 = this;
  19275. var step = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  19276. var fn = arguments.length > 2 ? arguments[2] : undefined;
  19277. var obj = animates[step];
  19278. if (obj) {
  19279. var styles = obj.styles,
  19280. config = obj.config;
  19281. this._animateRun(styles, config).then(function () {
  19282. step += 1;
  19283. _this2._nvueNextAnimate(animates, step, fn);
  19284. });
  19285. } else {
  19286. this.currentStepAnimates = {};
  19287. typeof fn === 'function' && fn();
  19288. this.isEnd = true;
  19289. }
  19290. }
  19291. }, {
  19292. key: "step",
  19293. value: function step() {
  19294. var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  19295. this.animation.step(config);
  19296. return this;
  19297. }
  19298. }, {
  19299. key: "run",
  19300. value: function run(fn) {
  19301. this.$.animationData = this.animation.export();
  19302. this.$.timer = setTimeout(function () {
  19303. typeof fn === 'function' && fn();
  19304. }, this.$.durationTime);
  19305. }
  19306. }]);
  19307. return MPAnimation;
  19308. }();
  19309. var animateTypes1 = ['matrix', 'matrix3d', 'rotate', 'rotate3d', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scale3d', 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'translate', 'translate3d', 'translateX', 'translateY', 'translateZ'];
  19310. var animateTypes2 = ['opacity', 'backgroundColor'];
  19311. var animateTypes3 = ['width', 'height', 'left', 'right', 'top', 'bottom'];
  19312. animateTypes1.concat(animateTypes2, animateTypes3).forEach(function (type) {
  19313. MPAnimation.prototype[type] = function () {
  19314. var _this$animation;
  19315. (_this$animation = this.animation)[type].apply(_this$animation, arguments);
  19316. return this;
  19317. };
  19318. });
  19319. function createAnimation(option, _this) {
  19320. if (!_this) return;
  19321. clearTimeout(_this.timer);
  19322. return new MPAnimation(option, _this);
  19323. }
  19324. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  19325. /***/ }),
  19326. /***/ 32:
  19327. /*!**********************************************************************************************************!*\
  19328. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  19329. \**********************************************************************************************************/
  19330. /*! exports provided: default */
  19331. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19332. "use strict";
  19333. __webpack_require__.r(__webpack_exports__);
  19334. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  19335. /* globals __VUE_SSR_CONTEXT__ */
  19336. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  19337. // This module is a runtime utility for cleaner component module output and will
  19338. // be included in the final webpack user bundle.
  19339. function normalizeComponent (
  19340. scriptExports,
  19341. render,
  19342. staticRenderFns,
  19343. functionalTemplate,
  19344. injectStyles,
  19345. scopeId,
  19346. moduleIdentifier, /* server only */
  19347. shadowMode, /* vue-cli only */
  19348. components, // fixed by xxxxxx auto components
  19349. renderjs // fixed by xxxxxx renderjs
  19350. ) {
  19351. // Vue.extend constructor export interop
  19352. var options = typeof scriptExports === 'function'
  19353. ? scriptExports.options
  19354. : scriptExports
  19355. // fixed by xxxxxx auto components
  19356. if (components) {
  19357. if (!options.components) {
  19358. options.components = {}
  19359. }
  19360. var hasOwn = Object.prototype.hasOwnProperty
  19361. for (var name in components) {
  19362. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  19363. options.components[name] = components[name]
  19364. }
  19365. }
  19366. }
  19367. // fixed by xxxxxx renderjs
  19368. if (renderjs) {
  19369. if(typeof renderjs.beforeCreate === 'function'){
  19370. renderjs.beforeCreate = [renderjs.beforeCreate]
  19371. }
  19372. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  19373. this[renderjs.__module] = this
  19374. });
  19375. (options.mixins || (options.mixins = [])).push(renderjs)
  19376. }
  19377. // render functions
  19378. if (render) {
  19379. options.render = render
  19380. options.staticRenderFns = staticRenderFns
  19381. options._compiled = true
  19382. }
  19383. // functional template
  19384. if (functionalTemplate) {
  19385. options.functional = true
  19386. }
  19387. // scopedId
  19388. if (scopeId) {
  19389. options._scopeId = 'data-v-' + scopeId
  19390. }
  19391. var hook
  19392. if (moduleIdentifier) { // server build
  19393. hook = function (context) {
  19394. // 2.3 injection
  19395. context =
  19396. context || // cached call
  19397. (this.$vnode && this.$vnode.ssrContext) || // stateful
  19398. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  19399. // 2.2 with runInNewContext: true
  19400. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  19401. context = __VUE_SSR_CONTEXT__
  19402. }
  19403. // inject component styles
  19404. if (injectStyles) {
  19405. injectStyles.call(this, context)
  19406. }
  19407. // register component module identifier for async chunk inferrence
  19408. if (context && context._registeredComponents) {
  19409. context._registeredComponents.add(moduleIdentifier)
  19410. }
  19411. }
  19412. // used by ssr in case component is cached and beforeCreate
  19413. // never gets called
  19414. options._ssrRegister = hook
  19415. } else if (injectStyles) {
  19416. hook = shadowMode
  19417. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  19418. : injectStyles
  19419. }
  19420. if (hook) {
  19421. if (options.functional) {
  19422. // for template-only hot-reload because in that case the render fn doesn't
  19423. // go through the normalizer
  19424. options._injectStyles = hook
  19425. // register for functioal component in vue file
  19426. var originalRender = options.render
  19427. options.render = function renderWithStyleInjection (h, context) {
  19428. hook.call(context)
  19429. return originalRender(h, context)
  19430. }
  19431. } else {
  19432. // inject component registration as beforeCreate hook
  19433. var existing = options.beforeCreate
  19434. options.beforeCreate = existing
  19435. ? [].concat(existing, hook)
  19436. : [hook]
  19437. }
  19438. }
  19439. return {
  19440. exports: scriptExports,
  19441. options: options
  19442. }
  19443. }
  19444. /***/ }),
  19445. /***/ 321:
  19446. /*!****************************************************************************************************************!*\
  19447. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js ***!
  19448. \****************************************************************************************************************/
  19449. /*! no static exports found */
  19450. /***/ (function(module, exports, __webpack_require__) {
  19451. "use strict";
  19452. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  19453. Object.defineProperty(exports, "__esModule", {
  19454. value: true
  19455. });
  19456. exports.default = void 0;
  19457. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 322));
  19458. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 323));
  19459. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 324));
  19460. var _default = {
  19461. en: _en.default,
  19462. 'zh-Hans': _zhHans.default,
  19463. 'zh-Hant': _zhHant.default
  19464. };
  19465. exports.default = _default;
  19466. /***/ }),
  19467. /***/ 322:
  19468. /*!***************************************************************************************************************!*\
  19469. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-load-more/components/uni-load-more/i18n/en.json ***!
  19470. \***************************************************************************************************************/
  19471. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  19472. /***/ (function(module) {
  19473. 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\"}");
  19474. /***/ }),
  19475. /***/ 323:
  19476. /*!********************************************************************************************************************!*\
  19477. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json ***!
  19478. \********************************************************************************************************************/
  19479. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  19480. /***/ (function(module) {
  19481. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉显示更多\",\"uni-load-more.contentrefresh\":\"正在加载...\",\"uni-load-more.contentnomore\":\"没有更多数据了\"}");
  19482. /***/ }),
  19483. /***/ 324:
  19484. /*!********************************************************************************************************************!*\
  19485. !*** D:/A_GraduationDesign/errand/errand_app/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json ***!
  19486. \********************************************************************************************************************/
  19487. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  19488. /***/ (function(module) {
  19489. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉顯示更多\",\"uni-load-more.contentrefresh\":\"正在加載...\",\"uni-load-more.contentnomore\":\"沒有更多數據了\"}");
  19490. /***/ }),
  19491. /***/ 33:
  19492. /*!************************************************************************!*\
  19493. !*** D:/A_GraduationDesign/errand/errand_app/uni.promisify.adaptor.js ***!
  19494. \************************************************************************/
  19495. /*! no static exports found */
  19496. /***/ (function(module, exports, __webpack_require__) {
  19497. /* WEBPACK VAR INJECTION */(function(uni) {var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  19498. uni.addInterceptor({
  19499. returnValue: function returnValue(res) {
  19500. if (!(!!res && (_typeof(res) === "object" || typeof res === "function") && typeof res.then === "function")) {
  19501. return res;
  19502. }
  19503. return new Promise(function (resolve, reject) {
  19504. res.then(function (res) {
  19505. return res[0] ? reject(res[0]) : resolve(res[1]);
  19506. });
  19507. });
  19508. }
  19509. });
  19510. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  19511. /***/ }),
  19512. /***/ 34:
  19513. /*!*********************************************************************!*\
  19514. !*** D:/A_GraduationDesign/errand/errand_app/static/css/global.css ***!
  19515. \*********************************************************************/
  19516. /*! no static exports found */
  19517. /***/ (function(module, exports, __webpack_require__) {
  19518. // extracted by mini-css-extract-plugin
  19519. if(false) { var cssReload; }
  19520. /***/ }),
  19521. /***/ 35:
  19522. /*!****************************************************************!*\
  19523. !*** D:/A_GraduationDesign/errand/errand_app/utils/request.js ***!
  19524. \****************************************************************/
  19525. /*! no static exports found */
  19526. /***/ (function(module, exports, __webpack_require__) {
  19527. "use strict";
  19528. /* WEBPACK VAR INJECTION */(function(uni) {
  19529. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  19530. Object.defineProperty(exports, "__esModule", {
  19531. value: true
  19532. });
  19533. exports.default = void 0;
  19534. var _config = _interopRequireDefault(__webpack_require__(/*! @/config.js */ 36));
  19535. var baseUrl = true ? _config.default.dev.baseUrl : undefined;
  19536. var request = function request() {
  19537. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  19538. return new Promise(function (resolve, reject) {
  19539. var _uni$getStorageSync;
  19540. uni.request({
  19541. url: baseUrl + options.url || '',
  19542. method: options.method || 'GET',
  19543. data: options.data || {},
  19544. header: options.header || {
  19545. "Content-Type": "application/json",
  19546. token: (_uni$getStorageSync = uni.getStorageSync('xm-user')) === null || _uni$getStorageSync === void 0 ? void 0 : _uni$getStorageSync.token
  19547. }
  19548. }).then(function (res) {
  19549. var data = res.data;
  19550. if (data.code === '401') {
  19551. uni.navigateTo({
  19552. url: '/pages/login/login'
  19553. });
  19554. }
  19555. resolve(data);
  19556. }).catch(function (error) {
  19557. reject(error);
  19558. });
  19559. });
  19560. };
  19561. var get = function get(url, data) {
  19562. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  19563. options.method = 'GET';
  19564. options.data = data;
  19565. options.url = url;
  19566. return request(options);
  19567. };
  19568. var post = function post(url, data) {
  19569. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  19570. options.method = 'POST';
  19571. options.data = data;
  19572. options.url = url;
  19573. return request(options);
  19574. };
  19575. var put = function put(url, data) {
  19576. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  19577. options.method = 'PUT';
  19578. options.data = data;
  19579. options.url = url;
  19580. return request(options);
  19581. };
  19582. var del = function del(url, data) {
  19583. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  19584. options.method = 'DELETE';
  19585. options.data = data;
  19586. options.url = url;
  19587. return request(options);
  19588. };
  19589. var _default = {
  19590. request: request,
  19591. get: get,
  19592. post: post,
  19593. put: put,
  19594. del: del
  19595. };
  19596. exports.default = _default;
  19597. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  19598. /***/ }),
  19599. /***/ 36:
  19600. /*!*********************************************************!*\
  19601. !*** D:/A_GraduationDesign/errand/errand_app/config.js ***!
  19602. \*********************************************************/
  19603. /*! no static exports found */
  19604. /***/ (function(module, exports, __webpack_require__) {
  19605. "use strict";
  19606. Object.defineProperty(exports, "__esModule", {
  19607. value: true
  19608. });
  19609. exports.default = void 0;
  19610. var apiConfig = {
  19611. dev: {
  19612. baseUrl: 'http://localhost:9090'
  19613. },
  19614. prod: {
  19615. baseUrl: 'http://:9090'
  19616. }
  19617. };
  19618. var _default = apiConfig;
  19619. exports.default = _default;
  19620. /***/ }),
  19621. /***/ 4:
  19622. /*!**********************************************************************!*\
  19623. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  19624. \**********************************************************************/
  19625. /*! no static exports found */
  19626. /***/ (function(module, exports) {
  19627. function _interopRequireDefault(obj) {
  19628. return obj && obj.__esModule ? obj : {
  19629. "default": obj
  19630. };
  19631. }
  19632. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19633. /***/ }),
  19634. /***/ 43:
  19635. /*!***********************************************************************!*\
  19636. !*** D:/A_GraduationDesign/errand/errand_app/static/imgs/banner1.png ***!
  19637. \***********************************************************************/
  19638. /*! no static exports found */
  19639. /***/ (function(module, exports, __webpack_require__) {
  19640. module.exports = __webpack_require__.p + "static/imgs/banner1.png";
  19641. /***/ }),
  19642. /***/ 44:
  19643. /*!***********************************************************************!*\
  19644. !*** D:/A_GraduationDesign/errand/errand_app/static/imgs/banner2.png ***!
  19645. \***********************************************************************/
  19646. /*! no static exports found */
  19647. /***/ (function(module, exports, __webpack_require__) {
  19648. module.exports = __webpack_require__.p + "static/imgs/banner2.png";
  19649. /***/ }),
  19650. /***/ 5:
  19651. /*!**************************************************************!*\
  19652. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  19653. \**************************************************************/
  19654. /*! no static exports found */
  19655. /***/ (function(module, exports, __webpack_require__) {
  19656. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  19657. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  19658. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  19659. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  19660. function _slicedToArray(arr, i) {
  19661. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  19662. }
  19663. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19664. /***/ }),
  19665. /***/ 6:
  19666. /*!***************************************************************!*\
  19667. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  19668. \***************************************************************/
  19669. /*! no static exports found */
  19670. /***/ (function(module, exports) {
  19671. function _arrayWithHoles(arr) {
  19672. if (Array.isArray(arr)) return arr;
  19673. }
  19674. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19675. /***/ }),
  19676. /***/ 7:
  19677. /*!*********************************************************************!*\
  19678. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  19679. \*********************************************************************/
  19680. /*! no static exports found */
  19681. /***/ (function(module, exports) {
  19682. function _iterableToArrayLimit(r, l) {
  19683. var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  19684. if (null != t) {
  19685. var e,
  19686. n,
  19687. i,
  19688. u,
  19689. a = [],
  19690. f = !0,
  19691. o = !1;
  19692. try {
  19693. if (i = (t = t.call(r)).next, 0 === l) {
  19694. if (Object(t) !== t) return;
  19695. f = !1;
  19696. } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) {
  19697. ;
  19698. }
  19699. } catch (r) {
  19700. o = !0, n = r;
  19701. } finally {
  19702. try {
  19703. if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
  19704. } finally {
  19705. if (o) throw n;
  19706. }
  19707. }
  19708. return a;
  19709. }
  19710. }
  19711. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19712. /***/ }),
  19713. /***/ 8:
  19714. /*!***************************************************************************!*\
  19715. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  19716. \***************************************************************************/
  19717. /*! no static exports found */
  19718. /***/ (function(module, exports, __webpack_require__) {
  19719. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  19720. function _unsupportedIterableToArray(o, minLen) {
  19721. if (!o) return;
  19722. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  19723. var n = Object.prototype.toString.call(o).slice(8, -1);
  19724. if (n === "Object" && o.constructor) n = o.constructor.name;
  19725. if (n === "Map" || n === "Set") return Array.from(o);
  19726. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  19727. }
  19728. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19729. /***/ }),
  19730. /***/ 9:
  19731. /*!*****************************************************************!*\
  19732. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  19733. \*****************************************************************/
  19734. /*! no static exports found */
  19735. /***/ (function(module, exports) {
  19736. function _arrayLikeToArray(arr, len) {
  19737. if (len == null || len > arr.length) len = arr.length;
  19738. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  19739. arr2[i] = arr[i];
  19740. }
  19741. return arr2;
  19742. }
  19743. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19744. /***/ })
  19745. }]);
  19746. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map