vendor.js 603 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],[
  2. /* 0 */,
  3. /* 1 */
  4. /*!*********************************************************!*\
  5. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js ***!
  6. \*********************************************************/
  7. /*! no static exports found */
  8. /***/ (function(module, exports, __webpack_require__) {
  9. "use strict";
  10. Object.defineProperty(exports, "__esModule", {
  11. value: true
  12. });
  13. exports.default = void 0;
  14. var objectKeys = ['qy', 'env', 'error', 'version', 'lanDebug', 'cloud', 'serviceMarket', 'router', 'worklet'];
  15. var singlePageDisableKey = ['lanDebug', 'router', 'worklet'];
  16. var target = typeof globalThis !== 'undefined' ? globalThis : function () {
  17. return this;
  18. }();
  19. var key = ['w', 'x'].join('');
  20. var oldWx = target[key];
  21. var launchOption = oldWx.getLaunchOptionsSync ? oldWx.getLaunchOptionsSync() : null;
  22. function isWxKey(key) {
  23. if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
  24. return false;
  25. }
  26. return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function';
  27. }
  28. function initWx() {
  29. var newWx = {};
  30. for (var _key in oldWx) {
  31. if (isWxKey(_key)) {
  32. // TODO wrapper function
  33. newWx[_key] = oldWx[_key];
  34. }
  35. }
  36. return newWx;
  37. }
  38. target[key] = initWx();
  39. var _default = target[key];
  40. exports.default = _default;
  41. /***/ }),
  42. /* 2 */
  43. /*!************************************************************!*\
  44. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  45. \************************************************************/
  46. /*! no static exports found */
  47. /***/ (function(module, exports, __webpack_require__) {
  48. "use strict";
  49. /* WEBPACK VAR INJECTION */(function(wx, global) {
  50. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  51. Object.defineProperty(exports, "__esModule", {
  52. value: true
  53. });
  54. exports.createApp = createApp;
  55. exports.createComponent = createComponent;
  56. exports.createPage = createPage;
  57. exports.createPlugin = createPlugin;
  58. exports.createSubpackageApp = createSubpackageApp;
  59. exports.default = void 0;
  60. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  61. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  62. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  63. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  64. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  65. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  66. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  67. 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; }
  68. 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; }
  69. var realAtob;
  70. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  71. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  72. if (typeof atob !== 'function') {
  73. realAtob = function realAtob(str) {
  74. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  75. if (!b64re.test(str)) {
  76. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  77. }
  78. // Adding the padding if missing, for semplicity
  79. str += '=='.slice(2 - (str.length & 3));
  80. var bitmap;
  81. var result = '';
  82. var r1;
  83. var r2;
  84. var i = 0;
  85. for (; i < str.length;) {
  86. 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++)));
  87. 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);
  88. }
  89. return result;
  90. };
  91. } else {
  92. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  93. realAtob = atob;
  94. }
  95. function b64DecodeUnicode(str) {
  96. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  97. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  98. }).join(''));
  99. }
  100. function getCurrentUserInfo() {
  101. var token = wx.getStorageSync('uni_id_token') || '';
  102. var tokenArr = token.split('.');
  103. if (!token || tokenArr.length !== 3) {
  104. return {
  105. uid: null,
  106. role: [],
  107. permission: [],
  108. tokenExpired: 0
  109. };
  110. }
  111. var userInfo;
  112. try {
  113. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  114. } catch (error) {
  115. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  116. }
  117. userInfo.tokenExpired = userInfo.exp * 1000;
  118. delete userInfo.exp;
  119. delete userInfo.iat;
  120. return userInfo;
  121. }
  122. function uniIdMixin(Vue) {
  123. Vue.prototype.uniIDHasRole = function (roleId) {
  124. var _getCurrentUserInfo = getCurrentUserInfo(),
  125. role = _getCurrentUserInfo.role;
  126. return role.indexOf(roleId) > -1;
  127. };
  128. Vue.prototype.uniIDHasPermission = function (permissionId) {
  129. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  130. permission = _getCurrentUserInfo2.permission;
  131. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  132. };
  133. Vue.prototype.uniIDTokenValid = function () {
  134. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  135. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  136. return tokenExpired > Date.now();
  137. };
  138. }
  139. var _toString = Object.prototype.toString;
  140. var hasOwnProperty = Object.prototype.hasOwnProperty;
  141. function isFn(fn) {
  142. return typeof fn === 'function';
  143. }
  144. function isStr(str) {
  145. return typeof str === 'string';
  146. }
  147. function isObject(obj) {
  148. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  149. }
  150. function isPlainObject(obj) {
  151. return _toString.call(obj) === '[object Object]';
  152. }
  153. function hasOwn(obj, key) {
  154. return hasOwnProperty.call(obj, key);
  155. }
  156. function noop() {}
  157. /**
  158. * Create a cached version of a pure function.
  159. */
  160. function cached(fn) {
  161. var cache = Object.create(null);
  162. return function cachedFn(str) {
  163. var hit = cache[str];
  164. return hit || (cache[str] = fn(str));
  165. };
  166. }
  167. /**
  168. * Camelize a hyphen-delimited string.
  169. */
  170. var camelizeRE = /-(\w)/g;
  171. var camelize = cached(function (str) {
  172. return str.replace(camelizeRE, function (_, c) {
  173. return c ? c.toUpperCase() : '';
  174. });
  175. });
  176. function sortObject(obj) {
  177. var sortObj = {};
  178. if (isPlainObject(obj)) {
  179. Object.keys(obj).sort().forEach(function (key) {
  180. sortObj[key] = obj[key];
  181. });
  182. }
  183. return !Object.keys(sortObj) ? obj : sortObj;
  184. }
  185. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  186. var globalInterceptors = {};
  187. var scopedInterceptors = {};
  188. function mergeHook(parentVal, childVal) {
  189. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  190. return res ? dedupeHooks(res) : res;
  191. }
  192. function dedupeHooks(hooks) {
  193. var res = [];
  194. for (var i = 0; i < hooks.length; i++) {
  195. if (res.indexOf(hooks[i]) === -1) {
  196. res.push(hooks[i]);
  197. }
  198. }
  199. return res;
  200. }
  201. function removeHook(hooks, hook) {
  202. var index = hooks.indexOf(hook);
  203. if (index !== -1) {
  204. hooks.splice(index, 1);
  205. }
  206. }
  207. function mergeInterceptorHook(interceptor, option) {
  208. Object.keys(option).forEach(function (hook) {
  209. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  210. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  211. }
  212. });
  213. }
  214. function removeInterceptorHook(interceptor, option) {
  215. if (!interceptor || !option) {
  216. return;
  217. }
  218. Object.keys(option).forEach(function (hook) {
  219. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  220. removeHook(interceptor[hook], option[hook]);
  221. }
  222. });
  223. }
  224. function addInterceptor(method, option) {
  225. if (typeof method === 'string' && isPlainObject(option)) {
  226. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  227. } else if (isPlainObject(method)) {
  228. mergeInterceptorHook(globalInterceptors, method);
  229. }
  230. }
  231. function removeInterceptor(method, option) {
  232. if (typeof method === 'string') {
  233. if (isPlainObject(option)) {
  234. removeInterceptorHook(scopedInterceptors[method], option);
  235. } else {
  236. delete scopedInterceptors[method];
  237. }
  238. } else if (isPlainObject(method)) {
  239. removeInterceptorHook(globalInterceptors, method);
  240. }
  241. }
  242. function wrapperHook(hook) {
  243. return function (data) {
  244. return hook(data) || data;
  245. };
  246. }
  247. function isPromise(obj) {
  248. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  249. }
  250. function queue(hooks, data) {
  251. var promise = false;
  252. for (var i = 0; i < hooks.length; i++) {
  253. var hook = hooks[i];
  254. if (promise) {
  255. promise = Promise.resolve(wrapperHook(hook));
  256. } else {
  257. var res = hook(data);
  258. if (isPromise(res)) {
  259. promise = Promise.resolve(res);
  260. }
  261. if (res === false) {
  262. return {
  263. then: function then() {}
  264. };
  265. }
  266. }
  267. }
  268. return promise || {
  269. then: function then(callback) {
  270. return callback(data);
  271. }
  272. };
  273. }
  274. function wrapperOptions(interceptor) {
  275. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  276. ['success', 'fail', 'complete'].forEach(function (name) {
  277. if (Array.isArray(interceptor[name])) {
  278. var oldCallback = options[name];
  279. options[name] = function callbackInterceptor(res) {
  280. queue(interceptor[name], res).then(function (res) {
  281. /* eslint-disable no-mixed-operators */
  282. return isFn(oldCallback) && oldCallback(res) || res;
  283. });
  284. };
  285. }
  286. });
  287. return options;
  288. }
  289. function wrapperReturnValue(method, returnValue) {
  290. var returnValueHooks = [];
  291. if (Array.isArray(globalInterceptors.returnValue)) {
  292. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  293. }
  294. var interceptor = scopedInterceptors[method];
  295. if (interceptor && Array.isArray(interceptor.returnValue)) {
  296. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  297. }
  298. returnValueHooks.forEach(function (hook) {
  299. returnValue = hook(returnValue) || returnValue;
  300. });
  301. return returnValue;
  302. }
  303. function getApiInterceptorHooks(method) {
  304. var interceptor = Object.create(null);
  305. Object.keys(globalInterceptors).forEach(function (hook) {
  306. if (hook !== 'returnValue') {
  307. interceptor[hook] = globalInterceptors[hook].slice();
  308. }
  309. });
  310. var scopedInterceptor = scopedInterceptors[method];
  311. if (scopedInterceptor) {
  312. Object.keys(scopedInterceptor).forEach(function (hook) {
  313. if (hook !== 'returnValue') {
  314. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  315. }
  316. });
  317. }
  318. return interceptor;
  319. }
  320. function invokeApi(method, api, options) {
  321. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  322. params[_key - 3] = arguments[_key];
  323. }
  324. var interceptor = getApiInterceptorHooks(method);
  325. if (interceptor && Object.keys(interceptor).length) {
  326. if (Array.isArray(interceptor.invoke)) {
  327. var res = queue(interceptor.invoke, options);
  328. return res.then(function (options) {
  329. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  330. });
  331. } else {
  332. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  333. }
  334. }
  335. return api.apply(void 0, [options].concat(params));
  336. }
  337. var promiseInterceptor = {
  338. returnValue: function returnValue(res) {
  339. if (!isPromise(res)) {
  340. return res;
  341. }
  342. return new Promise(function (resolve, reject) {
  343. res.then(function (res) {
  344. if (res[0]) {
  345. reject(res[0]);
  346. } else {
  347. resolve(res[1]);
  348. }
  349. });
  350. });
  351. }
  352. };
  353. 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/;
  354. var CONTEXT_API_RE = /^create|Manager$/;
  355. // Context例外情况
  356. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  357. // 同步例外情况
  358. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  359. var CALLBACK_API_RE = /^on|^off/;
  360. function isContextApi(name) {
  361. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  362. }
  363. function isSyncApi(name) {
  364. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  365. }
  366. function isCallbackApi(name) {
  367. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  368. }
  369. function handlePromise(promise) {
  370. return promise.then(function (data) {
  371. return [null, data];
  372. }).catch(function (err) {
  373. return [err];
  374. });
  375. }
  376. function shouldPromise(name) {
  377. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  378. return false;
  379. }
  380. return true;
  381. }
  382. /* eslint-disable no-extend-native */
  383. if (!Promise.prototype.finally) {
  384. Promise.prototype.finally = function (callback) {
  385. var promise = this.constructor;
  386. return this.then(function (value) {
  387. return promise.resolve(callback()).then(function () {
  388. return value;
  389. });
  390. }, function (reason) {
  391. return promise.resolve(callback()).then(function () {
  392. throw reason;
  393. });
  394. });
  395. };
  396. }
  397. function promisify(name, api) {
  398. if (!shouldPromise(name) || !isFn(api)) {
  399. return api;
  400. }
  401. return function promiseApi() {
  402. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  403. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  404. params[_key2 - 1] = arguments[_key2];
  405. }
  406. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  407. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  408. }
  409. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  410. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  411. success: resolve,
  412. fail: reject
  413. })].concat(params));
  414. })));
  415. };
  416. }
  417. var EPS = 1e-4;
  418. var BASE_DEVICE_WIDTH = 750;
  419. var isIOS = false;
  420. var deviceWidth = 0;
  421. var deviceDPR = 0;
  422. function checkDeviceWidth() {
  423. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  424. platform = _wx$getSystemInfoSync.platform,
  425. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  426. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  427. deviceWidth = windowWidth;
  428. deviceDPR = pixelRatio;
  429. isIOS = platform === 'ios';
  430. }
  431. function upx2px(number, newDeviceWidth) {
  432. if (deviceWidth === 0) {
  433. checkDeviceWidth();
  434. }
  435. number = Number(number);
  436. if (number === 0) {
  437. return 0;
  438. }
  439. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  440. if (result < 0) {
  441. result = -result;
  442. }
  443. result = Math.floor(result + EPS);
  444. if (result === 0) {
  445. if (deviceDPR === 1 || !isIOS) {
  446. result = 1;
  447. } else {
  448. result = 0.5;
  449. }
  450. }
  451. return number < 0 ? -result : result;
  452. }
  453. var LOCALE_ZH_HANS = 'zh-Hans';
  454. var LOCALE_ZH_HANT = 'zh-Hant';
  455. var LOCALE_EN = 'en';
  456. var LOCALE_FR = 'fr';
  457. var LOCALE_ES = 'es';
  458. var messages = {};
  459. var locale;
  460. {
  461. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  462. }
  463. function initI18nMessages() {
  464. if (!isEnableLocale()) {
  465. return;
  466. }
  467. var localeKeys = Object.keys(__uniConfig.locales);
  468. if (localeKeys.length) {
  469. localeKeys.forEach(function (locale) {
  470. var curMessages = messages[locale];
  471. var userMessages = __uniConfig.locales[locale];
  472. if (curMessages) {
  473. Object.assign(curMessages, userMessages);
  474. } else {
  475. messages[locale] = userMessages;
  476. }
  477. });
  478. }
  479. }
  480. initI18nMessages();
  481. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  482. var t = i18n.t;
  483. var i18nMixin = i18n.mixin = {
  484. beforeCreate: function beforeCreate() {
  485. var _this = this;
  486. var unwatch = i18n.i18n.watchLocale(function () {
  487. _this.$forceUpdate();
  488. });
  489. this.$once('hook:beforeDestroy', function () {
  490. unwatch();
  491. });
  492. },
  493. methods: {
  494. $$t: function $$t(key, values) {
  495. return t(key, values);
  496. }
  497. }
  498. };
  499. var setLocale = i18n.setLocale;
  500. var getLocale = i18n.getLocale;
  501. function initAppLocale(Vue, appVm, locale) {
  502. var state = Vue.observable({
  503. locale: locale || i18n.getLocale()
  504. });
  505. var localeWatchers = [];
  506. appVm.$watchLocale = function (fn) {
  507. localeWatchers.push(fn);
  508. };
  509. Object.defineProperty(appVm, '$locale', {
  510. get: function get() {
  511. return state.locale;
  512. },
  513. set: function set(v) {
  514. state.locale = v;
  515. localeWatchers.forEach(function (watch) {
  516. return watch(v);
  517. });
  518. }
  519. });
  520. }
  521. function isEnableLocale() {
  522. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  523. }
  524. function include(str, parts) {
  525. return !!parts.find(function (part) {
  526. return str.indexOf(part) !== -1;
  527. });
  528. }
  529. function startsWith(str, parts) {
  530. return parts.find(function (part) {
  531. return str.indexOf(part) === 0;
  532. });
  533. }
  534. function normalizeLocale(locale, messages) {
  535. if (!locale) {
  536. return;
  537. }
  538. locale = locale.trim().replace(/_/g, '-');
  539. if (messages && messages[locale]) {
  540. return locale;
  541. }
  542. locale = locale.toLowerCase();
  543. if (locale === 'chinese') {
  544. // 支付宝
  545. return LOCALE_ZH_HANS;
  546. }
  547. if (locale.indexOf('zh') === 0) {
  548. if (locale.indexOf('-hans') > -1) {
  549. return LOCALE_ZH_HANS;
  550. }
  551. if (locale.indexOf('-hant') > -1) {
  552. return LOCALE_ZH_HANT;
  553. }
  554. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  555. return LOCALE_ZH_HANT;
  556. }
  557. return LOCALE_ZH_HANS;
  558. }
  559. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  560. if (lang) {
  561. return lang;
  562. }
  563. }
  564. // export function initI18n() {
  565. // const localeKeys = Object.keys(__uniConfig.locales || {})
  566. // if (localeKeys.length) {
  567. // localeKeys.forEach((locale) =>
  568. // i18n.add(locale, __uniConfig.locales[locale])
  569. // )
  570. // }
  571. // }
  572. function getLocale$1() {
  573. // 优先使用 $locale
  574. if (isFn(getApp)) {
  575. var app = getApp({
  576. allowDefault: true
  577. });
  578. if (app && app.$vm) {
  579. return app.$vm.$locale;
  580. }
  581. }
  582. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  583. }
  584. function setLocale$1(locale) {
  585. var app = isFn(getApp) ? getApp() : false;
  586. if (!app) {
  587. return false;
  588. }
  589. var oldLocale = app.$vm.$locale;
  590. if (oldLocale !== locale) {
  591. app.$vm.$locale = locale;
  592. onLocaleChangeCallbacks.forEach(function (fn) {
  593. return fn({
  594. locale: locale
  595. });
  596. });
  597. return true;
  598. }
  599. return false;
  600. }
  601. var onLocaleChangeCallbacks = [];
  602. function onLocaleChange(fn) {
  603. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  604. onLocaleChangeCallbacks.push(fn);
  605. }
  606. }
  607. if (typeof global !== 'undefined') {
  608. global.getLocale = getLocale$1;
  609. }
  610. var interceptors = {
  611. promiseInterceptor: promiseInterceptor
  612. };
  613. var baseApi = /*#__PURE__*/Object.freeze({
  614. __proto__: null,
  615. upx2px: upx2px,
  616. getLocale: getLocale$1,
  617. setLocale: setLocale$1,
  618. onLocaleChange: onLocaleChange,
  619. addInterceptor: addInterceptor,
  620. removeInterceptor: removeInterceptor,
  621. interceptors: interceptors
  622. });
  623. function findExistsPageIndex(url) {
  624. var pages = getCurrentPages();
  625. var len = pages.length;
  626. while (len--) {
  627. var page = pages[len];
  628. if (page.$page && page.$page.fullPath === url) {
  629. return len;
  630. }
  631. }
  632. return -1;
  633. }
  634. var redirectTo = {
  635. name: function name(fromArgs) {
  636. if (fromArgs.exists === 'back' && fromArgs.delta) {
  637. return 'navigateBack';
  638. }
  639. return 'redirectTo';
  640. },
  641. args: function args(fromArgs) {
  642. if (fromArgs.exists === 'back' && fromArgs.url) {
  643. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  644. if (existsPageIndex !== -1) {
  645. var delta = getCurrentPages().length - 1 - existsPageIndex;
  646. if (delta > 0) {
  647. fromArgs.delta = delta;
  648. }
  649. }
  650. }
  651. }
  652. };
  653. var previewImage = {
  654. args: function args(fromArgs) {
  655. var currentIndex = parseInt(fromArgs.current);
  656. if (isNaN(currentIndex)) {
  657. return;
  658. }
  659. var urls = fromArgs.urls;
  660. if (!Array.isArray(urls)) {
  661. return;
  662. }
  663. var len = urls.length;
  664. if (!len) {
  665. return;
  666. }
  667. if (currentIndex < 0) {
  668. currentIndex = 0;
  669. } else if (currentIndex >= len) {
  670. currentIndex = len - 1;
  671. }
  672. if (currentIndex > 0) {
  673. fromArgs.current = urls[currentIndex];
  674. fromArgs.urls = urls.filter(function (item, index) {
  675. return index < currentIndex ? item !== urls[currentIndex] : true;
  676. });
  677. } else {
  678. fromArgs.current = urls[0];
  679. }
  680. return {
  681. indicator: false,
  682. loop: false
  683. };
  684. }
  685. };
  686. var UUID_KEY = '__DC_STAT_UUID';
  687. var deviceId;
  688. function useDeviceId(result) {
  689. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  690. if (!deviceId) {
  691. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  692. wx.setStorage({
  693. key: UUID_KEY,
  694. data: deviceId
  695. });
  696. }
  697. result.deviceId = deviceId;
  698. }
  699. function addSafeAreaInsets(result) {
  700. if (result.safeArea) {
  701. var safeArea = result.safeArea;
  702. result.safeAreaInsets = {
  703. top: safeArea.top,
  704. left: safeArea.left,
  705. right: result.windowWidth - safeArea.right,
  706. bottom: result.screenHeight - safeArea.bottom
  707. };
  708. }
  709. }
  710. function populateParameters(result) {
  711. var _result$brand = result.brand,
  712. brand = _result$brand === void 0 ? '' : _result$brand,
  713. _result$model = result.model,
  714. model = _result$model === void 0 ? '' : _result$model,
  715. _result$system = result.system,
  716. system = _result$system === void 0 ? '' : _result$system,
  717. _result$language = result.language,
  718. language = _result$language === void 0 ? '' : _result$language,
  719. theme = result.theme,
  720. version = result.version,
  721. platform = result.platform,
  722. fontSizeSetting = result.fontSizeSetting,
  723. SDKVersion = result.SDKVersion,
  724. pixelRatio = result.pixelRatio,
  725. deviceOrientation = result.deviceOrientation;
  726. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  727. var extraParam = {};
  728. // osName osVersion
  729. var osName = '';
  730. var osVersion = '';
  731. {
  732. osName = system.split(' ')[0] || '';
  733. osVersion = system.split(' ')[1] || '';
  734. }
  735. var hostVersion = version;
  736. // deviceType
  737. var deviceType = getGetDeviceType(result, model);
  738. // deviceModel
  739. var deviceBrand = getDeviceBrand(brand);
  740. // hostName
  741. var _hostName = getHostName(result);
  742. // deviceOrientation
  743. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  744. // devicePixelRatio
  745. var _devicePixelRatio = pixelRatio;
  746. // SDKVersion
  747. var _SDKVersion = SDKVersion;
  748. // hostLanguage
  749. var hostLanguage = language.replace(/_/g, '-');
  750. // wx.getAccountInfoSync
  751. var parameters = {
  752. appId: "__UNI__50B3EE1",
  753. appName: "wx-app-new",
  754. appVersion: "1.0.0",
  755. appVersionCode: "100",
  756. appLanguage: getAppLanguage(hostLanguage),
  757. uniCompileVersion: "3.7.9",
  758. uniRuntimeVersion: "3.7.9",
  759. uniPlatform: undefined || "mp-weixin",
  760. deviceBrand: deviceBrand,
  761. deviceModel: model,
  762. deviceType: deviceType,
  763. devicePixelRatio: _devicePixelRatio,
  764. deviceOrientation: _deviceOrientation,
  765. osName: osName.toLocaleLowerCase(),
  766. osVersion: osVersion,
  767. hostTheme: theme,
  768. hostVersion: hostVersion,
  769. hostLanguage: hostLanguage,
  770. hostName: _hostName,
  771. hostSDKVersion: _SDKVersion,
  772. hostFontSizeSetting: fontSizeSetting,
  773. windowTop: 0,
  774. windowBottom: 0,
  775. // TODO
  776. osLanguage: undefined,
  777. osTheme: undefined,
  778. ua: undefined,
  779. hostPackageName: undefined,
  780. browserName: undefined,
  781. browserVersion: undefined
  782. };
  783. Object.assign(result, parameters, extraParam);
  784. }
  785. function getGetDeviceType(result, model) {
  786. var deviceType = result.deviceType || 'phone';
  787. {
  788. var deviceTypeMaps = {
  789. ipad: 'pad',
  790. windows: 'pc',
  791. mac: 'pc'
  792. };
  793. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  794. var _model = model.toLocaleLowerCase();
  795. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  796. var _m = deviceTypeMapsKeys[index];
  797. if (_model.indexOf(_m) !== -1) {
  798. deviceType = deviceTypeMaps[_m];
  799. break;
  800. }
  801. }
  802. }
  803. return deviceType;
  804. }
  805. function getDeviceBrand(brand) {
  806. var deviceBrand = brand;
  807. if (deviceBrand) {
  808. deviceBrand = brand.toLocaleLowerCase();
  809. }
  810. return deviceBrand;
  811. }
  812. function getAppLanguage(defaultLanguage) {
  813. return getLocale$1 ? getLocale$1() : defaultLanguage;
  814. }
  815. function getHostName(result) {
  816. var _platform = 'WeChat';
  817. var _hostName = result.hostName || _platform; // mp-jd
  818. {
  819. if (result.environment) {
  820. _hostName = result.environment;
  821. } else if (result.host && result.host.env) {
  822. _hostName = result.host.env;
  823. }
  824. }
  825. return _hostName;
  826. }
  827. var getSystemInfo = {
  828. returnValue: function returnValue(result) {
  829. useDeviceId(result);
  830. addSafeAreaInsets(result);
  831. populateParameters(result);
  832. }
  833. };
  834. var showActionSheet = {
  835. args: function args(fromArgs) {
  836. if ((0, _typeof2.default)(fromArgs) === 'object') {
  837. fromArgs.alertText = fromArgs.title;
  838. }
  839. }
  840. };
  841. var getAppBaseInfo = {
  842. returnValue: function returnValue(result) {
  843. var _result = result,
  844. version = _result.version,
  845. language = _result.language,
  846. SDKVersion = _result.SDKVersion,
  847. theme = _result.theme;
  848. var _hostName = getHostName(result);
  849. var hostLanguage = language.replace('_', '-');
  850. result = sortObject(Object.assign(result, {
  851. appId: "__UNI__50B3EE1",
  852. appName: "wx-app-new",
  853. appVersion: "1.0.0",
  854. appVersionCode: "100",
  855. appLanguage: getAppLanguage(hostLanguage),
  856. hostVersion: version,
  857. hostLanguage: hostLanguage,
  858. hostName: _hostName,
  859. hostSDKVersion: SDKVersion,
  860. hostTheme: theme
  861. }));
  862. }
  863. };
  864. var getDeviceInfo = {
  865. returnValue: function returnValue(result) {
  866. var _result2 = result,
  867. brand = _result2.brand,
  868. model = _result2.model;
  869. var deviceType = getGetDeviceType(result, model);
  870. var deviceBrand = getDeviceBrand(brand);
  871. useDeviceId(result);
  872. result = sortObject(Object.assign(result, {
  873. deviceType: deviceType,
  874. deviceBrand: deviceBrand,
  875. deviceModel: model
  876. }));
  877. }
  878. };
  879. var getWindowInfo = {
  880. returnValue: function returnValue(result) {
  881. addSafeAreaInsets(result);
  882. result = sortObject(Object.assign(result, {
  883. windowTop: 0,
  884. windowBottom: 0
  885. }));
  886. }
  887. };
  888. var getAppAuthorizeSetting = {
  889. returnValue: function returnValue(result) {
  890. var locationReducedAccuracy = result.locationReducedAccuracy;
  891. result.locationAccuracy = 'unsupported';
  892. if (locationReducedAccuracy === true) {
  893. result.locationAccuracy = 'reduced';
  894. } else if (locationReducedAccuracy === false) {
  895. result.locationAccuracy = 'full';
  896. }
  897. }
  898. };
  899. // import navigateTo from 'uni-helpers/navigate-to'
  900. var compressImage = {
  901. args: function args(fromArgs) {
  902. // https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
  903. if (fromArgs.compressedHeight && !fromArgs.compressHeight) {
  904. fromArgs.compressHeight = fromArgs.compressedHeight;
  905. }
  906. if (fromArgs.compressedWidth && !fromArgs.compressWidth) {
  907. fromArgs.compressWidth = fromArgs.compressedWidth;
  908. }
  909. }
  910. };
  911. var protocols = {
  912. redirectTo: redirectTo,
  913. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  914. previewImage: previewImage,
  915. getSystemInfo: getSystemInfo,
  916. getSystemInfoSync: getSystemInfo,
  917. showActionSheet: showActionSheet,
  918. getAppBaseInfo: getAppBaseInfo,
  919. getDeviceInfo: getDeviceInfo,
  920. getWindowInfo: getWindowInfo,
  921. getAppAuthorizeSetting: getAppAuthorizeSetting,
  922. compressImage: compressImage
  923. };
  924. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  925. var canIUses = [];
  926. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  927. function processCallback(methodName, method, returnValue) {
  928. return function (res) {
  929. return method(processReturnValue(methodName, res, returnValue));
  930. };
  931. }
  932. function processArgs(methodName, fromArgs) {
  933. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  934. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  935. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  936. if (isPlainObject(fromArgs)) {
  937. // 一般 api 的参数解析
  938. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  939. if (isFn(argsOption)) {
  940. argsOption = argsOption(fromArgs, toArgs) || {};
  941. }
  942. for (var key in fromArgs) {
  943. if (hasOwn(argsOption, key)) {
  944. var keyOption = argsOption[key];
  945. if (isFn(keyOption)) {
  946. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  947. }
  948. if (!keyOption) {
  949. // 不支持的参数
  950. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  951. } else if (isStr(keyOption)) {
  952. // 重写参数 key
  953. toArgs[keyOption] = fromArgs[key];
  954. } else if (isPlainObject(keyOption)) {
  955. // {name:newName,value:value}可重新指定参数 key:value
  956. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  957. }
  958. } else if (CALLBACKS.indexOf(key) !== -1) {
  959. if (isFn(fromArgs[key])) {
  960. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  961. }
  962. } else {
  963. if (!keepFromArgs) {
  964. toArgs[key] = fromArgs[key];
  965. }
  966. }
  967. }
  968. return toArgs;
  969. } else if (isFn(fromArgs)) {
  970. fromArgs = processCallback(methodName, fromArgs, returnValue);
  971. }
  972. return fromArgs;
  973. }
  974. function processReturnValue(methodName, res, returnValue) {
  975. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  976. if (isFn(protocols.returnValue)) {
  977. // 处理通用 returnValue
  978. res = protocols.returnValue(methodName, res);
  979. }
  980. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  981. }
  982. function wrapper(methodName, method) {
  983. if (hasOwn(protocols, methodName)) {
  984. var protocol = protocols[methodName];
  985. if (!protocol) {
  986. // 暂不支持的 api
  987. return function () {
  988. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  989. };
  990. }
  991. return function (arg1, arg2) {
  992. // 目前 api 最多两个参数
  993. var options = protocol;
  994. if (isFn(protocol)) {
  995. options = protocol(arg1);
  996. }
  997. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  998. var args = [arg1];
  999. if (typeof arg2 !== 'undefined') {
  1000. args.push(arg2);
  1001. }
  1002. if (isFn(options.name)) {
  1003. methodName = options.name(arg1);
  1004. } else if (isStr(options.name)) {
  1005. methodName = options.name;
  1006. }
  1007. var returnValue = wx[methodName].apply(wx, args);
  1008. if (isSyncApi(methodName)) {
  1009. // 同步 api
  1010. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  1011. }
  1012. return returnValue;
  1013. };
  1014. }
  1015. return method;
  1016. }
  1017. var todoApis = Object.create(null);
  1018. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  1019. function createTodoApi(name) {
  1020. return function todoApi(_ref) {
  1021. var fail = _ref.fail,
  1022. complete = _ref.complete;
  1023. var res = {
  1024. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  1025. };
  1026. isFn(fail) && fail(res);
  1027. isFn(complete) && complete(res);
  1028. };
  1029. }
  1030. TODOS.forEach(function (name) {
  1031. todoApis[name] = createTodoApi(name);
  1032. });
  1033. var providers = {
  1034. oauth: ['weixin'],
  1035. share: ['weixin'],
  1036. payment: ['wxpay'],
  1037. push: ['weixin']
  1038. };
  1039. function getProvider(_ref2) {
  1040. var service = _ref2.service,
  1041. success = _ref2.success,
  1042. fail = _ref2.fail,
  1043. complete = _ref2.complete;
  1044. var res = false;
  1045. if (providers[service]) {
  1046. res = {
  1047. errMsg: 'getProvider:ok',
  1048. service: service,
  1049. provider: providers[service]
  1050. };
  1051. isFn(success) && success(res);
  1052. } else {
  1053. res = {
  1054. errMsg: 'getProvider:fail service not found'
  1055. };
  1056. isFn(fail) && fail(res);
  1057. }
  1058. isFn(complete) && complete(res);
  1059. }
  1060. var extraApi = /*#__PURE__*/Object.freeze({
  1061. __proto__: null,
  1062. getProvider: getProvider
  1063. });
  1064. var getEmitter = function () {
  1065. var Emitter;
  1066. return function getUniEmitter() {
  1067. if (!Emitter) {
  1068. Emitter = new _vue.default();
  1069. }
  1070. return Emitter;
  1071. };
  1072. }();
  1073. function apply(ctx, method, args) {
  1074. return ctx[method].apply(ctx, args);
  1075. }
  1076. function $on() {
  1077. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  1078. }
  1079. function $off() {
  1080. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  1081. }
  1082. function $once() {
  1083. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  1084. }
  1085. function $emit() {
  1086. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  1087. }
  1088. var eventApi = /*#__PURE__*/Object.freeze({
  1089. __proto__: null,
  1090. $on: $on,
  1091. $off: $off,
  1092. $once: $once,
  1093. $emit: $emit
  1094. });
  1095. /**
  1096. * 框架内 try-catch
  1097. */
  1098. /**
  1099. * 开发者 try-catch
  1100. */
  1101. function tryCatch(fn) {
  1102. return function () {
  1103. try {
  1104. return fn.apply(fn, arguments);
  1105. } catch (e) {
  1106. // TODO
  1107. console.error(e);
  1108. }
  1109. };
  1110. }
  1111. function getApiCallbacks(params) {
  1112. var apiCallbacks = {};
  1113. for (var name in params) {
  1114. var param = params[name];
  1115. if (isFn(param)) {
  1116. apiCallbacks[name] = tryCatch(param);
  1117. delete params[name];
  1118. }
  1119. }
  1120. return apiCallbacks;
  1121. }
  1122. var cid;
  1123. var cidErrMsg;
  1124. var enabled;
  1125. function normalizePushMessage(message) {
  1126. try {
  1127. return JSON.parse(message);
  1128. } catch (e) {}
  1129. return message;
  1130. }
  1131. function invokePushCallback(args) {
  1132. if (args.type === 'enabled') {
  1133. enabled = true;
  1134. } else if (args.type === 'clientId') {
  1135. cid = args.cid;
  1136. cidErrMsg = args.errMsg;
  1137. invokeGetPushCidCallbacks(cid, args.errMsg);
  1138. } else if (args.type === 'pushMsg') {
  1139. var message = {
  1140. type: 'receive',
  1141. data: normalizePushMessage(args.message)
  1142. };
  1143. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  1144. var callback = onPushMessageCallbacks[i];
  1145. callback(message);
  1146. // 该消息已被阻止
  1147. if (message.stopped) {
  1148. break;
  1149. }
  1150. }
  1151. } else if (args.type === 'click') {
  1152. onPushMessageCallbacks.forEach(function (callback) {
  1153. callback({
  1154. type: 'click',
  1155. data: normalizePushMessage(args.message)
  1156. });
  1157. });
  1158. }
  1159. }
  1160. var getPushCidCallbacks = [];
  1161. function invokeGetPushCidCallbacks(cid, errMsg) {
  1162. getPushCidCallbacks.forEach(function (callback) {
  1163. callback(cid, errMsg);
  1164. });
  1165. getPushCidCallbacks.length = 0;
  1166. }
  1167. function getPushClientId(args) {
  1168. if (!isPlainObject(args)) {
  1169. args = {};
  1170. }
  1171. var _getApiCallbacks = getApiCallbacks(args),
  1172. success = _getApiCallbacks.success,
  1173. fail = _getApiCallbacks.fail,
  1174. complete = _getApiCallbacks.complete;
  1175. var hasSuccess = isFn(success);
  1176. var hasFail = isFn(fail);
  1177. var hasComplete = isFn(complete);
  1178. Promise.resolve().then(function () {
  1179. if (typeof enabled === 'undefined') {
  1180. enabled = false;
  1181. cid = '';
  1182. cidErrMsg = 'uniPush is not enabled';
  1183. }
  1184. getPushCidCallbacks.push(function (cid, errMsg) {
  1185. var res;
  1186. if (cid) {
  1187. res = {
  1188. errMsg: 'getPushClientId:ok',
  1189. cid: cid
  1190. };
  1191. hasSuccess && success(res);
  1192. } else {
  1193. res = {
  1194. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  1195. };
  1196. hasFail && fail(res);
  1197. }
  1198. hasComplete && complete(res);
  1199. });
  1200. if (typeof cid !== 'undefined') {
  1201. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1202. }
  1203. });
  1204. }
  1205. var onPushMessageCallbacks = [];
  1206. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1207. var onPushMessage = function onPushMessage(fn) {
  1208. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1209. onPushMessageCallbacks.push(fn);
  1210. }
  1211. };
  1212. var offPushMessage = function offPushMessage(fn) {
  1213. if (!fn) {
  1214. onPushMessageCallbacks.length = 0;
  1215. } else {
  1216. var index = onPushMessageCallbacks.indexOf(fn);
  1217. if (index > -1) {
  1218. onPushMessageCallbacks.splice(index, 1);
  1219. }
  1220. }
  1221. };
  1222. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  1223. if (!baseInfo) {
  1224. baseInfo = wx.getSystemInfoSync();
  1225. }
  1226. var host = baseInfo ? baseInfo.host : null;
  1227. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  1228. var api = /*#__PURE__*/Object.freeze({
  1229. __proto__: null,
  1230. shareVideoMessage: shareVideoMessage,
  1231. getPushClientId: getPushClientId,
  1232. onPushMessage: onPushMessage,
  1233. offPushMessage: offPushMessage,
  1234. invokePushCallback: invokePushCallback
  1235. });
  1236. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1237. function findVmByVueId(vm, vuePid) {
  1238. var $children = vm.$children;
  1239. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1240. for (var i = $children.length - 1; i >= 0; i--) {
  1241. var childVm = $children[i];
  1242. if (childVm.$scope._$vueId === vuePid) {
  1243. return childVm;
  1244. }
  1245. }
  1246. // 反向递归查找
  1247. var parentVm;
  1248. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1249. parentVm = findVmByVueId($children[_i], vuePid);
  1250. if (parentVm) {
  1251. return parentVm;
  1252. }
  1253. }
  1254. }
  1255. function initBehavior(options) {
  1256. return Behavior(options);
  1257. }
  1258. function isPage() {
  1259. return !!this.route;
  1260. }
  1261. function initRelation(detail) {
  1262. this.triggerEvent('__l', detail);
  1263. }
  1264. function selectAllComponents(mpInstance, selector, $refs) {
  1265. var components = mpInstance.selectAllComponents(selector) || [];
  1266. components.forEach(function (component) {
  1267. var ref = component.dataset.ref;
  1268. $refs[ref] = component.$vm || toSkip(component);
  1269. {
  1270. if (component.dataset.vueGeneric === 'scoped') {
  1271. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1272. selectAllComponents(scopedComponent, selector, $refs);
  1273. });
  1274. }
  1275. }
  1276. });
  1277. }
  1278. function syncRefs(refs, newRefs) {
  1279. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  1280. var newKeys = Object.keys(newRefs);
  1281. newKeys.forEach(function (key) {
  1282. var oldValue = refs[key];
  1283. var newValue = newRefs[key];
  1284. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  1285. return oldValue.includes(value);
  1286. })) {
  1287. return;
  1288. }
  1289. refs[key] = newValue;
  1290. oldKeys.delete(key);
  1291. });
  1292. oldKeys.forEach(function (key) {
  1293. delete refs[key];
  1294. });
  1295. return refs;
  1296. }
  1297. function initRefs(vm) {
  1298. var mpInstance = vm.$scope;
  1299. var refs = {};
  1300. Object.defineProperty(vm, '$refs', {
  1301. get: function get() {
  1302. var $refs = {};
  1303. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1304. // TODO 暂不考虑 for 中的 scoped
  1305. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  1306. forComponents.forEach(function (component) {
  1307. var ref = component.dataset.ref;
  1308. if (!$refs[ref]) {
  1309. $refs[ref] = [];
  1310. }
  1311. $refs[ref].push(component.$vm || toSkip(component));
  1312. });
  1313. return syncRefs(refs, $refs);
  1314. }
  1315. });
  1316. }
  1317. function handleLink(event) {
  1318. var _ref3 = event.detail || event.value,
  1319. vuePid = _ref3.vuePid,
  1320. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  1321. var parentVm;
  1322. if (vuePid) {
  1323. parentVm = findVmByVueId(this.$vm, vuePid);
  1324. }
  1325. if (!parentVm) {
  1326. parentVm = this.$vm;
  1327. }
  1328. vueOptions.parent = parentVm;
  1329. }
  1330. function markMPComponent(component) {
  1331. // 在 Vue 中标记为小程序组件
  1332. var IS_MP = '__v_isMPComponent';
  1333. Object.defineProperty(component, IS_MP, {
  1334. configurable: true,
  1335. enumerable: false,
  1336. value: true
  1337. });
  1338. return component;
  1339. }
  1340. function toSkip(obj) {
  1341. var OB = '__ob__';
  1342. var SKIP = '__v_skip';
  1343. if (isObject(obj) && Object.isExtensible(obj)) {
  1344. // 避免被 @vue/composition-api 观测
  1345. Object.defineProperty(obj, OB, {
  1346. configurable: true,
  1347. enumerable: false,
  1348. value: (0, _defineProperty2.default)({}, SKIP, true)
  1349. });
  1350. }
  1351. return obj;
  1352. }
  1353. var WORKLET_RE = /_(.*)_worklet_factory_/;
  1354. function initWorkletMethods(mpMethods, vueMethods) {
  1355. if (vueMethods) {
  1356. Object.keys(vueMethods).forEach(function (name) {
  1357. var matches = name.match(WORKLET_RE);
  1358. if (matches) {
  1359. var workletName = matches[1];
  1360. mpMethods[name] = vueMethods[name];
  1361. mpMethods[workletName] = vueMethods[workletName];
  1362. }
  1363. });
  1364. }
  1365. }
  1366. var MPPage = Page;
  1367. var MPComponent = Component;
  1368. var customizeRE = /:/g;
  1369. var customize = cached(function (str) {
  1370. return camelize(str.replace(customizeRE, '-'));
  1371. });
  1372. function initTriggerEvent(mpInstance) {
  1373. var oldTriggerEvent = mpInstance.triggerEvent;
  1374. var newTriggerEvent = function newTriggerEvent(event) {
  1375. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  1376. args[_key3 - 1] = arguments[_key3];
  1377. }
  1378. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  1379. if (this.$vm || this.dataset && this.dataset.comType) {
  1380. event = customize(event);
  1381. } else {
  1382. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  1383. var newEvent = customize(event);
  1384. if (newEvent !== event) {
  1385. oldTriggerEvent.apply(this, [newEvent].concat(args));
  1386. }
  1387. }
  1388. return oldTriggerEvent.apply(this, [event].concat(args));
  1389. };
  1390. try {
  1391. // 京东小程序 triggerEvent 为只读
  1392. mpInstance.triggerEvent = newTriggerEvent;
  1393. } catch (error) {
  1394. mpInstance._triggerEvent = newTriggerEvent;
  1395. }
  1396. }
  1397. function initHook(name, options, isComponent) {
  1398. var oldHook = options[name];
  1399. options[name] = function () {
  1400. markMPComponent(this);
  1401. initTriggerEvent(this);
  1402. if (oldHook) {
  1403. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  1404. args[_key4] = arguments[_key4];
  1405. }
  1406. return oldHook.apply(this, args);
  1407. }
  1408. };
  1409. }
  1410. if (!MPPage.__$wrappered) {
  1411. MPPage.__$wrappered = true;
  1412. Page = function Page() {
  1413. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1414. initHook('onLoad', options);
  1415. return MPPage(options);
  1416. };
  1417. Page.after = MPPage.after;
  1418. Component = function Component() {
  1419. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1420. initHook('created', options);
  1421. return MPComponent(options);
  1422. };
  1423. }
  1424. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  1425. function initMocks(vm, mocks) {
  1426. var mpInstance = vm.$mp[vm.mpType];
  1427. mocks.forEach(function (mock) {
  1428. if (hasOwn(mpInstance, mock)) {
  1429. vm[mock] = mpInstance[mock];
  1430. }
  1431. });
  1432. }
  1433. function hasHook(hook, vueOptions) {
  1434. if (!vueOptions) {
  1435. return true;
  1436. }
  1437. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  1438. return true;
  1439. }
  1440. vueOptions = vueOptions.default || vueOptions;
  1441. if (isFn(vueOptions)) {
  1442. if (isFn(vueOptions.extendOptions[hook])) {
  1443. return true;
  1444. }
  1445. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  1446. return true;
  1447. }
  1448. return false;
  1449. }
  1450. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  1451. return true;
  1452. }
  1453. var mixins = vueOptions.mixins;
  1454. if (Array.isArray(mixins)) {
  1455. return !!mixins.find(function (mixin) {
  1456. return hasHook(hook, mixin);
  1457. });
  1458. }
  1459. }
  1460. function initHooks(mpOptions, hooks, vueOptions) {
  1461. hooks.forEach(function (hook) {
  1462. if (hasHook(hook, vueOptions)) {
  1463. mpOptions[hook] = function (args) {
  1464. return this.$vm && this.$vm.__call_hook(hook, args);
  1465. };
  1466. }
  1467. });
  1468. }
  1469. function initUnknownHooks(mpOptions, vueOptions) {
  1470. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1471. findHooks(vueOptions).forEach(function (hook) {
  1472. return initHook$1(mpOptions, hook, excludes);
  1473. });
  1474. }
  1475. function findHooks(vueOptions) {
  1476. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  1477. if (vueOptions) {
  1478. Object.keys(vueOptions).forEach(function (name) {
  1479. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  1480. hooks.push(name);
  1481. }
  1482. });
  1483. }
  1484. return hooks;
  1485. }
  1486. function initHook$1(mpOptions, hook, excludes) {
  1487. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  1488. mpOptions[hook] = function (args) {
  1489. return this.$vm && this.$vm.__call_hook(hook, args);
  1490. };
  1491. }
  1492. }
  1493. function initVueComponent(Vue, vueOptions) {
  1494. vueOptions = vueOptions.default || vueOptions;
  1495. var VueComponent;
  1496. if (isFn(vueOptions)) {
  1497. VueComponent = vueOptions;
  1498. } else {
  1499. VueComponent = Vue.extend(vueOptions);
  1500. }
  1501. vueOptions = VueComponent.options;
  1502. return [VueComponent, vueOptions];
  1503. }
  1504. function initSlots(vm, vueSlots) {
  1505. if (Array.isArray(vueSlots) && vueSlots.length) {
  1506. var $slots = Object.create(null);
  1507. vueSlots.forEach(function (slotName) {
  1508. $slots[slotName] = true;
  1509. });
  1510. vm.$scopedSlots = vm.$slots = $slots;
  1511. }
  1512. }
  1513. function initVueIds(vueIds, mpInstance) {
  1514. vueIds = (vueIds || '').split(',');
  1515. var len = vueIds.length;
  1516. if (len === 1) {
  1517. mpInstance._$vueId = vueIds[0];
  1518. } else if (len === 2) {
  1519. mpInstance._$vueId = vueIds[0];
  1520. mpInstance._$vuePid = vueIds[1];
  1521. }
  1522. }
  1523. function initData(vueOptions, context) {
  1524. var data = vueOptions.data || {};
  1525. var methods = vueOptions.methods || {};
  1526. if (typeof data === 'function') {
  1527. try {
  1528. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  1529. } catch (e) {
  1530. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"wx-app-new","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  1531. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  1532. }
  1533. }
  1534. } else {
  1535. try {
  1536. // 对 data 格式化
  1537. data = JSON.parse(JSON.stringify(data));
  1538. } catch (e) {}
  1539. }
  1540. if (!isPlainObject(data)) {
  1541. data = {};
  1542. }
  1543. Object.keys(methods).forEach(function (methodName) {
  1544. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  1545. data[methodName] = methods[methodName];
  1546. }
  1547. });
  1548. return data;
  1549. }
  1550. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  1551. function createObserver(name) {
  1552. return function observer(newVal, oldVal) {
  1553. if (this.$vm) {
  1554. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  1555. }
  1556. };
  1557. }
  1558. function initBehaviors(vueOptions, initBehavior) {
  1559. var vueBehaviors = vueOptions.behaviors;
  1560. var vueExtends = vueOptions.extends;
  1561. var vueMixins = vueOptions.mixins;
  1562. var vueProps = vueOptions.props;
  1563. if (!vueProps) {
  1564. vueOptions.props = vueProps = [];
  1565. }
  1566. var behaviors = [];
  1567. if (Array.isArray(vueBehaviors)) {
  1568. vueBehaviors.forEach(function (behavior) {
  1569. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  1570. if (behavior === 'uni://form-field') {
  1571. if (Array.isArray(vueProps)) {
  1572. vueProps.push('name');
  1573. vueProps.push('value');
  1574. } else {
  1575. vueProps.name = {
  1576. type: String,
  1577. default: ''
  1578. };
  1579. vueProps.value = {
  1580. type: [String, Number, Boolean, Array, Object, Date],
  1581. default: ''
  1582. };
  1583. }
  1584. }
  1585. });
  1586. }
  1587. if (isPlainObject(vueExtends) && vueExtends.props) {
  1588. behaviors.push(initBehavior({
  1589. properties: initProperties(vueExtends.props, true)
  1590. }));
  1591. }
  1592. if (Array.isArray(vueMixins)) {
  1593. vueMixins.forEach(function (vueMixin) {
  1594. if (isPlainObject(vueMixin) && vueMixin.props) {
  1595. behaviors.push(initBehavior({
  1596. properties: initProperties(vueMixin.props, true)
  1597. }));
  1598. }
  1599. });
  1600. }
  1601. return behaviors;
  1602. }
  1603. function parsePropType(key, type, defaultValue, file) {
  1604. // [String]=>String
  1605. if (Array.isArray(type) && type.length === 1) {
  1606. return type[0];
  1607. }
  1608. return type;
  1609. }
  1610. function initProperties(props) {
  1611. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  1612. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  1613. var options = arguments.length > 3 ? arguments[3] : undefined;
  1614. var properties = {};
  1615. if (!isBehavior) {
  1616. properties.vueId = {
  1617. type: String,
  1618. value: ''
  1619. };
  1620. {
  1621. if (options.virtualHost) {
  1622. properties.virtualHostStyle = {
  1623. type: null,
  1624. value: ''
  1625. };
  1626. properties.virtualHostClass = {
  1627. type: null,
  1628. value: ''
  1629. };
  1630. }
  1631. }
  1632. // scopedSlotsCompiler auto
  1633. properties.scopedSlotsCompiler = {
  1634. type: String,
  1635. value: ''
  1636. };
  1637. properties.vueSlots = {
  1638. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  1639. type: null,
  1640. value: [],
  1641. observer: function observer(newVal, oldVal) {
  1642. var $slots = Object.create(null);
  1643. newVal.forEach(function (slotName) {
  1644. $slots[slotName] = true;
  1645. });
  1646. this.setData({
  1647. $slots: $slots
  1648. });
  1649. }
  1650. };
  1651. }
  1652. if (Array.isArray(props)) {
  1653. // ['title']
  1654. props.forEach(function (key) {
  1655. properties[key] = {
  1656. type: null,
  1657. observer: createObserver(key)
  1658. };
  1659. });
  1660. } else if (isPlainObject(props)) {
  1661. // {title:{type:String,default:''},content:String}
  1662. Object.keys(props).forEach(function (key) {
  1663. var opts = props[key];
  1664. if (isPlainObject(opts)) {
  1665. // title:{type:String,default:''}
  1666. var value = opts.default;
  1667. if (isFn(value)) {
  1668. value = value();
  1669. }
  1670. opts.type = parsePropType(key, opts.type);
  1671. properties[key] = {
  1672. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  1673. value: value,
  1674. observer: createObserver(key)
  1675. };
  1676. } else {
  1677. // content:String
  1678. var type = parsePropType(key, opts);
  1679. properties[key] = {
  1680. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  1681. observer: createObserver(key)
  1682. };
  1683. }
  1684. });
  1685. }
  1686. return properties;
  1687. }
  1688. function wrapper$1(event) {
  1689. // TODO 又得兼容 mpvue 的 mp 对象
  1690. try {
  1691. event.mp = JSON.parse(JSON.stringify(event));
  1692. } catch (e) {}
  1693. event.stopPropagation = noop;
  1694. event.preventDefault = noop;
  1695. event.target = event.target || {};
  1696. if (!hasOwn(event, 'detail')) {
  1697. event.detail = {};
  1698. }
  1699. if (hasOwn(event, 'markerId')) {
  1700. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  1701. event.detail.markerId = event.markerId;
  1702. }
  1703. if (isPlainObject(event.detail)) {
  1704. event.target = Object.assign({}, event.target, event.detail);
  1705. }
  1706. return event;
  1707. }
  1708. function getExtraValue(vm, dataPathsArray) {
  1709. var context = vm;
  1710. dataPathsArray.forEach(function (dataPathArray) {
  1711. var dataPath = dataPathArray[0];
  1712. var value = dataPathArray[2];
  1713. if (dataPath || typeof value !== 'undefined') {
  1714. // ['','',index,'disable']
  1715. var propPath = dataPathArray[1];
  1716. var valuePath = dataPathArray[3];
  1717. var vFor;
  1718. if (Number.isInteger(dataPath)) {
  1719. vFor = dataPath;
  1720. } else if (!dataPath) {
  1721. vFor = context;
  1722. } else if (typeof dataPath === 'string' && dataPath) {
  1723. if (dataPath.indexOf('#s#') === 0) {
  1724. vFor = dataPath.substr(3);
  1725. } else {
  1726. vFor = vm.__get_value(dataPath, context);
  1727. }
  1728. }
  1729. if (Number.isInteger(vFor)) {
  1730. context = value;
  1731. } else if (!propPath) {
  1732. context = vFor[value];
  1733. } else {
  1734. if (Array.isArray(vFor)) {
  1735. context = vFor.find(function (vForItem) {
  1736. return vm.__get_value(propPath, vForItem) === value;
  1737. });
  1738. } else if (isPlainObject(vFor)) {
  1739. context = Object.keys(vFor).find(function (vForKey) {
  1740. return vm.__get_value(propPath, vFor[vForKey]) === value;
  1741. });
  1742. } else {
  1743. console.error('v-for 暂不支持循环数据:', vFor);
  1744. }
  1745. }
  1746. if (valuePath) {
  1747. context = vm.__get_value(valuePath, context);
  1748. }
  1749. }
  1750. });
  1751. return context;
  1752. }
  1753. function processEventExtra(vm, extra, event, __args__) {
  1754. var extraObj = {};
  1755. if (Array.isArray(extra) && extra.length) {
  1756. /**
  1757. *[
  1758. * ['data.items', 'data.id', item.data.id],
  1759. * ['metas', 'id', meta.id]
  1760. *],
  1761. *[
  1762. * ['data.items', 'data.id', item.data.id],
  1763. * ['metas', 'id', meta.id]
  1764. *],
  1765. *'test'
  1766. */
  1767. extra.forEach(function (dataPath, index) {
  1768. if (typeof dataPath === 'string') {
  1769. if (!dataPath) {
  1770. // model,prop.sync
  1771. extraObj['$' + index] = vm;
  1772. } else {
  1773. if (dataPath === '$event') {
  1774. // $event
  1775. extraObj['$' + index] = event;
  1776. } else if (dataPath === 'arguments') {
  1777. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  1778. } else if (dataPath.indexOf('$event.') === 0) {
  1779. // $event.target.value
  1780. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1781. } else {
  1782. extraObj['$' + index] = vm.__get_value(dataPath);
  1783. }
  1784. }
  1785. } else {
  1786. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1787. }
  1788. });
  1789. }
  1790. return extraObj;
  1791. }
  1792. function getObjByArray(arr) {
  1793. var obj = {};
  1794. for (var i = 1; i < arr.length; i++) {
  1795. var element = arr[i];
  1796. obj[element[0]] = element[1];
  1797. }
  1798. return obj;
  1799. }
  1800. function processEventArgs(vm, event) {
  1801. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1802. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  1803. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  1804. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  1805. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1806. // fixed 用户直接触发 mpInstance.triggerEvent
  1807. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  1808. if (isCustom) {
  1809. // 自定义事件
  1810. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  1811. if (!args.length) {
  1812. // 无参数,直接传入 event 或 detail 数组
  1813. if (isCustomMPEvent) {
  1814. return [event];
  1815. }
  1816. return __args__;
  1817. }
  1818. }
  1819. var extraObj = processEventExtra(vm, extra, event, __args__);
  1820. var ret = [];
  1821. args.forEach(function (arg) {
  1822. if (arg === '$event') {
  1823. if (methodName === '__set_model' && !isCustom) {
  1824. // input v-model value
  1825. ret.push(event.target.value);
  1826. } else {
  1827. if (isCustom && !isCustomMPEvent) {
  1828. ret.push(__args__[0]);
  1829. } else {
  1830. // wxcomponent 组件或内置组件
  1831. ret.push(event);
  1832. }
  1833. }
  1834. } else {
  1835. if (Array.isArray(arg) && arg[0] === 'o') {
  1836. ret.push(getObjByArray(arg));
  1837. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1838. ret.push(extraObj[arg]);
  1839. } else {
  1840. ret.push(arg);
  1841. }
  1842. }
  1843. });
  1844. return ret;
  1845. }
  1846. var ONCE = '~';
  1847. var CUSTOM = '^';
  1848. function isMatchEventType(eventType, optType) {
  1849. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  1850. }
  1851. function getContextVm(vm) {
  1852. var $parent = vm.$parent;
  1853. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1854. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1855. $parent = $parent.$parent;
  1856. }
  1857. return $parent && $parent.$parent;
  1858. }
  1859. function handleEvent(event) {
  1860. var _this2 = this;
  1861. event = wrapper$1(event);
  1862. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1863. var dataset = (event.currentTarget || event.target).dataset;
  1864. if (!dataset) {
  1865. return console.warn('事件信息不存在');
  1866. }
  1867. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1868. if (!eventOpts) {
  1869. return console.warn('事件信息不存在');
  1870. }
  1871. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1872. var eventType = event.type;
  1873. var ret = [];
  1874. eventOpts.forEach(function (eventOpt) {
  1875. var type = eventOpt[0];
  1876. var eventsArray = eventOpt[1];
  1877. var isCustom = type.charAt(0) === CUSTOM;
  1878. type = isCustom ? type.slice(1) : type;
  1879. var isOnce = type.charAt(0) === ONCE;
  1880. type = isOnce ? type.slice(1) : type;
  1881. if (eventsArray && isMatchEventType(eventType, type)) {
  1882. eventsArray.forEach(function (eventArray) {
  1883. var methodName = eventArray[0];
  1884. if (methodName) {
  1885. var handlerCtx = _this2.$vm;
  1886. if (handlerCtx.$options.generic) {
  1887. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1888. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1889. }
  1890. if (methodName === '$emit') {
  1891. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  1892. return;
  1893. }
  1894. var handler = handlerCtx[methodName];
  1895. if (!isFn(handler)) {
  1896. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  1897. var path = _this2.route || _this2.is;
  1898. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  1899. }
  1900. if (isOnce) {
  1901. if (handler.once) {
  1902. return;
  1903. }
  1904. handler.once = true;
  1905. }
  1906. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  1907. params = Array.isArray(params) ? params : [];
  1908. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1909. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1910. // eslint-disable-next-line no-sparse-arrays
  1911. params = params.concat([,,,,,,,,,, event]);
  1912. }
  1913. ret.push(handler.apply(handlerCtx, params));
  1914. }
  1915. });
  1916. }
  1917. });
  1918. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  1919. return ret[0];
  1920. }
  1921. }
  1922. var eventChannels = {};
  1923. var eventChannelStack = [];
  1924. function getEventChannel(id) {
  1925. if (id) {
  1926. var eventChannel = eventChannels[id];
  1927. delete eventChannels[id];
  1928. return eventChannel;
  1929. }
  1930. return eventChannelStack.shift();
  1931. }
  1932. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  1933. function initEventChannel() {
  1934. _vue.default.prototype.getOpenerEventChannel = function () {
  1935. // 微信小程序使用自身getOpenerEventChannel
  1936. {
  1937. return this.$scope.getOpenerEventChannel();
  1938. }
  1939. };
  1940. var callHook = _vue.default.prototype.__call_hook;
  1941. _vue.default.prototype.__call_hook = function (hook, args) {
  1942. if (hook === 'onLoad' && args && args.__id__) {
  1943. this.__eventChannel__ = getEventChannel(args.__id__);
  1944. delete args.__id__;
  1945. }
  1946. return callHook.call(this, hook, args);
  1947. };
  1948. }
  1949. function initScopedSlotsParams() {
  1950. var center = {};
  1951. var parents = {};
  1952. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1953. var has = center[vueId];
  1954. if (!has) {
  1955. parents[vueId] = this;
  1956. this.$on('hook:destroyed', function () {
  1957. delete parents[vueId];
  1958. });
  1959. }
  1960. return has;
  1961. };
  1962. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1963. var data = center[vueId];
  1964. if (data) {
  1965. var object = data[name] || {};
  1966. return key ? object[key] : object;
  1967. } else {
  1968. parents[vueId] = this;
  1969. this.$on('hook:destroyed', function () {
  1970. delete parents[vueId];
  1971. });
  1972. }
  1973. };
  1974. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1975. var vueIds = this.$options.propsData.vueId;
  1976. if (vueIds) {
  1977. var vueId = vueIds.split(',')[0];
  1978. var object = center[vueId] = center[vueId] || {};
  1979. object[name] = value;
  1980. if (parents[vueId]) {
  1981. parents[vueId].$forceUpdate();
  1982. }
  1983. }
  1984. };
  1985. _vue.default.mixin({
  1986. destroyed: function destroyed() {
  1987. var propsData = this.$options.propsData;
  1988. var vueId = propsData && propsData.vueId;
  1989. if (vueId) {
  1990. delete center[vueId];
  1991. delete parents[vueId];
  1992. }
  1993. }
  1994. });
  1995. }
  1996. function parseBaseApp(vm, _ref4) {
  1997. var mocks = _ref4.mocks,
  1998. initRefs = _ref4.initRefs;
  1999. initEventChannel();
  2000. {
  2001. initScopedSlotsParams();
  2002. }
  2003. if (vm.$options.store) {
  2004. _vue.default.prototype.$store = vm.$options.store;
  2005. }
  2006. uniIdMixin(_vue.default);
  2007. _vue.default.prototype.mpHost = "mp-weixin";
  2008. _vue.default.mixin({
  2009. beforeCreate: function beforeCreate() {
  2010. if (!this.$options.mpType) {
  2011. return;
  2012. }
  2013. this.mpType = this.$options.mpType;
  2014. this.$mp = (0, _defineProperty2.default)({
  2015. data: {}
  2016. }, this.mpType, this.$options.mpInstance);
  2017. this.$scope = this.$options.mpInstance;
  2018. delete this.$options.mpType;
  2019. delete this.$options.mpInstance;
  2020. if (this.mpType === 'page' && typeof getApp === 'function') {
  2021. // hack vue-i18n
  2022. var app = getApp();
  2023. if (app.$vm && app.$vm.$i18n) {
  2024. this._i18n = app.$vm.$i18n;
  2025. }
  2026. }
  2027. if (this.mpType !== 'app') {
  2028. initRefs(this);
  2029. initMocks(this, mocks);
  2030. }
  2031. }
  2032. });
  2033. var appOptions = {
  2034. onLaunch: function onLaunch(args) {
  2035. if (this.$vm) {
  2036. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  2037. return;
  2038. }
  2039. {
  2040. if (wx.canIUse && !wx.canIUse('nextTick')) {
  2041. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  2042. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  2043. }
  2044. }
  2045. this.$vm = vm;
  2046. this.$vm.$mp = {
  2047. app: this
  2048. };
  2049. this.$vm.$scope = this;
  2050. // vm 上也挂载 globalData
  2051. this.$vm.globalData = this.globalData;
  2052. this.$vm._isMounted = true;
  2053. this.$vm.__call_hook('mounted', args);
  2054. this.$vm.__call_hook('onLaunch', args);
  2055. }
  2056. };
  2057. // 兼容旧版本 globalData
  2058. appOptions.globalData = vm.$options.globalData || {};
  2059. // 将 methods 中的方法挂在 getApp() 中
  2060. var methods = vm.$options.methods;
  2061. if (methods) {
  2062. Object.keys(methods).forEach(function (name) {
  2063. appOptions[name] = methods[name];
  2064. });
  2065. }
  2066. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  2067. initHooks(appOptions, hooks);
  2068. initUnknownHooks(appOptions, vm.$options);
  2069. return appOptions;
  2070. }
  2071. function parseApp(vm) {
  2072. return parseBaseApp(vm, {
  2073. mocks: mocks,
  2074. initRefs: initRefs
  2075. });
  2076. }
  2077. function createApp(vm) {
  2078. App(parseApp(vm));
  2079. return vm;
  2080. }
  2081. var encodeReserveRE = /[!'()*]/g;
  2082. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  2083. return '%' + c.charCodeAt(0).toString(16);
  2084. };
  2085. var commaRE = /%2C/g;
  2086. // fixed encodeURIComponent which is more conformant to RFC3986:
  2087. // - escapes [!'()*]
  2088. // - preserve commas
  2089. var encode = function encode(str) {
  2090. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  2091. };
  2092. function stringifyQuery(obj) {
  2093. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  2094. var res = obj ? Object.keys(obj).map(function (key) {
  2095. var val = obj[key];
  2096. if (val === undefined) {
  2097. return '';
  2098. }
  2099. if (val === null) {
  2100. return encodeStr(key);
  2101. }
  2102. if (Array.isArray(val)) {
  2103. var result = [];
  2104. val.forEach(function (val2) {
  2105. if (val2 === undefined) {
  2106. return;
  2107. }
  2108. if (val2 === null) {
  2109. result.push(encodeStr(key));
  2110. } else {
  2111. result.push(encodeStr(key) + '=' + encodeStr(val2));
  2112. }
  2113. });
  2114. return result.join('&');
  2115. }
  2116. return encodeStr(key) + '=' + encodeStr(val);
  2117. }).filter(function (x) {
  2118. return x.length > 0;
  2119. }).join('&') : null;
  2120. return res ? "?".concat(res) : '';
  2121. }
  2122. function parseBaseComponent(vueComponentOptions) {
  2123. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  2124. isPage = _ref5.isPage,
  2125. initRelation = _ref5.initRelation;
  2126. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  2127. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  2128. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  2129. VueComponent = _initVueComponent2[0],
  2130. vueOptions = _initVueComponent2[1];
  2131. var options = _objectSpread({
  2132. multipleSlots: true,
  2133. addGlobalClass: true
  2134. }, vueOptions.options || {});
  2135. {
  2136. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  2137. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  2138. Object.assign(options, vueOptions['mp-weixin'].options);
  2139. }
  2140. }
  2141. var componentOptions = {
  2142. options: options,
  2143. data: initData(vueOptions, _vue.default.prototype),
  2144. behaviors: initBehaviors(vueOptions, initBehavior),
  2145. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  2146. lifetimes: {
  2147. attached: function attached() {
  2148. var properties = this.properties;
  2149. var options = {
  2150. mpType: isPage.call(this) ? 'page' : 'component',
  2151. mpInstance: this,
  2152. propsData: properties
  2153. };
  2154. initVueIds(properties.vueId, this);
  2155. // 处理父子关系
  2156. initRelation.call(this, {
  2157. vuePid: this._$vuePid,
  2158. vueOptions: options
  2159. });
  2160. // 初始化 vue 实例
  2161. this.$vm = new VueComponent(options);
  2162. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  2163. initSlots(this.$vm, properties.vueSlots);
  2164. // 触发首次 setData
  2165. this.$vm.$mount();
  2166. },
  2167. ready: function ready() {
  2168. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  2169. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  2170. if (this.$vm) {
  2171. this.$vm._isMounted = true;
  2172. this.$vm.__call_hook('mounted');
  2173. this.$vm.__call_hook('onReady');
  2174. }
  2175. },
  2176. detached: function detached() {
  2177. this.$vm && this.$vm.$destroy();
  2178. }
  2179. },
  2180. pageLifetimes: {
  2181. show: function show(args) {
  2182. this.$vm && this.$vm.__call_hook('onPageShow', args);
  2183. },
  2184. hide: function hide() {
  2185. this.$vm && this.$vm.__call_hook('onPageHide');
  2186. },
  2187. resize: function resize(size) {
  2188. this.$vm && this.$vm.__call_hook('onPageResize', size);
  2189. }
  2190. },
  2191. methods: {
  2192. __l: handleLink,
  2193. __e: handleEvent
  2194. }
  2195. };
  2196. // externalClasses
  2197. if (vueOptions.externalClasses) {
  2198. componentOptions.externalClasses = vueOptions.externalClasses;
  2199. }
  2200. if (Array.isArray(vueOptions.wxsCallMethods)) {
  2201. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  2202. componentOptions.methods[callMethod] = function (args) {
  2203. return this.$vm[callMethod](args);
  2204. };
  2205. });
  2206. }
  2207. if (needVueOptions) {
  2208. return [componentOptions, vueOptions, VueComponent];
  2209. }
  2210. if (isPage) {
  2211. return componentOptions;
  2212. }
  2213. return [componentOptions, VueComponent];
  2214. }
  2215. function parseComponent(vueComponentOptions, needVueOptions) {
  2216. return parseBaseComponent(vueComponentOptions, {
  2217. isPage: isPage,
  2218. initRelation: initRelation
  2219. }, needVueOptions);
  2220. }
  2221. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  2222. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  2223. function parseBasePage(vuePageOptions) {
  2224. var _parseComponent = parseComponent(vuePageOptions, true),
  2225. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  2226. pageOptions = _parseComponent2[0],
  2227. vueOptions = _parseComponent2[1];
  2228. initHooks(pageOptions.methods, hooks$1, vueOptions);
  2229. pageOptions.methods.onLoad = function (query) {
  2230. this.options = query;
  2231. var copyQuery = Object.assign({}, query);
  2232. delete copyQuery.__id__;
  2233. this.$page = {
  2234. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  2235. };
  2236. this.$vm.$mp.query = query; // 兼容 mpvue
  2237. this.$vm.__call_hook('onLoad', query);
  2238. };
  2239. {
  2240. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  2241. }
  2242. {
  2243. initWorkletMethods(pageOptions.methods, vueOptions.methods);
  2244. }
  2245. return pageOptions;
  2246. }
  2247. function parsePage(vuePageOptions) {
  2248. return parseBasePage(vuePageOptions);
  2249. }
  2250. function createPage(vuePageOptions) {
  2251. {
  2252. return Component(parsePage(vuePageOptions));
  2253. }
  2254. }
  2255. function createComponent(vueOptions) {
  2256. {
  2257. return Component(parseComponent(vueOptions));
  2258. }
  2259. }
  2260. function createSubpackageApp(vm) {
  2261. var appOptions = parseApp(vm);
  2262. var app = getApp({
  2263. allowDefault: true
  2264. });
  2265. vm.$scope = app;
  2266. var globalData = app.globalData;
  2267. if (globalData) {
  2268. Object.keys(appOptions.globalData).forEach(function (name) {
  2269. if (!hasOwn(globalData, name)) {
  2270. globalData[name] = appOptions.globalData[name];
  2271. }
  2272. });
  2273. }
  2274. Object.keys(appOptions).forEach(function (name) {
  2275. if (!hasOwn(app, name)) {
  2276. app[name] = appOptions[name];
  2277. }
  2278. });
  2279. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2280. wx.onAppShow(function () {
  2281. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  2282. args[_key5] = arguments[_key5];
  2283. }
  2284. vm.__call_hook('onShow', args);
  2285. });
  2286. }
  2287. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2288. wx.onAppHide(function () {
  2289. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  2290. args[_key6] = arguments[_key6];
  2291. }
  2292. vm.__call_hook('onHide', args);
  2293. });
  2294. }
  2295. if (isFn(appOptions.onLaunch)) {
  2296. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2297. vm.__call_hook('onLaunch', args);
  2298. }
  2299. return vm;
  2300. }
  2301. function createPlugin(vm) {
  2302. var appOptions = parseApp(vm);
  2303. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2304. wx.onAppShow(function () {
  2305. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  2306. args[_key7] = arguments[_key7];
  2307. }
  2308. vm.__call_hook('onShow', args);
  2309. });
  2310. }
  2311. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2312. wx.onAppHide(function () {
  2313. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  2314. args[_key8] = arguments[_key8];
  2315. }
  2316. vm.__call_hook('onHide', args);
  2317. });
  2318. }
  2319. if (isFn(appOptions.onLaunch)) {
  2320. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2321. vm.__call_hook('onLaunch', args);
  2322. }
  2323. return vm;
  2324. }
  2325. todos.forEach(function (todoApi) {
  2326. protocols[todoApi] = false;
  2327. });
  2328. canIUses.forEach(function (canIUseApi) {
  2329. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  2330. if (!wx.canIUse(apiName)) {
  2331. protocols[canIUseApi] = false;
  2332. }
  2333. });
  2334. var uni = {};
  2335. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  2336. uni = new Proxy({}, {
  2337. get: function get(target, name) {
  2338. if (hasOwn(target, name)) {
  2339. return target[name];
  2340. }
  2341. if (baseApi[name]) {
  2342. return baseApi[name];
  2343. }
  2344. if (api[name]) {
  2345. return promisify(name, api[name]);
  2346. }
  2347. {
  2348. if (extraApi[name]) {
  2349. return promisify(name, extraApi[name]);
  2350. }
  2351. if (todoApis[name]) {
  2352. return promisify(name, todoApis[name]);
  2353. }
  2354. }
  2355. if (eventApi[name]) {
  2356. return eventApi[name];
  2357. }
  2358. return promisify(name, wrapper(name, wx[name]));
  2359. },
  2360. set: function set(target, name, value) {
  2361. target[name] = value;
  2362. return true;
  2363. }
  2364. });
  2365. } else {
  2366. Object.keys(baseApi).forEach(function (name) {
  2367. uni[name] = baseApi[name];
  2368. });
  2369. {
  2370. Object.keys(todoApis).forEach(function (name) {
  2371. uni[name] = promisify(name, todoApis[name]);
  2372. });
  2373. Object.keys(extraApi).forEach(function (name) {
  2374. uni[name] = promisify(name, todoApis[name]);
  2375. });
  2376. }
  2377. Object.keys(eventApi).forEach(function (name) {
  2378. uni[name] = eventApi[name];
  2379. });
  2380. Object.keys(api).forEach(function (name) {
  2381. uni[name] = promisify(name, api[name]);
  2382. });
  2383. Object.keys(wx).forEach(function (name) {
  2384. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2385. uni[name] = promisify(name, wrapper(name, wx[name]));
  2386. }
  2387. });
  2388. }
  2389. wx.createApp = createApp;
  2390. wx.createPage = createPage;
  2391. wx.createComponent = createComponent;
  2392. wx.createSubpackageApp = createSubpackageApp;
  2393. wx.createPlugin = createPlugin;
  2394. var uni$1 = uni;
  2395. var _default = uni$1;
  2396. exports.default = _default;
  2397. /* 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)))
  2398. /***/ }),
  2399. /* 3 */
  2400. /*!***********************************!*\
  2401. !*** (webpack)/buildin/global.js ***!
  2402. \***********************************/
  2403. /*! no static exports found */
  2404. /***/ (function(module, exports) {
  2405. var g;
  2406. // This works in non-strict mode
  2407. g = (function() {
  2408. return this;
  2409. })();
  2410. try {
  2411. // This works if eval is allowed (see CSP)
  2412. g = g || new Function("return this")();
  2413. } catch (e) {
  2414. // This works if the window reference is available
  2415. if (typeof window === "object") g = window;
  2416. }
  2417. // g can still be undefined, but nothing to do about it...
  2418. // We return undefined, instead of nothing here, so it's
  2419. // easier to handle this case. if(!global) { ...}
  2420. module.exports = g;
  2421. /***/ }),
  2422. /* 4 */
  2423. /*!**********************************************************************!*\
  2424. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  2425. \**********************************************************************/
  2426. /*! no static exports found */
  2427. /***/ (function(module, exports) {
  2428. function _interopRequireDefault(obj) {
  2429. return obj && obj.__esModule ? obj : {
  2430. "default": obj
  2431. };
  2432. }
  2433. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2434. /***/ }),
  2435. /* 5 */
  2436. /*!**************************************************************!*\
  2437. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  2438. \**************************************************************/
  2439. /*! no static exports found */
  2440. /***/ (function(module, exports, __webpack_require__) {
  2441. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  2442. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  2443. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  2444. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  2445. function _slicedToArray(arr, i) {
  2446. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  2447. }
  2448. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2449. /***/ }),
  2450. /* 6 */
  2451. /*!***************************************************************!*\
  2452. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  2453. \***************************************************************/
  2454. /*! no static exports found */
  2455. /***/ (function(module, exports) {
  2456. function _arrayWithHoles(arr) {
  2457. if (Array.isArray(arr)) return arr;
  2458. }
  2459. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2460. /***/ }),
  2461. /* 7 */
  2462. /*!*********************************************************************!*\
  2463. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  2464. \*********************************************************************/
  2465. /*! no static exports found */
  2466. /***/ (function(module, exports) {
  2467. function _iterableToArrayLimit(arr, i) {
  2468. var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  2469. if (null != _i) {
  2470. var _s,
  2471. _e,
  2472. _x,
  2473. _r,
  2474. _arr = [],
  2475. _n = !0,
  2476. _d = !1;
  2477. try {
  2478. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  2479. if (Object(_i) !== _i) return;
  2480. _n = !1;
  2481. } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  2482. ;
  2483. }
  2484. } catch (err) {
  2485. _d = !0, _e = err;
  2486. } finally {
  2487. try {
  2488. if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
  2489. } finally {
  2490. if (_d) throw _e;
  2491. }
  2492. }
  2493. return _arr;
  2494. }
  2495. }
  2496. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2497. /***/ }),
  2498. /* 8 */
  2499. /*!***************************************************************************!*\
  2500. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  2501. \***************************************************************************/
  2502. /*! no static exports found */
  2503. /***/ (function(module, exports, __webpack_require__) {
  2504. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  2505. function _unsupportedIterableToArray(o, minLen) {
  2506. if (!o) return;
  2507. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  2508. var n = Object.prototype.toString.call(o).slice(8, -1);
  2509. if (n === "Object" && o.constructor) n = o.constructor.name;
  2510. if (n === "Map" || n === "Set") return Array.from(o);
  2511. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  2512. }
  2513. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2514. /***/ }),
  2515. /* 9 */
  2516. /*!*****************************************************************!*\
  2517. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  2518. \*****************************************************************/
  2519. /*! no static exports found */
  2520. /***/ (function(module, exports) {
  2521. function _arrayLikeToArray(arr, len) {
  2522. if (len == null || len > arr.length) len = arr.length;
  2523. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  2524. arr2[i] = arr[i];
  2525. }
  2526. return arr2;
  2527. }
  2528. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2529. /***/ }),
  2530. /* 10 */
  2531. /*!****************************************************************!*\
  2532. !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
  2533. \****************************************************************/
  2534. /*! no static exports found */
  2535. /***/ (function(module, exports) {
  2536. function _nonIterableRest() {
  2537. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  2538. }
  2539. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2540. /***/ }),
  2541. /* 11 */
  2542. /*!***************************************************************!*\
  2543. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  2544. \***************************************************************/
  2545. /*! no static exports found */
  2546. /***/ (function(module, exports, __webpack_require__) {
  2547. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  2548. function _defineProperty(obj, key, value) {
  2549. key = toPropertyKey(key);
  2550. if (key in obj) {
  2551. Object.defineProperty(obj, key, {
  2552. value: value,
  2553. enumerable: true,
  2554. configurable: true,
  2555. writable: true
  2556. });
  2557. } else {
  2558. obj[key] = value;
  2559. }
  2560. return obj;
  2561. }
  2562. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2563. /***/ }),
  2564. /* 12 */
  2565. /*!**************************************************************!*\
  2566. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  2567. \**************************************************************/
  2568. /*! no static exports found */
  2569. /***/ (function(module, exports, __webpack_require__) {
  2570. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  2571. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  2572. function _toPropertyKey(arg) {
  2573. var key = toPrimitive(arg, "string");
  2574. return _typeof(key) === "symbol" ? key : String(key);
  2575. }
  2576. module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2577. /***/ }),
  2578. /* 13 */
  2579. /*!*******************************************************!*\
  2580. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  2581. \*******************************************************/
  2582. /*! no static exports found */
  2583. /***/ (function(module, exports) {
  2584. function _typeof(obj) {
  2585. "@babel/helpers - typeof";
  2586. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  2587. return typeof obj;
  2588. } : function (obj) {
  2589. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  2590. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
  2591. }
  2592. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2593. /***/ }),
  2594. /* 14 */
  2595. /*!************************************************************!*\
  2596. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  2597. \************************************************************/
  2598. /*! no static exports found */
  2599. /***/ (function(module, exports, __webpack_require__) {
  2600. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  2601. function _toPrimitive(input, hint) {
  2602. if (_typeof(input) !== "object" || input === null) return input;
  2603. var prim = input[Symbol.toPrimitive];
  2604. if (prim !== undefined) {
  2605. var res = prim.call(input, hint || "default");
  2606. if (_typeof(res) !== "object") return res;
  2607. throw new TypeError("@@toPrimitive must return a primitive value.");
  2608. }
  2609. return (hint === "string" ? String : Number)(input);
  2610. }
  2611. module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2612. /***/ }),
  2613. /* 15 */
  2614. /*!**********************************************************!*\
  2615. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  2616. \**********************************************************/
  2617. /*! no static exports found */
  2618. /***/ (function(module, exports, __webpack_require__) {
  2619. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  2620. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  2621. function _construct(Parent, args, Class) {
  2622. if (isNativeReflectConstruct()) {
  2623. module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
  2624. } else {
  2625. module.exports = _construct = function _construct(Parent, args, Class) {
  2626. var a = [null];
  2627. a.push.apply(a, args);
  2628. var Constructor = Function.bind.apply(Parent, a);
  2629. var instance = new Constructor();
  2630. if (Class) setPrototypeOf(instance, Class.prototype);
  2631. return instance;
  2632. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2633. }
  2634. return _construct.apply(null, arguments);
  2635. }
  2636. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2637. /***/ }),
  2638. /* 16 */
  2639. /*!***************************************************************!*\
  2640. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  2641. \***************************************************************/
  2642. /*! no static exports found */
  2643. /***/ (function(module, exports) {
  2644. function _setPrototypeOf(o, p) {
  2645. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  2646. o.__proto__ = p;
  2647. return o;
  2648. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2649. return _setPrototypeOf(o, p);
  2650. }
  2651. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2652. /***/ }),
  2653. /* 17 */
  2654. /*!*************************************************************************!*\
  2655. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  2656. \*************************************************************************/
  2657. /*! no static exports found */
  2658. /***/ (function(module, exports) {
  2659. function _isNativeReflectConstruct() {
  2660. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  2661. if (Reflect.construct.sham) return false;
  2662. if (typeof Proxy === "function") return true;
  2663. try {
  2664. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  2665. return true;
  2666. } catch (e) {
  2667. return false;
  2668. }
  2669. }
  2670. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2671. /***/ }),
  2672. /* 18 */
  2673. /*!******************************************************************!*\
  2674. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  2675. \******************************************************************/
  2676. /*! no static exports found */
  2677. /***/ (function(module, exports, __webpack_require__) {
  2678. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  2679. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  2680. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  2681. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  2682. function _toConsumableArray(arr) {
  2683. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  2684. }
  2685. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2686. /***/ }),
  2687. /* 19 */
  2688. /*!******************************************************************!*\
  2689. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  2690. \******************************************************************/
  2691. /*! no static exports found */
  2692. /***/ (function(module, exports, __webpack_require__) {
  2693. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  2694. function _arrayWithoutHoles(arr) {
  2695. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  2696. }
  2697. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2698. /***/ }),
  2699. /* 20 */
  2700. /*!****************************************************************!*\
  2701. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  2702. \****************************************************************/
  2703. /*! no static exports found */
  2704. /***/ (function(module, exports) {
  2705. function _iterableToArray(iter) {
  2706. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  2707. }
  2708. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2709. /***/ }),
  2710. /* 21 */
  2711. /*!******************************************************************!*\
  2712. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  2713. \******************************************************************/
  2714. /*! no static exports found */
  2715. /***/ (function(module, exports) {
  2716. function _nonIterableSpread() {
  2717. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  2718. }
  2719. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2720. /***/ }),
  2721. /* 22 */
  2722. /*!*************************************************************!*\
  2723. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  2724. \*************************************************************/
  2725. /*! no static exports found */
  2726. /***/ (function(module, exports, __webpack_require__) {
  2727. "use strict";
  2728. /* WEBPACK VAR INJECTION */(function(uni, global) {
  2729. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  2730. Object.defineProperty(exports, "__esModule", {
  2731. value: true
  2732. });
  2733. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  2734. exports.compileI18nJsonStr = compileI18nJsonStr;
  2735. exports.hasI18nJson = hasI18nJson;
  2736. exports.initVueI18n = initVueI18n;
  2737. exports.isI18nStr = isI18nStr;
  2738. exports.isString = void 0;
  2739. exports.normalizeLocale = normalizeLocale;
  2740. exports.parseI18nJson = parseI18nJson;
  2741. exports.resolveLocale = resolveLocale;
  2742. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  2743. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  2744. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  2745. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  2746. var isArray = Array.isArray;
  2747. var isObject = function isObject(val) {
  2748. return val !== null && (0, _typeof2.default)(val) === 'object';
  2749. };
  2750. var defaultDelimiters = ['{', '}'];
  2751. var BaseFormatter = /*#__PURE__*/function () {
  2752. function BaseFormatter() {
  2753. (0, _classCallCheck2.default)(this, BaseFormatter);
  2754. this._caches = Object.create(null);
  2755. }
  2756. (0, _createClass2.default)(BaseFormatter, [{
  2757. key: "interpolate",
  2758. value: function interpolate(message, values) {
  2759. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  2760. if (!values) {
  2761. return [message];
  2762. }
  2763. var tokens = this._caches[message];
  2764. if (!tokens) {
  2765. tokens = parse(message, delimiters);
  2766. this._caches[message] = tokens;
  2767. }
  2768. return compile(tokens, values);
  2769. }
  2770. }]);
  2771. return BaseFormatter;
  2772. }();
  2773. exports.Formatter = BaseFormatter;
  2774. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  2775. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  2776. function parse(format, _ref) {
  2777. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  2778. startDelimiter = _ref2[0],
  2779. endDelimiter = _ref2[1];
  2780. var tokens = [];
  2781. var position = 0;
  2782. var text = '';
  2783. while (position < format.length) {
  2784. var char = format[position++];
  2785. if (char === startDelimiter) {
  2786. if (text) {
  2787. tokens.push({
  2788. type: 'text',
  2789. value: text
  2790. });
  2791. }
  2792. text = '';
  2793. var sub = '';
  2794. char = format[position++];
  2795. while (char !== undefined && char !== endDelimiter) {
  2796. sub += char;
  2797. char = format[position++];
  2798. }
  2799. var isClosed = char === endDelimiter;
  2800. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  2801. tokens.push({
  2802. value: sub,
  2803. type: type
  2804. });
  2805. }
  2806. // else if (char === '%') {
  2807. // // when found rails i18n syntax, skip text capture
  2808. // if (format[position] !== '{') {
  2809. // text += char
  2810. // }
  2811. // }
  2812. else {
  2813. text += char;
  2814. }
  2815. }
  2816. text && tokens.push({
  2817. type: 'text',
  2818. value: text
  2819. });
  2820. return tokens;
  2821. }
  2822. function compile(tokens, values) {
  2823. var compiled = [];
  2824. var index = 0;
  2825. var mode = isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  2826. if (mode === 'unknown') {
  2827. return compiled;
  2828. }
  2829. while (index < tokens.length) {
  2830. var token = tokens[index];
  2831. switch (token.type) {
  2832. case 'text':
  2833. compiled.push(token.value);
  2834. break;
  2835. case 'list':
  2836. compiled.push(values[parseInt(token.value, 10)]);
  2837. break;
  2838. case 'named':
  2839. if (mode === 'named') {
  2840. compiled.push(values[token.value]);
  2841. } else {
  2842. if (true) {
  2843. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  2844. }
  2845. }
  2846. break;
  2847. case 'unknown':
  2848. if (true) {
  2849. console.warn("Detect 'unknown' type of token!");
  2850. }
  2851. break;
  2852. }
  2853. index++;
  2854. }
  2855. return compiled;
  2856. }
  2857. var LOCALE_ZH_HANS = 'zh-Hans';
  2858. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  2859. var LOCALE_ZH_HANT = 'zh-Hant';
  2860. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  2861. var LOCALE_EN = 'en';
  2862. exports.LOCALE_EN = LOCALE_EN;
  2863. var LOCALE_FR = 'fr';
  2864. exports.LOCALE_FR = LOCALE_FR;
  2865. var LOCALE_ES = 'es';
  2866. exports.LOCALE_ES = LOCALE_ES;
  2867. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2868. var hasOwn = function hasOwn(val, key) {
  2869. return hasOwnProperty.call(val, key);
  2870. };
  2871. var defaultFormatter = new BaseFormatter();
  2872. function include(str, parts) {
  2873. return !!parts.find(function (part) {
  2874. return str.indexOf(part) !== -1;
  2875. });
  2876. }
  2877. function startsWith(str, parts) {
  2878. return parts.find(function (part) {
  2879. return str.indexOf(part) === 0;
  2880. });
  2881. }
  2882. function normalizeLocale(locale, messages) {
  2883. if (!locale) {
  2884. return;
  2885. }
  2886. locale = locale.trim().replace(/_/g, '-');
  2887. if (messages && messages[locale]) {
  2888. return locale;
  2889. }
  2890. locale = locale.toLowerCase();
  2891. if (locale.indexOf('zh') === 0) {
  2892. if (locale.indexOf('-hans') > -1) {
  2893. return LOCALE_ZH_HANS;
  2894. }
  2895. if (locale.indexOf('-hant') > -1) {
  2896. return LOCALE_ZH_HANT;
  2897. }
  2898. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  2899. return LOCALE_ZH_HANT;
  2900. }
  2901. return LOCALE_ZH_HANS;
  2902. }
  2903. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  2904. if (lang) {
  2905. return lang;
  2906. }
  2907. }
  2908. var I18n = /*#__PURE__*/function () {
  2909. function I18n(_ref3) {
  2910. var locale = _ref3.locale,
  2911. fallbackLocale = _ref3.fallbackLocale,
  2912. messages = _ref3.messages,
  2913. watcher = _ref3.watcher,
  2914. formater = _ref3.formater;
  2915. (0, _classCallCheck2.default)(this, I18n);
  2916. this.locale = LOCALE_EN;
  2917. this.fallbackLocale = LOCALE_EN;
  2918. this.message = {};
  2919. this.messages = {};
  2920. this.watchers = [];
  2921. if (fallbackLocale) {
  2922. this.fallbackLocale = fallbackLocale;
  2923. }
  2924. this.formater = formater || defaultFormatter;
  2925. this.messages = messages || {};
  2926. this.setLocale(locale || LOCALE_EN);
  2927. if (watcher) {
  2928. this.watchLocale(watcher);
  2929. }
  2930. }
  2931. (0, _createClass2.default)(I18n, [{
  2932. key: "setLocale",
  2933. value: function setLocale(locale) {
  2934. var _this = this;
  2935. var oldLocale = this.locale;
  2936. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  2937. if (!this.messages[this.locale]) {
  2938. // 可能初始化时不存在
  2939. this.messages[this.locale] = {};
  2940. }
  2941. this.message = this.messages[this.locale];
  2942. // 仅发生变化时,通知
  2943. if (oldLocale !== this.locale) {
  2944. this.watchers.forEach(function (watcher) {
  2945. watcher(_this.locale, oldLocale);
  2946. });
  2947. }
  2948. }
  2949. }, {
  2950. key: "getLocale",
  2951. value: function getLocale() {
  2952. return this.locale;
  2953. }
  2954. }, {
  2955. key: "watchLocale",
  2956. value: function watchLocale(fn) {
  2957. var _this2 = this;
  2958. var index = this.watchers.push(fn) - 1;
  2959. return function () {
  2960. _this2.watchers.splice(index, 1);
  2961. };
  2962. }
  2963. }, {
  2964. key: "add",
  2965. value: function add(locale, message) {
  2966. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  2967. var curMessages = this.messages[locale];
  2968. if (curMessages) {
  2969. if (override) {
  2970. Object.assign(curMessages, message);
  2971. } else {
  2972. Object.keys(message).forEach(function (key) {
  2973. if (!hasOwn(curMessages, key)) {
  2974. curMessages[key] = message[key];
  2975. }
  2976. });
  2977. }
  2978. } else {
  2979. this.messages[locale] = message;
  2980. }
  2981. }
  2982. }, {
  2983. key: "f",
  2984. value: function f(message, values, delimiters) {
  2985. return this.formater.interpolate(message, values, delimiters).join('');
  2986. }
  2987. }, {
  2988. key: "t",
  2989. value: function t(key, locale, values) {
  2990. var message = this.message;
  2991. if (typeof locale === 'string') {
  2992. locale = normalizeLocale(locale, this.messages);
  2993. locale && (message = this.messages[locale]);
  2994. } else {
  2995. values = locale;
  2996. }
  2997. if (!hasOwn(message, key)) {
  2998. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  2999. return key;
  3000. }
  3001. return this.formater.interpolate(message[key], values).join('');
  3002. }
  3003. }]);
  3004. return I18n;
  3005. }();
  3006. exports.I18n = I18n;
  3007. function watchAppLocale(appVm, i18n) {
  3008. // 需要保证 watch 的触发在组件渲染之前
  3009. if (appVm.$watchLocale) {
  3010. // vue2
  3011. appVm.$watchLocale(function (newLocale) {
  3012. i18n.setLocale(newLocale);
  3013. });
  3014. } else {
  3015. appVm.$watch(function () {
  3016. return appVm.$locale;
  3017. }, function (newLocale) {
  3018. i18n.setLocale(newLocale);
  3019. });
  3020. }
  3021. }
  3022. function getDefaultLocale() {
  3023. if (typeof uni !== 'undefined' && uni.getLocale) {
  3024. return uni.getLocale();
  3025. }
  3026. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  3027. if (typeof global !== 'undefined' && global.getLocale) {
  3028. return global.getLocale();
  3029. }
  3030. return LOCALE_EN;
  3031. }
  3032. function initVueI18n(locale) {
  3033. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3034. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  3035. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  3036. // 兼容旧版本入参
  3037. if (typeof locale !== 'string') {
  3038. var _ref4 = [messages, locale];
  3039. locale = _ref4[0];
  3040. messages = _ref4[1];
  3041. }
  3042. if (typeof locale !== 'string') {
  3043. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  3044. locale = getDefaultLocale();
  3045. }
  3046. if (typeof fallbackLocale !== 'string') {
  3047. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  3048. }
  3049. var i18n = new I18n({
  3050. locale: locale,
  3051. fallbackLocale: fallbackLocale,
  3052. messages: messages,
  3053. watcher: watcher
  3054. });
  3055. var _t = function t(key, values) {
  3056. if (typeof getApp !== 'function') {
  3057. // app view
  3058. /* eslint-disable no-func-assign */
  3059. _t = function t(key, values) {
  3060. return i18n.t(key, values);
  3061. };
  3062. } else {
  3063. var isWatchedAppLocale = false;
  3064. _t = function t(key, values) {
  3065. var appVm = getApp().$vm;
  3066. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  3067. // options: {
  3068. // type: Array,
  3069. // default () {
  3070. // return [{
  3071. // icon: 'shop',
  3072. // text: t("uni-goods-nav.options.shop"),
  3073. // }, {
  3074. // icon: 'cart',
  3075. // text: t("uni-goods-nav.options.cart")
  3076. // }]
  3077. // }
  3078. // },
  3079. if (appVm) {
  3080. // 触发响应式
  3081. appVm.$locale;
  3082. if (!isWatchedAppLocale) {
  3083. isWatchedAppLocale = true;
  3084. watchAppLocale(appVm, i18n);
  3085. }
  3086. }
  3087. return i18n.t(key, values);
  3088. };
  3089. }
  3090. return _t(key, values);
  3091. };
  3092. return {
  3093. i18n: i18n,
  3094. f: function f(message, values, delimiters) {
  3095. return i18n.f(message, values, delimiters);
  3096. },
  3097. t: function t(key, values) {
  3098. return _t(key, values);
  3099. },
  3100. add: function add(locale, message) {
  3101. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3102. return i18n.add(locale, message, override);
  3103. },
  3104. watch: function watch(fn) {
  3105. return i18n.watchLocale(fn);
  3106. },
  3107. getLocale: function getLocale() {
  3108. return i18n.getLocale();
  3109. },
  3110. setLocale: function setLocale(newLocale) {
  3111. return i18n.setLocale(newLocale);
  3112. }
  3113. };
  3114. }
  3115. var isString = function isString(val) {
  3116. return typeof val === 'string';
  3117. };
  3118. exports.isString = isString;
  3119. var formater;
  3120. function hasI18nJson(jsonObj, delimiters) {
  3121. if (!formater) {
  3122. formater = new BaseFormatter();
  3123. }
  3124. return walkJsonObj(jsonObj, function (jsonObj, key) {
  3125. var value = jsonObj[key];
  3126. if (isString(value)) {
  3127. if (isI18nStr(value, delimiters)) {
  3128. return true;
  3129. }
  3130. } else {
  3131. return hasI18nJson(value, delimiters);
  3132. }
  3133. });
  3134. }
  3135. function parseI18nJson(jsonObj, values, delimiters) {
  3136. if (!formater) {
  3137. formater = new BaseFormatter();
  3138. }
  3139. walkJsonObj(jsonObj, function (jsonObj, key) {
  3140. var value = jsonObj[key];
  3141. if (isString(value)) {
  3142. if (isI18nStr(value, delimiters)) {
  3143. jsonObj[key] = compileStr(value, values, delimiters);
  3144. }
  3145. } else {
  3146. parseI18nJson(value, values, delimiters);
  3147. }
  3148. });
  3149. return jsonObj;
  3150. }
  3151. function compileI18nJsonStr(jsonStr, _ref5) {
  3152. var locale = _ref5.locale,
  3153. locales = _ref5.locales,
  3154. delimiters = _ref5.delimiters;
  3155. if (!isI18nStr(jsonStr, delimiters)) {
  3156. return jsonStr;
  3157. }
  3158. if (!formater) {
  3159. formater = new BaseFormatter();
  3160. }
  3161. var localeValues = [];
  3162. Object.keys(locales).forEach(function (name) {
  3163. if (name !== locale) {
  3164. localeValues.push({
  3165. locale: name,
  3166. values: locales[name]
  3167. });
  3168. }
  3169. });
  3170. localeValues.unshift({
  3171. locale: locale,
  3172. values: locales[locale]
  3173. });
  3174. try {
  3175. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  3176. } catch (e) {}
  3177. return jsonStr;
  3178. }
  3179. function isI18nStr(value, delimiters) {
  3180. return value.indexOf(delimiters[0]) > -1;
  3181. }
  3182. function compileStr(value, values, delimiters) {
  3183. return formater.interpolate(value, values, delimiters).join('');
  3184. }
  3185. function compileValue(jsonObj, key, localeValues, delimiters) {
  3186. var value = jsonObj[key];
  3187. if (isString(value)) {
  3188. // 存在国际化
  3189. if (isI18nStr(value, delimiters)) {
  3190. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  3191. if (localeValues.length > 1) {
  3192. // 格式化国际化语言
  3193. var valueLocales = jsonObj[key + 'Locales'] = {};
  3194. localeValues.forEach(function (localValue) {
  3195. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  3196. });
  3197. }
  3198. }
  3199. } else {
  3200. compileJsonObj(value, localeValues, delimiters);
  3201. }
  3202. }
  3203. function compileJsonObj(jsonObj, localeValues, delimiters) {
  3204. walkJsonObj(jsonObj, function (jsonObj, key) {
  3205. compileValue(jsonObj, key, localeValues, delimiters);
  3206. });
  3207. return jsonObj;
  3208. }
  3209. function walkJsonObj(jsonObj, walk) {
  3210. if (isArray(jsonObj)) {
  3211. for (var i = 0; i < jsonObj.length; i++) {
  3212. if (walk(jsonObj, i)) {
  3213. return true;
  3214. }
  3215. }
  3216. } else if (isObject(jsonObj)) {
  3217. for (var key in jsonObj) {
  3218. if (walk(jsonObj, key)) {
  3219. return true;
  3220. }
  3221. }
  3222. }
  3223. return false;
  3224. }
  3225. function resolveLocale(locales) {
  3226. return function (locale) {
  3227. if (!locale) {
  3228. return locale;
  3229. }
  3230. locale = normalizeLocale(locale) || locale;
  3231. return resolveLocaleChain(locale).find(function (locale) {
  3232. return locales.indexOf(locale) > -1;
  3233. });
  3234. };
  3235. }
  3236. function resolveLocaleChain(locale) {
  3237. var chain = [];
  3238. var tokens = locale.split('-');
  3239. while (tokens.length) {
  3240. chain.push(tokens.join('-'));
  3241. tokens.pop();
  3242. }
  3243. return chain;
  3244. }
  3245. /* 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)))
  3246. /***/ }),
  3247. /* 23 */
  3248. /*!***************************************************************!*\
  3249. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  3250. \***************************************************************/
  3251. /*! no static exports found */
  3252. /***/ (function(module, exports) {
  3253. function _classCallCheck(instance, Constructor) {
  3254. if (!(instance instanceof Constructor)) {
  3255. throw new TypeError("Cannot call a class as a function");
  3256. }
  3257. }
  3258. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3259. /***/ }),
  3260. /* 24 */
  3261. /*!************************************************************!*\
  3262. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  3263. \************************************************************/
  3264. /*! no static exports found */
  3265. /***/ (function(module, exports, __webpack_require__) {
  3266. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  3267. function _defineProperties(target, props) {
  3268. for (var i = 0; i < props.length; i++) {
  3269. var descriptor = props[i];
  3270. descriptor.enumerable = descriptor.enumerable || false;
  3271. descriptor.configurable = true;
  3272. if ("value" in descriptor) descriptor.writable = true;
  3273. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  3274. }
  3275. }
  3276. function _createClass(Constructor, protoProps, staticProps) {
  3277. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  3278. if (staticProps) _defineProperties(Constructor, staticProps);
  3279. Object.defineProperty(Constructor, "prototype", {
  3280. writable: false
  3281. });
  3282. return Constructor;
  3283. }
  3284. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3285. /***/ }),
  3286. /* 25 */
  3287. /*!******************************************************************************************!*\
  3288. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3289. \******************************************************************************************/
  3290. /*! exports provided: default */
  3291. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3292. "use strict";
  3293. __webpack_require__.r(__webpack_exports__);
  3294. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3295. * Vue.js v2.6.11
  3296. * (c) 2014-2022 Evan You
  3297. * Released under the MIT License.
  3298. */
  3299. /* */
  3300. var emptyObject = Object.freeze({});
  3301. // These helpers produce better VM code in JS engines due to their
  3302. // explicitness and function inlining.
  3303. function isUndef (v) {
  3304. return v === undefined || v === null
  3305. }
  3306. function isDef (v) {
  3307. return v !== undefined && v !== null
  3308. }
  3309. function isTrue (v) {
  3310. return v === true
  3311. }
  3312. function isFalse (v) {
  3313. return v === false
  3314. }
  3315. /**
  3316. * Check if value is primitive.
  3317. */
  3318. function isPrimitive (value) {
  3319. return (
  3320. typeof value === 'string' ||
  3321. typeof value === 'number' ||
  3322. // $flow-disable-line
  3323. typeof value === 'symbol' ||
  3324. typeof value === 'boolean'
  3325. )
  3326. }
  3327. /**
  3328. * Quick object check - this is primarily used to tell
  3329. * Objects from primitive values when we know the value
  3330. * is a JSON-compliant type.
  3331. */
  3332. function isObject (obj) {
  3333. return obj !== null && typeof obj === 'object'
  3334. }
  3335. /**
  3336. * Get the raw type string of a value, e.g., [object Object].
  3337. */
  3338. var _toString = Object.prototype.toString;
  3339. function toRawType (value) {
  3340. return _toString.call(value).slice(8, -1)
  3341. }
  3342. /**
  3343. * Strict object type check. Only returns true
  3344. * for plain JavaScript objects.
  3345. */
  3346. function isPlainObject (obj) {
  3347. return _toString.call(obj) === '[object Object]'
  3348. }
  3349. function isRegExp (v) {
  3350. return _toString.call(v) === '[object RegExp]'
  3351. }
  3352. /**
  3353. * Check if val is a valid array index.
  3354. */
  3355. function isValidArrayIndex (val) {
  3356. var n = parseFloat(String(val));
  3357. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3358. }
  3359. function isPromise (val) {
  3360. return (
  3361. isDef(val) &&
  3362. typeof val.then === 'function' &&
  3363. typeof val.catch === 'function'
  3364. )
  3365. }
  3366. /**
  3367. * Convert a value to a string that is actually rendered.
  3368. */
  3369. function toString (val) {
  3370. return val == null
  3371. ? ''
  3372. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3373. ? JSON.stringify(val, null, 2)
  3374. : String(val)
  3375. }
  3376. /**
  3377. * Convert an input value to a number for persistence.
  3378. * If the conversion fails, return original string.
  3379. */
  3380. function toNumber (val) {
  3381. var n = parseFloat(val);
  3382. return isNaN(n) ? val : n
  3383. }
  3384. /**
  3385. * Make a map and return a function for checking if a key
  3386. * is in that map.
  3387. */
  3388. function makeMap (
  3389. str,
  3390. expectsLowerCase
  3391. ) {
  3392. var map = Object.create(null);
  3393. var list = str.split(',');
  3394. for (var i = 0; i < list.length; i++) {
  3395. map[list[i]] = true;
  3396. }
  3397. return expectsLowerCase
  3398. ? function (val) { return map[val.toLowerCase()]; }
  3399. : function (val) { return map[val]; }
  3400. }
  3401. /**
  3402. * Check if a tag is a built-in tag.
  3403. */
  3404. var isBuiltInTag = makeMap('slot,component', true);
  3405. /**
  3406. * Check if an attribute is a reserved attribute.
  3407. */
  3408. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  3409. /**
  3410. * Remove an item from an array.
  3411. */
  3412. function remove (arr, item) {
  3413. if (arr.length) {
  3414. var index = arr.indexOf(item);
  3415. if (index > -1) {
  3416. return arr.splice(index, 1)
  3417. }
  3418. }
  3419. }
  3420. /**
  3421. * Check whether an object has the property.
  3422. */
  3423. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3424. function hasOwn (obj, key) {
  3425. return hasOwnProperty.call(obj, key)
  3426. }
  3427. /**
  3428. * Create a cached version of a pure function.
  3429. */
  3430. function cached (fn) {
  3431. var cache = Object.create(null);
  3432. return (function cachedFn (str) {
  3433. var hit = cache[str];
  3434. return hit || (cache[str] = fn(str))
  3435. })
  3436. }
  3437. /**
  3438. * Camelize a hyphen-delimited string.
  3439. */
  3440. var camelizeRE = /-(\w)/g;
  3441. var camelize = cached(function (str) {
  3442. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3443. });
  3444. /**
  3445. * Capitalize a string.
  3446. */
  3447. var capitalize = cached(function (str) {
  3448. return str.charAt(0).toUpperCase() + str.slice(1)
  3449. });
  3450. /**
  3451. * Hyphenate a camelCase string.
  3452. */
  3453. var hyphenateRE = /\B([A-Z])/g;
  3454. var hyphenate = cached(function (str) {
  3455. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3456. });
  3457. /**
  3458. * Simple bind polyfill for environments that do not support it,
  3459. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3460. * since native bind is now performant enough in most browsers.
  3461. * But removing it would mean breaking code that was able to run in
  3462. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3463. */
  3464. /* istanbul ignore next */
  3465. function polyfillBind (fn, ctx) {
  3466. function boundFn (a) {
  3467. var l = arguments.length;
  3468. return l
  3469. ? l > 1
  3470. ? fn.apply(ctx, arguments)
  3471. : fn.call(ctx, a)
  3472. : fn.call(ctx)
  3473. }
  3474. boundFn._length = fn.length;
  3475. return boundFn
  3476. }
  3477. function nativeBind (fn, ctx) {
  3478. return fn.bind(ctx)
  3479. }
  3480. var bind = Function.prototype.bind
  3481. ? nativeBind
  3482. : polyfillBind;
  3483. /**
  3484. * Convert an Array-like object to a real Array.
  3485. */
  3486. function toArray (list, start) {
  3487. start = start || 0;
  3488. var i = list.length - start;
  3489. var ret = new Array(i);
  3490. while (i--) {
  3491. ret[i] = list[i + start];
  3492. }
  3493. return ret
  3494. }
  3495. /**
  3496. * Mix properties into target object.
  3497. */
  3498. function extend (to, _from) {
  3499. for (var key in _from) {
  3500. to[key] = _from[key];
  3501. }
  3502. return to
  3503. }
  3504. /**
  3505. * Merge an Array of Objects into a single Object.
  3506. */
  3507. function toObject (arr) {
  3508. var res = {};
  3509. for (var i = 0; i < arr.length; i++) {
  3510. if (arr[i]) {
  3511. extend(res, arr[i]);
  3512. }
  3513. }
  3514. return res
  3515. }
  3516. /* eslint-disable no-unused-vars */
  3517. /**
  3518. * Perform no operation.
  3519. * Stubbing args to make Flow happy without leaving useless transpiled code
  3520. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3521. */
  3522. function noop (a, b, c) {}
  3523. /**
  3524. * Always return false.
  3525. */
  3526. var no = function (a, b, c) { return false; };
  3527. /* eslint-enable no-unused-vars */
  3528. /**
  3529. * Return the same value.
  3530. */
  3531. var identity = function (_) { return _; };
  3532. /**
  3533. * Check if two values are loosely equal - that is,
  3534. * if they are plain objects, do they have the same shape?
  3535. */
  3536. function looseEqual (a, b) {
  3537. if (a === b) { return true }
  3538. var isObjectA = isObject(a);
  3539. var isObjectB = isObject(b);
  3540. if (isObjectA && isObjectB) {
  3541. try {
  3542. var isArrayA = Array.isArray(a);
  3543. var isArrayB = Array.isArray(b);
  3544. if (isArrayA && isArrayB) {
  3545. return a.length === b.length && a.every(function (e, i) {
  3546. return looseEqual(e, b[i])
  3547. })
  3548. } else if (a instanceof Date && b instanceof Date) {
  3549. return a.getTime() === b.getTime()
  3550. } else if (!isArrayA && !isArrayB) {
  3551. var keysA = Object.keys(a);
  3552. var keysB = Object.keys(b);
  3553. return keysA.length === keysB.length && keysA.every(function (key) {
  3554. return looseEqual(a[key], b[key])
  3555. })
  3556. } else {
  3557. /* istanbul ignore next */
  3558. return false
  3559. }
  3560. } catch (e) {
  3561. /* istanbul ignore next */
  3562. return false
  3563. }
  3564. } else if (!isObjectA && !isObjectB) {
  3565. return String(a) === String(b)
  3566. } else {
  3567. return false
  3568. }
  3569. }
  3570. /**
  3571. * Return the first index at which a loosely equal value can be
  3572. * found in the array (if value is a plain object, the array must
  3573. * contain an object of the same shape), or -1 if it is not present.
  3574. */
  3575. function looseIndexOf (arr, val) {
  3576. for (var i = 0; i < arr.length; i++) {
  3577. if (looseEqual(arr[i], val)) { return i }
  3578. }
  3579. return -1
  3580. }
  3581. /**
  3582. * Ensure a function is called only once.
  3583. */
  3584. function once (fn) {
  3585. var called = false;
  3586. return function () {
  3587. if (!called) {
  3588. called = true;
  3589. fn.apply(this, arguments);
  3590. }
  3591. }
  3592. }
  3593. var ASSET_TYPES = [
  3594. 'component',
  3595. 'directive',
  3596. 'filter'
  3597. ];
  3598. var LIFECYCLE_HOOKS = [
  3599. 'beforeCreate',
  3600. 'created',
  3601. 'beforeMount',
  3602. 'mounted',
  3603. 'beforeUpdate',
  3604. 'updated',
  3605. 'beforeDestroy',
  3606. 'destroyed',
  3607. 'activated',
  3608. 'deactivated',
  3609. 'errorCaptured',
  3610. 'serverPrefetch'
  3611. ];
  3612. /* */
  3613. var config = ({
  3614. /**
  3615. * Option merge strategies (used in core/util/options)
  3616. */
  3617. // $flow-disable-line
  3618. optionMergeStrategies: Object.create(null),
  3619. /**
  3620. * Whether to suppress warnings.
  3621. */
  3622. silent: false,
  3623. /**
  3624. * Show production mode tip message on boot?
  3625. */
  3626. productionTip: "development" !== 'production',
  3627. /**
  3628. * Whether to enable devtools
  3629. */
  3630. devtools: "development" !== 'production',
  3631. /**
  3632. * Whether to record perf
  3633. */
  3634. performance: false,
  3635. /**
  3636. * Error handler for watcher errors
  3637. */
  3638. errorHandler: null,
  3639. /**
  3640. * Warn handler for watcher warns
  3641. */
  3642. warnHandler: null,
  3643. /**
  3644. * Ignore certain custom elements
  3645. */
  3646. ignoredElements: [],
  3647. /**
  3648. * Custom user key aliases for v-on
  3649. */
  3650. // $flow-disable-line
  3651. keyCodes: Object.create(null),
  3652. /**
  3653. * Check if a tag is reserved so that it cannot be registered as a
  3654. * component. This is platform-dependent and may be overwritten.
  3655. */
  3656. isReservedTag: no,
  3657. /**
  3658. * Check if an attribute is reserved so that it cannot be used as a component
  3659. * prop. This is platform-dependent and may be overwritten.
  3660. */
  3661. isReservedAttr: no,
  3662. /**
  3663. * Check if a tag is an unknown element.
  3664. * Platform-dependent.
  3665. */
  3666. isUnknownElement: no,
  3667. /**
  3668. * Get the namespace of an element
  3669. */
  3670. getTagNamespace: noop,
  3671. /**
  3672. * Parse the real tag name for the specific platform.
  3673. */
  3674. parsePlatformTagName: identity,
  3675. /**
  3676. * Check if an attribute must be bound using property, e.g. value
  3677. * Platform-dependent.
  3678. */
  3679. mustUseProp: no,
  3680. /**
  3681. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  3682. * This will significantly reduce performance if set to false.
  3683. */
  3684. async: true,
  3685. /**
  3686. * Exposed for legacy reasons
  3687. */
  3688. _lifecycleHooks: LIFECYCLE_HOOKS
  3689. });
  3690. /* */
  3691. /**
  3692. * unicode letters used for parsing html tags, component names and property paths.
  3693. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  3694. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  3695. */
  3696. 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/;
  3697. /**
  3698. * Check if a string starts with $ or _
  3699. */
  3700. function isReserved (str) {
  3701. var c = (str + '').charCodeAt(0);
  3702. return c === 0x24 || c === 0x5F
  3703. }
  3704. /**
  3705. * Define a property.
  3706. */
  3707. function def (obj, key, val, enumerable) {
  3708. Object.defineProperty(obj, key, {
  3709. value: val,
  3710. enumerable: !!enumerable,
  3711. writable: true,
  3712. configurable: true
  3713. });
  3714. }
  3715. /**
  3716. * Parse simple path.
  3717. */
  3718. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  3719. function parsePath (path) {
  3720. if (bailRE.test(path)) {
  3721. return
  3722. }
  3723. var segments = path.split('.');
  3724. return function (obj) {
  3725. for (var i = 0; i < segments.length; i++) {
  3726. if (!obj) { return }
  3727. obj = obj[segments[i]];
  3728. }
  3729. return obj
  3730. }
  3731. }
  3732. /* */
  3733. // can we use __proto__?
  3734. var hasProto = '__proto__' in {};
  3735. // Browser environment sniffing
  3736. var inBrowser = typeof window !== 'undefined';
  3737. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  3738. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  3739. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  3740. var isIE = UA && /msie|trident/.test(UA);
  3741. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  3742. var isEdge = UA && UA.indexOf('edge/') > 0;
  3743. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  3744. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  3745. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  3746. var isPhantomJS = UA && /phantomjs/.test(UA);
  3747. var isFF = UA && UA.match(/firefox\/(\d+)/);
  3748. // Firefox has a "watch" function on Object.prototype...
  3749. var nativeWatch = ({}).watch;
  3750. if (inBrowser) {
  3751. try {
  3752. var opts = {};
  3753. Object.defineProperty(opts, 'passive', ({
  3754. get: function get () {
  3755. }
  3756. })); // https://github.com/facebook/flow/issues/285
  3757. window.addEventListener('test-passive', null, opts);
  3758. } catch (e) {}
  3759. }
  3760. // this needs to be lazy-evaled because vue may be required before
  3761. // vue-server-renderer can set VUE_ENV
  3762. var _isServer;
  3763. var isServerRendering = function () {
  3764. if (_isServer === undefined) {
  3765. /* istanbul ignore if */
  3766. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  3767. // detect presence of vue-server-renderer and avoid
  3768. // Webpack shimming the process
  3769. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  3770. } else {
  3771. _isServer = false;
  3772. }
  3773. }
  3774. return _isServer
  3775. };
  3776. // detect devtools
  3777. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3778. /* istanbul ignore next */
  3779. function isNative (Ctor) {
  3780. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  3781. }
  3782. var hasSymbol =
  3783. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  3784. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  3785. var _Set;
  3786. /* istanbul ignore if */ // $flow-disable-line
  3787. if (typeof Set !== 'undefined' && isNative(Set)) {
  3788. // use native Set when available.
  3789. _Set = Set;
  3790. } else {
  3791. // a non-standard Set polyfill that only works with primitive keys.
  3792. _Set = /*@__PURE__*/(function () {
  3793. function Set () {
  3794. this.set = Object.create(null);
  3795. }
  3796. Set.prototype.has = function has (key) {
  3797. return this.set[key] === true
  3798. };
  3799. Set.prototype.add = function add (key) {
  3800. this.set[key] = true;
  3801. };
  3802. Set.prototype.clear = function clear () {
  3803. this.set = Object.create(null);
  3804. };
  3805. return Set;
  3806. }());
  3807. }
  3808. /* */
  3809. var warn = noop;
  3810. var tip = noop;
  3811. var generateComponentTrace = (noop); // work around flow check
  3812. var formatComponentName = (noop);
  3813. if (true) {
  3814. var hasConsole = typeof console !== 'undefined';
  3815. var classifyRE = /(?:^|[-_])(\w)/g;
  3816. var classify = function (str) { return str
  3817. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  3818. .replace(/[-_]/g, ''); };
  3819. warn = function (msg, vm) {
  3820. var trace = vm ? generateComponentTrace(vm) : '';
  3821. if (config.warnHandler) {
  3822. config.warnHandler.call(null, msg, vm, trace);
  3823. } else if (hasConsole && (!config.silent)) {
  3824. console.error(("[Vue warn]: " + msg + trace));
  3825. }
  3826. };
  3827. tip = function (msg, vm) {
  3828. if (hasConsole && (!config.silent)) {
  3829. console.warn("[Vue tip]: " + msg + (
  3830. vm ? generateComponentTrace(vm) : ''
  3831. ));
  3832. }
  3833. };
  3834. formatComponentName = function (vm, includeFile) {
  3835. if (vm.$root === vm) {
  3836. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  3837. return ('') + vm.$options.__file
  3838. }
  3839. return '<Root>'
  3840. }
  3841. var options = typeof vm === 'function' && vm.cid != null
  3842. ? vm.options
  3843. : vm._isVue
  3844. ? vm.$options || vm.constructor.options
  3845. : vm;
  3846. var name = options.name || options._componentTag;
  3847. var file = options.__file;
  3848. if (!name && file) {
  3849. var match = file.match(/([^/\\]+)\.vue$/);
  3850. name = match && match[1];
  3851. }
  3852. return (
  3853. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  3854. (file && includeFile !== false ? (" at " + file) : '')
  3855. )
  3856. };
  3857. var repeat = function (str, n) {
  3858. var res = '';
  3859. while (n) {
  3860. if (n % 2 === 1) { res += str; }
  3861. if (n > 1) { str += str; }
  3862. n >>= 1;
  3863. }
  3864. return res
  3865. };
  3866. generateComponentTrace = function (vm) {
  3867. if (vm._isVue && vm.$parent) {
  3868. var tree = [];
  3869. var currentRecursiveSequence = 0;
  3870. while (vm && vm.$options.name !== 'PageBody') {
  3871. if (tree.length > 0) {
  3872. var last = tree[tree.length - 1];
  3873. if (last.constructor === vm.constructor) {
  3874. currentRecursiveSequence++;
  3875. vm = vm.$parent;
  3876. continue
  3877. } else if (currentRecursiveSequence > 0) {
  3878. tree[tree.length - 1] = [last, currentRecursiveSequence];
  3879. currentRecursiveSequence = 0;
  3880. }
  3881. }
  3882. !vm.$options.isReserved && tree.push(vm);
  3883. vm = vm.$parent;
  3884. }
  3885. return '\n\nfound in\n\n' + tree
  3886. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  3887. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  3888. : formatComponentName(vm))); })
  3889. .join('\n')
  3890. } else {
  3891. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  3892. }
  3893. };
  3894. }
  3895. /* */
  3896. var uid = 0;
  3897. /**
  3898. * A dep is an observable that can have multiple
  3899. * directives subscribing to it.
  3900. */
  3901. var Dep = function Dep () {
  3902. this.id = uid++;
  3903. this.subs = [];
  3904. };
  3905. Dep.prototype.addSub = function addSub (sub) {
  3906. this.subs.push(sub);
  3907. };
  3908. Dep.prototype.removeSub = function removeSub (sub) {
  3909. remove(this.subs, sub);
  3910. };
  3911. Dep.prototype.depend = function depend () {
  3912. if (Dep.SharedObject.target) {
  3913. Dep.SharedObject.target.addDep(this);
  3914. }
  3915. };
  3916. Dep.prototype.notify = function notify () {
  3917. // stabilize the subscriber list first
  3918. var subs = this.subs.slice();
  3919. if ( true && !config.async) {
  3920. // subs aren't sorted in scheduler if not running async
  3921. // we need to sort them now to make sure they fire in correct
  3922. // order
  3923. subs.sort(function (a, b) { return a.id - b.id; });
  3924. }
  3925. for (var i = 0, l = subs.length; i < l; i++) {
  3926. subs[i].update();
  3927. }
  3928. };
  3929. // The current target watcher being evaluated.
  3930. // This is globally unique because only one watcher
  3931. // can be evaluated at a time.
  3932. // fixed by xxxxxx (nvue shared vuex)
  3933. /* eslint-disable no-undef */
  3934. Dep.SharedObject = {};
  3935. Dep.SharedObject.target = null;
  3936. Dep.SharedObject.targetStack = [];
  3937. function pushTarget (target) {
  3938. Dep.SharedObject.targetStack.push(target);
  3939. Dep.SharedObject.target = target;
  3940. Dep.target = target;
  3941. }
  3942. function popTarget () {
  3943. Dep.SharedObject.targetStack.pop();
  3944. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  3945. Dep.target = Dep.SharedObject.target;
  3946. }
  3947. /* */
  3948. var VNode = function VNode (
  3949. tag,
  3950. data,
  3951. children,
  3952. text,
  3953. elm,
  3954. context,
  3955. componentOptions,
  3956. asyncFactory
  3957. ) {
  3958. this.tag = tag;
  3959. this.data = data;
  3960. this.children = children;
  3961. this.text = text;
  3962. this.elm = elm;
  3963. this.ns = undefined;
  3964. this.context = context;
  3965. this.fnContext = undefined;
  3966. this.fnOptions = undefined;
  3967. this.fnScopeId = undefined;
  3968. this.key = data && data.key;
  3969. this.componentOptions = componentOptions;
  3970. this.componentInstance = undefined;
  3971. this.parent = undefined;
  3972. this.raw = false;
  3973. this.isStatic = false;
  3974. this.isRootInsert = true;
  3975. this.isComment = false;
  3976. this.isCloned = false;
  3977. this.isOnce = false;
  3978. this.asyncFactory = asyncFactory;
  3979. this.asyncMeta = undefined;
  3980. this.isAsyncPlaceholder = false;
  3981. };
  3982. var prototypeAccessors = { child: { configurable: true } };
  3983. // DEPRECATED: alias for componentInstance for backwards compat.
  3984. /* istanbul ignore next */
  3985. prototypeAccessors.child.get = function () {
  3986. return this.componentInstance
  3987. };
  3988. Object.defineProperties( VNode.prototype, prototypeAccessors );
  3989. var createEmptyVNode = function (text) {
  3990. if ( text === void 0 ) text = '';
  3991. var node = new VNode();
  3992. node.text = text;
  3993. node.isComment = true;
  3994. return node
  3995. };
  3996. function createTextVNode (val) {
  3997. return new VNode(undefined, undefined, undefined, String(val))
  3998. }
  3999. // optimized shallow clone
  4000. // used for static nodes and slot nodes because they may be reused across
  4001. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4002. // on their elm reference.
  4003. function cloneVNode (vnode) {
  4004. var cloned = new VNode(
  4005. vnode.tag,
  4006. vnode.data,
  4007. // #7975
  4008. // clone children array to avoid mutating original in case of cloning
  4009. // a child.
  4010. vnode.children && vnode.children.slice(),
  4011. vnode.text,
  4012. vnode.elm,
  4013. vnode.context,
  4014. vnode.componentOptions,
  4015. vnode.asyncFactory
  4016. );
  4017. cloned.ns = vnode.ns;
  4018. cloned.isStatic = vnode.isStatic;
  4019. cloned.key = vnode.key;
  4020. cloned.isComment = vnode.isComment;
  4021. cloned.fnContext = vnode.fnContext;
  4022. cloned.fnOptions = vnode.fnOptions;
  4023. cloned.fnScopeId = vnode.fnScopeId;
  4024. cloned.asyncMeta = vnode.asyncMeta;
  4025. cloned.isCloned = true;
  4026. return cloned
  4027. }
  4028. /*
  4029. * not type checking this file because flow doesn't play well with
  4030. * dynamically accessing methods on Array prototype
  4031. */
  4032. var arrayProto = Array.prototype;
  4033. var arrayMethods = Object.create(arrayProto);
  4034. var methodsToPatch = [
  4035. 'push',
  4036. 'pop',
  4037. 'shift',
  4038. 'unshift',
  4039. 'splice',
  4040. 'sort',
  4041. 'reverse'
  4042. ];
  4043. /**
  4044. * Intercept mutating methods and emit events
  4045. */
  4046. methodsToPatch.forEach(function (method) {
  4047. // cache original method
  4048. var original = arrayProto[method];
  4049. def(arrayMethods, method, function mutator () {
  4050. var args = [], len = arguments.length;
  4051. while ( len-- ) args[ len ] = arguments[ len ];
  4052. var result = original.apply(this, args);
  4053. var ob = this.__ob__;
  4054. var inserted;
  4055. switch (method) {
  4056. case 'push':
  4057. case 'unshift':
  4058. inserted = args;
  4059. break
  4060. case 'splice':
  4061. inserted = args.slice(2);
  4062. break
  4063. }
  4064. if (inserted) { ob.observeArray(inserted); }
  4065. // notify change
  4066. ob.dep.notify();
  4067. return result
  4068. });
  4069. });
  4070. /* */
  4071. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4072. /**
  4073. * In some cases we may want to disable observation inside a component's
  4074. * update computation.
  4075. */
  4076. var shouldObserve = true;
  4077. function toggleObserving (value) {
  4078. shouldObserve = value;
  4079. }
  4080. /**
  4081. * Observer class that is attached to each observed
  4082. * object. Once attached, the observer converts the target
  4083. * object's property keys into getter/setters that
  4084. * collect dependencies and dispatch updates.
  4085. */
  4086. var Observer = function Observer (value) {
  4087. this.value = value;
  4088. this.dep = new Dep();
  4089. this.vmCount = 0;
  4090. def(value, '__ob__', this);
  4091. if (Array.isArray(value)) {
  4092. if (hasProto) {
  4093. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4094. if(value.push !== value.__proto__.push){
  4095. copyAugment(value, arrayMethods, arrayKeys);
  4096. } else {
  4097. protoAugment(value, arrayMethods);
  4098. }
  4099. }
  4100. } else {
  4101. copyAugment(value, arrayMethods, arrayKeys);
  4102. }
  4103. this.observeArray(value);
  4104. } else {
  4105. this.walk(value);
  4106. }
  4107. };
  4108. /**
  4109. * Walk through all properties and convert them into
  4110. * getter/setters. This method should only be called when
  4111. * value type is Object.
  4112. */
  4113. Observer.prototype.walk = function walk (obj) {
  4114. var keys = Object.keys(obj);
  4115. for (var i = 0; i < keys.length; i++) {
  4116. defineReactive$$1(obj, keys[i]);
  4117. }
  4118. };
  4119. /**
  4120. * Observe a list of Array items.
  4121. */
  4122. Observer.prototype.observeArray = function observeArray (items) {
  4123. for (var i = 0, l = items.length; i < l; i++) {
  4124. observe(items[i]);
  4125. }
  4126. };
  4127. // helpers
  4128. /**
  4129. * Augment a target Object or Array by intercepting
  4130. * the prototype chain using __proto__
  4131. */
  4132. function protoAugment (target, src) {
  4133. /* eslint-disable no-proto */
  4134. target.__proto__ = src;
  4135. /* eslint-enable no-proto */
  4136. }
  4137. /**
  4138. * Augment a target Object or Array by defining
  4139. * hidden properties.
  4140. */
  4141. /* istanbul ignore next */
  4142. function copyAugment (target, src, keys) {
  4143. for (var i = 0, l = keys.length; i < l; i++) {
  4144. var key = keys[i];
  4145. def(target, key, src[key]);
  4146. }
  4147. }
  4148. /**
  4149. * Attempt to create an observer instance for a value,
  4150. * returns the new observer if successfully observed,
  4151. * or the existing observer if the value already has one.
  4152. */
  4153. function observe (value, asRootData) {
  4154. if (!isObject(value) || value instanceof VNode) {
  4155. return
  4156. }
  4157. var ob;
  4158. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4159. ob = value.__ob__;
  4160. } else if (
  4161. shouldObserve &&
  4162. !isServerRendering() &&
  4163. (Array.isArray(value) || isPlainObject(value)) &&
  4164. Object.isExtensible(value) &&
  4165. !value._isVue &&
  4166. !value.__v_isMPComponent
  4167. ) {
  4168. ob = new Observer(value);
  4169. }
  4170. if (asRootData && ob) {
  4171. ob.vmCount++;
  4172. }
  4173. return ob
  4174. }
  4175. /**
  4176. * Define a reactive property on an Object.
  4177. */
  4178. function defineReactive$$1 (
  4179. obj,
  4180. key,
  4181. val,
  4182. customSetter,
  4183. shallow
  4184. ) {
  4185. var dep = new Dep();
  4186. var property = Object.getOwnPropertyDescriptor(obj, key);
  4187. if (property && property.configurable === false) {
  4188. return
  4189. }
  4190. // cater for pre-defined getter/setters
  4191. var getter = property && property.get;
  4192. var setter = property && property.set;
  4193. if ((!getter || setter) && arguments.length === 2) {
  4194. val = obj[key];
  4195. }
  4196. var childOb = !shallow && observe(val);
  4197. Object.defineProperty(obj, key, {
  4198. enumerable: true,
  4199. configurable: true,
  4200. get: function reactiveGetter () {
  4201. var value = getter ? getter.call(obj) : val;
  4202. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4203. dep.depend();
  4204. if (childOb) {
  4205. childOb.dep.depend();
  4206. if (Array.isArray(value)) {
  4207. dependArray(value);
  4208. }
  4209. }
  4210. }
  4211. return value
  4212. },
  4213. set: function reactiveSetter (newVal) {
  4214. var value = getter ? getter.call(obj) : val;
  4215. /* eslint-disable no-self-compare */
  4216. if (newVal === value || (newVal !== newVal && value !== value)) {
  4217. return
  4218. }
  4219. /* eslint-enable no-self-compare */
  4220. if ( true && customSetter) {
  4221. customSetter();
  4222. }
  4223. // #7981: for accessor properties without setter
  4224. if (getter && !setter) { return }
  4225. if (setter) {
  4226. setter.call(obj, newVal);
  4227. } else {
  4228. val = newVal;
  4229. }
  4230. childOb = !shallow && observe(newVal);
  4231. dep.notify();
  4232. }
  4233. });
  4234. }
  4235. /**
  4236. * Set a property on an object. Adds the new property and
  4237. * triggers change notification if the property doesn't
  4238. * already exist.
  4239. */
  4240. function set (target, key, val) {
  4241. if ( true &&
  4242. (isUndef(target) || isPrimitive(target))
  4243. ) {
  4244. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4245. }
  4246. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4247. target.length = Math.max(target.length, key);
  4248. target.splice(key, 1, val);
  4249. return val
  4250. }
  4251. if (key in target && !(key in Object.prototype)) {
  4252. target[key] = val;
  4253. return val
  4254. }
  4255. var ob = (target).__ob__;
  4256. if (target._isVue || (ob && ob.vmCount)) {
  4257. true && warn(
  4258. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4259. 'at runtime - declare it upfront in the data option.'
  4260. );
  4261. return val
  4262. }
  4263. if (!ob) {
  4264. target[key] = val;
  4265. return val
  4266. }
  4267. defineReactive$$1(ob.value, key, val);
  4268. ob.dep.notify();
  4269. return val
  4270. }
  4271. /**
  4272. * Delete a property and trigger change if necessary.
  4273. */
  4274. function del (target, key) {
  4275. if ( true &&
  4276. (isUndef(target) || isPrimitive(target))
  4277. ) {
  4278. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4279. }
  4280. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4281. target.splice(key, 1);
  4282. return
  4283. }
  4284. var ob = (target).__ob__;
  4285. if (target._isVue || (ob && ob.vmCount)) {
  4286. true && warn(
  4287. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4288. '- just set it to null.'
  4289. );
  4290. return
  4291. }
  4292. if (!hasOwn(target, key)) {
  4293. return
  4294. }
  4295. delete target[key];
  4296. if (!ob) {
  4297. return
  4298. }
  4299. ob.dep.notify();
  4300. }
  4301. /**
  4302. * Collect dependencies on array elements when the array is touched, since
  4303. * we cannot intercept array element access like property getters.
  4304. */
  4305. function dependArray (value) {
  4306. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4307. e = value[i];
  4308. e && e.__ob__ && e.__ob__.dep.depend();
  4309. if (Array.isArray(e)) {
  4310. dependArray(e);
  4311. }
  4312. }
  4313. }
  4314. /* */
  4315. /**
  4316. * Option overwriting strategies are functions that handle
  4317. * how to merge a parent option value and a child option
  4318. * value into the final value.
  4319. */
  4320. var strats = config.optionMergeStrategies;
  4321. /**
  4322. * Options with restrictions
  4323. */
  4324. if (true) {
  4325. strats.el = strats.propsData = function (parent, child, vm, key) {
  4326. if (!vm) {
  4327. warn(
  4328. "option \"" + key + "\" can only be used during instance " +
  4329. 'creation with the `new` keyword.'
  4330. );
  4331. }
  4332. return defaultStrat(parent, child)
  4333. };
  4334. }
  4335. /**
  4336. * Helper that recursively merges two data objects together.
  4337. */
  4338. function mergeData (to, from) {
  4339. if (!from) { return to }
  4340. var key, toVal, fromVal;
  4341. var keys = hasSymbol
  4342. ? Reflect.ownKeys(from)
  4343. : Object.keys(from);
  4344. for (var i = 0; i < keys.length; i++) {
  4345. key = keys[i];
  4346. // in case the object is already observed...
  4347. if (key === '__ob__') { continue }
  4348. toVal = to[key];
  4349. fromVal = from[key];
  4350. if (!hasOwn(to, key)) {
  4351. set(to, key, fromVal);
  4352. } else if (
  4353. toVal !== fromVal &&
  4354. isPlainObject(toVal) &&
  4355. isPlainObject(fromVal)
  4356. ) {
  4357. mergeData(toVal, fromVal);
  4358. }
  4359. }
  4360. return to
  4361. }
  4362. /**
  4363. * Data
  4364. */
  4365. function mergeDataOrFn (
  4366. parentVal,
  4367. childVal,
  4368. vm
  4369. ) {
  4370. if (!vm) {
  4371. // in a Vue.extend merge, both should be functions
  4372. if (!childVal) {
  4373. return parentVal
  4374. }
  4375. if (!parentVal) {
  4376. return childVal
  4377. }
  4378. // when parentVal & childVal are both present,
  4379. // we need to return a function that returns the
  4380. // merged result of both functions... no need to
  4381. // check if parentVal is a function here because
  4382. // it has to be a function to pass previous merges.
  4383. return function mergedDataFn () {
  4384. return mergeData(
  4385. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  4386. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  4387. )
  4388. }
  4389. } else {
  4390. return function mergedInstanceDataFn () {
  4391. // instance merge
  4392. var instanceData = typeof childVal === 'function'
  4393. ? childVal.call(vm, vm)
  4394. : childVal;
  4395. var defaultData = typeof parentVal === 'function'
  4396. ? parentVal.call(vm, vm)
  4397. : parentVal;
  4398. if (instanceData) {
  4399. return mergeData(instanceData, defaultData)
  4400. } else {
  4401. return defaultData
  4402. }
  4403. }
  4404. }
  4405. }
  4406. strats.data = function (
  4407. parentVal,
  4408. childVal,
  4409. vm
  4410. ) {
  4411. if (!vm) {
  4412. if (childVal && typeof childVal !== 'function') {
  4413. true && warn(
  4414. 'The "data" option should be a function ' +
  4415. 'that returns a per-instance value in component ' +
  4416. 'definitions.',
  4417. vm
  4418. );
  4419. return parentVal
  4420. }
  4421. return mergeDataOrFn(parentVal, childVal)
  4422. }
  4423. return mergeDataOrFn(parentVal, childVal, vm)
  4424. };
  4425. /**
  4426. * Hooks and props are merged as arrays.
  4427. */
  4428. function mergeHook (
  4429. parentVal,
  4430. childVal
  4431. ) {
  4432. var res = childVal
  4433. ? parentVal
  4434. ? parentVal.concat(childVal)
  4435. : Array.isArray(childVal)
  4436. ? childVal
  4437. : [childVal]
  4438. : parentVal;
  4439. return res
  4440. ? dedupeHooks(res)
  4441. : res
  4442. }
  4443. function dedupeHooks (hooks) {
  4444. var res = [];
  4445. for (var i = 0; i < hooks.length; i++) {
  4446. if (res.indexOf(hooks[i]) === -1) {
  4447. res.push(hooks[i]);
  4448. }
  4449. }
  4450. return res
  4451. }
  4452. LIFECYCLE_HOOKS.forEach(function (hook) {
  4453. strats[hook] = mergeHook;
  4454. });
  4455. /**
  4456. * Assets
  4457. *
  4458. * When a vm is present (instance creation), we need to do
  4459. * a three-way merge between constructor options, instance
  4460. * options and parent options.
  4461. */
  4462. function mergeAssets (
  4463. parentVal,
  4464. childVal,
  4465. vm,
  4466. key
  4467. ) {
  4468. var res = Object.create(parentVal || null);
  4469. if (childVal) {
  4470. true && assertObjectType(key, childVal, vm);
  4471. return extend(res, childVal)
  4472. } else {
  4473. return res
  4474. }
  4475. }
  4476. ASSET_TYPES.forEach(function (type) {
  4477. strats[type + 's'] = mergeAssets;
  4478. });
  4479. /**
  4480. * Watchers.
  4481. *
  4482. * Watchers hashes should not overwrite one
  4483. * another, so we merge them as arrays.
  4484. */
  4485. strats.watch = function (
  4486. parentVal,
  4487. childVal,
  4488. vm,
  4489. key
  4490. ) {
  4491. // work around Firefox's Object.prototype.watch...
  4492. if (parentVal === nativeWatch) { parentVal = undefined; }
  4493. if (childVal === nativeWatch) { childVal = undefined; }
  4494. /* istanbul ignore if */
  4495. if (!childVal) { return Object.create(parentVal || null) }
  4496. if (true) {
  4497. assertObjectType(key, childVal, vm);
  4498. }
  4499. if (!parentVal) { return childVal }
  4500. var ret = {};
  4501. extend(ret, parentVal);
  4502. for (var key$1 in childVal) {
  4503. var parent = ret[key$1];
  4504. var child = childVal[key$1];
  4505. if (parent && !Array.isArray(parent)) {
  4506. parent = [parent];
  4507. }
  4508. ret[key$1] = parent
  4509. ? parent.concat(child)
  4510. : Array.isArray(child) ? child : [child];
  4511. }
  4512. return ret
  4513. };
  4514. /**
  4515. * Other object hashes.
  4516. */
  4517. strats.props =
  4518. strats.methods =
  4519. strats.inject =
  4520. strats.computed = function (
  4521. parentVal,
  4522. childVal,
  4523. vm,
  4524. key
  4525. ) {
  4526. if (childVal && "development" !== 'production') {
  4527. assertObjectType(key, childVal, vm);
  4528. }
  4529. if (!parentVal) { return childVal }
  4530. var ret = Object.create(null);
  4531. extend(ret, parentVal);
  4532. if (childVal) { extend(ret, childVal); }
  4533. return ret
  4534. };
  4535. strats.provide = mergeDataOrFn;
  4536. /**
  4537. * Default strategy.
  4538. */
  4539. var defaultStrat = function (parentVal, childVal) {
  4540. return childVal === undefined
  4541. ? parentVal
  4542. : childVal
  4543. };
  4544. /**
  4545. * Validate component names
  4546. */
  4547. function checkComponents (options) {
  4548. for (var key in options.components) {
  4549. validateComponentName(key);
  4550. }
  4551. }
  4552. function validateComponentName (name) {
  4553. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4554. warn(
  4555. 'Invalid component name: "' + name + '". Component names ' +
  4556. 'should conform to valid custom element name in html5 specification.'
  4557. );
  4558. }
  4559. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4560. warn(
  4561. 'Do not use built-in or reserved HTML elements as component ' +
  4562. 'id: ' + name
  4563. );
  4564. }
  4565. }
  4566. /**
  4567. * Ensure all props option syntax are normalized into the
  4568. * Object-based format.
  4569. */
  4570. function normalizeProps (options, vm) {
  4571. var props = options.props;
  4572. if (!props) { return }
  4573. var res = {};
  4574. var i, val, name;
  4575. if (Array.isArray(props)) {
  4576. i = props.length;
  4577. while (i--) {
  4578. val = props[i];
  4579. if (typeof val === 'string') {
  4580. name = camelize(val);
  4581. res[name] = { type: null };
  4582. } else if (true) {
  4583. warn('props must be strings when using array syntax.');
  4584. }
  4585. }
  4586. } else if (isPlainObject(props)) {
  4587. for (var key in props) {
  4588. val = props[key];
  4589. name = camelize(key);
  4590. res[name] = isPlainObject(val)
  4591. ? val
  4592. : { type: val };
  4593. }
  4594. } else if (true) {
  4595. warn(
  4596. "Invalid value for option \"props\": expected an Array or an Object, " +
  4597. "but got " + (toRawType(props)) + ".",
  4598. vm
  4599. );
  4600. }
  4601. options.props = res;
  4602. }
  4603. /**
  4604. * Normalize all injections into Object-based format
  4605. */
  4606. function normalizeInject (options, vm) {
  4607. var inject = options.inject;
  4608. if (!inject) { return }
  4609. var normalized = options.inject = {};
  4610. if (Array.isArray(inject)) {
  4611. for (var i = 0; i < inject.length; i++) {
  4612. normalized[inject[i]] = { from: inject[i] };
  4613. }
  4614. } else if (isPlainObject(inject)) {
  4615. for (var key in inject) {
  4616. var val = inject[key];
  4617. normalized[key] = isPlainObject(val)
  4618. ? extend({ from: key }, val)
  4619. : { from: val };
  4620. }
  4621. } else if (true) {
  4622. warn(
  4623. "Invalid value for option \"inject\": expected an Array or an Object, " +
  4624. "but got " + (toRawType(inject)) + ".",
  4625. vm
  4626. );
  4627. }
  4628. }
  4629. /**
  4630. * Normalize raw function directives into object format.
  4631. */
  4632. function normalizeDirectives (options) {
  4633. var dirs = options.directives;
  4634. if (dirs) {
  4635. for (var key in dirs) {
  4636. var def$$1 = dirs[key];
  4637. if (typeof def$$1 === 'function') {
  4638. dirs[key] = { bind: def$$1, update: def$$1 };
  4639. }
  4640. }
  4641. }
  4642. }
  4643. function assertObjectType (name, value, vm) {
  4644. if (!isPlainObject(value)) {
  4645. warn(
  4646. "Invalid value for option \"" + name + "\": expected an Object, " +
  4647. "but got " + (toRawType(value)) + ".",
  4648. vm
  4649. );
  4650. }
  4651. }
  4652. /**
  4653. * Merge two option objects into a new one.
  4654. * Core utility used in both instantiation and inheritance.
  4655. */
  4656. function mergeOptions (
  4657. parent,
  4658. child,
  4659. vm
  4660. ) {
  4661. if (true) {
  4662. checkComponents(child);
  4663. }
  4664. if (typeof child === 'function') {
  4665. child = child.options;
  4666. }
  4667. normalizeProps(child, vm);
  4668. normalizeInject(child, vm);
  4669. normalizeDirectives(child);
  4670. // Apply extends and mixins on the child options,
  4671. // but only if it is a raw options object that isn't
  4672. // the result of another mergeOptions call.
  4673. // Only merged options has the _base property.
  4674. if (!child._base) {
  4675. if (child.extends) {
  4676. parent = mergeOptions(parent, child.extends, vm);
  4677. }
  4678. if (child.mixins) {
  4679. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4680. parent = mergeOptions(parent, child.mixins[i], vm);
  4681. }
  4682. }
  4683. }
  4684. var options = {};
  4685. var key;
  4686. for (key in parent) {
  4687. mergeField(key);
  4688. }
  4689. for (key in child) {
  4690. if (!hasOwn(parent, key)) {
  4691. mergeField(key);
  4692. }
  4693. }
  4694. function mergeField (key) {
  4695. var strat = strats[key] || defaultStrat;
  4696. options[key] = strat(parent[key], child[key], vm, key);
  4697. }
  4698. return options
  4699. }
  4700. /**
  4701. * Resolve an asset.
  4702. * This function is used because child instances need access
  4703. * to assets defined in its ancestor chain.
  4704. */
  4705. function resolveAsset (
  4706. options,
  4707. type,
  4708. id,
  4709. warnMissing
  4710. ) {
  4711. /* istanbul ignore if */
  4712. if (typeof id !== 'string') {
  4713. return
  4714. }
  4715. var assets = options[type];
  4716. // check local registration variations first
  4717. if (hasOwn(assets, id)) { return assets[id] }
  4718. var camelizedId = camelize(id);
  4719. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  4720. var PascalCaseId = capitalize(camelizedId);
  4721. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  4722. // fallback to prototype chain
  4723. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  4724. if ( true && warnMissing && !res) {
  4725. warn(
  4726. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  4727. options
  4728. );
  4729. }
  4730. return res
  4731. }
  4732. /* */
  4733. function validateProp (
  4734. key,
  4735. propOptions,
  4736. propsData,
  4737. vm
  4738. ) {
  4739. var prop = propOptions[key];
  4740. var absent = !hasOwn(propsData, key);
  4741. var value = propsData[key];
  4742. // boolean casting
  4743. var booleanIndex = getTypeIndex(Boolean, prop.type);
  4744. if (booleanIndex > -1) {
  4745. if (absent && !hasOwn(prop, 'default')) {
  4746. value = false;
  4747. } else if (value === '' || value === hyphenate(key)) {
  4748. // only cast empty string / same name to boolean if
  4749. // boolean has higher priority
  4750. var stringIndex = getTypeIndex(String, prop.type);
  4751. if (stringIndex < 0 || booleanIndex < stringIndex) {
  4752. value = true;
  4753. }
  4754. }
  4755. }
  4756. // check default value
  4757. if (value === undefined) {
  4758. value = getPropDefaultValue(vm, prop, key);
  4759. // since the default value is a fresh copy,
  4760. // make sure to observe it.
  4761. var prevShouldObserve = shouldObserve;
  4762. toggleObserving(true);
  4763. observe(value);
  4764. toggleObserving(prevShouldObserve);
  4765. }
  4766. if (
  4767. true
  4768. ) {
  4769. assertProp(prop, key, value, vm, absent);
  4770. }
  4771. return value
  4772. }
  4773. /**
  4774. * Get the default value of a prop.
  4775. */
  4776. function getPropDefaultValue (vm, prop, key) {
  4777. // no default, return undefined
  4778. if (!hasOwn(prop, 'default')) {
  4779. return undefined
  4780. }
  4781. var def = prop.default;
  4782. // warn against non-factory defaults for Object & Array
  4783. if ( true && isObject(def)) {
  4784. warn(
  4785. 'Invalid default value for prop "' + key + '": ' +
  4786. 'Props with type Object/Array must use a factory function ' +
  4787. 'to return the default value.',
  4788. vm
  4789. );
  4790. }
  4791. // the raw prop value was also undefined from previous render,
  4792. // return previous default value to avoid unnecessary watcher trigger
  4793. if (vm && vm.$options.propsData &&
  4794. vm.$options.propsData[key] === undefined &&
  4795. vm._props[key] !== undefined
  4796. ) {
  4797. return vm._props[key]
  4798. }
  4799. // call factory function for non-Function types
  4800. // a value is Function if its prototype is function even across different execution context
  4801. return typeof def === 'function' && getType(prop.type) !== 'Function'
  4802. ? def.call(vm)
  4803. : def
  4804. }
  4805. /**
  4806. * Assert whether a prop is valid.
  4807. */
  4808. function assertProp (
  4809. prop,
  4810. name,
  4811. value,
  4812. vm,
  4813. absent
  4814. ) {
  4815. if (prop.required && absent) {
  4816. warn(
  4817. 'Missing required prop: "' + name + '"',
  4818. vm
  4819. );
  4820. return
  4821. }
  4822. if (value == null && !prop.required) {
  4823. return
  4824. }
  4825. var type = prop.type;
  4826. var valid = !type || type === true;
  4827. var expectedTypes = [];
  4828. if (type) {
  4829. if (!Array.isArray(type)) {
  4830. type = [type];
  4831. }
  4832. for (var i = 0; i < type.length && !valid; i++) {
  4833. var assertedType = assertType(value, type[i]);
  4834. expectedTypes.push(assertedType.expectedType || '');
  4835. valid = assertedType.valid;
  4836. }
  4837. }
  4838. if (!valid) {
  4839. warn(
  4840. getInvalidTypeMessage(name, value, expectedTypes),
  4841. vm
  4842. );
  4843. return
  4844. }
  4845. var validator = prop.validator;
  4846. if (validator) {
  4847. if (!validator(value)) {
  4848. warn(
  4849. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  4850. vm
  4851. );
  4852. }
  4853. }
  4854. }
  4855. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  4856. function assertType (value, type) {
  4857. var valid;
  4858. var expectedType = getType(type);
  4859. if (simpleCheckRE.test(expectedType)) {
  4860. var t = typeof value;
  4861. valid = t === expectedType.toLowerCase();
  4862. // for primitive wrapper objects
  4863. if (!valid && t === 'object') {
  4864. valid = value instanceof type;
  4865. }
  4866. } else if (expectedType === 'Object') {
  4867. valid = isPlainObject(value);
  4868. } else if (expectedType === 'Array') {
  4869. valid = Array.isArray(value);
  4870. } else {
  4871. valid = value instanceof type;
  4872. }
  4873. return {
  4874. valid: valid,
  4875. expectedType: expectedType
  4876. }
  4877. }
  4878. /**
  4879. * Use function string name to check built-in types,
  4880. * because a simple equality check will fail when running
  4881. * across different vms / iframes.
  4882. */
  4883. function getType (fn) {
  4884. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  4885. return match ? match[1] : ''
  4886. }
  4887. function isSameType (a, b) {
  4888. return getType(a) === getType(b)
  4889. }
  4890. function getTypeIndex (type, expectedTypes) {
  4891. if (!Array.isArray(expectedTypes)) {
  4892. return isSameType(expectedTypes, type) ? 0 : -1
  4893. }
  4894. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  4895. if (isSameType(expectedTypes[i], type)) {
  4896. return i
  4897. }
  4898. }
  4899. return -1
  4900. }
  4901. function getInvalidTypeMessage (name, value, expectedTypes) {
  4902. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  4903. " Expected " + (expectedTypes.map(capitalize).join(', '));
  4904. var expectedType = expectedTypes[0];
  4905. var receivedType = toRawType(value);
  4906. var expectedValue = styleValue(value, expectedType);
  4907. var receivedValue = styleValue(value, receivedType);
  4908. // check if we need to specify expected value
  4909. if (expectedTypes.length === 1 &&
  4910. isExplicable(expectedType) &&
  4911. !isBoolean(expectedType, receivedType)) {
  4912. message += " with value " + expectedValue;
  4913. }
  4914. message += ", got " + receivedType + " ";
  4915. // check if we need to specify received value
  4916. if (isExplicable(receivedType)) {
  4917. message += "with value " + receivedValue + ".";
  4918. }
  4919. return message
  4920. }
  4921. function styleValue (value, type) {
  4922. if (type === 'String') {
  4923. return ("\"" + value + "\"")
  4924. } else if (type === 'Number') {
  4925. return ("" + (Number(value)))
  4926. } else {
  4927. return ("" + value)
  4928. }
  4929. }
  4930. function isExplicable (value) {
  4931. var explicitTypes = ['string', 'number', 'boolean'];
  4932. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  4933. }
  4934. function isBoolean () {
  4935. var args = [], len = arguments.length;
  4936. while ( len-- ) args[ len ] = arguments[ len ];
  4937. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  4938. }
  4939. /* */
  4940. function handleError (err, vm, info) {
  4941. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  4942. // See: https://github.com/vuejs/vuex/issues/1505
  4943. pushTarget();
  4944. try {
  4945. if (vm) {
  4946. var cur = vm;
  4947. while ((cur = cur.$parent)) {
  4948. var hooks = cur.$options.errorCaptured;
  4949. if (hooks) {
  4950. for (var i = 0; i < hooks.length; i++) {
  4951. try {
  4952. var capture = hooks[i].call(cur, err, vm, info) === false;
  4953. if (capture) { return }
  4954. } catch (e) {
  4955. globalHandleError(e, cur, 'errorCaptured hook');
  4956. }
  4957. }
  4958. }
  4959. }
  4960. }
  4961. globalHandleError(err, vm, info);
  4962. } finally {
  4963. popTarget();
  4964. }
  4965. }
  4966. function invokeWithErrorHandling (
  4967. handler,
  4968. context,
  4969. args,
  4970. vm,
  4971. info
  4972. ) {
  4973. var res;
  4974. try {
  4975. res = args ? handler.apply(context, args) : handler.call(context);
  4976. if (res && !res._isVue && isPromise(res) && !res._handled) {
  4977. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  4978. // issue #9511
  4979. // avoid catch triggering multiple times when nested calls
  4980. res._handled = true;
  4981. }
  4982. } catch (e) {
  4983. handleError(e, vm, info);
  4984. }
  4985. return res
  4986. }
  4987. function globalHandleError (err, vm, info) {
  4988. if (config.errorHandler) {
  4989. try {
  4990. return config.errorHandler.call(null, err, vm, info)
  4991. } catch (e) {
  4992. // if the user intentionally throws the original error in the handler,
  4993. // do not log it twice
  4994. if (e !== err) {
  4995. logError(e, null, 'config.errorHandler');
  4996. }
  4997. }
  4998. }
  4999. logError(err, vm, info);
  5000. }
  5001. function logError (err, vm, info) {
  5002. if (true) {
  5003. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5004. }
  5005. /* istanbul ignore else */
  5006. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5007. console.error(err);
  5008. } else {
  5009. throw err
  5010. }
  5011. }
  5012. /* */
  5013. var callbacks = [];
  5014. var pending = false;
  5015. function flushCallbacks () {
  5016. pending = false;
  5017. var copies = callbacks.slice(0);
  5018. callbacks.length = 0;
  5019. for (var i = 0; i < copies.length; i++) {
  5020. copies[i]();
  5021. }
  5022. }
  5023. // Here we have async deferring wrappers using microtasks.
  5024. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5025. // However, it has subtle problems when state is changed right before repaint
  5026. // (e.g. #6813, out-in transitions).
  5027. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5028. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5029. // So we now use microtasks everywhere, again.
  5030. // A major drawback of this tradeoff is that there are some scenarios
  5031. // where microtasks have too high a priority and fire in between supposedly
  5032. // sequential events (e.g. #4521, #6690, which have workarounds)
  5033. // or even between bubbling of the same event (#6566).
  5034. var timerFunc;
  5035. // The nextTick behavior leverages the microtask queue, which can be accessed
  5036. // via either native Promise.then or MutationObserver.
  5037. // MutationObserver has wider support, however it is seriously bugged in
  5038. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5039. // completely stops working after triggering a few times... so, if native
  5040. // Promise is available, we will use it:
  5041. /* istanbul ignore next, $flow-disable-line */
  5042. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5043. var p = Promise.resolve();
  5044. timerFunc = function () {
  5045. p.then(flushCallbacks);
  5046. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5047. // it can get stuck in a weird state where callbacks are pushed into the
  5048. // microtask queue but the queue isn't being flushed, until the browser
  5049. // needs to do some other work, e.g. handle a timer. Therefore we can
  5050. // "force" the microtask queue to be flushed by adding an empty timer.
  5051. if (isIOS) { setTimeout(noop); }
  5052. };
  5053. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5054. isNative(MutationObserver) ||
  5055. // PhantomJS and iOS 7.x
  5056. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5057. )) {
  5058. // Use MutationObserver where native Promise is not available,
  5059. // e.g. PhantomJS, iOS7, Android 4.4
  5060. // (#6466 MutationObserver is unreliable in IE11)
  5061. var counter = 1;
  5062. var observer = new MutationObserver(flushCallbacks);
  5063. var textNode = document.createTextNode(String(counter));
  5064. observer.observe(textNode, {
  5065. characterData: true
  5066. });
  5067. timerFunc = function () {
  5068. counter = (counter + 1) % 2;
  5069. textNode.data = String(counter);
  5070. };
  5071. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5072. // Fallback to setImmediate.
  5073. // Technically it leverages the (macro) task queue,
  5074. // but it is still a better choice than setTimeout.
  5075. timerFunc = function () {
  5076. setImmediate(flushCallbacks);
  5077. };
  5078. } else {
  5079. // Fallback to setTimeout.
  5080. timerFunc = function () {
  5081. setTimeout(flushCallbacks, 0);
  5082. };
  5083. }
  5084. function nextTick (cb, ctx) {
  5085. var _resolve;
  5086. callbacks.push(function () {
  5087. if (cb) {
  5088. try {
  5089. cb.call(ctx);
  5090. } catch (e) {
  5091. handleError(e, ctx, 'nextTick');
  5092. }
  5093. } else if (_resolve) {
  5094. _resolve(ctx);
  5095. }
  5096. });
  5097. if (!pending) {
  5098. pending = true;
  5099. timerFunc();
  5100. }
  5101. // $flow-disable-line
  5102. if (!cb && typeof Promise !== 'undefined') {
  5103. return new Promise(function (resolve) {
  5104. _resolve = resolve;
  5105. })
  5106. }
  5107. }
  5108. /* */
  5109. /* not type checking this file because flow doesn't play well with Proxy */
  5110. var initProxy;
  5111. if (true) {
  5112. var allowedGlobals = makeMap(
  5113. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5114. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5115. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5116. 'require' // for Webpack/Browserify
  5117. );
  5118. var warnNonPresent = function (target, key) {
  5119. warn(
  5120. "Property or method \"" + key + "\" is not defined on the instance but " +
  5121. 'referenced during render. Make sure that this property is reactive, ' +
  5122. 'either in the data option, or for class-based components, by ' +
  5123. 'initializing the property. ' +
  5124. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5125. target
  5126. );
  5127. };
  5128. var warnReservedPrefix = function (target, key) {
  5129. warn(
  5130. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5131. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5132. 'prevent conflicts with Vue internals. ' +
  5133. 'See: https://vuejs.org/v2/api/#data',
  5134. target
  5135. );
  5136. };
  5137. var hasProxy =
  5138. typeof Proxy !== 'undefined' && isNative(Proxy);
  5139. if (hasProxy) {
  5140. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5141. config.keyCodes = new Proxy(config.keyCodes, {
  5142. set: function set (target, key, value) {
  5143. if (isBuiltInModifier(key)) {
  5144. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5145. return false
  5146. } else {
  5147. target[key] = value;
  5148. return true
  5149. }
  5150. }
  5151. });
  5152. }
  5153. var hasHandler = {
  5154. has: function has (target, key) {
  5155. var has = key in target;
  5156. var isAllowed = allowedGlobals(key) ||
  5157. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5158. if (!has && !isAllowed) {
  5159. if (key in target.$data) { warnReservedPrefix(target, key); }
  5160. else { warnNonPresent(target, key); }
  5161. }
  5162. return has || !isAllowed
  5163. }
  5164. };
  5165. var getHandler = {
  5166. get: function get (target, key) {
  5167. if (typeof key === 'string' && !(key in target)) {
  5168. if (key in target.$data) { warnReservedPrefix(target, key); }
  5169. else { warnNonPresent(target, key); }
  5170. }
  5171. return target[key]
  5172. }
  5173. };
  5174. initProxy = function initProxy (vm) {
  5175. if (hasProxy) {
  5176. // determine which proxy handler to use
  5177. var options = vm.$options;
  5178. var handlers = options.render && options.render._withStripped
  5179. ? getHandler
  5180. : hasHandler;
  5181. vm._renderProxy = new Proxy(vm, handlers);
  5182. } else {
  5183. vm._renderProxy = vm;
  5184. }
  5185. };
  5186. }
  5187. /* */
  5188. var seenObjects = new _Set();
  5189. /**
  5190. * Recursively traverse an object to evoke all converted
  5191. * getters, so that every nested property inside the object
  5192. * is collected as a "deep" dependency.
  5193. */
  5194. function traverse (val) {
  5195. _traverse(val, seenObjects);
  5196. seenObjects.clear();
  5197. }
  5198. function _traverse (val, seen) {
  5199. var i, keys;
  5200. var isA = Array.isArray(val);
  5201. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5202. return
  5203. }
  5204. if (val.__ob__) {
  5205. var depId = val.__ob__.dep.id;
  5206. if (seen.has(depId)) {
  5207. return
  5208. }
  5209. seen.add(depId);
  5210. }
  5211. if (isA) {
  5212. i = val.length;
  5213. while (i--) { _traverse(val[i], seen); }
  5214. } else {
  5215. keys = Object.keys(val);
  5216. i = keys.length;
  5217. while (i--) { _traverse(val[keys[i]], seen); }
  5218. }
  5219. }
  5220. var mark;
  5221. var measure;
  5222. if (true) {
  5223. var perf = inBrowser && window.performance;
  5224. /* istanbul ignore if */
  5225. if (
  5226. perf &&
  5227. perf.mark &&
  5228. perf.measure &&
  5229. perf.clearMarks &&
  5230. perf.clearMeasures
  5231. ) {
  5232. mark = function (tag) { return perf.mark(tag); };
  5233. measure = function (name, startTag, endTag) {
  5234. perf.measure(name, startTag, endTag);
  5235. perf.clearMarks(startTag);
  5236. perf.clearMarks(endTag);
  5237. // perf.clearMeasures(name)
  5238. };
  5239. }
  5240. }
  5241. /* */
  5242. var normalizeEvent = cached(function (name) {
  5243. var passive = name.charAt(0) === '&';
  5244. name = passive ? name.slice(1) : name;
  5245. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5246. name = once$$1 ? name.slice(1) : name;
  5247. var capture = name.charAt(0) === '!';
  5248. name = capture ? name.slice(1) : name;
  5249. return {
  5250. name: name,
  5251. once: once$$1,
  5252. capture: capture,
  5253. passive: passive
  5254. }
  5255. });
  5256. function createFnInvoker (fns, vm) {
  5257. function invoker () {
  5258. var arguments$1 = arguments;
  5259. var fns = invoker.fns;
  5260. if (Array.isArray(fns)) {
  5261. var cloned = fns.slice();
  5262. for (var i = 0; i < cloned.length; i++) {
  5263. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5264. }
  5265. } else {
  5266. // return handler return value for single handlers
  5267. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5268. }
  5269. }
  5270. invoker.fns = fns;
  5271. return invoker
  5272. }
  5273. function updateListeners (
  5274. on,
  5275. oldOn,
  5276. add,
  5277. remove$$1,
  5278. createOnceHandler,
  5279. vm
  5280. ) {
  5281. var name, def$$1, cur, old, event;
  5282. for (name in on) {
  5283. def$$1 = cur = on[name];
  5284. old = oldOn[name];
  5285. event = normalizeEvent(name);
  5286. if (isUndef(cur)) {
  5287. true && warn(
  5288. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5289. vm
  5290. );
  5291. } else if (isUndef(old)) {
  5292. if (isUndef(cur.fns)) {
  5293. cur = on[name] = createFnInvoker(cur, vm);
  5294. }
  5295. if (isTrue(event.once)) {
  5296. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5297. }
  5298. add(event.name, cur, event.capture, event.passive, event.params);
  5299. } else if (cur !== old) {
  5300. old.fns = cur;
  5301. on[name] = old;
  5302. }
  5303. }
  5304. for (name in oldOn) {
  5305. if (isUndef(on[name])) {
  5306. event = normalizeEvent(name);
  5307. remove$$1(event.name, oldOn[name], event.capture);
  5308. }
  5309. }
  5310. }
  5311. /* */
  5312. /* */
  5313. // fixed by xxxxxx (mp properties)
  5314. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5315. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5316. if (isUndef(propOptions)) {
  5317. return res
  5318. }
  5319. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5320. var attrs = data.attrs;
  5321. var props = data.props;
  5322. if (isDef(attrs) || isDef(props)) {
  5323. for (var key in propOptions) {
  5324. var altKey = hyphenate(key);
  5325. var result = checkProp(res, props, key, altKey, true) ||
  5326. checkProp(res, attrs, key, altKey, false);
  5327. // externalClass
  5328. if (
  5329. result &&
  5330. res[key] &&
  5331. externalClasses.indexOf(altKey) !== -1 &&
  5332. context[camelize(res[key])]
  5333. ) {
  5334. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5335. res[key] = context[camelize(res[key])];
  5336. }
  5337. }
  5338. }
  5339. return res
  5340. }
  5341. function extractPropsFromVNodeData (
  5342. data,
  5343. Ctor,
  5344. tag,
  5345. context// fixed by xxxxxx
  5346. ) {
  5347. // we are only extracting raw values here.
  5348. // validation and default values are handled in the child
  5349. // component itself.
  5350. var propOptions = Ctor.options.props;
  5351. if (isUndef(propOptions)) {
  5352. // fixed by xxxxxx
  5353. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5354. }
  5355. var res = {};
  5356. var attrs = data.attrs;
  5357. var props = data.props;
  5358. if (isDef(attrs) || isDef(props)) {
  5359. for (var key in propOptions) {
  5360. var altKey = hyphenate(key);
  5361. if (true) {
  5362. var keyInLowerCase = key.toLowerCase();
  5363. if (
  5364. key !== keyInLowerCase &&
  5365. attrs && hasOwn(attrs, keyInLowerCase)
  5366. ) {
  5367. tip(
  5368. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5369. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5370. " \"" + key + "\". " +
  5371. "Note that HTML attributes are case-insensitive and camelCased " +
  5372. "props need to use their kebab-case equivalents when using in-DOM " +
  5373. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5374. );
  5375. }
  5376. }
  5377. checkProp(res, props, key, altKey, true) ||
  5378. checkProp(res, attrs, key, altKey, false);
  5379. }
  5380. }
  5381. // fixed by xxxxxx
  5382. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  5383. }
  5384. function checkProp (
  5385. res,
  5386. hash,
  5387. key,
  5388. altKey,
  5389. preserve
  5390. ) {
  5391. if (isDef(hash)) {
  5392. if (hasOwn(hash, key)) {
  5393. res[key] = hash[key];
  5394. if (!preserve) {
  5395. delete hash[key];
  5396. }
  5397. return true
  5398. } else if (hasOwn(hash, altKey)) {
  5399. res[key] = hash[altKey];
  5400. if (!preserve) {
  5401. delete hash[altKey];
  5402. }
  5403. return true
  5404. }
  5405. }
  5406. return false
  5407. }
  5408. /* */
  5409. // The template compiler attempts to minimize the need for normalization by
  5410. // statically analyzing the template at compile time.
  5411. //
  5412. // For plain HTML markup, normalization can be completely skipped because the
  5413. // generated render function is guaranteed to return Array<VNode>. There are
  5414. // two cases where extra normalization is needed:
  5415. // 1. When the children contains components - because a functional component
  5416. // may return an Array instead of a single root. In this case, just a simple
  5417. // normalization is needed - if any child is an Array, we flatten the whole
  5418. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  5419. // because functional components already normalize their own children.
  5420. function simpleNormalizeChildren (children) {
  5421. for (var i = 0; i < children.length; i++) {
  5422. if (Array.isArray(children[i])) {
  5423. return Array.prototype.concat.apply([], children)
  5424. }
  5425. }
  5426. return children
  5427. }
  5428. // 2. When the children contains constructs that always generated nested Arrays,
  5429. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  5430. // with hand-written render functions / JSX. In such cases a full normalization
  5431. // is needed to cater to all possible types of children values.
  5432. function normalizeChildren (children) {
  5433. return isPrimitive(children)
  5434. ? [createTextVNode(children)]
  5435. : Array.isArray(children)
  5436. ? normalizeArrayChildren(children)
  5437. : undefined
  5438. }
  5439. function isTextNode (node) {
  5440. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  5441. }
  5442. function normalizeArrayChildren (children, nestedIndex) {
  5443. var res = [];
  5444. var i, c, lastIndex, last;
  5445. for (i = 0; i < children.length; i++) {
  5446. c = children[i];
  5447. if (isUndef(c) || typeof c === 'boolean') { continue }
  5448. lastIndex = res.length - 1;
  5449. last = res[lastIndex];
  5450. // nested
  5451. if (Array.isArray(c)) {
  5452. if (c.length > 0) {
  5453. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  5454. // merge adjacent text nodes
  5455. if (isTextNode(c[0]) && isTextNode(last)) {
  5456. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5457. c.shift();
  5458. }
  5459. res.push.apply(res, c);
  5460. }
  5461. } else if (isPrimitive(c)) {
  5462. if (isTextNode(last)) {
  5463. // merge adjacent text nodes
  5464. // this is necessary for SSR hydration because text nodes are
  5465. // essentially merged when rendered to HTML strings
  5466. res[lastIndex] = createTextVNode(last.text + c);
  5467. } else if (c !== '') {
  5468. // convert primitive to vnode
  5469. res.push(createTextVNode(c));
  5470. }
  5471. } else {
  5472. if (isTextNode(c) && isTextNode(last)) {
  5473. // merge adjacent text nodes
  5474. res[lastIndex] = createTextVNode(last.text + c.text);
  5475. } else {
  5476. // default key for nested array children (likely generated by v-for)
  5477. if (isTrue(children._isVList) &&
  5478. isDef(c.tag) &&
  5479. isUndef(c.key) &&
  5480. isDef(nestedIndex)) {
  5481. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5482. }
  5483. res.push(c);
  5484. }
  5485. }
  5486. }
  5487. return res
  5488. }
  5489. /* */
  5490. function initProvide (vm) {
  5491. var provide = vm.$options.provide;
  5492. if (provide) {
  5493. vm._provided = typeof provide === 'function'
  5494. ? provide.call(vm)
  5495. : provide;
  5496. }
  5497. }
  5498. function initInjections (vm) {
  5499. var result = resolveInject(vm.$options.inject, vm);
  5500. if (result) {
  5501. toggleObserving(false);
  5502. Object.keys(result).forEach(function (key) {
  5503. /* istanbul ignore else */
  5504. if (true) {
  5505. defineReactive$$1(vm, key, result[key], function () {
  5506. warn(
  5507. "Avoid mutating an injected value directly since the changes will be " +
  5508. "overwritten whenever the provided component re-renders. " +
  5509. "injection being mutated: \"" + key + "\"",
  5510. vm
  5511. );
  5512. });
  5513. } else {}
  5514. });
  5515. toggleObserving(true);
  5516. }
  5517. }
  5518. function resolveInject (inject, vm) {
  5519. if (inject) {
  5520. // inject is :any because flow is not smart enough to figure out cached
  5521. var result = Object.create(null);
  5522. var keys = hasSymbol
  5523. ? Reflect.ownKeys(inject)
  5524. : Object.keys(inject);
  5525. for (var i = 0; i < keys.length; i++) {
  5526. var key = keys[i];
  5527. // #6574 in case the inject object is observed...
  5528. if (key === '__ob__') { continue }
  5529. var provideKey = inject[key].from;
  5530. var source = vm;
  5531. while (source) {
  5532. if (source._provided && hasOwn(source._provided, provideKey)) {
  5533. result[key] = source._provided[provideKey];
  5534. break
  5535. }
  5536. source = source.$parent;
  5537. }
  5538. if (!source) {
  5539. if ('default' in inject[key]) {
  5540. var provideDefault = inject[key].default;
  5541. result[key] = typeof provideDefault === 'function'
  5542. ? provideDefault.call(vm)
  5543. : provideDefault;
  5544. } else if (true) {
  5545. warn(("Injection \"" + key + "\" not found"), vm);
  5546. }
  5547. }
  5548. }
  5549. return result
  5550. }
  5551. }
  5552. /* */
  5553. /**
  5554. * Runtime helper for resolving raw children VNodes into a slot object.
  5555. */
  5556. function resolveSlots (
  5557. children,
  5558. context
  5559. ) {
  5560. if (!children || !children.length) {
  5561. return {}
  5562. }
  5563. var slots = {};
  5564. for (var i = 0, l = children.length; i < l; i++) {
  5565. var child = children[i];
  5566. var data = child.data;
  5567. // remove slot attribute if the node is resolved as a Vue slot node
  5568. if (data && data.attrs && data.attrs.slot) {
  5569. delete data.attrs.slot;
  5570. }
  5571. // named slots should only be respected if the vnode was rendered in the
  5572. // same context.
  5573. if ((child.context === context || child.fnContext === context) &&
  5574. data && data.slot != null
  5575. ) {
  5576. var name = data.slot;
  5577. var slot = (slots[name] || (slots[name] = []));
  5578. if (child.tag === 'template') {
  5579. slot.push.apply(slot, child.children || []);
  5580. } else {
  5581. slot.push(child);
  5582. }
  5583. } else {
  5584. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  5585. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  5586. (slots['page'] || (slots['page'] = [])).push(child);
  5587. }else{
  5588. (slots.default || (slots.default = [])).push(child);
  5589. }
  5590. }
  5591. }
  5592. // ignore slots that contains only whitespace
  5593. for (var name$1 in slots) {
  5594. if (slots[name$1].every(isWhitespace)) {
  5595. delete slots[name$1];
  5596. }
  5597. }
  5598. return slots
  5599. }
  5600. function isWhitespace (node) {
  5601. return (node.isComment && !node.asyncFactory) || node.text === ' '
  5602. }
  5603. /* */
  5604. function normalizeScopedSlots (
  5605. slots,
  5606. normalSlots,
  5607. prevSlots
  5608. ) {
  5609. var res;
  5610. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  5611. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  5612. var key = slots && slots.$key;
  5613. if (!slots) {
  5614. res = {};
  5615. } else if (slots._normalized) {
  5616. // fast path 1: child component re-render only, parent did not change
  5617. return slots._normalized
  5618. } else if (
  5619. isStable &&
  5620. prevSlots &&
  5621. prevSlots !== emptyObject &&
  5622. key === prevSlots.$key &&
  5623. !hasNormalSlots &&
  5624. !prevSlots.$hasNormal
  5625. ) {
  5626. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  5627. // only need to normalize once
  5628. return prevSlots
  5629. } else {
  5630. res = {};
  5631. for (var key$1 in slots) {
  5632. if (slots[key$1] && key$1[0] !== '$') {
  5633. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  5634. }
  5635. }
  5636. }
  5637. // expose normal slots on scopedSlots
  5638. for (var key$2 in normalSlots) {
  5639. if (!(key$2 in res)) {
  5640. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  5641. }
  5642. }
  5643. // avoriaz seems to mock a non-extensible $scopedSlots object
  5644. // and when that is passed down this would cause an error
  5645. if (slots && Object.isExtensible(slots)) {
  5646. (slots)._normalized = res;
  5647. }
  5648. def(res, '$stable', isStable);
  5649. def(res, '$key', key);
  5650. def(res, '$hasNormal', hasNormalSlots);
  5651. return res
  5652. }
  5653. function normalizeScopedSlot(normalSlots, key, fn) {
  5654. var normalized = function () {
  5655. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  5656. res = res && typeof res === 'object' && !Array.isArray(res)
  5657. ? [res] // single vnode
  5658. : normalizeChildren(res);
  5659. return res && (
  5660. res.length === 0 ||
  5661. (res.length === 1 && res[0].isComment) // #9658
  5662. ) ? undefined
  5663. : res
  5664. };
  5665. // this is a slot using the new v-slot syntax without scope. although it is
  5666. // compiled as a scoped slot, render fn users would expect it to be present
  5667. // on this.$slots because the usage is semantically a normal slot.
  5668. if (fn.proxy) {
  5669. Object.defineProperty(normalSlots, key, {
  5670. get: normalized,
  5671. enumerable: true,
  5672. configurable: true
  5673. });
  5674. }
  5675. return normalized
  5676. }
  5677. function proxyNormalSlot(slots, key) {
  5678. return function () { return slots[key]; }
  5679. }
  5680. /* */
  5681. /**
  5682. * Runtime helper for rendering v-for lists.
  5683. */
  5684. function renderList (
  5685. val,
  5686. render
  5687. ) {
  5688. var ret, i, l, keys, key;
  5689. if (Array.isArray(val) || typeof val === 'string') {
  5690. ret = new Array(val.length);
  5691. for (i = 0, l = val.length; i < l; i++) {
  5692. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  5693. }
  5694. } else if (typeof val === 'number') {
  5695. ret = new Array(val);
  5696. for (i = 0; i < val; i++) {
  5697. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  5698. }
  5699. } else if (isObject(val)) {
  5700. if (hasSymbol && val[Symbol.iterator]) {
  5701. ret = [];
  5702. var iterator = val[Symbol.iterator]();
  5703. var result = iterator.next();
  5704. while (!result.done) {
  5705. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  5706. result = iterator.next();
  5707. }
  5708. } else {
  5709. keys = Object.keys(val);
  5710. ret = new Array(keys.length);
  5711. for (i = 0, l = keys.length; i < l; i++) {
  5712. key = keys[i];
  5713. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  5714. }
  5715. }
  5716. }
  5717. if (!isDef(ret)) {
  5718. ret = [];
  5719. }
  5720. (ret)._isVList = true;
  5721. return ret
  5722. }
  5723. /* */
  5724. /**
  5725. * Runtime helper for rendering <slot>
  5726. */
  5727. function renderSlot (
  5728. name,
  5729. fallback,
  5730. props,
  5731. bindObject
  5732. ) {
  5733. var scopedSlotFn = this.$scopedSlots[name];
  5734. var nodes;
  5735. if (scopedSlotFn) { // scoped slot
  5736. props = props || {};
  5737. if (bindObject) {
  5738. if ( true && !isObject(bindObject)) {
  5739. warn(
  5740. 'slot v-bind without argument expects an Object',
  5741. this
  5742. );
  5743. }
  5744. props = extend(extend({}, bindObject), props);
  5745. }
  5746. // fixed by xxxxxx app-plus scopedSlot
  5747. nodes = scopedSlotFn(props, this, props._i) || fallback;
  5748. } else {
  5749. nodes = this.$slots[name] || fallback;
  5750. }
  5751. var target = props && props.slot;
  5752. if (target) {
  5753. return this.$createElement('template', { slot: target }, nodes)
  5754. } else {
  5755. return nodes
  5756. }
  5757. }
  5758. /* */
  5759. /**
  5760. * Runtime helper for resolving filters
  5761. */
  5762. function resolveFilter (id) {
  5763. return resolveAsset(this.$options, 'filters', id, true) || identity
  5764. }
  5765. /* */
  5766. function isKeyNotMatch (expect, actual) {
  5767. if (Array.isArray(expect)) {
  5768. return expect.indexOf(actual) === -1
  5769. } else {
  5770. return expect !== actual
  5771. }
  5772. }
  5773. /**
  5774. * Runtime helper for checking keyCodes from config.
  5775. * exposed as Vue.prototype._k
  5776. * passing in eventKeyName as last argument separately for backwards compat
  5777. */
  5778. function checkKeyCodes (
  5779. eventKeyCode,
  5780. key,
  5781. builtInKeyCode,
  5782. eventKeyName,
  5783. builtInKeyName
  5784. ) {
  5785. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  5786. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  5787. return isKeyNotMatch(builtInKeyName, eventKeyName)
  5788. } else if (mappedKeyCode) {
  5789. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  5790. } else if (eventKeyName) {
  5791. return hyphenate(eventKeyName) !== key
  5792. }
  5793. }
  5794. /* */
  5795. /**
  5796. * Runtime helper for merging v-bind="object" into a VNode's data.
  5797. */
  5798. function bindObjectProps (
  5799. data,
  5800. tag,
  5801. value,
  5802. asProp,
  5803. isSync
  5804. ) {
  5805. if (value) {
  5806. if (!isObject(value)) {
  5807. true && warn(
  5808. 'v-bind without argument expects an Object or Array value',
  5809. this
  5810. );
  5811. } else {
  5812. if (Array.isArray(value)) {
  5813. value = toObject(value);
  5814. }
  5815. var hash;
  5816. var loop = function ( key ) {
  5817. if (
  5818. key === 'class' ||
  5819. key === 'style' ||
  5820. isReservedAttribute(key)
  5821. ) {
  5822. hash = data;
  5823. } else {
  5824. var type = data.attrs && data.attrs.type;
  5825. hash = asProp || config.mustUseProp(tag, type, key)
  5826. ? data.domProps || (data.domProps = {})
  5827. : data.attrs || (data.attrs = {});
  5828. }
  5829. var camelizedKey = camelize(key);
  5830. var hyphenatedKey = hyphenate(key);
  5831. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  5832. hash[key] = value[key];
  5833. if (isSync) {
  5834. var on = data.on || (data.on = {});
  5835. on[("update:" + key)] = function ($event) {
  5836. value[key] = $event;
  5837. };
  5838. }
  5839. }
  5840. };
  5841. for (var key in value) loop( key );
  5842. }
  5843. }
  5844. return data
  5845. }
  5846. /* */
  5847. /**
  5848. * Runtime helper for rendering static trees.
  5849. */
  5850. function renderStatic (
  5851. index,
  5852. isInFor
  5853. ) {
  5854. var cached = this._staticTrees || (this._staticTrees = []);
  5855. var tree = cached[index];
  5856. // if has already-rendered static tree and not inside v-for,
  5857. // we can reuse the same tree.
  5858. if (tree && !isInFor) {
  5859. return tree
  5860. }
  5861. // otherwise, render a fresh tree.
  5862. tree = cached[index] = this.$options.staticRenderFns[index].call(
  5863. this._renderProxy,
  5864. null,
  5865. this // for render fns generated for functional component templates
  5866. );
  5867. markStatic(tree, ("__static__" + index), false);
  5868. return tree
  5869. }
  5870. /**
  5871. * Runtime helper for v-once.
  5872. * Effectively it means marking the node as static with a unique key.
  5873. */
  5874. function markOnce (
  5875. tree,
  5876. index,
  5877. key
  5878. ) {
  5879. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  5880. return tree
  5881. }
  5882. function markStatic (
  5883. tree,
  5884. key,
  5885. isOnce
  5886. ) {
  5887. if (Array.isArray(tree)) {
  5888. for (var i = 0; i < tree.length; i++) {
  5889. if (tree[i] && typeof tree[i] !== 'string') {
  5890. markStaticNode(tree[i], (key + "_" + i), isOnce);
  5891. }
  5892. }
  5893. } else {
  5894. markStaticNode(tree, key, isOnce);
  5895. }
  5896. }
  5897. function markStaticNode (node, key, isOnce) {
  5898. node.isStatic = true;
  5899. node.key = key;
  5900. node.isOnce = isOnce;
  5901. }
  5902. /* */
  5903. function bindObjectListeners (data, value) {
  5904. if (value) {
  5905. if (!isPlainObject(value)) {
  5906. true && warn(
  5907. 'v-on without argument expects an Object value',
  5908. this
  5909. );
  5910. } else {
  5911. var on = data.on = data.on ? extend({}, data.on) : {};
  5912. for (var key in value) {
  5913. var existing = on[key];
  5914. var ours = value[key];
  5915. on[key] = existing ? [].concat(existing, ours) : ours;
  5916. }
  5917. }
  5918. }
  5919. return data
  5920. }
  5921. /* */
  5922. function resolveScopedSlots (
  5923. fns, // see flow/vnode
  5924. res,
  5925. // the following are added in 2.6
  5926. hasDynamicKeys,
  5927. contentHashKey
  5928. ) {
  5929. res = res || { $stable: !hasDynamicKeys };
  5930. for (var i = 0; i < fns.length; i++) {
  5931. var slot = fns[i];
  5932. if (Array.isArray(slot)) {
  5933. resolveScopedSlots(slot, res, hasDynamicKeys);
  5934. } else if (slot) {
  5935. // marker for reverse proxying v-slot without scope on this.$slots
  5936. if (slot.proxy) {
  5937. slot.fn.proxy = true;
  5938. }
  5939. res[slot.key] = slot.fn;
  5940. }
  5941. }
  5942. if (contentHashKey) {
  5943. (res).$key = contentHashKey;
  5944. }
  5945. return res
  5946. }
  5947. /* */
  5948. function bindDynamicKeys (baseObj, values) {
  5949. for (var i = 0; i < values.length; i += 2) {
  5950. var key = values[i];
  5951. if (typeof key === 'string' && key) {
  5952. baseObj[values[i]] = values[i + 1];
  5953. } else if ( true && key !== '' && key !== null) {
  5954. // null is a special value for explicitly removing a binding
  5955. warn(
  5956. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  5957. this
  5958. );
  5959. }
  5960. }
  5961. return baseObj
  5962. }
  5963. // helper to dynamically append modifier runtime markers to event names.
  5964. // ensure only append when value is already string, otherwise it will be cast
  5965. // to string and cause the type check to miss.
  5966. function prependModifier (value, symbol) {
  5967. return typeof value === 'string' ? symbol + value : value
  5968. }
  5969. /* */
  5970. function installRenderHelpers (target) {
  5971. target._o = markOnce;
  5972. target._n = toNumber;
  5973. target._s = toString;
  5974. target._l = renderList;
  5975. target._t = renderSlot;
  5976. target._q = looseEqual;
  5977. target._i = looseIndexOf;
  5978. target._m = renderStatic;
  5979. target._f = resolveFilter;
  5980. target._k = checkKeyCodes;
  5981. target._b = bindObjectProps;
  5982. target._v = createTextVNode;
  5983. target._e = createEmptyVNode;
  5984. target._u = resolveScopedSlots;
  5985. target._g = bindObjectListeners;
  5986. target._d = bindDynamicKeys;
  5987. target._p = prependModifier;
  5988. }
  5989. /* */
  5990. function FunctionalRenderContext (
  5991. data,
  5992. props,
  5993. children,
  5994. parent,
  5995. Ctor
  5996. ) {
  5997. var this$1 = this;
  5998. var options = Ctor.options;
  5999. // ensure the createElement function in functional components
  6000. // gets a unique context - this is necessary for correct named slot check
  6001. var contextVm;
  6002. if (hasOwn(parent, '_uid')) {
  6003. contextVm = Object.create(parent);
  6004. // $flow-disable-line
  6005. contextVm._original = parent;
  6006. } else {
  6007. // the context vm passed in is a functional context as well.
  6008. // in this case we want to make sure we are able to get a hold to the
  6009. // real context instance.
  6010. contextVm = parent;
  6011. // $flow-disable-line
  6012. parent = parent._original;
  6013. }
  6014. var isCompiled = isTrue(options._compiled);
  6015. var needNormalization = !isCompiled;
  6016. this.data = data;
  6017. this.props = props;
  6018. this.children = children;
  6019. this.parent = parent;
  6020. this.listeners = data.on || emptyObject;
  6021. this.injections = resolveInject(options.inject, parent);
  6022. this.slots = function () {
  6023. if (!this$1.$slots) {
  6024. normalizeScopedSlots(
  6025. data.scopedSlots,
  6026. this$1.$slots = resolveSlots(children, parent)
  6027. );
  6028. }
  6029. return this$1.$slots
  6030. };
  6031. Object.defineProperty(this, 'scopedSlots', ({
  6032. enumerable: true,
  6033. get: function get () {
  6034. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6035. }
  6036. }));
  6037. // support for compiled functional template
  6038. if (isCompiled) {
  6039. // exposing $options for renderStatic()
  6040. this.$options = options;
  6041. // pre-resolve slots for renderSlot()
  6042. this.$slots = this.slots();
  6043. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6044. }
  6045. if (options._scopeId) {
  6046. this._c = function (a, b, c, d) {
  6047. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6048. if (vnode && !Array.isArray(vnode)) {
  6049. vnode.fnScopeId = options._scopeId;
  6050. vnode.fnContext = parent;
  6051. }
  6052. return vnode
  6053. };
  6054. } else {
  6055. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6056. }
  6057. }
  6058. installRenderHelpers(FunctionalRenderContext.prototype);
  6059. function createFunctionalComponent (
  6060. Ctor,
  6061. propsData,
  6062. data,
  6063. contextVm,
  6064. children
  6065. ) {
  6066. var options = Ctor.options;
  6067. var props = {};
  6068. var propOptions = options.props;
  6069. if (isDef(propOptions)) {
  6070. for (var key in propOptions) {
  6071. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6072. }
  6073. } else {
  6074. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6075. if (isDef(data.props)) { mergeProps(props, data.props); }
  6076. }
  6077. var renderContext = new FunctionalRenderContext(
  6078. data,
  6079. props,
  6080. children,
  6081. contextVm,
  6082. Ctor
  6083. );
  6084. var vnode = options.render.call(null, renderContext._c, renderContext);
  6085. if (vnode instanceof VNode) {
  6086. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6087. } else if (Array.isArray(vnode)) {
  6088. var vnodes = normalizeChildren(vnode) || [];
  6089. var res = new Array(vnodes.length);
  6090. for (var i = 0; i < vnodes.length; i++) {
  6091. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6092. }
  6093. return res
  6094. }
  6095. }
  6096. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6097. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6098. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6099. // that should not be matched to match.
  6100. var clone = cloneVNode(vnode);
  6101. clone.fnContext = contextVm;
  6102. clone.fnOptions = options;
  6103. if (true) {
  6104. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6105. }
  6106. if (data.slot) {
  6107. (clone.data || (clone.data = {})).slot = data.slot;
  6108. }
  6109. return clone
  6110. }
  6111. function mergeProps (to, from) {
  6112. for (var key in from) {
  6113. to[camelize(key)] = from[key];
  6114. }
  6115. }
  6116. /* */
  6117. /* */
  6118. /* */
  6119. /* */
  6120. // inline hooks to be invoked on component VNodes during patch
  6121. var componentVNodeHooks = {
  6122. init: function init (vnode, hydrating) {
  6123. if (
  6124. vnode.componentInstance &&
  6125. !vnode.componentInstance._isDestroyed &&
  6126. vnode.data.keepAlive
  6127. ) {
  6128. // kept-alive components, treat as a patch
  6129. var mountedNode = vnode; // work around flow
  6130. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6131. } else {
  6132. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6133. vnode,
  6134. activeInstance
  6135. );
  6136. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6137. }
  6138. },
  6139. prepatch: function prepatch (oldVnode, vnode) {
  6140. var options = vnode.componentOptions;
  6141. var child = vnode.componentInstance = oldVnode.componentInstance;
  6142. updateChildComponent(
  6143. child,
  6144. options.propsData, // updated props
  6145. options.listeners, // updated listeners
  6146. vnode, // new parent vnode
  6147. options.children // new children
  6148. );
  6149. },
  6150. insert: function insert (vnode) {
  6151. var context = vnode.context;
  6152. var componentInstance = vnode.componentInstance;
  6153. if (!componentInstance._isMounted) {
  6154. callHook(componentInstance, 'onServiceCreated');
  6155. callHook(componentInstance, 'onServiceAttached');
  6156. componentInstance._isMounted = true;
  6157. callHook(componentInstance, 'mounted');
  6158. }
  6159. if (vnode.data.keepAlive) {
  6160. if (context._isMounted) {
  6161. // vue-router#1212
  6162. // During updates, a kept-alive component's child components may
  6163. // change, so directly walking the tree here may call activated hooks
  6164. // on incorrect children. Instead we push them into a queue which will
  6165. // be processed after the whole patch process ended.
  6166. queueActivatedComponent(componentInstance);
  6167. } else {
  6168. activateChildComponent(componentInstance, true /* direct */);
  6169. }
  6170. }
  6171. },
  6172. destroy: function destroy (vnode) {
  6173. var componentInstance = vnode.componentInstance;
  6174. if (!componentInstance._isDestroyed) {
  6175. if (!vnode.data.keepAlive) {
  6176. componentInstance.$destroy();
  6177. } else {
  6178. deactivateChildComponent(componentInstance, true /* direct */);
  6179. }
  6180. }
  6181. }
  6182. };
  6183. var hooksToMerge = Object.keys(componentVNodeHooks);
  6184. function createComponent (
  6185. Ctor,
  6186. data,
  6187. context,
  6188. children,
  6189. tag
  6190. ) {
  6191. if (isUndef(Ctor)) {
  6192. return
  6193. }
  6194. var baseCtor = context.$options._base;
  6195. // plain options object: turn it into a constructor
  6196. if (isObject(Ctor)) {
  6197. Ctor = baseCtor.extend(Ctor);
  6198. }
  6199. // if at this stage it's not a constructor or an async component factory,
  6200. // reject.
  6201. if (typeof Ctor !== 'function') {
  6202. if (true) {
  6203. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6204. }
  6205. return
  6206. }
  6207. // async component
  6208. var asyncFactory;
  6209. if (isUndef(Ctor.cid)) {
  6210. asyncFactory = Ctor;
  6211. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6212. if (Ctor === undefined) {
  6213. // return a placeholder node for async component, which is rendered
  6214. // as a comment node but preserves all the raw information for the node.
  6215. // the information will be used for async server-rendering and hydration.
  6216. return createAsyncPlaceholder(
  6217. asyncFactory,
  6218. data,
  6219. context,
  6220. children,
  6221. tag
  6222. )
  6223. }
  6224. }
  6225. data = data || {};
  6226. // resolve constructor options in case global mixins are applied after
  6227. // component constructor creation
  6228. resolveConstructorOptions(Ctor);
  6229. // transform component v-model data into props & events
  6230. if (isDef(data.model)) {
  6231. transformModel(Ctor.options, data);
  6232. }
  6233. // extract props
  6234. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6235. // functional component
  6236. if (isTrue(Ctor.options.functional)) {
  6237. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6238. }
  6239. // extract listeners, since these needs to be treated as
  6240. // child component listeners instead of DOM listeners
  6241. var listeners = data.on;
  6242. // replace with listeners with .native modifier
  6243. // so it gets processed during parent component patch.
  6244. data.on = data.nativeOn;
  6245. if (isTrue(Ctor.options.abstract)) {
  6246. // abstract components do not keep anything
  6247. // other than props & listeners & slot
  6248. // work around flow
  6249. var slot = data.slot;
  6250. data = {};
  6251. if (slot) {
  6252. data.slot = slot;
  6253. }
  6254. }
  6255. // install component management hooks onto the placeholder node
  6256. installComponentHooks(data);
  6257. // return a placeholder vnode
  6258. var name = Ctor.options.name || tag;
  6259. var vnode = new VNode(
  6260. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6261. data, undefined, undefined, undefined, context,
  6262. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6263. asyncFactory
  6264. );
  6265. return vnode
  6266. }
  6267. function createComponentInstanceForVnode (
  6268. vnode, // we know it's MountedComponentVNode but flow doesn't
  6269. parent // activeInstance in lifecycle state
  6270. ) {
  6271. var options = {
  6272. _isComponent: true,
  6273. _parentVnode: vnode,
  6274. parent: parent
  6275. };
  6276. // check inline-template render functions
  6277. var inlineTemplate = vnode.data.inlineTemplate;
  6278. if (isDef(inlineTemplate)) {
  6279. options.render = inlineTemplate.render;
  6280. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6281. }
  6282. return new vnode.componentOptions.Ctor(options)
  6283. }
  6284. function installComponentHooks (data) {
  6285. var hooks = data.hook || (data.hook = {});
  6286. for (var i = 0; i < hooksToMerge.length; i++) {
  6287. var key = hooksToMerge[i];
  6288. var existing = hooks[key];
  6289. var toMerge = componentVNodeHooks[key];
  6290. if (existing !== toMerge && !(existing && existing._merged)) {
  6291. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6292. }
  6293. }
  6294. }
  6295. function mergeHook$1 (f1, f2) {
  6296. var merged = function (a, b) {
  6297. // flow complains about extra args which is why we use any
  6298. f1(a, b);
  6299. f2(a, b);
  6300. };
  6301. merged._merged = true;
  6302. return merged
  6303. }
  6304. // transform component v-model info (value and callback) into
  6305. // prop and event handler respectively.
  6306. function transformModel (options, data) {
  6307. var prop = (options.model && options.model.prop) || 'value';
  6308. var event = (options.model && options.model.event) || 'input'
  6309. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6310. var on = data.on || (data.on = {});
  6311. var existing = on[event];
  6312. var callback = data.model.callback;
  6313. if (isDef(existing)) {
  6314. if (
  6315. Array.isArray(existing)
  6316. ? existing.indexOf(callback) === -1
  6317. : existing !== callback
  6318. ) {
  6319. on[event] = [callback].concat(existing);
  6320. }
  6321. } else {
  6322. on[event] = callback;
  6323. }
  6324. }
  6325. /* */
  6326. var SIMPLE_NORMALIZE = 1;
  6327. var ALWAYS_NORMALIZE = 2;
  6328. // wrapper function for providing a more flexible interface
  6329. // without getting yelled at by flow
  6330. function createElement (
  6331. context,
  6332. tag,
  6333. data,
  6334. children,
  6335. normalizationType,
  6336. alwaysNormalize
  6337. ) {
  6338. if (Array.isArray(data) || isPrimitive(data)) {
  6339. normalizationType = children;
  6340. children = data;
  6341. data = undefined;
  6342. }
  6343. if (isTrue(alwaysNormalize)) {
  6344. normalizationType = ALWAYS_NORMALIZE;
  6345. }
  6346. return _createElement(context, tag, data, children, normalizationType)
  6347. }
  6348. function _createElement (
  6349. context,
  6350. tag,
  6351. data,
  6352. children,
  6353. normalizationType
  6354. ) {
  6355. if (isDef(data) && isDef((data).__ob__)) {
  6356. true && warn(
  6357. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6358. 'Always create fresh vnode data objects in each render!',
  6359. context
  6360. );
  6361. return createEmptyVNode()
  6362. }
  6363. // object syntax in v-bind
  6364. if (isDef(data) && isDef(data.is)) {
  6365. tag = data.is;
  6366. }
  6367. if (!tag) {
  6368. // in case of component :is set to falsy value
  6369. return createEmptyVNode()
  6370. }
  6371. // warn against non-primitive key
  6372. if ( true &&
  6373. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6374. ) {
  6375. {
  6376. warn(
  6377. 'Avoid using non-primitive value as key, ' +
  6378. 'use string/number value instead.',
  6379. context
  6380. );
  6381. }
  6382. }
  6383. // support single function children as default scoped slot
  6384. if (Array.isArray(children) &&
  6385. typeof children[0] === 'function'
  6386. ) {
  6387. data = data || {};
  6388. data.scopedSlots = { default: children[0] };
  6389. children.length = 0;
  6390. }
  6391. if (normalizationType === ALWAYS_NORMALIZE) {
  6392. children = normalizeChildren(children);
  6393. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6394. children = simpleNormalizeChildren(children);
  6395. }
  6396. var vnode, ns;
  6397. if (typeof tag === 'string') {
  6398. var Ctor;
  6399. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6400. if (config.isReservedTag(tag)) {
  6401. // platform built-in elements
  6402. if ( true && isDef(data) && isDef(data.nativeOn)) {
  6403. warn(
  6404. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  6405. context
  6406. );
  6407. }
  6408. vnode = new VNode(
  6409. config.parsePlatformTagName(tag), data, children,
  6410. undefined, undefined, context
  6411. );
  6412. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6413. // component
  6414. vnode = createComponent(Ctor, data, context, children, tag);
  6415. } else {
  6416. // unknown or unlisted namespaced elements
  6417. // check at runtime because it may get assigned a namespace when its
  6418. // parent normalizes children
  6419. vnode = new VNode(
  6420. tag, data, children,
  6421. undefined, undefined, context
  6422. );
  6423. }
  6424. } else {
  6425. // direct component options / constructor
  6426. vnode = createComponent(tag, data, context, children);
  6427. }
  6428. if (Array.isArray(vnode)) {
  6429. return vnode
  6430. } else if (isDef(vnode)) {
  6431. if (isDef(ns)) { applyNS(vnode, ns); }
  6432. if (isDef(data)) { registerDeepBindings(data); }
  6433. return vnode
  6434. } else {
  6435. return createEmptyVNode()
  6436. }
  6437. }
  6438. function applyNS (vnode, ns, force) {
  6439. vnode.ns = ns;
  6440. if (vnode.tag === 'foreignObject') {
  6441. // use default namespace inside foreignObject
  6442. ns = undefined;
  6443. force = true;
  6444. }
  6445. if (isDef(vnode.children)) {
  6446. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6447. var child = vnode.children[i];
  6448. if (isDef(child.tag) && (
  6449. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6450. applyNS(child, ns, force);
  6451. }
  6452. }
  6453. }
  6454. }
  6455. // ref #5318
  6456. // necessary to ensure parent re-render when deep bindings like :style and
  6457. // :class are used on slot nodes
  6458. function registerDeepBindings (data) {
  6459. if (isObject(data.style)) {
  6460. traverse(data.style);
  6461. }
  6462. if (isObject(data.class)) {
  6463. traverse(data.class);
  6464. }
  6465. }
  6466. /* */
  6467. function initRender (vm) {
  6468. vm._vnode = null; // the root of the child tree
  6469. vm._staticTrees = null; // v-once cached trees
  6470. var options = vm.$options;
  6471. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6472. var renderContext = parentVnode && parentVnode.context;
  6473. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6474. vm.$scopedSlots = emptyObject;
  6475. // bind the createElement fn to this instance
  6476. // so that we get proper render context inside it.
  6477. // args order: tag, data, children, normalizationType, alwaysNormalize
  6478. // internal version is used by render functions compiled from templates
  6479. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6480. // normalization is always applied for the public version, used in
  6481. // user-written render functions.
  6482. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6483. // $attrs & $listeners are exposed for easier HOC creation.
  6484. // they need to be reactive so that HOCs using them are always updated
  6485. var parentData = parentVnode && parentVnode.data;
  6486. /* istanbul ignore else */
  6487. if (true) {
  6488. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6489. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6490. }, true);
  6491. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6492. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6493. }, true);
  6494. } else {}
  6495. }
  6496. var currentRenderingInstance = null;
  6497. function renderMixin (Vue) {
  6498. // install runtime convenience helpers
  6499. installRenderHelpers(Vue.prototype);
  6500. Vue.prototype.$nextTick = function (fn) {
  6501. return nextTick(fn, this)
  6502. };
  6503. Vue.prototype._render = function () {
  6504. var vm = this;
  6505. var ref = vm.$options;
  6506. var render = ref.render;
  6507. var _parentVnode = ref._parentVnode;
  6508. if (_parentVnode) {
  6509. vm.$scopedSlots = normalizeScopedSlots(
  6510. _parentVnode.data.scopedSlots,
  6511. vm.$slots,
  6512. vm.$scopedSlots
  6513. );
  6514. }
  6515. // set parent vnode. this allows render functions to have access
  6516. // to the data on the placeholder node.
  6517. vm.$vnode = _parentVnode;
  6518. // render self
  6519. var vnode;
  6520. try {
  6521. // There's no need to maintain a stack because all render fns are called
  6522. // separately from one another. Nested component's render fns are called
  6523. // when parent component is patched.
  6524. currentRenderingInstance = vm;
  6525. vnode = render.call(vm._renderProxy, vm.$createElement);
  6526. } catch (e) {
  6527. handleError(e, vm, "render");
  6528. // return error render result,
  6529. // or previous vnode to prevent render error causing blank component
  6530. /* istanbul ignore else */
  6531. if ( true && vm.$options.renderError) {
  6532. try {
  6533. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6534. } catch (e) {
  6535. handleError(e, vm, "renderError");
  6536. vnode = vm._vnode;
  6537. }
  6538. } else {
  6539. vnode = vm._vnode;
  6540. }
  6541. } finally {
  6542. currentRenderingInstance = null;
  6543. }
  6544. // if the returned array contains only a single node, allow it
  6545. if (Array.isArray(vnode) && vnode.length === 1) {
  6546. vnode = vnode[0];
  6547. }
  6548. // return empty vnode in case the render function errored out
  6549. if (!(vnode instanceof VNode)) {
  6550. if ( true && Array.isArray(vnode)) {
  6551. warn(
  6552. 'Multiple root nodes returned from render function. Render function ' +
  6553. 'should return a single root node.',
  6554. vm
  6555. );
  6556. }
  6557. vnode = createEmptyVNode();
  6558. }
  6559. // set parent
  6560. vnode.parent = _parentVnode;
  6561. return vnode
  6562. };
  6563. }
  6564. /* */
  6565. function ensureCtor (comp, base) {
  6566. if (
  6567. comp.__esModule ||
  6568. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  6569. ) {
  6570. comp = comp.default;
  6571. }
  6572. return isObject(comp)
  6573. ? base.extend(comp)
  6574. : comp
  6575. }
  6576. function createAsyncPlaceholder (
  6577. factory,
  6578. data,
  6579. context,
  6580. children,
  6581. tag
  6582. ) {
  6583. var node = createEmptyVNode();
  6584. node.asyncFactory = factory;
  6585. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  6586. return node
  6587. }
  6588. function resolveAsyncComponent (
  6589. factory,
  6590. baseCtor
  6591. ) {
  6592. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  6593. return factory.errorComp
  6594. }
  6595. if (isDef(factory.resolved)) {
  6596. return factory.resolved
  6597. }
  6598. var owner = currentRenderingInstance;
  6599. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  6600. // already pending
  6601. factory.owners.push(owner);
  6602. }
  6603. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  6604. return factory.loadingComp
  6605. }
  6606. if (owner && !isDef(factory.owners)) {
  6607. var owners = factory.owners = [owner];
  6608. var sync = true;
  6609. var timerLoading = null;
  6610. var timerTimeout = null
  6611. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  6612. var forceRender = function (renderCompleted) {
  6613. for (var i = 0, l = owners.length; i < l; i++) {
  6614. (owners[i]).$forceUpdate();
  6615. }
  6616. if (renderCompleted) {
  6617. owners.length = 0;
  6618. if (timerLoading !== null) {
  6619. clearTimeout(timerLoading);
  6620. timerLoading = null;
  6621. }
  6622. if (timerTimeout !== null) {
  6623. clearTimeout(timerTimeout);
  6624. timerTimeout = null;
  6625. }
  6626. }
  6627. };
  6628. var resolve = once(function (res) {
  6629. // cache resolved
  6630. factory.resolved = ensureCtor(res, baseCtor);
  6631. // invoke callbacks only if this is not a synchronous resolve
  6632. // (async resolves are shimmed as synchronous during SSR)
  6633. if (!sync) {
  6634. forceRender(true);
  6635. } else {
  6636. owners.length = 0;
  6637. }
  6638. });
  6639. var reject = once(function (reason) {
  6640. true && warn(
  6641. "Failed to resolve async component: " + (String(factory)) +
  6642. (reason ? ("\nReason: " + reason) : '')
  6643. );
  6644. if (isDef(factory.errorComp)) {
  6645. factory.error = true;
  6646. forceRender(true);
  6647. }
  6648. });
  6649. var res = factory(resolve, reject);
  6650. if (isObject(res)) {
  6651. if (isPromise(res)) {
  6652. // () => Promise
  6653. if (isUndef(factory.resolved)) {
  6654. res.then(resolve, reject);
  6655. }
  6656. } else if (isPromise(res.component)) {
  6657. res.component.then(resolve, reject);
  6658. if (isDef(res.error)) {
  6659. factory.errorComp = ensureCtor(res.error, baseCtor);
  6660. }
  6661. if (isDef(res.loading)) {
  6662. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  6663. if (res.delay === 0) {
  6664. factory.loading = true;
  6665. } else {
  6666. timerLoading = setTimeout(function () {
  6667. timerLoading = null;
  6668. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  6669. factory.loading = true;
  6670. forceRender(false);
  6671. }
  6672. }, res.delay || 200);
  6673. }
  6674. }
  6675. if (isDef(res.timeout)) {
  6676. timerTimeout = setTimeout(function () {
  6677. timerTimeout = null;
  6678. if (isUndef(factory.resolved)) {
  6679. reject(
  6680. true
  6681. ? ("timeout (" + (res.timeout) + "ms)")
  6682. : undefined
  6683. );
  6684. }
  6685. }, res.timeout);
  6686. }
  6687. }
  6688. }
  6689. sync = false;
  6690. // return in case resolved synchronously
  6691. return factory.loading
  6692. ? factory.loadingComp
  6693. : factory.resolved
  6694. }
  6695. }
  6696. /* */
  6697. function isAsyncPlaceholder (node) {
  6698. return node.isComment && node.asyncFactory
  6699. }
  6700. /* */
  6701. function getFirstComponentChild (children) {
  6702. if (Array.isArray(children)) {
  6703. for (var i = 0; i < children.length; i++) {
  6704. var c = children[i];
  6705. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  6706. return c
  6707. }
  6708. }
  6709. }
  6710. }
  6711. /* */
  6712. /* */
  6713. function initEvents (vm) {
  6714. vm._events = Object.create(null);
  6715. vm._hasHookEvent = false;
  6716. // init parent attached events
  6717. var listeners = vm.$options._parentListeners;
  6718. if (listeners) {
  6719. updateComponentListeners(vm, listeners);
  6720. }
  6721. }
  6722. var target;
  6723. function add (event, fn) {
  6724. target.$on(event, fn);
  6725. }
  6726. function remove$1 (event, fn) {
  6727. target.$off(event, fn);
  6728. }
  6729. function createOnceHandler (event, fn) {
  6730. var _target = target;
  6731. return function onceHandler () {
  6732. var res = fn.apply(null, arguments);
  6733. if (res !== null) {
  6734. _target.$off(event, onceHandler);
  6735. }
  6736. }
  6737. }
  6738. function updateComponentListeners (
  6739. vm,
  6740. listeners,
  6741. oldListeners
  6742. ) {
  6743. target = vm;
  6744. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  6745. target = undefined;
  6746. }
  6747. function eventsMixin (Vue) {
  6748. var hookRE = /^hook:/;
  6749. Vue.prototype.$on = function (event, fn) {
  6750. var vm = this;
  6751. if (Array.isArray(event)) {
  6752. for (var i = 0, l = event.length; i < l; i++) {
  6753. vm.$on(event[i], fn);
  6754. }
  6755. } else {
  6756. (vm._events[event] || (vm._events[event] = [])).push(fn);
  6757. // optimize hook:event cost by using a boolean flag marked at registration
  6758. // instead of a hash lookup
  6759. if (hookRE.test(event)) {
  6760. vm._hasHookEvent = true;
  6761. }
  6762. }
  6763. return vm
  6764. };
  6765. Vue.prototype.$once = function (event, fn) {
  6766. var vm = this;
  6767. function on () {
  6768. vm.$off(event, on);
  6769. fn.apply(vm, arguments);
  6770. }
  6771. on.fn = fn;
  6772. vm.$on(event, on);
  6773. return vm
  6774. };
  6775. Vue.prototype.$off = function (event, fn) {
  6776. var vm = this;
  6777. // all
  6778. if (!arguments.length) {
  6779. vm._events = Object.create(null);
  6780. return vm
  6781. }
  6782. // array of events
  6783. if (Array.isArray(event)) {
  6784. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  6785. vm.$off(event[i$1], fn);
  6786. }
  6787. return vm
  6788. }
  6789. // specific event
  6790. var cbs = vm._events[event];
  6791. if (!cbs) {
  6792. return vm
  6793. }
  6794. if (!fn) {
  6795. vm._events[event] = null;
  6796. return vm
  6797. }
  6798. // specific handler
  6799. var cb;
  6800. var i = cbs.length;
  6801. while (i--) {
  6802. cb = cbs[i];
  6803. if (cb === fn || cb.fn === fn) {
  6804. cbs.splice(i, 1);
  6805. break
  6806. }
  6807. }
  6808. return vm
  6809. };
  6810. Vue.prototype.$emit = function (event) {
  6811. var vm = this;
  6812. if (true) {
  6813. var lowerCaseEvent = event.toLowerCase();
  6814. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  6815. tip(
  6816. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  6817. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  6818. "Note that HTML attributes are case-insensitive and you cannot use " +
  6819. "v-on to listen to camelCase events when using in-DOM templates. " +
  6820. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  6821. );
  6822. }
  6823. }
  6824. var cbs = vm._events[event];
  6825. if (cbs) {
  6826. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  6827. var args = toArray(arguments, 1);
  6828. var info = "event handler for \"" + event + "\"";
  6829. for (var i = 0, l = cbs.length; i < l; i++) {
  6830. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  6831. }
  6832. }
  6833. return vm
  6834. };
  6835. }
  6836. /* */
  6837. var activeInstance = null;
  6838. var isUpdatingChildComponent = false;
  6839. function setActiveInstance(vm) {
  6840. var prevActiveInstance = activeInstance;
  6841. activeInstance = vm;
  6842. return function () {
  6843. activeInstance = prevActiveInstance;
  6844. }
  6845. }
  6846. function initLifecycle (vm) {
  6847. var options = vm.$options;
  6848. // locate first non-abstract parent
  6849. var parent = options.parent;
  6850. if (parent && !options.abstract) {
  6851. while (parent.$options.abstract && parent.$parent) {
  6852. parent = parent.$parent;
  6853. }
  6854. parent.$children.push(vm);
  6855. }
  6856. vm.$parent = parent;
  6857. vm.$root = parent ? parent.$root : vm;
  6858. vm.$children = [];
  6859. vm.$refs = {};
  6860. vm._watcher = null;
  6861. vm._inactive = null;
  6862. vm._directInactive = false;
  6863. vm._isMounted = false;
  6864. vm._isDestroyed = false;
  6865. vm._isBeingDestroyed = false;
  6866. }
  6867. function lifecycleMixin (Vue) {
  6868. Vue.prototype._update = function (vnode, hydrating) {
  6869. var vm = this;
  6870. var prevEl = vm.$el;
  6871. var prevVnode = vm._vnode;
  6872. var restoreActiveInstance = setActiveInstance(vm);
  6873. vm._vnode = vnode;
  6874. // Vue.prototype.__patch__ is injected in entry points
  6875. // based on the rendering backend used.
  6876. if (!prevVnode) {
  6877. // initial render
  6878. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  6879. } else {
  6880. // updates
  6881. vm.$el = vm.__patch__(prevVnode, vnode);
  6882. }
  6883. restoreActiveInstance();
  6884. // update __vue__ reference
  6885. if (prevEl) {
  6886. prevEl.__vue__ = null;
  6887. }
  6888. if (vm.$el) {
  6889. vm.$el.__vue__ = vm;
  6890. }
  6891. // if parent is an HOC, update its $el as well
  6892. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  6893. vm.$parent.$el = vm.$el;
  6894. }
  6895. // updated hook is called by the scheduler to ensure that children are
  6896. // updated in a parent's updated hook.
  6897. };
  6898. Vue.prototype.$forceUpdate = function () {
  6899. var vm = this;
  6900. if (vm._watcher) {
  6901. vm._watcher.update();
  6902. }
  6903. };
  6904. Vue.prototype.$destroy = function () {
  6905. var vm = this;
  6906. if (vm._isBeingDestroyed) {
  6907. return
  6908. }
  6909. callHook(vm, 'beforeDestroy');
  6910. vm._isBeingDestroyed = true;
  6911. // remove self from parent
  6912. var parent = vm.$parent;
  6913. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  6914. remove(parent.$children, vm);
  6915. }
  6916. // teardown watchers
  6917. if (vm._watcher) {
  6918. vm._watcher.teardown();
  6919. }
  6920. var i = vm._watchers.length;
  6921. while (i--) {
  6922. vm._watchers[i].teardown();
  6923. }
  6924. // remove reference from data ob
  6925. // frozen object may not have observer.
  6926. if (vm._data.__ob__) {
  6927. vm._data.__ob__.vmCount--;
  6928. }
  6929. // call the last hook...
  6930. vm._isDestroyed = true;
  6931. // invoke destroy hooks on current rendered tree
  6932. vm.__patch__(vm._vnode, null);
  6933. // fire destroyed hook
  6934. callHook(vm, 'destroyed');
  6935. // turn off all instance listeners.
  6936. vm.$off();
  6937. // remove __vue__ reference
  6938. if (vm.$el) {
  6939. vm.$el.__vue__ = null;
  6940. }
  6941. // release circular reference (#6759)
  6942. if (vm.$vnode) {
  6943. vm.$vnode.parent = null;
  6944. }
  6945. };
  6946. }
  6947. function updateChildComponent (
  6948. vm,
  6949. propsData,
  6950. listeners,
  6951. parentVnode,
  6952. renderChildren
  6953. ) {
  6954. if (true) {
  6955. isUpdatingChildComponent = true;
  6956. }
  6957. // determine whether component has slot children
  6958. // we need to do this before overwriting $options._renderChildren.
  6959. // check if there are dynamic scopedSlots (hand-written or compiled but with
  6960. // dynamic slot names). Static scoped slots compiled from template has the
  6961. // "$stable" marker.
  6962. var newScopedSlots = parentVnode.data.scopedSlots;
  6963. var oldScopedSlots = vm.$scopedSlots;
  6964. var hasDynamicScopedSlot = !!(
  6965. (newScopedSlots && !newScopedSlots.$stable) ||
  6966. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  6967. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  6968. );
  6969. // Any static slot children from the parent may have changed during parent's
  6970. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  6971. // update is necessary to ensure correctness.
  6972. var needsForceUpdate = !!(
  6973. renderChildren || // has new static slots
  6974. vm.$options._renderChildren || // has old static slots
  6975. hasDynamicScopedSlot
  6976. );
  6977. vm.$options._parentVnode = parentVnode;
  6978. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  6979. if (vm._vnode) { // update child tree's parent
  6980. vm._vnode.parent = parentVnode;
  6981. }
  6982. vm.$options._renderChildren = renderChildren;
  6983. // update $attrs and $listeners hash
  6984. // these are also reactive so they may trigger child update if the child
  6985. // used them during render
  6986. vm.$attrs = parentVnode.data.attrs || emptyObject;
  6987. vm.$listeners = listeners || emptyObject;
  6988. // update props
  6989. if (propsData && vm.$options.props) {
  6990. toggleObserving(false);
  6991. var props = vm._props;
  6992. var propKeys = vm.$options._propKeys || [];
  6993. for (var i = 0; i < propKeys.length; i++) {
  6994. var key = propKeys[i];
  6995. var propOptions = vm.$options.props; // wtf flow?
  6996. props[key] = validateProp(key, propOptions, propsData, vm);
  6997. }
  6998. toggleObserving(true);
  6999. // keep a copy of raw propsData
  7000. vm.$options.propsData = propsData;
  7001. }
  7002. // fixed by xxxxxx update properties(mp runtime)
  7003. vm._$updateProperties && vm._$updateProperties(vm);
  7004. // update listeners
  7005. listeners = listeners || emptyObject;
  7006. var oldListeners = vm.$options._parentListeners;
  7007. vm.$options._parentListeners = listeners;
  7008. updateComponentListeners(vm, listeners, oldListeners);
  7009. // resolve slots + force update if has children
  7010. if (needsForceUpdate) {
  7011. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7012. vm.$forceUpdate();
  7013. }
  7014. if (true) {
  7015. isUpdatingChildComponent = false;
  7016. }
  7017. }
  7018. function isInInactiveTree (vm) {
  7019. while (vm && (vm = vm.$parent)) {
  7020. if (vm._inactive) { return true }
  7021. }
  7022. return false
  7023. }
  7024. function activateChildComponent (vm, direct) {
  7025. if (direct) {
  7026. vm._directInactive = false;
  7027. if (isInInactiveTree(vm)) {
  7028. return
  7029. }
  7030. } else if (vm._directInactive) {
  7031. return
  7032. }
  7033. if (vm._inactive || vm._inactive === null) {
  7034. vm._inactive = false;
  7035. for (var i = 0; i < vm.$children.length; i++) {
  7036. activateChildComponent(vm.$children[i]);
  7037. }
  7038. callHook(vm, 'activated');
  7039. }
  7040. }
  7041. function deactivateChildComponent (vm, direct) {
  7042. if (direct) {
  7043. vm._directInactive = true;
  7044. if (isInInactiveTree(vm)) {
  7045. return
  7046. }
  7047. }
  7048. if (!vm._inactive) {
  7049. vm._inactive = true;
  7050. for (var i = 0; i < vm.$children.length; i++) {
  7051. deactivateChildComponent(vm.$children[i]);
  7052. }
  7053. callHook(vm, 'deactivated');
  7054. }
  7055. }
  7056. function callHook (vm, hook) {
  7057. // #7573 disable dep collection when invoking lifecycle hooks
  7058. pushTarget();
  7059. var handlers = vm.$options[hook];
  7060. var info = hook + " hook";
  7061. if (handlers) {
  7062. for (var i = 0, j = handlers.length; i < j; i++) {
  7063. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7064. }
  7065. }
  7066. if (vm._hasHookEvent) {
  7067. vm.$emit('hook:' + hook);
  7068. }
  7069. popTarget();
  7070. }
  7071. /* */
  7072. var MAX_UPDATE_COUNT = 100;
  7073. var queue = [];
  7074. var activatedChildren = [];
  7075. var has = {};
  7076. var circular = {};
  7077. var waiting = false;
  7078. var flushing = false;
  7079. var index = 0;
  7080. /**
  7081. * Reset the scheduler's state.
  7082. */
  7083. function resetSchedulerState () {
  7084. index = queue.length = activatedChildren.length = 0;
  7085. has = {};
  7086. if (true) {
  7087. circular = {};
  7088. }
  7089. waiting = flushing = false;
  7090. }
  7091. // Async edge case #6566 requires saving the timestamp when event listeners are
  7092. // attached. However, calling performance.now() has a perf overhead especially
  7093. // if the page has thousands of event listeners. Instead, we take a timestamp
  7094. // every time the scheduler flushes and use that for all event listeners
  7095. // attached during that flush.
  7096. var currentFlushTimestamp = 0;
  7097. // Async edge case fix requires storing an event listener's attach timestamp.
  7098. var getNow = Date.now;
  7099. // Determine what event timestamp the browser is using. Annoyingly, the
  7100. // timestamp can either be hi-res (relative to page load) or low-res
  7101. // (relative to UNIX epoch), so in order to compare time we have to use the
  7102. // same timestamp type when saving the flush timestamp.
  7103. // All IE versions use low-res event timestamps, and have problematic clock
  7104. // implementations (#9632)
  7105. if (inBrowser && !isIE) {
  7106. var performance = window.performance;
  7107. if (
  7108. performance &&
  7109. typeof performance.now === 'function' &&
  7110. getNow() > document.createEvent('Event').timeStamp
  7111. ) {
  7112. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7113. // smaller than it, it means the event is using a hi-res timestamp,
  7114. // and we need to use the hi-res version for event listener timestamps as
  7115. // well.
  7116. getNow = function () { return performance.now(); };
  7117. }
  7118. }
  7119. /**
  7120. * Flush both queues and run the watchers.
  7121. */
  7122. function flushSchedulerQueue () {
  7123. currentFlushTimestamp = getNow();
  7124. flushing = true;
  7125. var watcher, id;
  7126. // Sort queue before flush.
  7127. // This ensures that:
  7128. // 1. Components are updated from parent to child. (because parent is always
  7129. // created before the child)
  7130. // 2. A component's user watchers are run before its render watcher (because
  7131. // user watchers are created before the render watcher)
  7132. // 3. If a component is destroyed during a parent component's watcher run,
  7133. // its watchers can be skipped.
  7134. queue.sort(function (a, b) { return a.id - b.id; });
  7135. // do not cache length because more watchers might be pushed
  7136. // as we run existing watchers
  7137. for (index = 0; index < queue.length; index++) {
  7138. watcher = queue[index];
  7139. if (watcher.before) {
  7140. watcher.before();
  7141. }
  7142. id = watcher.id;
  7143. has[id] = null;
  7144. watcher.run();
  7145. // in dev build, check and stop circular updates.
  7146. if ( true && has[id] != null) {
  7147. circular[id] = (circular[id] || 0) + 1;
  7148. if (circular[id] > MAX_UPDATE_COUNT) {
  7149. warn(
  7150. 'You may have an infinite update loop ' + (
  7151. watcher.user
  7152. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7153. : "in a component render function."
  7154. ),
  7155. watcher.vm
  7156. );
  7157. break
  7158. }
  7159. }
  7160. }
  7161. // keep copies of post queues before resetting state
  7162. var activatedQueue = activatedChildren.slice();
  7163. var updatedQueue = queue.slice();
  7164. resetSchedulerState();
  7165. // call component updated and activated hooks
  7166. callActivatedHooks(activatedQueue);
  7167. callUpdatedHooks(updatedQueue);
  7168. // devtool hook
  7169. /* istanbul ignore if */
  7170. if (devtools && config.devtools) {
  7171. devtools.emit('flush');
  7172. }
  7173. }
  7174. function callUpdatedHooks (queue) {
  7175. var i = queue.length;
  7176. while (i--) {
  7177. var watcher = queue[i];
  7178. var vm = watcher.vm;
  7179. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7180. callHook(vm, 'updated');
  7181. }
  7182. }
  7183. }
  7184. /**
  7185. * Queue a kept-alive component that was activated during patch.
  7186. * The queue will be processed after the entire tree has been patched.
  7187. */
  7188. function queueActivatedComponent (vm) {
  7189. // setting _inactive to false here so that a render function can
  7190. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7191. vm._inactive = false;
  7192. activatedChildren.push(vm);
  7193. }
  7194. function callActivatedHooks (queue) {
  7195. for (var i = 0; i < queue.length; i++) {
  7196. queue[i]._inactive = true;
  7197. activateChildComponent(queue[i], true /* true */);
  7198. }
  7199. }
  7200. /**
  7201. * Push a watcher into the watcher queue.
  7202. * Jobs with duplicate IDs will be skipped unless it's
  7203. * pushed when the queue is being flushed.
  7204. */
  7205. function queueWatcher (watcher) {
  7206. var id = watcher.id;
  7207. if (has[id] == null) {
  7208. has[id] = true;
  7209. if (!flushing) {
  7210. queue.push(watcher);
  7211. } else {
  7212. // if already flushing, splice the watcher based on its id
  7213. // if already past its id, it will be run next immediately.
  7214. var i = queue.length - 1;
  7215. while (i > index && queue[i].id > watcher.id) {
  7216. i--;
  7217. }
  7218. queue.splice(i + 1, 0, watcher);
  7219. }
  7220. // queue the flush
  7221. if (!waiting) {
  7222. waiting = true;
  7223. if ( true && !config.async) {
  7224. flushSchedulerQueue();
  7225. return
  7226. }
  7227. nextTick(flushSchedulerQueue);
  7228. }
  7229. }
  7230. }
  7231. /* */
  7232. var uid$2 = 0;
  7233. /**
  7234. * A watcher parses an expression, collects dependencies,
  7235. * and fires callback when the expression value changes.
  7236. * This is used for both the $watch() api and directives.
  7237. */
  7238. var Watcher = function Watcher (
  7239. vm,
  7240. expOrFn,
  7241. cb,
  7242. options,
  7243. isRenderWatcher
  7244. ) {
  7245. this.vm = vm;
  7246. if (isRenderWatcher) {
  7247. vm._watcher = this;
  7248. }
  7249. vm._watchers.push(this);
  7250. // options
  7251. if (options) {
  7252. this.deep = !!options.deep;
  7253. this.user = !!options.user;
  7254. this.lazy = !!options.lazy;
  7255. this.sync = !!options.sync;
  7256. this.before = options.before;
  7257. } else {
  7258. this.deep = this.user = this.lazy = this.sync = false;
  7259. }
  7260. this.cb = cb;
  7261. this.id = ++uid$2; // uid for batching
  7262. this.active = true;
  7263. this.dirty = this.lazy; // for lazy watchers
  7264. this.deps = [];
  7265. this.newDeps = [];
  7266. this.depIds = new _Set();
  7267. this.newDepIds = new _Set();
  7268. this.expression = true
  7269. ? expOrFn.toString()
  7270. : undefined;
  7271. // parse expression for getter
  7272. if (typeof expOrFn === 'function') {
  7273. this.getter = expOrFn;
  7274. } else {
  7275. this.getter = parsePath(expOrFn);
  7276. if (!this.getter) {
  7277. this.getter = noop;
  7278. true && warn(
  7279. "Failed watching path: \"" + expOrFn + "\" " +
  7280. 'Watcher only accepts simple dot-delimited paths. ' +
  7281. 'For full control, use a function instead.',
  7282. vm
  7283. );
  7284. }
  7285. }
  7286. this.value = this.lazy
  7287. ? undefined
  7288. : this.get();
  7289. };
  7290. /**
  7291. * Evaluate the getter, and re-collect dependencies.
  7292. */
  7293. Watcher.prototype.get = function get () {
  7294. pushTarget(this);
  7295. var value;
  7296. var vm = this.vm;
  7297. try {
  7298. value = this.getter.call(vm, vm);
  7299. } catch (e) {
  7300. if (this.user) {
  7301. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7302. } else {
  7303. throw e
  7304. }
  7305. } finally {
  7306. // "touch" every property so they are all tracked as
  7307. // dependencies for deep watching
  7308. if (this.deep) {
  7309. traverse(value);
  7310. }
  7311. popTarget();
  7312. this.cleanupDeps();
  7313. }
  7314. return value
  7315. };
  7316. /**
  7317. * Add a dependency to this directive.
  7318. */
  7319. Watcher.prototype.addDep = function addDep (dep) {
  7320. var id = dep.id;
  7321. if (!this.newDepIds.has(id)) {
  7322. this.newDepIds.add(id);
  7323. this.newDeps.push(dep);
  7324. if (!this.depIds.has(id)) {
  7325. dep.addSub(this);
  7326. }
  7327. }
  7328. };
  7329. /**
  7330. * Clean up for dependency collection.
  7331. */
  7332. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7333. var i = this.deps.length;
  7334. while (i--) {
  7335. var dep = this.deps[i];
  7336. if (!this.newDepIds.has(dep.id)) {
  7337. dep.removeSub(this);
  7338. }
  7339. }
  7340. var tmp = this.depIds;
  7341. this.depIds = this.newDepIds;
  7342. this.newDepIds = tmp;
  7343. this.newDepIds.clear();
  7344. tmp = this.deps;
  7345. this.deps = this.newDeps;
  7346. this.newDeps = tmp;
  7347. this.newDeps.length = 0;
  7348. };
  7349. /**
  7350. * Subscriber interface.
  7351. * Will be called when a dependency changes.
  7352. */
  7353. Watcher.prototype.update = function update () {
  7354. /* istanbul ignore else */
  7355. if (this.lazy) {
  7356. this.dirty = true;
  7357. } else if (this.sync) {
  7358. this.run();
  7359. } else {
  7360. queueWatcher(this);
  7361. }
  7362. };
  7363. /**
  7364. * Scheduler job interface.
  7365. * Will be called by the scheduler.
  7366. */
  7367. Watcher.prototype.run = function run () {
  7368. if (this.active) {
  7369. var value = this.get();
  7370. if (
  7371. value !== this.value ||
  7372. // Deep watchers and watchers on Object/Arrays should fire even
  7373. // when the value is the same, because the value may
  7374. // have mutated.
  7375. isObject(value) ||
  7376. this.deep
  7377. ) {
  7378. // set new value
  7379. var oldValue = this.value;
  7380. this.value = value;
  7381. if (this.user) {
  7382. try {
  7383. this.cb.call(this.vm, value, oldValue);
  7384. } catch (e) {
  7385. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  7386. }
  7387. } else {
  7388. this.cb.call(this.vm, value, oldValue);
  7389. }
  7390. }
  7391. }
  7392. };
  7393. /**
  7394. * Evaluate the value of the watcher.
  7395. * This only gets called for lazy watchers.
  7396. */
  7397. Watcher.prototype.evaluate = function evaluate () {
  7398. this.value = this.get();
  7399. this.dirty = false;
  7400. };
  7401. /**
  7402. * Depend on all deps collected by this watcher.
  7403. */
  7404. Watcher.prototype.depend = function depend () {
  7405. var i = this.deps.length;
  7406. while (i--) {
  7407. this.deps[i].depend();
  7408. }
  7409. };
  7410. /**
  7411. * Remove self from all dependencies' subscriber list.
  7412. */
  7413. Watcher.prototype.teardown = function teardown () {
  7414. if (this.active) {
  7415. // remove self from vm's watcher list
  7416. // this is a somewhat expensive operation so we skip it
  7417. // if the vm is being destroyed.
  7418. if (!this.vm._isBeingDestroyed) {
  7419. remove(this.vm._watchers, this);
  7420. }
  7421. var i = this.deps.length;
  7422. while (i--) {
  7423. this.deps[i].removeSub(this);
  7424. }
  7425. this.active = false;
  7426. }
  7427. };
  7428. /* */
  7429. var sharedPropertyDefinition = {
  7430. enumerable: true,
  7431. configurable: true,
  7432. get: noop,
  7433. set: noop
  7434. };
  7435. function proxy (target, sourceKey, key) {
  7436. sharedPropertyDefinition.get = function proxyGetter () {
  7437. return this[sourceKey][key]
  7438. };
  7439. sharedPropertyDefinition.set = function proxySetter (val) {
  7440. this[sourceKey][key] = val;
  7441. };
  7442. Object.defineProperty(target, key, sharedPropertyDefinition);
  7443. }
  7444. function initState (vm) {
  7445. vm._watchers = [];
  7446. var opts = vm.$options;
  7447. if (opts.props) { initProps(vm, opts.props); }
  7448. if (opts.methods) { initMethods(vm, opts.methods); }
  7449. if (opts.data) {
  7450. initData(vm);
  7451. } else {
  7452. observe(vm._data = {}, true /* asRootData */);
  7453. }
  7454. if (opts.computed) { initComputed(vm, opts.computed); }
  7455. if (opts.watch && opts.watch !== nativeWatch) {
  7456. initWatch(vm, opts.watch);
  7457. }
  7458. }
  7459. function initProps (vm, propsOptions) {
  7460. var propsData = vm.$options.propsData || {};
  7461. var props = vm._props = {};
  7462. // cache prop keys so that future props updates can iterate using Array
  7463. // instead of dynamic object key enumeration.
  7464. var keys = vm.$options._propKeys = [];
  7465. var isRoot = !vm.$parent;
  7466. // root instance props should be converted
  7467. if (!isRoot) {
  7468. toggleObserving(false);
  7469. }
  7470. var loop = function ( key ) {
  7471. keys.push(key);
  7472. var value = validateProp(key, propsOptions, propsData, vm);
  7473. /* istanbul ignore else */
  7474. if (true) {
  7475. var hyphenatedKey = hyphenate(key);
  7476. if (isReservedAttribute(hyphenatedKey) ||
  7477. config.isReservedAttr(hyphenatedKey)) {
  7478. warn(
  7479. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7480. vm
  7481. );
  7482. }
  7483. defineReactive$$1(props, key, value, function () {
  7484. if (!isRoot && !isUpdatingChildComponent) {
  7485. {
  7486. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  7487. return
  7488. }
  7489. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7490. if(
  7491. key === 'value' &&
  7492. Array.isArray(vm.$options.behaviors) &&
  7493. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7494. ){
  7495. return
  7496. }
  7497. if(vm._getFormData){
  7498. return
  7499. }
  7500. var $parent = vm.$parent;
  7501. while($parent){
  7502. if($parent.__next_tick_pending){
  7503. return
  7504. }
  7505. $parent = $parent.$parent;
  7506. }
  7507. }
  7508. warn(
  7509. "Avoid mutating a prop directly since the value will be " +
  7510. "overwritten whenever the parent component re-renders. " +
  7511. "Instead, use a data or computed property based on the prop's " +
  7512. "value. Prop being mutated: \"" + key + "\"",
  7513. vm
  7514. );
  7515. }
  7516. });
  7517. } else {}
  7518. // static props are already proxied on the component's prototype
  7519. // during Vue.extend(). We only need to proxy props defined at
  7520. // instantiation here.
  7521. if (!(key in vm)) {
  7522. proxy(vm, "_props", key);
  7523. }
  7524. };
  7525. for (var key in propsOptions) loop( key );
  7526. toggleObserving(true);
  7527. }
  7528. function initData (vm) {
  7529. var data = vm.$options.data;
  7530. data = vm._data = typeof data === 'function'
  7531. ? getData(data, vm)
  7532. : data || {};
  7533. if (!isPlainObject(data)) {
  7534. data = {};
  7535. true && warn(
  7536. 'data functions should return an object:\n' +
  7537. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7538. vm
  7539. );
  7540. }
  7541. // proxy data on instance
  7542. var keys = Object.keys(data);
  7543. var props = vm.$options.props;
  7544. var methods = vm.$options.methods;
  7545. var i = keys.length;
  7546. while (i--) {
  7547. var key = keys[i];
  7548. if (true) {
  7549. if (methods && hasOwn(methods, key)) {
  7550. warn(
  7551. ("Method \"" + key + "\" has already been defined as a data property."),
  7552. vm
  7553. );
  7554. }
  7555. }
  7556. if (props && hasOwn(props, key)) {
  7557. true && warn(
  7558. "The data property \"" + key + "\" is already declared as a prop. " +
  7559. "Use prop default value instead.",
  7560. vm
  7561. );
  7562. } else if (!isReserved(key)) {
  7563. proxy(vm, "_data", key);
  7564. }
  7565. }
  7566. // observe data
  7567. observe(data, true /* asRootData */);
  7568. }
  7569. function getData (data, vm) {
  7570. // #7573 disable dep collection when invoking data getters
  7571. pushTarget();
  7572. try {
  7573. return data.call(vm, vm)
  7574. } catch (e) {
  7575. handleError(e, vm, "data()");
  7576. return {}
  7577. } finally {
  7578. popTarget();
  7579. }
  7580. }
  7581. var computedWatcherOptions = { lazy: true };
  7582. function initComputed (vm, computed) {
  7583. // $flow-disable-line
  7584. var watchers = vm._computedWatchers = Object.create(null);
  7585. // computed properties are just getters during SSR
  7586. var isSSR = isServerRendering();
  7587. for (var key in computed) {
  7588. var userDef = computed[key];
  7589. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  7590. if ( true && getter == null) {
  7591. warn(
  7592. ("Getter is missing for computed property \"" + key + "\"."),
  7593. vm
  7594. );
  7595. }
  7596. if (!isSSR) {
  7597. // create internal watcher for the computed property.
  7598. watchers[key] = new Watcher(
  7599. vm,
  7600. getter || noop,
  7601. noop,
  7602. computedWatcherOptions
  7603. );
  7604. }
  7605. // component-defined computed properties are already defined on the
  7606. // component prototype. We only need to define computed properties defined
  7607. // at instantiation here.
  7608. if (!(key in vm)) {
  7609. defineComputed(vm, key, userDef);
  7610. } else if (true) {
  7611. if (key in vm.$data) {
  7612. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  7613. } else if (vm.$options.props && key in vm.$options.props) {
  7614. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  7615. }
  7616. }
  7617. }
  7618. }
  7619. function defineComputed (
  7620. target,
  7621. key,
  7622. userDef
  7623. ) {
  7624. var shouldCache = !isServerRendering();
  7625. if (typeof userDef === 'function') {
  7626. sharedPropertyDefinition.get = shouldCache
  7627. ? createComputedGetter(key)
  7628. : createGetterInvoker(userDef);
  7629. sharedPropertyDefinition.set = noop;
  7630. } else {
  7631. sharedPropertyDefinition.get = userDef.get
  7632. ? shouldCache && userDef.cache !== false
  7633. ? createComputedGetter(key)
  7634. : createGetterInvoker(userDef.get)
  7635. : noop;
  7636. sharedPropertyDefinition.set = userDef.set || noop;
  7637. }
  7638. if ( true &&
  7639. sharedPropertyDefinition.set === noop) {
  7640. sharedPropertyDefinition.set = function () {
  7641. warn(
  7642. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  7643. this
  7644. );
  7645. };
  7646. }
  7647. Object.defineProperty(target, key, sharedPropertyDefinition);
  7648. }
  7649. function createComputedGetter (key) {
  7650. return function computedGetter () {
  7651. var watcher = this._computedWatchers && this._computedWatchers[key];
  7652. if (watcher) {
  7653. if (watcher.dirty) {
  7654. watcher.evaluate();
  7655. }
  7656. if (Dep.SharedObject.target) {// fixed by xxxxxx
  7657. watcher.depend();
  7658. }
  7659. return watcher.value
  7660. }
  7661. }
  7662. }
  7663. function createGetterInvoker(fn) {
  7664. return function computedGetter () {
  7665. return fn.call(this, this)
  7666. }
  7667. }
  7668. function initMethods (vm, methods) {
  7669. var props = vm.$options.props;
  7670. for (var key in methods) {
  7671. if (true) {
  7672. if (typeof methods[key] !== 'function') {
  7673. warn(
  7674. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  7675. "Did you reference the function correctly?",
  7676. vm
  7677. );
  7678. }
  7679. if (props && hasOwn(props, key)) {
  7680. warn(
  7681. ("Method \"" + key + "\" has already been defined as a prop."),
  7682. vm
  7683. );
  7684. }
  7685. if ((key in vm) && isReserved(key)) {
  7686. warn(
  7687. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  7688. "Avoid defining component methods that start with _ or $."
  7689. );
  7690. }
  7691. }
  7692. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  7693. }
  7694. }
  7695. function initWatch (vm, watch) {
  7696. for (var key in watch) {
  7697. var handler = watch[key];
  7698. if (Array.isArray(handler)) {
  7699. for (var i = 0; i < handler.length; i++) {
  7700. createWatcher(vm, key, handler[i]);
  7701. }
  7702. } else {
  7703. createWatcher(vm, key, handler);
  7704. }
  7705. }
  7706. }
  7707. function createWatcher (
  7708. vm,
  7709. expOrFn,
  7710. handler,
  7711. options
  7712. ) {
  7713. if (isPlainObject(handler)) {
  7714. options = handler;
  7715. handler = handler.handler;
  7716. }
  7717. if (typeof handler === 'string') {
  7718. handler = vm[handler];
  7719. }
  7720. return vm.$watch(expOrFn, handler, options)
  7721. }
  7722. function stateMixin (Vue) {
  7723. // flow somehow has problems with directly declared definition object
  7724. // when using Object.defineProperty, so we have to procedurally build up
  7725. // the object here.
  7726. var dataDef = {};
  7727. dataDef.get = function () { return this._data };
  7728. var propsDef = {};
  7729. propsDef.get = function () { return this._props };
  7730. if (true) {
  7731. dataDef.set = function () {
  7732. warn(
  7733. 'Avoid replacing instance root $data. ' +
  7734. 'Use nested data properties instead.',
  7735. this
  7736. );
  7737. };
  7738. propsDef.set = function () {
  7739. warn("$props is readonly.", this);
  7740. };
  7741. }
  7742. Object.defineProperty(Vue.prototype, '$data', dataDef);
  7743. Object.defineProperty(Vue.prototype, '$props', propsDef);
  7744. Vue.prototype.$set = set;
  7745. Vue.prototype.$delete = del;
  7746. Vue.prototype.$watch = function (
  7747. expOrFn,
  7748. cb,
  7749. options
  7750. ) {
  7751. var vm = this;
  7752. if (isPlainObject(cb)) {
  7753. return createWatcher(vm, expOrFn, cb, options)
  7754. }
  7755. options = options || {};
  7756. options.user = true;
  7757. var watcher = new Watcher(vm, expOrFn, cb, options);
  7758. if (options.immediate) {
  7759. try {
  7760. cb.call(vm, watcher.value);
  7761. } catch (error) {
  7762. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  7763. }
  7764. }
  7765. return function unwatchFn () {
  7766. watcher.teardown();
  7767. }
  7768. };
  7769. }
  7770. /* */
  7771. var uid$3 = 0;
  7772. function initMixin (Vue) {
  7773. Vue.prototype._init = function (options) {
  7774. var vm = this;
  7775. // a uid
  7776. vm._uid = uid$3++;
  7777. var startTag, endTag;
  7778. /* istanbul ignore if */
  7779. if ( true && config.performance && mark) {
  7780. startTag = "vue-perf-start:" + (vm._uid);
  7781. endTag = "vue-perf-end:" + (vm._uid);
  7782. mark(startTag);
  7783. }
  7784. // a flag to avoid this being observed
  7785. vm._isVue = true;
  7786. // merge options
  7787. if (options && options._isComponent) {
  7788. // optimize internal component instantiation
  7789. // since dynamic options merging is pretty slow, and none of the
  7790. // internal component options needs special treatment.
  7791. initInternalComponent(vm, options);
  7792. } else {
  7793. vm.$options = mergeOptions(
  7794. resolveConstructorOptions(vm.constructor),
  7795. options || {},
  7796. vm
  7797. );
  7798. }
  7799. /* istanbul ignore else */
  7800. if (true) {
  7801. initProxy(vm);
  7802. } else {}
  7803. // expose real self
  7804. vm._self = vm;
  7805. initLifecycle(vm);
  7806. initEvents(vm);
  7807. initRender(vm);
  7808. callHook(vm, 'beforeCreate');
  7809. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  7810. initState(vm);
  7811. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  7812. !vm._$fallback && callHook(vm, 'created');
  7813. /* istanbul ignore if */
  7814. if ( true && config.performance && mark) {
  7815. vm._name = formatComponentName(vm, false);
  7816. mark(endTag);
  7817. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  7818. }
  7819. if (vm.$options.el) {
  7820. vm.$mount(vm.$options.el);
  7821. }
  7822. };
  7823. }
  7824. function initInternalComponent (vm, options) {
  7825. var opts = vm.$options = Object.create(vm.constructor.options);
  7826. // doing this because it's faster than dynamic enumeration.
  7827. var parentVnode = options._parentVnode;
  7828. opts.parent = options.parent;
  7829. opts._parentVnode = parentVnode;
  7830. var vnodeComponentOptions = parentVnode.componentOptions;
  7831. opts.propsData = vnodeComponentOptions.propsData;
  7832. opts._parentListeners = vnodeComponentOptions.listeners;
  7833. opts._renderChildren = vnodeComponentOptions.children;
  7834. opts._componentTag = vnodeComponentOptions.tag;
  7835. if (options.render) {
  7836. opts.render = options.render;
  7837. opts.staticRenderFns = options.staticRenderFns;
  7838. }
  7839. }
  7840. function resolveConstructorOptions (Ctor) {
  7841. var options = Ctor.options;
  7842. if (Ctor.super) {
  7843. var superOptions = resolveConstructorOptions(Ctor.super);
  7844. var cachedSuperOptions = Ctor.superOptions;
  7845. if (superOptions !== cachedSuperOptions) {
  7846. // super option changed,
  7847. // need to resolve new options.
  7848. Ctor.superOptions = superOptions;
  7849. // check if there are any late-modified/attached options (#4976)
  7850. var modifiedOptions = resolveModifiedOptions(Ctor);
  7851. // update base extend options
  7852. if (modifiedOptions) {
  7853. extend(Ctor.extendOptions, modifiedOptions);
  7854. }
  7855. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  7856. if (options.name) {
  7857. options.components[options.name] = Ctor;
  7858. }
  7859. }
  7860. }
  7861. return options
  7862. }
  7863. function resolveModifiedOptions (Ctor) {
  7864. var modified;
  7865. var latest = Ctor.options;
  7866. var sealed = Ctor.sealedOptions;
  7867. for (var key in latest) {
  7868. if (latest[key] !== sealed[key]) {
  7869. if (!modified) { modified = {}; }
  7870. modified[key] = latest[key];
  7871. }
  7872. }
  7873. return modified
  7874. }
  7875. function Vue (options) {
  7876. if ( true &&
  7877. !(this instanceof Vue)
  7878. ) {
  7879. warn('Vue is a constructor and should be called with the `new` keyword');
  7880. }
  7881. this._init(options);
  7882. }
  7883. initMixin(Vue);
  7884. stateMixin(Vue);
  7885. eventsMixin(Vue);
  7886. lifecycleMixin(Vue);
  7887. renderMixin(Vue);
  7888. /* */
  7889. function initUse (Vue) {
  7890. Vue.use = function (plugin) {
  7891. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  7892. if (installedPlugins.indexOf(plugin) > -1) {
  7893. return this
  7894. }
  7895. // additional parameters
  7896. var args = toArray(arguments, 1);
  7897. args.unshift(this);
  7898. if (typeof plugin.install === 'function') {
  7899. plugin.install.apply(plugin, args);
  7900. } else if (typeof plugin === 'function') {
  7901. plugin.apply(null, args);
  7902. }
  7903. installedPlugins.push(plugin);
  7904. return this
  7905. };
  7906. }
  7907. /* */
  7908. function initMixin$1 (Vue) {
  7909. Vue.mixin = function (mixin) {
  7910. this.options = mergeOptions(this.options, mixin);
  7911. return this
  7912. };
  7913. }
  7914. /* */
  7915. function initExtend (Vue) {
  7916. /**
  7917. * Each instance constructor, including Vue, has a unique
  7918. * cid. This enables us to create wrapped "child
  7919. * constructors" for prototypal inheritance and cache them.
  7920. */
  7921. Vue.cid = 0;
  7922. var cid = 1;
  7923. /**
  7924. * Class inheritance
  7925. */
  7926. Vue.extend = function (extendOptions) {
  7927. extendOptions = extendOptions || {};
  7928. var Super = this;
  7929. var SuperId = Super.cid;
  7930. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  7931. if (cachedCtors[SuperId]) {
  7932. return cachedCtors[SuperId]
  7933. }
  7934. var name = extendOptions.name || Super.options.name;
  7935. if ( true && name) {
  7936. validateComponentName(name);
  7937. }
  7938. var Sub = function VueComponent (options) {
  7939. this._init(options);
  7940. };
  7941. Sub.prototype = Object.create(Super.prototype);
  7942. Sub.prototype.constructor = Sub;
  7943. Sub.cid = cid++;
  7944. Sub.options = mergeOptions(
  7945. Super.options,
  7946. extendOptions
  7947. );
  7948. Sub['super'] = Super;
  7949. // For props and computed properties, we define the proxy getters on
  7950. // the Vue instances at extension time, on the extended prototype. This
  7951. // avoids Object.defineProperty calls for each instance created.
  7952. if (Sub.options.props) {
  7953. initProps$1(Sub);
  7954. }
  7955. if (Sub.options.computed) {
  7956. initComputed$1(Sub);
  7957. }
  7958. // allow further extension/mixin/plugin usage
  7959. Sub.extend = Super.extend;
  7960. Sub.mixin = Super.mixin;
  7961. Sub.use = Super.use;
  7962. // create asset registers, so extended classes
  7963. // can have their private assets too.
  7964. ASSET_TYPES.forEach(function (type) {
  7965. Sub[type] = Super[type];
  7966. });
  7967. // enable recursive self-lookup
  7968. if (name) {
  7969. Sub.options.components[name] = Sub;
  7970. }
  7971. // keep a reference to the super options at extension time.
  7972. // later at instantiation we can check if Super's options have
  7973. // been updated.
  7974. Sub.superOptions = Super.options;
  7975. Sub.extendOptions = extendOptions;
  7976. Sub.sealedOptions = extend({}, Sub.options);
  7977. // cache constructor
  7978. cachedCtors[SuperId] = Sub;
  7979. return Sub
  7980. };
  7981. }
  7982. function initProps$1 (Comp) {
  7983. var props = Comp.options.props;
  7984. for (var key in props) {
  7985. proxy(Comp.prototype, "_props", key);
  7986. }
  7987. }
  7988. function initComputed$1 (Comp) {
  7989. var computed = Comp.options.computed;
  7990. for (var key in computed) {
  7991. defineComputed(Comp.prototype, key, computed[key]);
  7992. }
  7993. }
  7994. /* */
  7995. function initAssetRegisters (Vue) {
  7996. /**
  7997. * Create asset registration methods.
  7998. */
  7999. ASSET_TYPES.forEach(function (type) {
  8000. Vue[type] = function (
  8001. id,
  8002. definition
  8003. ) {
  8004. if (!definition) {
  8005. return this.options[type + 's'][id]
  8006. } else {
  8007. /* istanbul ignore if */
  8008. if ( true && type === 'component') {
  8009. validateComponentName(id);
  8010. }
  8011. if (type === 'component' && isPlainObject(definition)) {
  8012. definition.name = definition.name || id;
  8013. definition = this.options._base.extend(definition);
  8014. }
  8015. if (type === 'directive' && typeof definition === 'function') {
  8016. definition = { bind: definition, update: definition };
  8017. }
  8018. this.options[type + 's'][id] = definition;
  8019. return definition
  8020. }
  8021. };
  8022. });
  8023. }
  8024. /* */
  8025. function getComponentName (opts) {
  8026. return opts && (opts.Ctor.options.name || opts.tag)
  8027. }
  8028. function matches (pattern, name) {
  8029. if (Array.isArray(pattern)) {
  8030. return pattern.indexOf(name) > -1
  8031. } else if (typeof pattern === 'string') {
  8032. return pattern.split(',').indexOf(name) > -1
  8033. } else if (isRegExp(pattern)) {
  8034. return pattern.test(name)
  8035. }
  8036. /* istanbul ignore next */
  8037. return false
  8038. }
  8039. function pruneCache (keepAliveInstance, filter) {
  8040. var cache = keepAliveInstance.cache;
  8041. var keys = keepAliveInstance.keys;
  8042. var _vnode = keepAliveInstance._vnode;
  8043. for (var key in cache) {
  8044. var cachedNode = cache[key];
  8045. if (cachedNode) {
  8046. var name = getComponentName(cachedNode.componentOptions);
  8047. if (name && !filter(name)) {
  8048. pruneCacheEntry(cache, key, keys, _vnode);
  8049. }
  8050. }
  8051. }
  8052. }
  8053. function pruneCacheEntry (
  8054. cache,
  8055. key,
  8056. keys,
  8057. current
  8058. ) {
  8059. var cached$$1 = cache[key];
  8060. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8061. cached$$1.componentInstance.$destroy();
  8062. }
  8063. cache[key] = null;
  8064. remove(keys, key);
  8065. }
  8066. var patternTypes = [String, RegExp, Array];
  8067. var KeepAlive = {
  8068. name: 'keep-alive',
  8069. abstract: true,
  8070. props: {
  8071. include: patternTypes,
  8072. exclude: patternTypes,
  8073. max: [String, Number]
  8074. },
  8075. created: function created () {
  8076. this.cache = Object.create(null);
  8077. this.keys = [];
  8078. },
  8079. destroyed: function destroyed () {
  8080. for (var key in this.cache) {
  8081. pruneCacheEntry(this.cache, key, this.keys);
  8082. }
  8083. },
  8084. mounted: function mounted () {
  8085. var this$1 = this;
  8086. this.$watch('include', function (val) {
  8087. pruneCache(this$1, function (name) { return matches(val, name); });
  8088. });
  8089. this.$watch('exclude', function (val) {
  8090. pruneCache(this$1, function (name) { return !matches(val, name); });
  8091. });
  8092. },
  8093. render: function render () {
  8094. var slot = this.$slots.default;
  8095. var vnode = getFirstComponentChild(slot);
  8096. var componentOptions = vnode && vnode.componentOptions;
  8097. if (componentOptions) {
  8098. // check pattern
  8099. var name = getComponentName(componentOptions);
  8100. var ref = this;
  8101. var include = ref.include;
  8102. var exclude = ref.exclude;
  8103. if (
  8104. // not included
  8105. (include && (!name || !matches(include, name))) ||
  8106. // excluded
  8107. (exclude && name && matches(exclude, name))
  8108. ) {
  8109. return vnode
  8110. }
  8111. var ref$1 = this;
  8112. var cache = ref$1.cache;
  8113. var keys = ref$1.keys;
  8114. var key = vnode.key == null
  8115. // same constructor may get registered as different local components
  8116. // so cid alone is not enough (#3269)
  8117. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8118. : vnode.key;
  8119. if (cache[key]) {
  8120. vnode.componentInstance = cache[key].componentInstance;
  8121. // make current key freshest
  8122. remove(keys, key);
  8123. keys.push(key);
  8124. } else {
  8125. cache[key] = vnode;
  8126. keys.push(key);
  8127. // prune oldest entry
  8128. if (this.max && keys.length > parseInt(this.max)) {
  8129. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8130. }
  8131. }
  8132. vnode.data.keepAlive = true;
  8133. }
  8134. return vnode || (slot && slot[0])
  8135. }
  8136. };
  8137. var builtInComponents = {
  8138. KeepAlive: KeepAlive
  8139. };
  8140. /* */
  8141. function initGlobalAPI (Vue) {
  8142. // config
  8143. var configDef = {};
  8144. configDef.get = function () { return config; };
  8145. if (true) {
  8146. configDef.set = function () {
  8147. warn(
  8148. 'Do not replace the Vue.config object, set individual fields instead.'
  8149. );
  8150. };
  8151. }
  8152. Object.defineProperty(Vue, 'config', configDef);
  8153. // exposed util methods.
  8154. // NOTE: these are not considered part of the public API - avoid relying on
  8155. // them unless you are aware of the risk.
  8156. Vue.util = {
  8157. warn: warn,
  8158. extend: extend,
  8159. mergeOptions: mergeOptions,
  8160. defineReactive: defineReactive$$1
  8161. };
  8162. Vue.set = set;
  8163. Vue.delete = del;
  8164. Vue.nextTick = nextTick;
  8165. // 2.6 explicit observable API
  8166. Vue.observable = function (obj) {
  8167. observe(obj);
  8168. return obj
  8169. };
  8170. Vue.options = Object.create(null);
  8171. ASSET_TYPES.forEach(function (type) {
  8172. Vue.options[type + 's'] = Object.create(null);
  8173. });
  8174. // this is used to identify the "base" constructor to extend all plain-object
  8175. // components with in Weex's multi-instance scenarios.
  8176. Vue.options._base = Vue;
  8177. extend(Vue.options.components, builtInComponents);
  8178. initUse(Vue);
  8179. initMixin$1(Vue);
  8180. initExtend(Vue);
  8181. initAssetRegisters(Vue);
  8182. }
  8183. initGlobalAPI(Vue);
  8184. Object.defineProperty(Vue.prototype, '$isServer', {
  8185. get: isServerRendering
  8186. });
  8187. Object.defineProperty(Vue.prototype, '$ssrContext', {
  8188. get: function get () {
  8189. /* istanbul ignore next */
  8190. return this.$vnode && this.$vnode.ssrContext
  8191. }
  8192. });
  8193. // expose FunctionalRenderContext for ssr runtime helper installation
  8194. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8195. value: FunctionalRenderContext
  8196. });
  8197. Vue.version = '2.6.11';
  8198. /**
  8199. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8200. */
  8201. var ARRAYTYPE = '[object Array]';
  8202. var OBJECTTYPE = '[object Object]';
  8203. var NULLTYPE = '[object Null]';
  8204. var UNDEFINEDTYPE = '[object Undefined]';
  8205. // const FUNCTIONTYPE = '[object Function]'
  8206. function diff(current, pre) {
  8207. var result = {};
  8208. syncKeys(current, pre);
  8209. _diff(current, pre, '', result);
  8210. return result
  8211. }
  8212. function syncKeys(current, pre) {
  8213. if (current === pre) { return }
  8214. var rootCurrentType = type(current);
  8215. var rootPreType = type(pre);
  8216. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8217. if(Object.keys(current).length >= Object.keys(pre).length){
  8218. for (var key in pre) {
  8219. var currentValue = current[key];
  8220. if (currentValue === undefined) {
  8221. current[key] = null;
  8222. } else {
  8223. syncKeys(currentValue, pre[key]);
  8224. }
  8225. }
  8226. }
  8227. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8228. if (current.length >= pre.length) {
  8229. pre.forEach(function (item, index) {
  8230. syncKeys(current[index], item);
  8231. });
  8232. }
  8233. }
  8234. }
  8235. function nullOrUndefined(currentType, preType) {
  8236. if(
  8237. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  8238. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  8239. ) {
  8240. return false
  8241. }
  8242. return true
  8243. }
  8244. function _diff(current, pre, path, result) {
  8245. if (current === pre) { return }
  8246. var rootCurrentType = type(current);
  8247. var rootPreType = type(pre);
  8248. if (rootCurrentType == OBJECTTYPE) {
  8249. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8250. setResult(result, path, current);
  8251. } else {
  8252. var loop = function ( key ) {
  8253. var currentValue = current[key];
  8254. var preValue = pre[key];
  8255. var currentType = type(currentValue);
  8256. var preType = type(preValue);
  8257. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8258. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  8259. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8260. }
  8261. } else if (currentType == ARRAYTYPE) {
  8262. if (preType != ARRAYTYPE) {
  8263. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8264. } else {
  8265. if (currentValue.length < preValue.length) {
  8266. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8267. } else {
  8268. currentValue.forEach(function (item, index) {
  8269. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8270. });
  8271. }
  8272. }
  8273. } else if (currentType == OBJECTTYPE) {
  8274. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8275. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8276. } else {
  8277. for (var subKey in currentValue) {
  8278. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8279. }
  8280. }
  8281. }
  8282. };
  8283. for (var key in current) loop( key );
  8284. }
  8285. } else if (rootCurrentType == ARRAYTYPE) {
  8286. if (rootPreType != ARRAYTYPE) {
  8287. setResult(result, path, current);
  8288. } else {
  8289. if (current.length < pre.length) {
  8290. setResult(result, path, current);
  8291. } else {
  8292. current.forEach(function (item, index) {
  8293. _diff(item, pre[index], path + '[' + index + ']', result);
  8294. });
  8295. }
  8296. }
  8297. } else {
  8298. setResult(result, path, current);
  8299. }
  8300. }
  8301. function setResult(result, k, v) {
  8302. // if (type(v) != FUNCTIONTYPE) {
  8303. result[k] = v;
  8304. // }
  8305. }
  8306. function type(obj) {
  8307. return Object.prototype.toString.call(obj)
  8308. }
  8309. /* */
  8310. function flushCallbacks$1(vm) {
  8311. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8312. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"wx-app-new","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8313. var mpInstance = vm.$scope;
  8314. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8315. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8316. }
  8317. var copies = vm.__next_tick_callbacks.slice(0);
  8318. vm.__next_tick_callbacks.length = 0;
  8319. for (var i = 0; i < copies.length; i++) {
  8320. copies[i]();
  8321. }
  8322. }
  8323. }
  8324. function hasRenderWatcher(vm) {
  8325. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8326. }
  8327. function nextTick$1(vm, cb) {
  8328. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8329. //2.nextTick 之前存在 render watcher
  8330. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8331. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"wx-app-new","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8332. var mpInstance = vm.$scope;
  8333. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8334. ']:nextVueTick');
  8335. }
  8336. return nextTick(cb, vm)
  8337. }else{
  8338. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"wx-app-new","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8339. var mpInstance$1 = vm.$scope;
  8340. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8341. ']:nextMPTick');
  8342. }
  8343. }
  8344. var _resolve;
  8345. if (!vm.__next_tick_callbacks) {
  8346. vm.__next_tick_callbacks = [];
  8347. }
  8348. vm.__next_tick_callbacks.push(function () {
  8349. if (cb) {
  8350. try {
  8351. cb.call(vm);
  8352. } catch (e) {
  8353. handleError(e, vm, 'nextTick');
  8354. }
  8355. } else if (_resolve) {
  8356. _resolve(vm);
  8357. }
  8358. });
  8359. // $flow-disable-line
  8360. if (!cb && typeof Promise !== 'undefined') {
  8361. return new Promise(function (resolve) {
  8362. _resolve = resolve;
  8363. })
  8364. }
  8365. }
  8366. /* */
  8367. function clearInstance(key, value) {
  8368. // 简易去除 Vue 和小程序组件实例
  8369. if (value) {
  8370. if (value._isVue || value.__v_isMPComponent) {
  8371. return {}
  8372. }
  8373. }
  8374. return value
  8375. }
  8376. function cloneWithData(vm) {
  8377. // 确保当前 vm 所有数据被同步
  8378. var ret = Object.create(null);
  8379. var dataKeys = [].concat(
  8380. Object.keys(vm._data || {}),
  8381. Object.keys(vm._computedWatchers || {}));
  8382. dataKeys.reduce(function(ret, key) {
  8383. ret[key] = vm[key];
  8384. return ret
  8385. }, ret);
  8386. // vue-composition-api
  8387. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  8388. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  8389. if (rawBindings) {
  8390. Object.keys(rawBindings).forEach(function (key) {
  8391. ret[key] = vm[key];
  8392. });
  8393. }
  8394. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8395. Object.assign(ret, vm.$mp.data || {});
  8396. if (
  8397. Array.isArray(vm.$options.behaviors) &&
  8398. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8399. ) { //form-field
  8400. ret['name'] = vm.name;
  8401. ret['value'] = vm.value;
  8402. }
  8403. return JSON.parse(JSON.stringify(ret, clearInstance))
  8404. }
  8405. var patch = function(oldVnode, vnode) {
  8406. var this$1 = this;
  8407. if (vnode === null) { //destroy
  8408. return
  8409. }
  8410. if (this.mpType === 'page' || this.mpType === 'component') {
  8411. var mpInstance = this.$scope;
  8412. var data = Object.create(null);
  8413. try {
  8414. data = cloneWithData(this);
  8415. } catch (err) {
  8416. console.error(err);
  8417. }
  8418. data.__webviewId__ = mpInstance.data.__webviewId__;
  8419. var mpData = Object.create(null);
  8420. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  8421. mpData[key] = mpInstance.data[key];
  8422. });
  8423. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  8424. if (Object.keys(diffData).length) {
  8425. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"wx-app-new","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8426. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  8427. ']差量更新',
  8428. JSON.stringify(diffData));
  8429. }
  8430. this.__next_tick_pending = true;
  8431. mpInstance.setData(diffData, function () {
  8432. this$1.__next_tick_pending = false;
  8433. flushCallbacks$1(this$1);
  8434. });
  8435. } else {
  8436. flushCallbacks$1(this);
  8437. }
  8438. }
  8439. };
  8440. /* */
  8441. function createEmptyRender() {
  8442. }
  8443. function mountComponent$1(
  8444. vm,
  8445. el,
  8446. hydrating
  8447. ) {
  8448. if (!vm.mpType) {//main.js 中的 new Vue
  8449. return vm
  8450. }
  8451. if (vm.mpType === 'app') {
  8452. vm.$options.render = createEmptyRender;
  8453. }
  8454. if (!vm.$options.render) {
  8455. vm.$options.render = createEmptyRender;
  8456. if (true) {
  8457. /* istanbul ignore if */
  8458. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  8459. vm.$options.el || el) {
  8460. warn(
  8461. 'You are using the runtime-only build of Vue where the template ' +
  8462. 'compiler is not available. Either pre-compile the templates into ' +
  8463. 'render functions, or use the compiler-included build.',
  8464. vm
  8465. );
  8466. } else {
  8467. warn(
  8468. 'Failed to mount component: template or render function not defined.',
  8469. vm
  8470. );
  8471. }
  8472. }
  8473. }
  8474. !vm._$fallback && callHook(vm, 'beforeMount');
  8475. var updateComponent = function () {
  8476. vm._update(vm._render(), hydrating);
  8477. };
  8478. // we set this to vm._watcher inside the watcher's constructor
  8479. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8480. // component's mounted hook), which relies on vm._watcher being already defined
  8481. new Watcher(vm, updateComponent, noop, {
  8482. before: function before() {
  8483. if (vm._isMounted && !vm._isDestroyed) {
  8484. callHook(vm, 'beforeUpdate');
  8485. }
  8486. }
  8487. }, true /* isRenderWatcher */);
  8488. hydrating = false;
  8489. return vm
  8490. }
  8491. /* */
  8492. function renderClass (
  8493. staticClass,
  8494. dynamicClass
  8495. ) {
  8496. if (isDef(staticClass) || isDef(dynamicClass)) {
  8497. return concat(staticClass, stringifyClass(dynamicClass))
  8498. }
  8499. /* istanbul ignore next */
  8500. return ''
  8501. }
  8502. function concat (a, b) {
  8503. return a ? b ? (a + ' ' + b) : a : (b || '')
  8504. }
  8505. function stringifyClass (value) {
  8506. if (Array.isArray(value)) {
  8507. return stringifyArray(value)
  8508. }
  8509. if (isObject(value)) {
  8510. return stringifyObject(value)
  8511. }
  8512. if (typeof value === 'string') {
  8513. return value
  8514. }
  8515. /* istanbul ignore next */
  8516. return ''
  8517. }
  8518. function stringifyArray (value) {
  8519. var res = '';
  8520. var stringified;
  8521. for (var i = 0, l = value.length; i < l; i++) {
  8522. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8523. if (res) { res += ' '; }
  8524. res += stringified;
  8525. }
  8526. }
  8527. return res
  8528. }
  8529. function stringifyObject (value) {
  8530. var res = '';
  8531. for (var key in value) {
  8532. if (value[key]) {
  8533. if (res) { res += ' '; }
  8534. res += key;
  8535. }
  8536. }
  8537. return res
  8538. }
  8539. /* */
  8540. var parseStyleText = cached(function (cssText) {
  8541. var res = {};
  8542. var listDelimiter = /;(?![^(]*\))/g;
  8543. var propertyDelimiter = /:(.+)/;
  8544. cssText.split(listDelimiter).forEach(function (item) {
  8545. if (item) {
  8546. var tmp = item.split(propertyDelimiter);
  8547. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8548. }
  8549. });
  8550. return res
  8551. });
  8552. // normalize possible array / string values into Object
  8553. function normalizeStyleBinding (bindingStyle) {
  8554. if (Array.isArray(bindingStyle)) {
  8555. return toObject(bindingStyle)
  8556. }
  8557. if (typeof bindingStyle === 'string') {
  8558. return parseStyleText(bindingStyle)
  8559. }
  8560. return bindingStyle
  8561. }
  8562. /* */
  8563. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  8564. function getTarget(obj, path) {
  8565. var parts = path.split('.');
  8566. var key = parts[0];
  8567. if (key.indexOf('__$n') === 0) { //number index
  8568. key = parseInt(key.replace('__$n', ''));
  8569. }
  8570. if (parts.length === 1) {
  8571. return obj[key]
  8572. }
  8573. return getTarget(obj[key], parts.slice(1).join('.'))
  8574. }
  8575. function internalMixin(Vue) {
  8576. Vue.config.errorHandler = function(err, vm, info) {
  8577. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8578. console.error(err);
  8579. /* eslint-disable no-undef */
  8580. var app = typeof getApp === 'function' && getApp();
  8581. if (app && app.onError) {
  8582. app.onError(err);
  8583. }
  8584. };
  8585. var oldEmit = Vue.prototype.$emit;
  8586. Vue.prototype.$emit = function(event) {
  8587. if (this.$scope && event) {
  8588. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  8589. if (triggerEvent) {
  8590. try {
  8591. triggerEvent.call(this.$scope, event, {
  8592. __args__: toArray(arguments, 1)
  8593. });
  8594. } catch (error) {
  8595. }
  8596. }
  8597. }
  8598. return oldEmit.apply(this, arguments)
  8599. };
  8600. Vue.prototype.$nextTick = function(fn) {
  8601. return nextTick$1(this, fn)
  8602. };
  8603. MP_METHODS.forEach(function (method) {
  8604. Vue.prototype[method] = function(args) {
  8605. if (this.$scope && this.$scope[method]) {
  8606. return this.$scope[method](args)
  8607. }
  8608. // mp-alipay
  8609. if (typeof my === 'undefined') {
  8610. return
  8611. }
  8612. if (method === 'createSelectorQuery') {
  8613. /* eslint-disable no-undef */
  8614. return my.createSelectorQuery(args)
  8615. } else if (method === 'createIntersectionObserver') {
  8616. /* eslint-disable no-undef */
  8617. return my.createIntersectionObserver(args)
  8618. }
  8619. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  8620. };
  8621. });
  8622. Vue.prototype.__init_provide = initProvide;
  8623. Vue.prototype.__init_injections = initInjections;
  8624. Vue.prototype.__call_hook = function(hook, args) {
  8625. var vm = this;
  8626. // #7573 disable dep collection when invoking lifecycle hooks
  8627. pushTarget();
  8628. var handlers = vm.$options[hook];
  8629. var info = hook + " hook";
  8630. var ret;
  8631. if (handlers) {
  8632. for (var i = 0, j = handlers.length; i < j; i++) {
  8633. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  8634. }
  8635. }
  8636. if (vm._hasHookEvent) {
  8637. vm.$emit('hook:' + hook, args);
  8638. }
  8639. popTarget();
  8640. return ret
  8641. };
  8642. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  8643. if (Array.isArray(modifiers)) {
  8644. if (modifiers.indexOf('trim') !== -1) {
  8645. value = value.trim();
  8646. }
  8647. if (modifiers.indexOf('number') !== -1) {
  8648. value = this._n(value);
  8649. }
  8650. }
  8651. if (!target) {
  8652. target = this;
  8653. }
  8654. // 解决动态属性添加
  8655. Vue.set(target, key, value);
  8656. };
  8657. Vue.prototype.__set_sync = function(target, key, value) {
  8658. if (!target) {
  8659. target = this;
  8660. }
  8661. // 解决动态属性添加
  8662. Vue.set(target, key, value);
  8663. };
  8664. Vue.prototype.__get_orig = function(item) {
  8665. if (isPlainObject(item)) {
  8666. return item['$orig'] || item
  8667. }
  8668. return item
  8669. };
  8670. Vue.prototype.__get_value = function(dataPath, target) {
  8671. return getTarget(target || this, dataPath)
  8672. };
  8673. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  8674. return renderClass(staticClass, dynamicClass)
  8675. };
  8676. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  8677. if (!dynamicStyle && !staticStyle) {
  8678. return ''
  8679. }
  8680. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  8681. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  8682. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  8683. };
  8684. Vue.prototype.__map = function(val, iteratee) {
  8685. //TODO 暂不考虑 string
  8686. var ret, i, l, keys, key;
  8687. if (Array.isArray(val)) {
  8688. ret = new Array(val.length);
  8689. for (i = 0, l = val.length; i < l; i++) {
  8690. ret[i] = iteratee(val[i], i);
  8691. }
  8692. return ret
  8693. } else if (isObject(val)) {
  8694. keys = Object.keys(val);
  8695. ret = Object.create(null);
  8696. for (i = 0, l = keys.length; i < l; i++) {
  8697. key = keys[i];
  8698. ret[key] = iteratee(val[key], key, i);
  8699. }
  8700. return ret
  8701. } else if (typeof val === 'number') {
  8702. ret = new Array(val);
  8703. for (i = 0, l = val; i < l; i++) {
  8704. // 第一个参数暂时仍和小程序一致
  8705. ret[i] = iteratee(i, i);
  8706. }
  8707. return ret
  8708. }
  8709. return []
  8710. };
  8711. }
  8712. /* */
  8713. var LIFECYCLE_HOOKS$1 = [
  8714. //App
  8715. 'onLaunch',
  8716. 'onShow',
  8717. 'onHide',
  8718. 'onUniNViewMessage',
  8719. 'onPageNotFound',
  8720. 'onThemeChange',
  8721. 'onError',
  8722. 'onUnhandledRejection',
  8723. //Page
  8724. 'onInit',
  8725. 'onLoad',
  8726. // 'onShow',
  8727. 'onReady',
  8728. // 'onHide',
  8729. 'onUnload',
  8730. 'onPullDownRefresh',
  8731. 'onReachBottom',
  8732. 'onTabItemTap',
  8733. 'onAddToFavorites',
  8734. 'onShareTimeline',
  8735. 'onShareAppMessage',
  8736. 'onResize',
  8737. 'onPageScroll',
  8738. 'onNavigationBarButtonTap',
  8739. 'onBackPress',
  8740. 'onNavigationBarSearchInputChanged',
  8741. 'onNavigationBarSearchInputConfirmed',
  8742. 'onNavigationBarSearchInputClicked',
  8743. //Component
  8744. // 'onReady', // 兼容旧版本,应该移除该事件
  8745. 'onPageShow',
  8746. 'onPageHide',
  8747. 'onPageResize',
  8748. 'onUploadDouyinVideo'
  8749. ];
  8750. function lifecycleMixin$1(Vue) {
  8751. //fixed vue-class-component
  8752. var oldExtend = Vue.extend;
  8753. Vue.extend = function(extendOptions) {
  8754. extendOptions = extendOptions || {};
  8755. var methods = extendOptions.methods;
  8756. if (methods) {
  8757. Object.keys(methods).forEach(function (methodName) {
  8758. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  8759. extendOptions[methodName] = methods[methodName];
  8760. delete methods[methodName];
  8761. }
  8762. });
  8763. }
  8764. return oldExtend.call(this, extendOptions)
  8765. };
  8766. var strategies = Vue.config.optionMergeStrategies;
  8767. var mergeHook = strategies.created;
  8768. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  8769. strategies[hook] = mergeHook;
  8770. });
  8771. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  8772. }
  8773. /* */
  8774. // install platform patch function
  8775. Vue.prototype.__patch__ = patch;
  8776. // public mount method
  8777. Vue.prototype.$mount = function(
  8778. el ,
  8779. hydrating
  8780. ) {
  8781. return mountComponent$1(this, el, hydrating)
  8782. };
  8783. lifecycleMixin$1(Vue);
  8784. internalMixin(Vue);
  8785. /* */
  8786. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  8787. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  8788. /***/ }),
  8789. /* 26 */
  8790. /*!*******************************************************!*\
  8791. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/pages.json ***!
  8792. \*******************************************************/
  8793. /*! no static exports found */
  8794. /***/ (function(module, exports) {
  8795. /***/ }),
  8796. /* 27 */,
  8797. /* 28 */,
  8798. /* 29 */,
  8799. /* 30 */,
  8800. /* 31 */,
  8801. /* 32 */
  8802. /*!**********************************************************************************************************!*\
  8803. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  8804. \**********************************************************************************************************/
  8805. /*! exports provided: default */
  8806. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8807. "use strict";
  8808. __webpack_require__.r(__webpack_exports__);
  8809. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  8810. /* globals __VUE_SSR_CONTEXT__ */
  8811. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  8812. // This module is a runtime utility for cleaner component module output and will
  8813. // be included in the final webpack user bundle.
  8814. function normalizeComponent (
  8815. scriptExports,
  8816. render,
  8817. staticRenderFns,
  8818. functionalTemplate,
  8819. injectStyles,
  8820. scopeId,
  8821. moduleIdentifier, /* server only */
  8822. shadowMode, /* vue-cli only */
  8823. components, // fixed by xxxxxx auto components
  8824. renderjs // fixed by xxxxxx renderjs
  8825. ) {
  8826. // Vue.extend constructor export interop
  8827. var options = typeof scriptExports === 'function'
  8828. ? scriptExports.options
  8829. : scriptExports
  8830. // fixed by xxxxxx auto components
  8831. if (components) {
  8832. if (!options.components) {
  8833. options.components = {}
  8834. }
  8835. var hasOwn = Object.prototype.hasOwnProperty
  8836. for (var name in components) {
  8837. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  8838. options.components[name] = components[name]
  8839. }
  8840. }
  8841. }
  8842. // fixed by xxxxxx renderjs
  8843. if (renderjs) {
  8844. if(typeof renderjs.beforeCreate === 'function'){
  8845. renderjs.beforeCreate = [renderjs.beforeCreate]
  8846. }
  8847. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  8848. this[renderjs.__module] = this
  8849. });
  8850. (options.mixins || (options.mixins = [])).push(renderjs)
  8851. }
  8852. // render functions
  8853. if (render) {
  8854. options.render = render
  8855. options.staticRenderFns = staticRenderFns
  8856. options._compiled = true
  8857. }
  8858. // functional template
  8859. if (functionalTemplate) {
  8860. options.functional = true
  8861. }
  8862. // scopedId
  8863. if (scopeId) {
  8864. options._scopeId = 'data-v-' + scopeId
  8865. }
  8866. var hook
  8867. if (moduleIdentifier) { // server build
  8868. hook = function (context) {
  8869. // 2.3 injection
  8870. context =
  8871. context || // cached call
  8872. (this.$vnode && this.$vnode.ssrContext) || // stateful
  8873. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  8874. // 2.2 with runInNewContext: true
  8875. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  8876. context = __VUE_SSR_CONTEXT__
  8877. }
  8878. // inject component styles
  8879. if (injectStyles) {
  8880. injectStyles.call(this, context)
  8881. }
  8882. // register component module identifier for async chunk inferrence
  8883. if (context && context._registeredComponents) {
  8884. context._registeredComponents.add(moduleIdentifier)
  8885. }
  8886. }
  8887. // used by ssr in case component is cached and beforeCreate
  8888. // never gets called
  8889. options._ssrRegister = hook
  8890. } else if (injectStyles) {
  8891. hook = shadowMode
  8892. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  8893. : injectStyles
  8894. }
  8895. if (hook) {
  8896. if (options.functional) {
  8897. // for template-only hot-reload because in that case the render fn doesn't
  8898. // go through the normalizer
  8899. options._injectStyles = hook
  8900. // register for functioal component in vue file
  8901. var originalRender = options.render
  8902. options.render = function renderWithStyleInjection (h, context) {
  8903. hook.call(context)
  8904. return originalRender(h, context)
  8905. }
  8906. } else {
  8907. // inject component registration as beforeCreate hook
  8908. var existing = options.beforeCreate
  8909. options.beforeCreate = existing
  8910. ? [].concat(existing, hook)
  8911. : [hook]
  8912. }
  8913. }
  8914. return {
  8915. exports: scriptExports,
  8916. options: options
  8917. }
  8918. }
  8919. /***/ }),
  8920. /* 33 */,
  8921. /* 34 */,
  8922. /* 35 */,
  8923. /* 36 */,
  8924. /* 37 */,
  8925. /* 38 */,
  8926. /* 39 */
  8927. /*!***********************************************************!*\
  8928. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/utils/https.js ***!
  8929. \***********************************************************/
  8930. /*! no static exports found */
  8931. /***/ (function(module, exports, __webpack_require__) {
  8932. "use strict";
  8933. /* WEBPACK VAR INJECTION */(function(wx, uni) {
  8934. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  8935. Object.defineProperty(exports, "__esModule", {
  8936. value: true
  8937. });
  8938. exports.default = void 0;
  8939. var _config = _interopRequireDefault(__webpack_require__(/*! ./config */ 40));
  8940. // 区分开发环境和生产环境 接口地址
  8941. var baseUrl = _config.default.baseUrl;
  8942. // let baseUrl = 'http://60.191.110.205:19099/';
  8943. // let baseUrl = 'https://ksfdc.zjugis.com:19099/';
  8944. function https(config) {
  8945. //显示loading
  8946. wx.showLoading({
  8947. title: '正在请求中'
  8948. });
  8949. //设置请求头
  8950. if (!config.header) {
  8951. config.header = {};
  8952. }
  8953. if (!config.header['content-type']) {
  8954. config.header['content-type'] = 'application/json';
  8955. }
  8956. config.url = baseUrl + config.url; // 请求地址
  8957. var promise = new Promise(function (resolve, reject) {
  8958. uni.request(config).then(function (res) {
  8959. wx.hideLoading(); //隐藏loading
  8960. if (res[0]) {
  8961. uni.showToast({
  8962. title: "数据获取失败",
  8963. icon: "none",
  8964. duration: 1500
  8965. });
  8966. reject(false);
  8967. } else {
  8968. var data = res[1].data;
  8969. if (data.code == 1) {
  8970. resolve(data);
  8971. } else {
  8972. resolve(data);
  8973. }
  8974. }
  8975. }).catch(function (error) {
  8976. wx.hideLoading(); //隐藏loading
  8977. reject(error);
  8978. });
  8979. });
  8980. return promise;
  8981. }
  8982. var _default = https;
  8983. exports.default = _default;
  8984. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  8985. /***/ }),
  8986. /* 40 */
  8987. /*!************************************************************!*\
  8988. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/utils/config.js ***!
  8989. \************************************************************/
  8990. /*! no static exports found */
  8991. /***/ (function(module, exports, __webpack_require__) {
  8992. "use strict";
  8993. Object.defineProperty(exports, "__esModule", {
  8994. value: true
  8995. });
  8996. exports.default = void 0;
  8997. var config = {
  8998. //发布线上需要吧login里面地址跟这里替换掉
  8999. // baseUrl: "http://10.10.9.71:7089/ysgzybz/",
  9000. // webViewUrl: "http://10.10.9.58:8083/#/",
  9001. baseUrl: "https://zlzd.zrzyt.zj.gov.cn/app215/ybz-api/",
  9002. // webViewUrl: "https://zlzd.zrzyt.zj.gov.cn/app215/wxin-view/#/",
  9003. webViewUrl: "https://zlzd.zrzyt.zj.gov.cn/app215/wxin-view2/#/",
  9004. bjdkgl: 'https://zlzd.zrzyt.zj.gov.cn/geoserver/sde'
  9005. };
  9006. var _default = config;
  9007. exports.default = _default;
  9008. /***/ }),
  9009. /* 41 */,
  9010. /* 42 */,
  9011. /* 43 */,
  9012. /* 44 */,
  9013. /* 45 */,
  9014. /* 46 */,
  9015. /* 47 */,
  9016. /* 48 */,
  9017. /* 49 */,
  9018. /* 50 */,
  9019. /* 51 */,
  9020. /* 52 */,
  9021. /* 53 */,
  9022. /* 54 */,
  9023. /* 55 */,
  9024. /* 56 */,
  9025. /* 57 */
  9026. /*!*******************************************************************!*\
  9027. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/mixins/CustomMixins.js ***!
  9028. \*******************************************************************/
  9029. /*! no static exports found */
  9030. /***/ (function(module, exports, __webpack_require__) {
  9031. "use strict";
  9032. /* WEBPACK VAR INJECTION */(function(wx) {
  9033. Object.defineProperty(exports, "__esModule", {
  9034. value: true
  9035. });
  9036. exports.default = void 0;
  9037. var _default = {
  9038. data: function data() {
  9039. return {
  9040. innerAudioContext: null,
  9041. address: ''
  9042. };
  9043. },
  9044. methods: {
  9045. getLocationInfoByLatLnt: function getLocationInfoByLatLnt(lat, lng) {
  9046. var that = this;
  9047. var locationInfoURL = "https://apis.map.qq.com/ws/geocoder/v1/?location=".concat(lat, ",").concat(lng, "&key=G4BBZ-YSMCJ-56AFX-KD4FQ-23RQZ-S7FX3");
  9048. wx.request({
  9049. url: locationInfoURL,
  9050. //仅为示例,并非真实的接口地址
  9051. success: function success(res) {
  9052. var resultData = res.data;
  9053. that.address = resultData['result'].address;
  9054. }
  9055. });
  9056. },
  9057. setTabBarIndex: function setTabBarIndex(index) {
  9058. if (typeof this.$scope.getTabBar === 'function' && this.$scope.getTabBar()) {
  9059. this.$scope.getTabBar().setData({
  9060. selected: index
  9061. });
  9062. }
  9063. },
  9064. getTimeFuns: function getTimeFuns(sTimeStr, eTimeStr) {
  9065. var sTime = new Date(sTimeStr);
  9066. var eTime = +new Date(eTimeStr); //返回的是用户输入时间总的毫秒数
  9067. var secondTime = (eTime - sTime) / 1000; //剩余时间总的秒数
  9068. var d = parseInt(secondTime / 60 / 60 / 24); //计算天数
  9069. var h = parseInt(secondTime / 60 / 60 % 24); //计算小时
  9070. var m = parseInt(secondTime / 60 % 60); //计算分
  9071. var s = parseInt(secondTime % 60); //计算当前秒数
  9072. return {
  9073. time: Math.abs(d) + '天' + Math.abs(h) + '时' + Math.abs(m) + '分',
  9074. time2: {
  9075. a: d,
  9076. b: h,
  9077. c: m
  9078. }
  9079. };
  9080. },
  9081. //播放语音
  9082. createAudio: function createAudio(srcMic) {
  9083. if (this.innerAudioContext) return;
  9084. var that = this;
  9085. //创建内部 audio 上下文 InnerAudioContext 对象。
  9086. that.innerAudioContext = wx.createInnerAudioContext();
  9087. that.innerAudioContext.onError(function (error) {
  9088. console.error("自定义报错(checkedDetail 137行):" + error);
  9089. });
  9090. that.innerAudioContext.src = srcMic; //设置音频地址
  9091. },
  9092. //播放
  9093. audioPlay: function audioPlay(srcMic) {
  9094. this.createAudio(srcMic);
  9095. this.innerAudioContext.play(); //播放音频
  9096. return this.innerAudioContext;
  9097. },
  9098. // 停止播放
  9099. audioPause: function audioPause() {
  9100. if (!this.innerAudioContext) return;
  9101. this.innerAudioContext.pause(); //播放音频
  9102. }
  9103. }
  9104. };
  9105. exports.default = _default;
  9106. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  9107. /***/ }),
  9108. /* 58 */
  9109. /*!***********************************************************************!*\
  9110. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/utils/formData/formData.js ***!
  9111. \***********************************************************************/
  9112. /*! no static exports found */
  9113. /***/ (function(module, exports, __webpack_require__) {
  9114. /* WEBPACK VAR INJECTION */(function(wx) {var _toConsumableArray = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18);
  9115. var mimeMap = __webpack_require__(/*! ./mimeMap.js */ 59);
  9116. function FormData() {
  9117. var fileManager = wx.getFileSystemManager();
  9118. var data = {};
  9119. var files = [];
  9120. this.append = function (name, value) {
  9121. data[name] = value;
  9122. return true;
  9123. };
  9124. this.appendFile = function (name, path, fileName) {
  9125. var buffer = fileManager.readFileSync(path);
  9126. if (Object.prototype.toString.call(buffer).indexOf("ArrayBuffer") < 0) {
  9127. return false;
  9128. }
  9129. if (!fileName) {
  9130. fileName = getFileNameFromPath(path);
  9131. }
  9132. files.push({
  9133. name: name,
  9134. buffer: buffer,
  9135. fileName: fileName
  9136. });
  9137. return true;
  9138. };
  9139. this.getData = function () {
  9140. return convert(data, files);
  9141. };
  9142. }
  9143. function getFileNameFromPath(path) {
  9144. var idx = path.lastIndexOf("/");
  9145. return path.substr(idx + 1);
  9146. }
  9147. function convert(data, files) {
  9148. var boundaryKey = 'wxmpFormBoundary' + randString(); // 数据分割符,一般是随机的字符串
  9149. var boundary = '--' + boundaryKey;
  9150. var endBoundary = boundary + '--';
  9151. var postArray = [];
  9152. //拼接参数
  9153. if (data && Object.prototype.toString.call(data) == "[object Object]") {
  9154. for (var key in data) {
  9155. postArray = postArray.concat(formDataArray(boundary, key, data[key]));
  9156. }
  9157. }
  9158. //拼接文件
  9159. if (files && Object.prototype.toString.call(files) == "[object Array]") {
  9160. for (var i in files) {
  9161. var file = files[i];
  9162. postArray = postArray.concat(formDataArray(boundary, file.name, file.buffer, file.fileName));
  9163. }
  9164. }
  9165. //结尾
  9166. var endBoundaryArray = [];
  9167. endBoundaryArray.push.apply(endBoundaryArray, _toConsumableArray(endBoundary.toUtf8Bytes()));
  9168. postArray = postArray.concat(endBoundaryArray);
  9169. return {
  9170. contentType: 'multipart/form-data; boundary=' + boundaryKey,
  9171. buffer: new Uint8Array(postArray).buffer
  9172. };
  9173. }
  9174. function randString() {
  9175. var res = "";
  9176. for (var i = 0; i < 17; i++) {
  9177. var n = parseInt(Math.random() * 62);
  9178. if (n <= 9) {
  9179. res += n;
  9180. } else if (n <= 35) {
  9181. res += String.fromCharCode(n + 55);
  9182. } else {
  9183. res += String.fromCharCode(n + 61);
  9184. }
  9185. }
  9186. return res;
  9187. }
  9188. function formDataArray(boundary, name, value, fileName) {
  9189. var _dataArray, _dataArray2, _dataArray3;
  9190. var dataString = '';
  9191. var isFile = !!fileName;
  9192. dataString += boundary + '\r\n';
  9193. dataString += 'Content-Disposition: form-data; name="' + name + '"';
  9194. if (isFile) {
  9195. dataString += '; filename="' + fileName + '"' + '\r\n';
  9196. dataString += 'Content-Type: ' + getFileMime(fileName) + '\r\n\r\n';
  9197. } else {
  9198. dataString += '\r\n\r\n';
  9199. dataString += value;
  9200. }
  9201. var dataArray = [];
  9202. (_dataArray = dataArray).push.apply(_dataArray, _toConsumableArray(dataString.toUtf8Bytes()));
  9203. if (isFile) {
  9204. var fileArray = new Uint8Array(value);
  9205. dataArray = dataArray.concat(Array.prototype.slice.call(fileArray));
  9206. }
  9207. (_dataArray2 = dataArray).push.apply(_dataArray2, _toConsumableArray("\r".toUtf8Bytes()));
  9208. (_dataArray3 = dataArray).push.apply(_dataArray3, _toConsumableArray("\n".toUtf8Bytes()));
  9209. return dataArray;
  9210. }
  9211. function getFileMime(fileName) {
  9212. var idx = fileName.lastIndexOf(".");
  9213. var mime = mimeMap[fileName.substr(idx)];
  9214. return mime ? mime : "application/octet-stream";
  9215. }
  9216. String.prototype.toUtf8Bytes = function () {
  9217. var str = this;
  9218. var bytes = [];
  9219. for (var i = 0; i < str.length; i++) {
  9220. bytes.push.apply(bytes, _toConsumableArray(str.utf8CodeAt(i)));
  9221. if (str.codePointAt(i) > 0xffff) {
  9222. i++;
  9223. }
  9224. }
  9225. return bytes;
  9226. };
  9227. String.prototype.utf8CodeAt = function (i) {
  9228. var str = this;
  9229. var out = [],
  9230. p = 0;
  9231. var c = str.charCodeAt(i);
  9232. if (c < 128) {
  9233. out[p++] = c;
  9234. } else if (c < 2048) {
  9235. out[p++] = c >> 6 | 192;
  9236. out[p++] = c & 63 | 128;
  9237. } else if ((c & 0xFC00) == 0xD800 && i + 1 < str.length && (str.charCodeAt(i + 1) & 0xFC00) == 0xDC00) {
  9238. // Surrogate Pair
  9239. c = 0x10000 + ((c & 0x03FF) << 10) + (str.charCodeAt(++i) & 0x03FF);
  9240. out[p++] = c >> 18 | 240;
  9241. out[p++] = c >> 12 & 63 | 128;
  9242. out[p++] = c >> 6 & 63 | 128;
  9243. out[p++] = c & 63 | 128;
  9244. } else {
  9245. out[p++] = c >> 12 | 224;
  9246. out[p++] = c >> 6 & 63 | 128;
  9247. out[p++] = c & 63 | 128;
  9248. }
  9249. return out;
  9250. };
  9251. module.exports = FormData;
  9252. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  9253. /***/ }),
  9254. /* 59 */
  9255. /*!**********************************************************************!*\
  9256. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/utils/formData/mimeMap.js ***!
  9257. \**********************************************************************/
  9258. /*! no static exports found */
  9259. /***/ (function(module, exports, __webpack_require__) {
  9260. var _defineProperty = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11);
  9261. var _module$exports;
  9262. module.exports = (_module$exports = {
  9263. "0.001": "application/x-001",
  9264. "0.323": "text/h323",
  9265. "0.907": "drawing/907",
  9266. ".acp": "audio/x-mei-aac",
  9267. ".aif": "audio/aiff",
  9268. ".aiff": "audio/aiff",
  9269. ".asa": "text/asa",
  9270. ".asp": "text/asp",
  9271. ".au": "audio/basic",
  9272. ".awf": "application/vnd.adobe.workflow",
  9273. ".bmp": "application/x-bmp",
  9274. ".c4t": "application/x-c4t",
  9275. ".cal": "application/x-cals",
  9276. ".cdf": "application/x-netcdf",
  9277. ".cel": "application/x-cel",
  9278. ".cg4": "application/x-g4",
  9279. ".cit": "application/x-cit",
  9280. ".cml": "text/xml",
  9281. ".cmx": "application/x-cmx",
  9282. ".crl": "application/pkix-crl",
  9283. ".csi": "application/x-csi",
  9284. ".cut": "application/x-cut",
  9285. ".dbm": "application/x-dbm",
  9286. ".dcd": "text/xml",
  9287. ".der": "application/x-x509-ca-cert",
  9288. ".dib": "application/x-dib",
  9289. ".doc": "application/msword",
  9290. ".drw": "application/x-drw",
  9291. ".dwf": "Model/vnd.dwf",
  9292. ".dwg": "application/x-dwg",
  9293. ".dxf": "application/x-dxf",
  9294. ".emf": "application/x-emf",
  9295. ".ent": "text/xml",
  9296. ".eps": "application/x-ps",
  9297. ".etd": "application/x-ebx",
  9298. ".fax": "image/fax",
  9299. ".fif": "application/fractals",
  9300. ".frm": "application/x-frm",
  9301. ".gbr": "application/x-gbr",
  9302. ".gif": "image/gif",
  9303. ".gp4": "application/x-gp4",
  9304. ".hmr": "application/x-hmr",
  9305. ".hpl": "application/x-hpl",
  9306. ".hrf": "application/x-hrf",
  9307. ".htc": "text/x-component",
  9308. ".html": "text/html",
  9309. ".htx": "text/html",
  9310. ".ico": "image/x-icon",
  9311. ".iff": "application/x-iff",
  9312. ".igs": "application/x-igs",
  9313. ".img": "application/x-img",
  9314. ".isp": "application/x-internet-signup",
  9315. ".java": "java/*",
  9316. ".jpe": "image/jpeg",
  9317. ".jpeg": "image/jpeg",
  9318. ".jpg": "application/x-jpg",
  9319. ".jsp": "text/html",
  9320. ".lar": "application/x-laplayer-reg",
  9321. ".lavs": "audio/x-liquid-secure",
  9322. ".lmsff": "audio/x-la-lms",
  9323. ".ltr": "application/x-ltr",
  9324. ".m2v": "video/x-mpeg",
  9325. ".m4e": "video/mpeg4",
  9326. ".man": "application/x-troff-man",
  9327. ".mdb": "application/msaccess",
  9328. ".mfp": "application/x-shockwave-flash",
  9329. ".mhtml": "message/rfc822",
  9330. ".mid": "audio/mid",
  9331. ".mil": "application/x-mil",
  9332. ".mnd": "audio/x-musicnet-download",
  9333. ".mocha": "application/x-javascript",
  9334. ".mp1": "audio/mp1",
  9335. ".mp2v": "video/mpeg",
  9336. ".mp4": "video/mpeg4",
  9337. ".mpd": "application/vnd.ms-project",
  9338. ".mpeg": "video/mpg",
  9339. ".mpga": "audio/rn-mpeg",
  9340. ".mps": "video/x-mpeg",
  9341. ".mpv": "video/mpg",
  9342. ".mpw": "application/vnd.ms-project",
  9343. ".mtx": "text/xml",
  9344. ".net": "image/pnetvue",
  9345. ".nws": "message/rfc822",
  9346. ".out": "application/x-out",
  9347. ".p12": "application/x-pkcs12",
  9348. ".p7c": "application/pkcs7-mime",
  9349. ".p7r": "application/x-pkcs7-certreqresp",
  9350. ".pc5": "application/x-pc5",
  9351. ".pcl": "application/x-pcl",
  9352. ".pdf": "application/pdf",
  9353. ".pdx": "application/vnd.adobe.pdx",
  9354. ".pgl": "application/x-pgl",
  9355. ".pko": "application/vnd.ms-pki.pko",
  9356. ".plg": "text/html",
  9357. ".plt": "application/x-plt",
  9358. ".png": "application/x-png",
  9359. ".ppa": "application/vnd.ms-powerpoint",
  9360. ".pps": "application/vnd.ms-powerpoint",
  9361. ".ppt": "application/x-ppt",
  9362. ".prf": "application/pics-rules",
  9363. ".prt": "application/x-prt",
  9364. ".ps": "application/postscript",
  9365. ".pwz": "application/vnd.ms-powerpoint",
  9366. ".ra": "audio/vnd.rn-realaudio",
  9367. ".ras": "application/x-ras",
  9368. ".rdf": "text/xml",
  9369. ".red": "application/x-red",
  9370. ".rjs": "application/vnd.rn-realsystem-rjs",
  9371. ".rlc": "application/x-rlc",
  9372. ".rm": "application/vnd.rn-realmedia",
  9373. ".rmi": "audio/mid",
  9374. ".rmm": "audio/x-pn-realaudio",
  9375. ".rms": "application/vnd.rn-realmedia-secure",
  9376. ".rmx": "application/vnd.rn-realsystem-rmx",
  9377. ".rp": "image/vnd.rn-realpix",
  9378. ".rsml": "application/vnd.rn-rsml",
  9379. ".rtf": "application/msword",
  9380. ".rv": "video/vnd.rn-realvideo",
  9381. ".sat": "application/x-sat",
  9382. ".sdw": "application/x-sdw",
  9383. ".slb": "application/x-slb",
  9384. ".slk": "drawing/x-slk",
  9385. ".smil": "application/smil",
  9386. ".snd": "audio/basic",
  9387. ".sor": "text/plain",
  9388. ".spl": "application/futuresplash",
  9389. ".ssm": "application/streamingmedia",
  9390. ".stl": "application/vnd.ms-pki.stl",
  9391. ".sty": "application/x-sty",
  9392. ".swf": "application/x-shockwave-flash",
  9393. ".tg4": "application/x-tg4",
  9394. ".tif": "image/tiff",
  9395. ".tiff": "image/tiff",
  9396. ".top": "drawing/x-top",
  9397. ".tsd": "text/xml",
  9398. ".uin": "application/x-icq",
  9399. ".vcf": "text/x-vcard",
  9400. ".vdx": "application/vnd.visio",
  9401. ".vpg": "application/x-vpeg005",
  9402. ".vsd": "application/x-vsd",
  9403. ".vst": "application/vnd.visio",
  9404. ".vsw": "application/vnd.visio",
  9405. ".vtx": "application/vnd.visio",
  9406. ".wav": "audio/wav",
  9407. ".wb1": "application/x-wb1",
  9408. ".wb3": "application/x-wb3",
  9409. ".wiz": "application/msword",
  9410. ".wk4": "application/x-wk4",
  9411. ".wks": "application/x-wks",
  9412. ".wma": "audio/x-ms-wma",
  9413. ".wmf": "application/x-wmf",
  9414. ".wmv": "video/x-ms-wmv",
  9415. ".wmz": "application/x-ms-wmz",
  9416. ".wpd": "application/x-wpd",
  9417. ".wpl": "application/vnd.ms-wpl",
  9418. ".wr1": "application/x-wr1",
  9419. ".wrk": "application/x-wrk",
  9420. ".ws2": "application/x-ws",
  9421. ".wsdl": "text/xml",
  9422. ".xdp": "application/vnd.adobe.xdp",
  9423. ".xfd": "application/vnd.adobe.xfd",
  9424. ".xhtml": "text/html",
  9425. ".xls": "application/x-xls",
  9426. ".xml": "text/xml",
  9427. ".xq": "text/xml",
  9428. ".xquery": "text/xml",
  9429. ".xsl": "text/xml",
  9430. ".xwd": "application/x-xwd",
  9431. ".sis": "application/vnd.symbian.install",
  9432. ".x_t": "application/x-x_t",
  9433. ".apk": "application/vnd.android.package-archive",
  9434. "0.301": "application/x-301",
  9435. "0.906": "application/x-906",
  9436. ".a11": "application/x-a11",
  9437. ".ai": "application/postscript",
  9438. ".aifc": "audio/aiff",
  9439. ".anv": "application/x-anv",
  9440. ".asf": "video/x-ms-asf",
  9441. ".asx": "video/x-ms-asf",
  9442. ".avi": "video/avi",
  9443. ".biz": "text/xml",
  9444. ".bot": "application/x-bot",
  9445. ".c90": "application/x-c90",
  9446. ".cat": "application/vnd.ms-pki.seccat",
  9447. ".cdr": "application/x-cdr",
  9448. ".cer": "application/x-x509-ca-cert",
  9449. ".cgm": "application/x-cgm",
  9450. ".class": "java/*",
  9451. ".cmp": "application/x-cmp",
  9452. ".cot": "application/x-cot",
  9453. ".crt": "application/x-x509-ca-cert",
  9454. ".css": "text/css",
  9455. ".dbf": "application/x-dbf",
  9456. ".dbx": "application/x-dbx",
  9457. ".dcx": "application/x-dcx",
  9458. ".dgn": "application/x-dgn",
  9459. ".dll": "application/x-msdownload",
  9460. ".dot": "application/msword",
  9461. ".dtd": "text/xml"
  9462. }, _defineProperty(_module$exports, ".dwf", "application/x-dwf"), _defineProperty(_module$exports, ".dxb", "application/x-dxb"), _defineProperty(_module$exports, ".edn", "application/vnd.adobe.edn"), _defineProperty(_module$exports, ".eml", "message/rfc822"), _defineProperty(_module$exports, ".epi", "application/x-epi"), _defineProperty(_module$exports, ".eps", "application/postscript"), _defineProperty(_module$exports, ".exe", "application/x-msdownload"), _defineProperty(_module$exports, ".fdf", "application/vnd.fdf"), _defineProperty(_module$exports, ".fo", "text/xml"), _defineProperty(_module$exports, ".g4", "application/x-g4"), _defineProperty(_module$exports, ".tif", "image/tiff"), _defineProperty(_module$exports, ".gl2", "application/x-gl2"), _defineProperty(_module$exports, ".hgl", "application/x-hgl"), _defineProperty(_module$exports, ".hpg", "application/x-hpgl"), _defineProperty(_module$exports, ".hqx", "application/mac-binhex40"), _defineProperty(_module$exports, ".hta", "application/hta"), _defineProperty(_module$exports, ".htm", "text/html"), _defineProperty(_module$exports, ".htt", "text/webviewhtml"), _defineProperty(_module$exports, ".icb", "application/x-icb"), _defineProperty(_module$exports, ".ico", "application/x-ico"), _defineProperty(_module$exports, ".ig4", "application/x-g4"), _defineProperty(_module$exports, ".iii", "application/x-iphone"), _defineProperty(_module$exports, ".ins", "application/x-internet-signup"), _defineProperty(_module$exports, ".IVF", "video/x-ivf"), _defineProperty(_module$exports, ".jfif", "image/jpeg"), _defineProperty(_module$exports, ".jpe", "application/x-jpe"), _defineProperty(_module$exports, ".jpg", "image/jpeg"), _defineProperty(_module$exports, ".js", "application/x-javascript"), _defineProperty(_module$exports, ".la1", "audio/x-liquid-file"), _defineProperty(_module$exports, ".latex", "application/x-latex"), _defineProperty(_module$exports, ".lbm", "application/x-lbm"), _defineProperty(_module$exports, ".ls", "application/x-javascript"), _defineProperty(_module$exports, ".m1v", "video/x-mpeg"), _defineProperty(_module$exports, ".m3u", "audio/mpegurl"), _defineProperty(_module$exports, ".mac", "application/x-mac"), _defineProperty(_module$exports, ".math", "text/xml"), _defineProperty(_module$exports, ".mdb", "application/x-mdb"), _defineProperty(_module$exports, ".mht", "message/rfc822"), _defineProperty(_module$exports, ".mi", "application/x-mi"), _defineProperty(_module$exports, ".midi", "audio/mid"), _defineProperty(_module$exports, ".mml", "text/xml"), _defineProperty(_module$exports, ".mns", "audio/x-musicnet-stream"), _defineProperty(_module$exports, ".movie", "video/x-sgi-movie"), _defineProperty(_module$exports, ".mp2", "audio/mp2"), _defineProperty(_module$exports, ".mp3", "audio/mp3"), _defineProperty(_module$exports, ".mpa", "video/x-mpg"), _defineProperty(_module$exports, ".mpe", "video/x-mpeg"), _defineProperty(_module$exports, ".mpg", "video/mpg"), _defineProperty(_module$exports, ".mpp", "application/vnd.ms-project"), _defineProperty(_module$exports, ".mpt", "application/vnd.ms-project"), _defineProperty(_module$exports, ".mpv2", "video/mpeg"), _defineProperty(_module$exports, ".mpx", "application/vnd.ms-project"), _defineProperty(_module$exports, ".mxp", "application/x-mmxp"), _defineProperty(_module$exports, ".nrf", "application/x-nrf"), _defineProperty(_module$exports, ".odc", "text/x-ms-odc"), _defineProperty(_module$exports, ".p10", "application/pkcs10"), _defineProperty(_module$exports, ".p7b", "application/x-pkcs7-certificates"), _defineProperty(_module$exports, ".p7m", "application/pkcs7-mime"), _defineProperty(_module$exports, ".p7s", "application/pkcs7-signature"), _defineProperty(_module$exports, ".pci", "application/x-pci"), _defineProperty(_module$exports, ".pcx", "application/x-pcx"), _defineProperty(_module$exports, ".pdf", "application/pdf"), _defineProperty(_module$exports, ".pfx", "application/x-pkcs12"), _defineProperty(_module$exports, ".pic", "application/x-pic"), _defineProperty(_module$exports, ".pl", "application/x-perl"), _defineProperty(_module$exports, ".pls", "audio/scpls"), _defineProperty(_module$exports, ".png", "image/png"), _defineProperty(_module$exports, ".pot", "application/vnd.ms-powerpoint"), _defineProperty(_module$exports, ".ppm", "application/x-ppm"), _defineProperty(_module$exports, ".ppt", "application/vnd.ms-powerpoint"), _defineProperty(_module$exports, ".pr", "application/x-pr"), _defineProperty(_module$exports, ".prn", "application/x-prn"), _defineProperty(_module$exports, ".ps", "application/x-ps"), _defineProperty(_module$exports, ".ptn", "application/x-ptn"), _defineProperty(_module$exports, ".r3t", "text/vnd.rn-realtext3d"), _defineProperty(_module$exports, ".ram", "audio/x-pn-realaudio"), _defineProperty(_module$exports, ".rat", "application/rat-file"), _defineProperty(_module$exports, ".rec", "application/vnd.rn-recording"), _defineProperty(_module$exports, ".rgb", "application/x-rgb"), _defineProperty(_module$exports, ".rjt", "application/vnd.rn-realsystem-rjt"), _defineProperty(_module$exports, ".rle", "application/x-rle"), _defineProperty(_module$exports, ".rmf", "application/vnd.adobe.rmf"), _defineProperty(_module$exports, ".rmj", "application/vnd.rn-realsystem-rmj"), _defineProperty(_module$exports, ".rmp", "application/vnd.rn-rn_music_package"), _defineProperty(_module$exports, ".rmvb", "application/vnd.rn-realmedia-vbr"), _defineProperty(_module$exports, ".rnx", "application/vnd.rn-realplayer"), _defineProperty(_module$exports, ".rpm", "audio/x-pn-realaudio-plugin"), _defineProperty(_module$exports, ".rt", "text/vnd.rn-realtext"), _defineProperty(_module$exports, ".rtf", "application/x-rtf"), _defineProperty(_module$exports, ".sam", "application/x-sam"), _defineProperty(_module$exports, ".sdp", "application/sdp"), _defineProperty(_module$exports, ".sit", "application/x-stuffit"), _defineProperty(_module$exports, ".sld", "application/x-sld"), _defineProperty(_module$exports, ".smi", "application/smil"), _defineProperty(_module$exports, ".smk", "application/x-smk"), _defineProperty(_module$exports, ".sol", "text/plain"), _defineProperty(_module$exports, ".spc", "application/x-pkcs7-certificates"), _defineProperty(_module$exports, ".spp", "text/xml"), _defineProperty(_module$exports, ".sst", "application/vnd.ms-pki.certstore"), _defineProperty(_module$exports, ".stm", "text/html"), _defineProperty(_module$exports, ".svg", "text/xml"), _defineProperty(_module$exports, ".tdf", "application/x-tdf"), _defineProperty(_module$exports, ".tga", "application/x-tga"), _defineProperty(_module$exports, ".tif", "application/x-tif"), _defineProperty(_module$exports, ".tld", "text/xml"), _defineProperty(_module$exports, ".torrent", "application/x-bittorrent"), _defineProperty(_module$exports, ".txt", "text/plain"), _defineProperty(_module$exports, ".uls", "text/iuls"), _defineProperty(_module$exports, ".vda", "application/x-vda"), _defineProperty(_module$exports, ".vml", "text/xml"), _defineProperty(_module$exports, ".vsd", "application/vnd.visio"), _defineProperty(_module$exports, ".vss", "application/vnd.visio"), _defineProperty(_module$exports, ".vst", "application/x-vst"), _defineProperty(_module$exports, ".vsx", "application/vnd.visio"), _defineProperty(_module$exports, ".vxml", "text/xml"), _defineProperty(_module$exports, ".wax", "audio/x-ms-wax"), _defineProperty(_module$exports, ".wb2", "application/x-wb2"), _defineProperty(_module$exports, ".wbmp", "image/vnd.wap.wbmp"), _defineProperty(_module$exports, ".wk3", "application/x-wk3"), _defineProperty(_module$exports, ".wkq", "application/x-wkq"), _defineProperty(_module$exports, ".wm", "video/x-ms-wm"), _defineProperty(_module$exports, ".wmd", "application/x-ms-wmd"), _defineProperty(_module$exports, ".wml", "text/vnd.wap.wml"), _defineProperty(_module$exports, ".wmx", "video/x-ms-wmx"), _defineProperty(_module$exports, ".wp6", "application/x-wp6"), _defineProperty(_module$exports, ".wpg", "application/x-wpg"), _defineProperty(_module$exports, ".wq1", "application/x-wq1"), _defineProperty(_module$exports, ".wri", "application/x-wri"), _defineProperty(_module$exports, ".ws", "application/x-ws"), _defineProperty(_module$exports, ".wsc", "text/scriptlet"), _defineProperty(_module$exports, ".wvx", "video/x-ms-wvx"), _defineProperty(_module$exports, ".xdr", "text/xml"), _defineProperty(_module$exports, ".xfdf", "application/vnd.adobe.xfdf"), _defineProperty(_module$exports, ".xls", "application/vnd.ms-excel"), _defineProperty(_module$exports, ".xlw", "application/x-xlw"), _defineProperty(_module$exports, ".xpl", "audio/scpls"), _defineProperty(_module$exports, ".xql", "text/xml"), _defineProperty(_module$exports, ".xsd", "text/xml"), _defineProperty(_module$exports, ".xslt", "text/xml"), _defineProperty(_module$exports, ".x_b", "application/x-x_b"), _defineProperty(_module$exports, ".sisx", "application/vnd.symbian.install"), _defineProperty(_module$exports, ".ipa", "application/vnd.iphone"), _defineProperty(_module$exports, ".xap", "application/x-silverlight-app"), _defineProperty(_module$exports, ".zip", "application/x-zip-compressed"), _module$exports);
  9463. /***/ }),
  9464. /* 60 */,
  9465. /* 61 */,
  9466. /* 62 */,
  9467. /* 63 */,
  9468. /* 64 */,
  9469. /* 65 */,
  9470. /* 66 */,
  9471. /* 67 */,
  9472. /* 68 */
  9473. /*!************************************************************************************************!*\
  9474. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  9475. \************************************************************************************************/
  9476. /*! no static exports found */
  9477. /***/ (function(module, exports, __webpack_require__) {
  9478. // TODO(Babel 8): Remove this file.
  9479. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 69)();
  9480. module.exports = runtime;
  9481. /***/ }),
  9482. /* 69 */
  9483. /*!*******************************************************************!*\
  9484. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  9485. \*******************************************************************/
  9486. /*! no static exports found */
  9487. /***/ (function(module, exports, __webpack_require__) {
  9488. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  9489. function _regeneratorRuntime() {
  9490. "use strict";
  9491. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  9492. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  9493. return exports;
  9494. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9495. var exports = {},
  9496. Op = Object.prototype,
  9497. hasOwn = Op.hasOwnProperty,
  9498. defineProperty = Object.defineProperty || function (obj, key, desc) {
  9499. obj[key] = desc.value;
  9500. },
  9501. $Symbol = "function" == typeof Symbol ? Symbol : {},
  9502. iteratorSymbol = $Symbol.iterator || "@@iterator",
  9503. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  9504. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  9505. function define(obj, key, value) {
  9506. return Object.defineProperty(obj, key, {
  9507. value: value,
  9508. enumerable: !0,
  9509. configurable: !0,
  9510. writable: !0
  9511. }), obj[key];
  9512. }
  9513. try {
  9514. define({}, "");
  9515. } catch (err) {
  9516. define = function define(obj, key, value) {
  9517. return obj[key] = value;
  9518. };
  9519. }
  9520. function wrap(innerFn, outerFn, self, tryLocsList) {
  9521. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  9522. generator = Object.create(protoGenerator.prototype),
  9523. context = new Context(tryLocsList || []);
  9524. return defineProperty(generator, "_invoke", {
  9525. value: makeInvokeMethod(innerFn, self, context)
  9526. }), generator;
  9527. }
  9528. function tryCatch(fn, obj, arg) {
  9529. try {
  9530. return {
  9531. type: "normal",
  9532. arg: fn.call(obj, arg)
  9533. };
  9534. } catch (err) {
  9535. return {
  9536. type: "throw",
  9537. arg: err
  9538. };
  9539. }
  9540. }
  9541. exports.wrap = wrap;
  9542. var ContinueSentinel = {};
  9543. function Generator() {}
  9544. function GeneratorFunction() {}
  9545. function GeneratorFunctionPrototype() {}
  9546. var IteratorPrototype = {};
  9547. define(IteratorPrototype, iteratorSymbol, function () {
  9548. return this;
  9549. });
  9550. var getProto = Object.getPrototypeOf,
  9551. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  9552. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  9553. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  9554. function defineIteratorMethods(prototype) {
  9555. ["next", "throw", "return"].forEach(function (method) {
  9556. define(prototype, method, function (arg) {
  9557. return this._invoke(method, arg);
  9558. });
  9559. });
  9560. }
  9561. function AsyncIterator(generator, PromiseImpl) {
  9562. function invoke(method, arg, resolve, reject) {
  9563. var record = tryCatch(generator[method], generator, arg);
  9564. if ("throw" !== record.type) {
  9565. var result = record.arg,
  9566. value = result.value;
  9567. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  9568. invoke("next", value, resolve, reject);
  9569. }, function (err) {
  9570. invoke("throw", err, resolve, reject);
  9571. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  9572. result.value = unwrapped, resolve(result);
  9573. }, function (error) {
  9574. return invoke("throw", error, resolve, reject);
  9575. });
  9576. }
  9577. reject(record.arg);
  9578. }
  9579. var previousPromise;
  9580. defineProperty(this, "_invoke", {
  9581. value: function value(method, arg) {
  9582. function callInvokeWithMethodAndArg() {
  9583. return new PromiseImpl(function (resolve, reject) {
  9584. invoke(method, arg, resolve, reject);
  9585. });
  9586. }
  9587. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  9588. }
  9589. });
  9590. }
  9591. function makeInvokeMethod(innerFn, self, context) {
  9592. var state = "suspendedStart";
  9593. return function (method, arg) {
  9594. if ("executing" === state) throw new Error("Generator is already running");
  9595. if ("completed" === state) {
  9596. if ("throw" === method) throw arg;
  9597. return doneResult();
  9598. }
  9599. for (context.method = method, context.arg = arg;;) {
  9600. var delegate = context.delegate;
  9601. if (delegate) {
  9602. var delegateResult = maybeInvokeDelegate(delegate, context);
  9603. if (delegateResult) {
  9604. if (delegateResult === ContinueSentinel) continue;
  9605. return delegateResult;
  9606. }
  9607. }
  9608. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  9609. if ("suspendedStart" === state) throw state = "completed", context.arg;
  9610. context.dispatchException(context.arg);
  9611. } else "return" === context.method && context.abrupt("return", context.arg);
  9612. state = "executing";
  9613. var record = tryCatch(innerFn, self, context);
  9614. if ("normal" === record.type) {
  9615. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  9616. return {
  9617. value: record.arg,
  9618. done: context.done
  9619. };
  9620. }
  9621. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  9622. }
  9623. };
  9624. }
  9625. function maybeInvokeDelegate(delegate, context) {
  9626. var methodName = context.method,
  9627. method = delegate.iterator[methodName];
  9628. if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
  9629. var record = tryCatch(method, delegate.iterator, context.arg);
  9630. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  9631. var info = record.arg;
  9632. return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
  9633. }
  9634. function pushTryEntry(locs) {
  9635. var entry = {
  9636. tryLoc: locs[0]
  9637. };
  9638. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  9639. }
  9640. function resetTryEntry(entry) {
  9641. var record = entry.completion || {};
  9642. record.type = "normal", delete record.arg, entry.completion = record;
  9643. }
  9644. function Context(tryLocsList) {
  9645. this.tryEntries = [{
  9646. tryLoc: "root"
  9647. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  9648. }
  9649. function values(iterable) {
  9650. if (iterable) {
  9651. var iteratorMethod = iterable[iteratorSymbol];
  9652. if (iteratorMethod) return iteratorMethod.call(iterable);
  9653. if ("function" == typeof iterable.next) return iterable;
  9654. if (!isNaN(iterable.length)) {
  9655. var i = -1,
  9656. next = function next() {
  9657. for (; ++i < iterable.length;) {
  9658. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  9659. }
  9660. return next.value = undefined, next.done = !0, next;
  9661. };
  9662. return next.next = next;
  9663. }
  9664. }
  9665. return {
  9666. next: doneResult
  9667. };
  9668. }
  9669. function doneResult() {
  9670. return {
  9671. value: undefined,
  9672. done: !0
  9673. };
  9674. }
  9675. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  9676. value: GeneratorFunctionPrototype,
  9677. configurable: !0
  9678. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  9679. value: GeneratorFunction,
  9680. configurable: !0
  9681. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  9682. var ctor = "function" == typeof genFun && genFun.constructor;
  9683. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  9684. }, exports.mark = function (genFun) {
  9685. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  9686. }, exports.awrap = function (arg) {
  9687. return {
  9688. __await: arg
  9689. };
  9690. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  9691. return this;
  9692. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  9693. void 0 === PromiseImpl && (PromiseImpl = Promise);
  9694. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  9695. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  9696. return result.done ? result.value : iter.next();
  9697. });
  9698. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  9699. return this;
  9700. }), define(Gp, "toString", function () {
  9701. return "[object Generator]";
  9702. }), exports.keys = function (val) {
  9703. var object = Object(val),
  9704. keys = [];
  9705. for (var key in object) {
  9706. keys.push(key);
  9707. }
  9708. return keys.reverse(), function next() {
  9709. for (; keys.length;) {
  9710. var key = keys.pop();
  9711. if (key in object) return next.value = key, next.done = !1, next;
  9712. }
  9713. return next.done = !0, next;
  9714. };
  9715. }, exports.values = values, Context.prototype = {
  9716. constructor: Context,
  9717. reset: function reset(skipTempReset) {
  9718. if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {
  9719. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  9720. }
  9721. },
  9722. stop: function stop() {
  9723. this.done = !0;
  9724. var rootRecord = this.tryEntries[0].completion;
  9725. if ("throw" === rootRecord.type) throw rootRecord.arg;
  9726. return this.rval;
  9727. },
  9728. dispatchException: function dispatchException(exception) {
  9729. if (this.done) throw exception;
  9730. var context = this;
  9731. function handle(loc, caught) {
  9732. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  9733. }
  9734. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9735. var entry = this.tryEntries[i],
  9736. record = entry.completion;
  9737. if ("root" === entry.tryLoc) return handle("end");
  9738. if (entry.tryLoc <= this.prev) {
  9739. var hasCatch = hasOwn.call(entry, "catchLoc"),
  9740. hasFinally = hasOwn.call(entry, "finallyLoc");
  9741. if (hasCatch && hasFinally) {
  9742. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  9743. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  9744. } else if (hasCatch) {
  9745. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  9746. } else {
  9747. if (!hasFinally) throw new Error("try statement without catch or finally");
  9748. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  9749. }
  9750. }
  9751. }
  9752. },
  9753. abrupt: function abrupt(type, arg) {
  9754. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9755. var entry = this.tryEntries[i];
  9756. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  9757. var finallyEntry = entry;
  9758. break;
  9759. }
  9760. }
  9761. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  9762. var record = finallyEntry ? finallyEntry.completion : {};
  9763. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  9764. },
  9765. complete: function complete(record, afterLoc) {
  9766. if ("throw" === record.type) throw record.arg;
  9767. return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
  9768. },
  9769. finish: function finish(finallyLoc) {
  9770. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9771. var entry = this.tryEntries[i];
  9772. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  9773. }
  9774. },
  9775. "catch": function _catch(tryLoc) {
  9776. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9777. var entry = this.tryEntries[i];
  9778. if (entry.tryLoc === tryLoc) {
  9779. var record = entry.completion;
  9780. if ("throw" === record.type) {
  9781. var thrown = record.arg;
  9782. resetTryEntry(entry);
  9783. }
  9784. return thrown;
  9785. }
  9786. }
  9787. throw new Error("illegal catch attempt");
  9788. },
  9789. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  9790. return this.delegate = {
  9791. iterator: values(iterable),
  9792. resultName: resultName,
  9793. nextLoc: nextLoc
  9794. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  9795. }
  9796. }, exports;
  9797. }
  9798. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9799. /***/ }),
  9800. /* 70 */
  9801. /*!*****************************************************************!*\
  9802. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  9803. \*****************************************************************/
  9804. /*! no static exports found */
  9805. /***/ (function(module, exports) {
  9806. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  9807. try {
  9808. var info = gen[key](arg);
  9809. var value = info.value;
  9810. } catch (error) {
  9811. reject(error);
  9812. return;
  9813. }
  9814. if (info.done) {
  9815. resolve(value);
  9816. } else {
  9817. Promise.resolve(value).then(_next, _throw);
  9818. }
  9819. }
  9820. function _asyncToGenerator(fn) {
  9821. return function () {
  9822. var self = this,
  9823. args = arguments;
  9824. return new Promise(function (resolve, reject) {
  9825. var gen = fn.apply(self, args);
  9826. function _next(value) {
  9827. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  9828. }
  9829. function _throw(err) {
  9830. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  9831. }
  9832. _next(undefined);
  9833. });
  9834. };
  9835. }
  9836. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9837. /***/ }),
  9838. /* 71 */,
  9839. /* 72 */,
  9840. /* 73 */,
  9841. /* 74 */,
  9842. /* 75 */,
  9843. /* 76 */,
  9844. /* 77 */,
  9845. /* 78 */,
  9846. /* 79 */,
  9847. /* 80 */,
  9848. /* 81 */,
  9849. /* 82 */,
  9850. /* 83 */,
  9851. /* 84 */,
  9852. /* 85 */,
  9853. /* 86 */,
  9854. /* 87 */,
  9855. /* 88 */,
  9856. /* 89 */,
  9857. /* 90 */,
  9858. /* 91 */,
  9859. /* 92 */
  9860. /*!************************************************************************************!*\
  9861. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js ***!
  9862. \************************************************************************************/
  9863. /*! no static exports found */
  9864. /***/ (function(module, exports, __webpack_require__) {
  9865. "use strict";
  9866. /* WEBPACK VAR INJECTION */(function(global, uni, wx) {
  9867. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9868. Object.defineProperty(exports, "__esModule", {
  9869. value: true
  9870. });
  9871. exports.default = void 0;
  9872. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 68));
  9873. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  9874. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  9875. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  9876. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 70));
  9877. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  9878. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 93));
  9879. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 94));
  9880. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 96));
  9881. var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ 97));
  9882. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  9883. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  9884. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  9885. var _pages = _interopRequireDefault(__webpack_require__(/*! @/pages.json */ 99));
  9886. 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; } } }; }
  9887. 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); }
  9888. 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; }
  9889. 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; }
  9890. 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; }
  9891. 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); }; }
  9892. 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; } }
  9893. "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self;
  9894. function n(e) {
  9895. return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
  9896. }
  9897. function s(e, t, n) {
  9898. return e(n = {
  9899. path: t,
  9900. exports: {},
  9901. require: function require(e, t) {
  9902. return function () {
  9903. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  9904. }(null == t && n.path);
  9905. }
  9906. }, n.exports), n.exports;
  9907. }
  9908. var r = s(function (e, t) {
  9909. var n;
  9910. e.exports = (n = n || function (e, t) {
  9911. var n = Object.create || function () {
  9912. function e() {}
  9913. return function (t) {
  9914. var n;
  9915. return e.prototype = t, n = new e(), e.prototype = null, n;
  9916. };
  9917. }(),
  9918. s = {},
  9919. r = s.lib = {},
  9920. i = r.Base = {
  9921. extend: function extend(e) {
  9922. var t = n(this);
  9923. return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () {
  9924. t.$super.init.apply(this, arguments);
  9925. }), t.init.prototype = t, t.$super = this, t;
  9926. },
  9927. create: function create() {
  9928. var e = this.extend();
  9929. return e.init.apply(e, arguments), e;
  9930. },
  9931. init: function init() {},
  9932. mixIn: function mixIn(e) {
  9933. for (var t in e) {
  9934. e.hasOwnProperty(t) && (this[t] = e[t]);
  9935. }
  9936. e.hasOwnProperty("toString") && (this.toString = e.toString);
  9937. },
  9938. clone: function clone() {
  9939. return this.init.prototype.extend(this);
  9940. }
  9941. },
  9942. o = r.WordArray = i.extend({
  9943. init: function init(e, n) {
  9944. e = this.words = e || [], this.sigBytes = n != t ? n : 4 * e.length;
  9945. },
  9946. toString: function toString(e) {
  9947. return (e || c).stringify(this);
  9948. },
  9949. concat: function concat(e) {
  9950. var t = this.words,
  9951. n = e.words,
  9952. s = this.sigBytes,
  9953. r = e.sigBytes;
  9954. if (this.clamp(), s % 4) for (var i = 0; i < r; i++) {
  9955. var o = n[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  9956. t[s + i >>> 2] |= o << 24 - (s + i) % 4 * 8;
  9957. } else for (i = 0; i < r; i += 4) {
  9958. t[s + i >>> 2] = n[i >>> 2];
  9959. }
  9960. return this.sigBytes += r, this;
  9961. },
  9962. clamp: function clamp() {
  9963. var t = this.words,
  9964. n = this.sigBytes;
  9965. t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4);
  9966. },
  9967. clone: function clone() {
  9968. var e = i.clone.call(this);
  9969. return e.words = this.words.slice(0), e;
  9970. },
  9971. random: function random(t) {
  9972. for (var n, s = [], r = function r(t) {
  9973. t = t;
  9974. var n = 987654321,
  9975. s = 4294967295;
  9976. return function () {
  9977. var r = ((n = 36969 * (65535 & n) + (n >> 16) & s) << 16) + (t = 18e3 * (65535 & t) + (t >> 16) & s) & s;
  9978. return r /= 4294967296, (r += .5) * (e.random() > .5 ? 1 : -1);
  9979. };
  9980. }, i = 0; i < t; i += 4) {
  9981. var a = r(4294967296 * (n || e.random()));
  9982. n = 987654071 * a(), s.push(4294967296 * a() | 0);
  9983. }
  9984. return new o.init(s, t);
  9985. }
  9986. }),
  9987. a = s.enc = {},
  9988. c = a.Hex = {
  9989. stringify: function stringify(e) {
  9990. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  9991. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  9992. s.push((i >>> 4).toString(16)), s.push((15 & i).toString(16));
  9993. }
  9994. return s.join("");
  9995. },
  9996. parse: function parse(e) {
  9997. for (var t = e.length, n = [], s = 0; s < t; s += 2) {
  9998. n[s >>> 3] |= parseInt(e.substr(s, 2), 16) << 24 - s % 8 * 4;
  9999. }
  10000. return new o.init(n, t / 2);
  10001. }
  10002. },
  10003. u = a.Latin1 = {
  10004. stringify: function stringify(e) {
  10005. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  10006. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  10007. s.push(String.fromCharCode(i));
  10008. }
  10009. return s.join("");
  10010. },
  10011. parse: function parse(e) {
  10012. for (var t = e.length, n = [], s = 0; s < t; s++) {
  10013. n[s >>> 2] |= (255 & e.charCodeAt(s)) << 24 - s % 4 * 8;
  10014. }
  10015. return new o.init(n, t);
  10016. }
  10017. },
  10018. l = a.Utf8 = {
  10019. stringify: function stringify(e) {
  10020. try {
  10021. return decodeURIComponent(escape(u.stringify(e)));
  10022. } catch (e) {
  10023. throw new Error("Malformed UTF-8 data");
  10024. }
  10025. },
  10026. parse: function parse(e) {
  10027. return u.parse(unescape(encodeURIComponent(e)));
  10028. }
  10029. },
  10030. h = r.BufferedBlockAlgorithm = i.extend({
  10031. reset: function reset() {
  10032. this._data = new o.init(), this._nDataBytes = 0;
  10033. },
  10034. _append: function _append(e) {
  10035. "string" == typeof e && (e = l.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
  10036. },
  10037. _process: function _process(t) {
  10038. var n = this._data,
  10039. s = n.words,
  10040. r = n.sigBytes,
  10041. i = this.blockSize,
  10042. a = r / (4 * i),
  10043. c = (a = t ? e.ceil(a) : e.max((0 | a) - this._minBufferSize, 0)) * i,
  10044. u = e.min(4 * c, r);
  10045. if (c) {
  10046. for (var l = 0; l < c; l += i) {
  10047. this._doProcessBlock(s, l);
  10048. }
  10049. var h = s.splice(0, c);
  10050. n.sigBytes -= u;
  10051. }
  10052. return new o.init(h, u);
  10053. },
  10054. clone: function clone() {
  10055. var e = i.clone.call(this);
  10056. return e._data = this._data.clone(), e;
  10057. },
  10058. _minBufferSize: 0
  10059. });
  10060. r.Hasher = h.extend({
  10061. cfg: i.extend(),
  10062. init: function init(e) {
  10063. this.cfg = this.cfg.extend(e), this.reset();
  10064. },
  10065. reset: function reset() {
  10066. h.reset.call(this), this._doReset();
  10067. },
  10068. update: function update(e) {
  10069. return this._append(e), this._process(), this;
  10070. },
  10071. finalize: function finalize(e) {
  10072. return e && this._append(e), this._doFinalize();
  10073. },
  10074. blockSize: 16,
  10075. _createHelper: function _createHelper(e) {
  10076. return function (t, n) {
  10077. return new e.init(n).finalize(t);
  10078. };
  10079. },
  10080. _createHmacHelper: function _createHmacHelper(e) {
  10081. return function (t, n) {
  10082. return new d.HMAC.init(e, n).finalize(t);
  10083. };
  10084. }
  10085. });
  10086. var d = s.algo = {};
  10087. return s;
  10088. }(Math), n);
  10089. }),
  10090. i = r,
  10091. o = (s(function (e, t) {
  10092. var n;
  10093. e.exports = (n = i, function (e) {
  10094. var t = n,
  10095. s = t.lib,
  10096. r = s.WordArray,
  10097. i = s.Hasher,
  10098. o = t.algo,
  10099. a = [];
  10100. !function () {
  10101. for (var t = 0; t < 64; t++) {
  10102. a[t] = 4294967296 * e.abs(e.sin(t + 1)) | 0;
  10103. }
  10104. }();
  10105. var c = o.MD5 = i.extend({
  10106. _doReset: function _doReset() {
  10107. this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878]);
  10108. },
  10109. _doProcessBlock: function _doProcessBlock(e, t) {
  10110. for (var n = 0; n < 16; n++) {
  10111. var s = t + n,
  10112. r = e[s];
  10113. e[s] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8);
  10114. }
  10115. var i = this._hash.words,
  10116. o = e[t + 0],
  10117. c = e[t + 1],
  10118. p = e[t + 2],
  10119. f = e[t + 3],
  10120. g = e[t + 4],
  10121. m = e[t + 5],
  10122. y = e[t + 6],
  10123. _ = e[t + 7],
  10124. w = e[t + 8],
  10125. v = e[t + 9],
  10126. b = e[t + 10],
  10127. S = e[t + 11],
  10128. k = e[t + 12],
  10129. I = e[t + 13],
  10130. T = e[t + 14],
  10131. C = e[t + 15],
  10132. A = i[0],
  10133. P = i[1],
  10134. E = i[2],
  10135. O = i[3];
  10136. A = u(A, P, E, O, o, 7, a[0]), O = u(O, A, P, E, c, 12, a[1]), E = u(E, O, A, P, p, 17, a[2]), P = u(P, E, O, A, f, 22, a[3]), A = u(A, P, E, O, g, 7, a[4]), O = u(O, A, P, E, m, 12, a[5]), E = u(E, O, A, P, y, 17, a[6]), P = u(P, E, O, A, _, 22, a[7]), A = u(A, P, E, O, w, 7, a[8]), O = u(O, A, P, E, v, 12, a[9]), E = u(E, O, A, P, b, 17, a[10]), P = u(P, E, O, A, S, 22, a[11]), A = u(A, P, E, O, k, 7, a[12]), O = u(O, A, P, E, I, 12, a[13]), E = u(E, O, A, P, T, 17, a[14]), A = l(A, P = u(P, E, O, A, C, 22, a[15]), E, O, c, 5, a[16]), O = l(O, A, P, E, y, 9, a[17]), E = l(E, O, A, P, S, 14, a[18]), P = l(P, E, O, A, o, 20, a[19]), A = l(A, P, E, O, m, 5, a[20]), O = l(O, A, P, E, b, 9, a[21]), E = l(E, O, A, P, C, 14, a[22]), P = l(P, E, O, A, g, 20, a[23]), A = l(A, P, E, O, v, 5, a[24]), O = l(O, A, P, E, T, 9, a[25]), E = l(E, O, A, P, f, 14, a[26]), P = l(P, E, O, A, w, 20, a[27]), A = l(A, P, E, O, I, 5, a[28]), O = l(O, A, P, E, p, 9, a[29]), E = l(E, O, A, P, _, 14, a[30]), A = h(A, P = l(P, E, O, A, k, 20, a[31]), E, O, m, 4, a[32]), O = h(O, A, P, E, w, 11, a[33]), E = h(E, O, A, P, S, 16, a[34]), P = h(P, E, O, A, T, 23, a[35]), A = h(A, P, E, O, c, 4, a[36]), O = h(O, A, P, E, g, 11, a[37]), E = h(E, O, A, P, _, 16, a[38]), P = h(P, E, O, A, b, 23, a[39]), A = h(A, P, E, O, I, 4, a[40]), O = h(O, A, P, E, o, 11, a[41]), E = h(E, O, A, P, f, 16, a[42]), P = h(P, E, O, A, y, 23, a[43]), A = h(A, P, E, O, v, 4, a[44]), O = h(O, A, P, E, k, 11, a[45]), E = h(E, O, A, P, C, 16, a[46]), A = d(A, P = h(P, E, O, A, p, 23, a[47]), E, O, o, 6, a[48]), O = d(O, A, P, E, _, 10, a[49]), E = d(E, O, A, P, T, 15, a[50]), P = d(P, E, O, A, m, 21, a[51]), A = d(A, P, E, O, k, 6, a[52]), O = d(O, A, P, E, f, 10, a[53]), E = d(E, O, A, P, b, 15, a[54]), P = d(P, E, O, A, c, 21, a[55]), A = d(A, P, E, O, w, 6, a[56]), O = d(O, A, P, E, C, 10, a[57]), E = d(E, O, A, P, y, 15, a[58]), P = d(P, E, O, A, I, 21, a[59]), A = d(A, P, E, O, g, 6, a[60]), O = d(O, A, P, E, S, 10, a[61]), E = d(E, O, A, P, p, 15, a[62]), P = d(P, E, O, A, v, 21, a[63]), i[0] = i[0] + A | 0, i[1] = i[1] + P | 0, i[2] = i[2] + E | 0, i[3] = i[3] + O | 0;
  10137. },
  10138. _doFinalize: function _doFinalize() {
  10139. var t = this._data,
  10140. n = t.words,
  10141. s = 8 * this._nDataBytes,
  10142. r = 8 * t.sigBytes;
  10143. n[r >>> 5] |= 128 << 24 - r % 32;
  10144. var i = e.floor(s / 4294967296),
  10145. o = s;
  10146. 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();
  10147. for (var a = this._hash, c = a.words, u = 0; u < 4; u++) {
  10148. var l = c[u];
  10149. c[u] = 16711935 & (l << 8 | l >>> 24) | 4278255360 & (l << 24 | l >>> 8);
  10150. }
  10151. return a;
  10152. },
  10153. clone: function clone() {
  10154. var e = i.clone.call(this);
  10155. return e._hash = this._hash.clone(), e;
  10156. }
  10157. });
  10158. function u(e, t, n, s, r, i, o) {
  10159. var a = e + (t & n | ~t & s) + r + o;
  10160. return (a << i | a >>> 32 - i) + t;
  10161. }
  10162. function l(e, t, n, s, r, i, o) {
  10163. var a = e + (t & s | n & ~s) + r + o;
  10164. return (a << i | a >>> 32 - i) + t;
  10165. }
  10166. function h(e, t, n, s, r, i, o) {
  10167. var a = e + (t ^ n ^ s) + r + o;
  10168. return (a << i | a >>> 32 - i) + t;
  10169. }
  10170. function d(e, t, n, s, r, i, o) {
  10171. var a = e + (n ^ (t | ~s)) + r + o;
  10172. return (a << i | a >>> 32 - i) + t;
  10173. }
  10174. t.MD5 = i._createHelper(c), t.HmacMD5 = i._createHmacHelper(c);
  10175. }(Math), n.MD5);
  10176. }), s(function (e, t) {
  10177. var n;
  10178. e.exports = (n = i, void function () {
  10179. var e = n,
  10180. t = e.lib.Base,
  10181. s = e.enc.Utf8;
  10182. e.algo.HMAC = t.extend({
  10183. init: function init(e, t) {
  10184. e = this._hasher = new e.init(), "string" == typeof t && (t = s.parse(t));
  10185. var n = e.blockSize,
  10186. r = 4 * n;
  10187. t.sigBytes > r && (t = e.finalize(t)), t.clamp();
  10188. for (var i = this._oKey = t.clone(), o = this._iKey = t.clone(), a = i.words, c = o.words, u = 0; u < n; u++) {
  10189. a[u] ^= 1549556828, c[u] ^= 909522486;
  10190. }
  10191. i.sigBytes = o.sigBytes = r, this.reset();
  10192. },
  10193. reset: function reset() {
  10194. var e = this._hasher;
  10195. e.reset(), e.update(this._iKey);
  10196. },
  10197. update: function update(e) {
  10198. return this._hasher.update(e), this;
  10199. },
  10200. finalize: function finalize(e) {
  10201. var t = this._hasher,
  10202. n = t.finalize(e);
  10203. return t.reset(), t.finalize(this._oKey.clone().concat(n));
  10204. }
  10205. });
  10206. }());
  10207. }), s(function (e, t) {
  10208. e.exports = i.HmacMD5;
  10209. })),
  10210. a = s(function (e, t) {
  10211. e.exports = i.enc.Utf8;
  10212. }),
  10213. c = s(function (e, t) {
  10214. var n;
  10215. e.exports = (n = i, function () {
  10216. var e = n,
  10217. t = e.lib.WordArray;
  10218. function s(e, n, s) {
  10219. for (var r = [], i = 0, o = 0; o < n; o++) {
  10220. if (o % 4) {
  10221. var a = s[e.charCodeAt(o - 1)] << o % 4 * 2,
  10222. c = s[e.charCodeAt(o)] >>> 6 - o % 4 * 2;
  10223. r[i >>> 2] |= (a | c) << 24 - i % 4 * 8, i++;
  10224. }
  10225. }
  10226. return t.create(r, i);
  10227. }
  10228. e.enc.Base64 = {
  10229. stringify: function stringify(e) {
  10230. var t = e.words,
  10231. n = e.sigBytes,
  10232. s = this._map;
  10233. e.clamp();
  10234. for (var r = [], i = 0; i < n; i += 3) {
  10235. 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++) {
  10236. r.push(s.charAt(o >>> 6 * (3 - a) & 63));
  10237. }
  10238. }
  10239. var c = s.charAt(64);
  10240. if (c) for (; r.length % 4;) {
  10241. r.push(c);
  10242. }
  10243. return r.join("");
  10244. },
  10245. parse: function parse(e) {
  10246. var t = e.length,
  10247. n = this._map,
  10248. r = this._reverseMap;
  10249. if (!r) {
  10250. r = this._reverseMap = [];
  10251. for (var i = 0; i < n.length; i++) {
  10252. r[n.charCodeAt(i)] = i;
  10253. }
  10254. }
  10255. var o = n.charAt(64);
  10256. if (o) {
  10257. var a = e.indexOf(o);
  10258. -1 !== a && (t = a);
  10259. }
  10260. return s(e, t, r);
  10261. },
  10262. _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
  10263. };
  10264. }(), n.enc.Base64);
  10265. });
  10266. var u = "FUNCTION",
  10267. l = "OBJECT",
  10268. h = "CLIENT_DB",
  10269. d = "pending",
  10270. p = "fullfilled",
  10271. f = "rejected";
  10272. function g(e) {
  10273. return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();
  10274. }
  10275. function m(e) {
  10276. return "object" === g(e);
  10277. }
  10278. function y(e) {
  10279. return "function" == typeof e;
  10280. }
  10281. function _(e) {
  10282. return function () {
  10283. try {
  10284. return e.apply(e, arguments);
  10285. } catch (e) {
  10286. console.error(e);
  10287. }
  10288. };
  10289. }
  10290. var w = "REJECTED",
  10291. v = "NOT_PENDING";
  10292. var b = /*#__PURE__*/function () {
  10293. function b() {
  10294. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10295. e = _ref.createPromise,
  10296. _ref$retryRule = _ref.retryRule,
  10297. t = _ref$retryRule === void 0 ? w : _ref$retryRule;
  10298. (0, _classCallCheck2.default)(this, b);
  10299. this.createPromise = e, this.status = null, this.promise = null, this.retryRule = t;
  10300. }
  10301. (0, _createClass2.default)(b, [{
  10302. key: "needRetry",
  10303. get: function get() {
  10304. if (!this.status) return !0;
  10305. switch (this.retryRule) {
  10306. case w:
  10307. return this.status === f;
  10308. case v:
  10309. return this.status !== d;
  10310. }
  10311. }
  10312. }, {
  10313. key: "exec",
  10314. value: function exec() {
  10315. var _this = this;
  10316. return this.needRetry ? (this.status = d, this.promise = this.createPromise().then(function (e) {
  10317. return _this.status = p, Promise.resolve(e);
  10318. }, function (e) {
  10319. return _this.status = f, Promise.reject(e);
  10320. }), this.promise) : this.promise;
  10321. }
  10322. }]);
  10323. return b;
  10324. }();
  10325. function S(e) {
  10326. return e && "string" == typeof e ? JSON.parse(e) : e;
  10327. }
  10328. var k = "development" === "development",
  10329. I = "mp-weixin",
  10330. T = "true" === undefined || !0 === undefined,
  10331. C = S([]),
  10332. A = "h5" === I ? "web" : "app-plus" === I ? "app" : I,
  10333. P = S(undefined),
  10334. E = S(undefined) || [],
  10335. O = true;
  10336. var x = "";
  10337. try {
  10338. x = (__webpack_require__(/*! uni-stat-config */ 100).default || __webpack_require__(/*! uni-stat-config */ 100)).appid;
  10339. } catch (e) {}
  10340. var R = {};
  10341. function U(e) {
  10342. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10343. var n, s;
  10344. return n = R, s = e, Object.prototype.hasOwnProperty.call(n, s) || (R[e] = t), R[e];
  10345. }
  10346. "app" === A && (R = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {});
  10347. var L = ["invoke", "success", "fail", "complete"],
  10348. N = U("_globalUniCloudInterceptor");
  10349. function D(e, t) {
  10350. N[e] || (N[e] = {}), m(t) && Object.keys(t).forEach(function (n) {
  10351. L.indexOf(n) > -1 && function (e, t, n) {
  10352. var s = N[e][t];
  10353. s || (s = N[e][t] = []), -1 === s.indexOf(n) && y(n) && s.push(n);
  10354. }(e, n, t[n]);
  10355. });
  10356. }
  10357. function F(e, t) {
  10358. N[e] || (N[e] = {}), m(t) ? Object.keys(t).forEach(function (n) {
  10359. L.indexOf(n) > -1 && function (e, t, n) {
  10360. var s = N[e][t];
  10361. if (!s) return;
  10362. var r = s.indexOf(n);
  10363. r > -1 && s.splice(r, 1);
  10364. }(e, n, t[n]);
  10365. }) : delete N[e];
  10366. }
  10367. function q(e, t) {
  10368. return e && 0 !== e.length ? e.reduce(function (e, n) {
  10369. return e.then(function () {
  10370. return n(t);
  10371. });
  10372. }, Promise.resolve()) : Promise.resolve();
  10373. }
  10374. function K(e, t) {
  10375. return N[e] && N[e][t] || [];
  10376. }
  10377. function M(e) {
  10378. D("callObject", e);
  10379. }
  10380. var j = U("_globalUniCloudListener"),
  10381. B = "response",
  10382. $ = "needLogin",
  10383. W = "refreshToken",
  10384. z = "clientdb",
  10385. J = "cloudfunction",
  10386. H = "cloudobject";
  10387. function G(e) {
  10388. return j[e] || (j[e] = []), j[e];
  10389. }
  10390. function V(e, t) {
  10391. var n = G(e);
  10392. n.includes(t) || n.push(t);
  10393. }
  10394. function Y(e, t) {
  10395. var n = G(e),
  10396. s = n.indexOf(t);
  10397. -1 !== s && n.splice(s, 1);
  10398. }
  10399. function Q(e, t) {
  10400. var n = G(e);
  10401. for (var _e2 = 0; _e2 < n.length; _e2++) {
  10402. (0, n[_e2])(t);
  10403. }
  10404. }
  10405. var X,
  10406. Z = !1;
  10407. function ee() {
  10408. return X || (X = new Promise(function (e) {
  10409. Z && e(), function t() {
  10410. if ("function" == typeof getCurrentPages) {
  10411. var _t2 = getCurrentPages();
  10412. _t2 && _t2[0] && (Z = !0, e());
  10413. }
  10414. Z || setTimeout(function () {
  10415. t();
  10416. }, 30);
  10417. }();
  10418. }), X);
  10419. }
  10420. function te(e) {
  10421. var t = {};
  10422. for (var _n2 in e) {
  10423. var _s2 = e[_n2];
  10424. y(_s2) && (t[_n2] = _(_s2));
  10425. }
  10426. return t;
  10427. }
  10428. var ne = /*#__PURE__*/function (_Error) {
  10429. (0, _inherits2.default)(ne, _Error);
  10430. var _super = _createSuper(ne);
  10431. function ne(e) {
  10432. var _this2;
  10433. (0, _classCallCheck2.default)(this, ne);
  10434. _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;
  10435. return _this2;
  10436. }
  10437. (0, _createClass2.default)(ne, [{
  10438. key: "toJson",
  10439. value: function toJson() {
  10440. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  10441. if (!(e >= 10)) return e++, {
  10442. errCode: this.errCode,
  10443. errMsg: this.errMsg,
  10444. errSubject: this.errSubject,
  10445. cause: this.cause && this.cause.toJson ? this.cause.toJson(e) : this.cause
  10446. };
  10447. }
  10448. }]);
  10449. return ne;
  10450. }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
  10451. var se = {
  10452. request: function request(e) {
  10453. return uni.request(e);
  10454. },
  10455. uploadFile: function uploadFile(e) {
  10456. return uni.uploadFile(e);
  10457. },
  10458. setStorageSync: function setStorageSync(e, t) {
  10459. return uni.setStorageSync(e, t);
  10460. },
  10461. getStorageSync: function getStorageSync(e) {
  10462. return uni.getStorageSync(e);
  10463. },
  10464. removeStorageSync: function removeStorageSync(e) {
  10465. return uni.removeStorageSync(e);
  10466. },
  10467. clearStorageSync: function clearStorageSync() {
  10468. return uni.clearStorageSync();
  10469. }
  10470. };
  10471. function re() {
  10472. return {
  10473. token: se.getStorageSync("uni_id_token") || se.getStorageSync("uniIdToken"),
  10474. tokenExpired: se.getStorageSync("uni_id_token_expired")
  10475. };
  10476. }
  10477. function ie() {
  10478. var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10479. e = _ref2.token,
  10480. t = _ref2.tokenExpired;
  10481. e && se.setStorageSync("uni_id_token", e), t && se.setStorageSync("uni_id_token_expired", t);
  10482. }
  10483. var oe, ae;
  10484. function ce() {
  10485. return oe || (oe = uni.getSystemInfoSync()), oe;
  10486. }
  10487. function ue() {
  10488. var e, t;
  10489. try {
  10490. if (uni.getLaunchOptionsSync) {
  10491. if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1) return;
  10492. var _uni$getLaunchOptions = uni.getLaunchOptionsSync(),
  10493. _n3 = _uni$getLaunchOptions.scene,
  10494. _s3 = _uni$getLaunchOptions.channel;
  10495. e = _s3, t = _n3;
  10496. }
  10497. } catch (e) {}
  10498. return {
  10499. channel: e,
  10500. scene: t
  10501. };
  10502. }
  10503. function le() {
  10504. var e = uni.getLocale && uni.getLocale() || "en";
  10505. if (ae) return _objectSpread(_objectSpread({}, ae), {}, {
  10506. locale: e,
  10507. LOCALE: e
  10508. });
  10509. var t = ce(),
  10510. n = t.deviceId,
  10511. s = t.osName,
  10512. r = t.uniPlatform,
  10513. i = t.appId,
  10514. o = ["pixelRatio", "brand", "model", "system", "language", "version", "platform", "host", "SDKVersion", "swanNativeVersion", "app", "AppPlatform", "fontSizeSetting"];
  10515. for (var _e3 = 0; _e3 < o.length; _e3++) {
  10516. delete t[o[_e3]];
  10517. }
  10518. return ae = _objectSpread(_objectSpread({
  10519. PLATFORM: r,
  10520. OS: s,
  10521. APPID: i,
  10522. DEVICEID: n
  10523. }, ue()), t), _objectSpread(_objectSpread({}, ae), {}, {
  10524. locale: e,
  10525. LOCALE: e
  10526. });
  10527. }
  10528. var he = {
  10529. sign: function sign(e, t) {
  10530. var n = "";
  10531. return Object.keys(e).sort().forEach(function (t) {
  10532. e[t] && (n = n + "&" + t + "=" + e[t]);
  10533. }), n = n.slice(1), o(n, t).toString();
  10534. },
  10535. wrappedRequest: function wrappedRequest(e, t) {
  10536. return new Promise(function (n, s) {
  10537. t(Object.assign(e, {
  10538. complete: function complete(e) {
  10539. e || (e = {}), k && "web" === A && e.errMsg && 0 === e.errMsg.indexOf("request:fail") && console.warn("发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5");
  10540. var t = e.data && e.data.header && e.data.header["x-serverless-request-id"] || e.header && e.header["request-id"];
  10541. if (!e.statusCode || e.statusCode >= 400) return s(new ne({
  10542. code: "SYS_ERR",
  10543. message: e.errMsg || "request:fail",
  10544. requestId: t
  10545. }));
  10546. var r = e.data;
  10547. if (r.error) return s(new ne({
  10548. code: r.error.code,
  10549. message: r.error.message,
  10550. requestId: t
  10551. }));
  10552. r.result = r.data, r.requestId = t, delete r.data, n(r);
  10553. }
  10554. }));
  10555. });
  10556. },
  10557. toBase64: function toBase64(e) {
  10558. return c.stringify(a.parse(e));
  10559. }
  10560. },
  10561. de = {
  10562. "uniCloud.init.paramRequired": "{param} required",
  10563. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  10564. };
  10565. var _e4 = (0, _uniI18n.initVueI18n)({
  10566. "zh-Hans": {
  10567. "uniCloud.init.paramRequired": "缺少参数:{param}",
  10568. "uniCloud.uploadFile.fileError": "filePath应为File对象"
  10569. },
  10570. "zh-Hant": {
  10571. "uniCloud.init.paramRequired": "缺少参数:{param}",
  10572. "uniCloud.uploadFile.fileError": "filePath应为File对象"
  10573. },
  10574. en: de,
  10575. fr: {
  10576. "uniCloud.init.paramRequired": "{param} required",
  10577. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  10578. },
  10579. es: {
  10580. "uniCloud.init.paramRequired": "{param} required",
  10581. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  10582. },
  10583. ja: de
  10584. }, "zh-Hans"),
  10585. pe = _e4.t;
  10586. var fe = /*#__PURE__*/function () {
  10587. function fe(e) {
  10588. var _this3 = this;
  10589. (0, _classCallCheck2.default)(this, fe);
  10590. ["spaceId", "clientSecret"].forEach(function (t) {
  10591. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error(pe("uniCloud.init.paramRequired", {
  10592. param: t
  10593. }));
  10594. }), this.config = Object.assign({}, {
  10595. endpoint: 0 === e.spaceId.indexOf("mp-") ? "https://api.next.bspapp.com" : "https://api.bspapp.com"
  10596. }, 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 = se, this._getAccessTokenPromiseHub = new b({
  10597. createPromise: function createPromise() {
  10598. return _this3.requestAuth(_this3.setupRequest({
  10599. method: "serverless.auth.user.anonymousAuthorize",
  10600. params: "{}"
  10601. }, "auth")).then(function (e) {
  10602. if (!e.result || !e.result.accessToken) throw new ne({
  10603. code: "AUTH_FAILED",
  10604. message: "获取accessToken失败"
  10605. });
  10606. _this3.setAccessToken(e.result.accessToken);
  10607. });
  10608. },
  10609. retryRule: v
  10610. });
  10611. }
  10612. (0, _createClass2.default)(fe, [{
  10613. key: "hasAccessToken",
  10614. get: function get() {
  10615. return !!this.accessToken;
  10616. }
  10617. }, {
  10618. key: "setAccessToken",
  10619. value: function setAccessToken(e) {
  10620. this.accessToken = e;
  10621. }
  10622. }, {
  10623. key: "requestWrapped",
  10624. value: function requestWrapped(e) {
  10625. return he.wrappedRequest(e, this.adapter.request);
  10626. }
  10627. }, {
  10628. key: "requestAuth",
  10629. value: function requestAuth(e) {
  10630. return this.requestWrapped(e);
  10631. }
  10632. }, {
  10633. key: "request",
  10634. value: function request(e, t) {
  10635. var _this4 = this;
  10636. return Promise.resolve().then(function () {
  10637. return _this4.hasAccessToken ? t ? _this4.requestWrapped(e) : _this4.requestWrapped(e).catch(function (t) {
  10638. return new Promise(function (e, n) {
  10639. !t || "GATEWAY_INVALID_TOKEN" !== t.code && "InvalidParameter.InvalidToken" !== t.code ? n(t) : e();
  10640. }).then(function () {
  10641. return _this4.getAccessToken();
  10642. }).then(function () {
  10643. var t = _this4.rebuildRequest(e);
  10644. return _this4.request(t, !0);
  10645. });
  10646. }) : _this4.getAccessToken().then(function () {
  10647. var t = _this4.rebuildRequest(e);
  10648. return _this4.request(t, !0);
  10649. });
  10650. });
  10651. }
  10652. }, {
  10653. key: "rebuildRequest",
  10654. value: function rebuildRequest(e) {
  10655. var t = Object.assign({}, e);
  10656. return t.data.token = this.accessToken, t.header["x-basement-token"] = this.accessToken, t.header["x-serverless-sign"] = he.sign(t.data, this.config.clientSecret), t;
  10657. }
  10658. }, {
  10659. key: "setupRequest",
  10660. value: function setupRequest(e, t) {
  10661. var n = Object.assign({}, e, {
  10662. spaceId: this.config.spaceId,
  10663. timestamp: Date.now()
  10664. }),
  10665. s = {
  10666. "Content-Type": "application/json"
  10667. };
  10668. return "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = he.sign(n, this.config.clientSecret), {
  10669. url: this.config.requestUrl,
  10670. method: "POST",
  10671. data: n,
  10672. dataType: "json",
  10673. header: s
  10674. };
  10675. }
  10676. }, {
  10677. key: "getAccessToken",
  10678. value: function getAccessToken() {
  10679. return this._getAccessTokenPromiseHub.exec();
  10680. }
  10681. }, {
  10682. key: "authorize",
  10683. value: function () {
  10684. var _authorize = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  10685. return _regenerator.default.wrap(function _callee$(_context) {
  10686. while (1) {
  10687. switch (_context.prev = _context.next) {
  10688. case 0:
  10689. _context.next = 2;
  10690. return this.getAccessToken();
  10691. case 2:
  10692. case "end":
  10693. return _context.stop();
  10694. }
  10695. }
  10696. }, _callee, this);
  10697. }));
  10698. function authorize() {
  10699. return _authorize.apply(this, arguments);
  10700. }
  10701. return authorize;
  10702. }()
  10703. }, {
  10704. key: "callFunction",
  10705. value: function callFunction(e) {
  10706. var t = {
  10707. method: "serverless.function.runtime.invoke",
  10708. params: JSON.stringify({
  10709. functionTarget: e.name,
  10710. functionArgs: e.data || {}
  10711. })
  10712. };
  10713. return this.request(this.setupRequest(t));
  10714. }
  10715. }, {
  10716. key: "getOSSUploadOptionsFromPath",
  10717. value: function getOSSUploadOptionsFromPath(e) {
  10718. var t = {
  10719. method: "serverless.file.resource.generateProximalSign",
  10720. params: JSON.stringify(e)
  10721. };
  10722. return this.request(this.setupRequest(t));
  10723. }
  10724. }, {
  10725. key: "uploadFileToOSS",
  10726. value: function uploadFileToOSS(_ref3) {
  10727. var _this5 = this;
  10728. var e = _ref3.url,
  10729. t = _ref3.formData,
  10730. n = _ref3.name,
  10731. s = _ref3.filePath,
  10732. r = _ref3.fileType,
  10733. i = _ref3.onUploadProgress;
  10734. return new Promise(function (o, a) {
  10735. var c = _this5.adapter.uploadFile({
  10736. url: e,
  10737. formData: t,
  10738. name: n,
  10739. filePath: s,
  10740. fileType: r,
  10741. header: {
  10742. "X-OSS-server-side-encrpytion": "AES256"
  10743. },
  10744. success: function success(e) {
  10745. e && e.statusCode < 400 ? o(e) : a(new ne({
  10746. code: "UPLOAD_FAILED",
  10747. message: "文件上传失败"
  10748. }));
  10749. },
  10750. fail: function fail(e) {
  10751. a(new ne({
  10752. code: e.code || "UPLOAD_FAILED",
  10753. message: e.message || e.errMsg || "文件上传失败"
  10754. }));
  10755. }
  10756. });
  10757. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  10758. i({
  10759. loaded: e.totalBytesSent,
  10760. total: e.totalBytesExpectedToSend
  10761. });
  10762. });
  10763. });
  10764. }
  10765. }, {
  10766. key: "reportOSSUpload",
  10767. value: function reportOSSUpload(e) {
  10768. var t = {
  10769. method: "serverless.file.resource.report",
  10770. params: JSON.stringify(e)
  10771. };
  10772. return this.request(this.setupRequest(t));
  10773. }
  10774. }, {
  10775. key: "uploadFile",
  10776. value: function () {
  10777. var _uploadFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref4) {
  10778. var e, t, _ref4$fileType, n, s, r, i, o, a, c, u, l, h, d, p, f, m, y, _e5, _;
  10779. return _regenerator.default.wrap(function _callee2$(_context2) {
  10780. while (1) {
  10781. switch (_context2.prev = _context2.next) {
  10782. case 0:
  10783. e = _ref4.filePath, t = _ref4.cloudPath, _ref4$fileType = _ref4.fileType, n = _ref4$fileType === void 0 ? "image" : _ref4$fileType, s = _ref4.onUploadProgress, r = _ref4.config;
  10784. if (!("string" !== g(t))) {
  10785. _context2.next = 3;
  10786. break;
  10787. }
  10788. throw new ne({
  10789. code: "INVALID_PARAM",
  10790. message: "cloudPath必须为字符串类型"
  10791. });
  10792. case 3:
  10793. if (t = t.trim()) {
  10794. _context2.next = 5;
  10795. break;
  10796. }
  10797. throw new ne({
  10798. code: "CLOUDPATH_REQUIRED",
  10799. message: "cloudPath不可为空"
  10800. });
  10801. case 5:
  10802. if (!/:\/\//.test(t)) {
  10803. _context2.next = 7;
  10804. break;
  10805. }
  10806. throw new ne({
  10807. code: "INVALID_PARAM",
  10808. message: "cloudPath不合法"
  10809. });
  10810. case 7:
  10811. i = r && r.envType || this.config.envType;
  10812. _context2.next = 10;
  10813. return this.getOSSUploadOptionsFromPath({
  10814. env: i,
  10815. filename: t
  10816. });
  10817. case 10:
  10818. o = _context2.sent.result;
  10819. a = "https://" + o.cdnDomain + "/" + o.ossPath;
  10820. c = o.securityToken;
  10821. u = o.accessKeyId;
  10822. l = o.signature;
  10823. h = o.host;
  10824. d = o.ossPath;
  10825. p = o.id;
  10826. f = o.policy;
  10827. m = o.ossCallbackUrl;
  10828. y = {
  10829. "Cache-Control": "max-age=2592000",
  10830. "Content-Disposition": "attachment",
  10831. OSSAccessKeyId: u,
  10832. Signature: l,
  10833. host: h,
  10834. id: p,
  10835. key: d,
  10836. policy: f,
  10837. success_action_status: 200
  10838. };
  10839. if (c && (y["x-oss-security-token"] = c), m) {
  10840. _e5 = JSON.stringify({
  10841. callbackUrl: m,
  10842. callbackBody: JSON.stringify({
  10843. fileId: p,
  10844. spaceId: this.config.spaceId
  10845. }),
  10846. callbackBodyType: "application/json"
  10847. });
  10848. y.callback = he.toBase64(_e5);
  10849. }
  10850. _ = {
  10851. url: "https://" + o.host,
  10852. formData: y,
  10853. fileName: "file",
  10854. name: "file",
  10855. filePath: e,
  10856. fileType: n
  10857. };
  10858. _context2.next = 25;
  10859. return this.uploadFileToOSS(Object.assign({}, _, {
  10860. onUploadProgress: s
  10861. }));
  10862. case 25:
  10863. if (!m) {
  10864. _context2.next = 27;
  10865. break;
  10866. }
  10867. return _context2.abrupt("return", {
  10868. success: !0,
  10869. filePath: e,
  10870. fileID: a
  10871. });
  10872. case 27:
  10873. _context2.next = 29;
  10874. return this.reportOSSUpload({
  10875. id: p
  10876. });
  10877. case 29:
  10878. if (!_context2.sent.success) {
  10879. _context2.next = 31;
  10880. break;
  10881. }
  10882. return _context2.abrupt("return", {
  10883. success: !0,
  10884. filePath: e,
  10885. fileID: a
  10886. });
  10887. case 31:
  10888. throw new ne({
  10889. code: "UPLOAD_FAILED",
  10890. message: "文件上传失败"
  10891. });
  10892. case 32:
  10893. case "end":
  10894. return _context2.stop();
  10895. }
  10896. }
  10897. }, _callee2, this);
  10898. }));
  10899. function uploadFile(_x) {
  10900. return _uploadFile.apply(this, arguments);
  10901. }
  10902. return uploadFile;
  10903. }()
  10904. }, {
  10905. key: "getTempFileURL",
  10906. value: function getTempFileURL() {
  10907. var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10908. e = _ref5.fileList;
  10909. return new Promise(function (t, n) {
  10910. Array.isArray(e) && 0 !== e.length || n(new ne({
  10911. code: "INVALID_PARAM",
  10912. message: "fileList的元素必须是非空的字符串"
  10913. })), t({
  10914. fileList: e.map(function (e) {
  10915. return {
  10916. fileID: e,
  10917. tempFileURL: e
  10918. };
  10919. })
  10920. });
  10921. });
  10922. }
  10923. }, {
  10924. key: "getFileInfo",
  10925. value: function () {
  10926. var _getFileInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
  10927. var _ref6,
  10928. e,
  10929. t,
  10930. _args3 = arguments;
  10931. return _regenerator.default.wrap(function _callee3$(_context3) {
  10932. while (1) {
  10933. switch (_context3.prev = _context3.next) {
  10934. case 0:
  10935. _ref6 = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, e = _ref6.fileList;
  10936. if (!(!Array.isArray(e) || 0 === e.length)) {
  10937. _context3.next = 3;
  10938. break;
  10939. }
  10940. throw new ne({
  10941. code: "INVALID_PARAM",
  10942. message: "fileList的元素必须是非空的字符串"
  10943. });
  10944. case 3:
  10945. t = {
  10946. method: "serverless.file.resource.info",
  10947. params: JSON.stringify({
  10948. id: e.map(function (e) {
  10949. return e.split("?")[0];
  10950. }).join(",")
  10951. })
  10952. };
  10953. _context3.next = 6;
  10954. return this.request(this.setupRequest(t));
  10955. case 6:
  10956. _context3.t0 = _context3.sent.result;
  10957. return _context3.abrupt("return", {
  10958. fileList: _context3.t0
  10959. });
  10960. case 8:
  10961. case "end":
  10962. return _context3.stop();
  10963. }
  10964. }
  10965. }, _callee3, this);
  10966. }));
  10967. function getFileInfo() {
  10968. return _getFileInfo.apply(this, arguments);
  10969. }
  10970. return getFileInfo;
  10971. }()
  10972. }]);
  10973. return fe;
  10974. }();
  10975. var ge = {
  10976. init: function init(e) {
  10977. var t = new fe(e),
  10978. n = {
  10979. signInAnonymously: function signInAnonymously() {
  10980. return t.authorize();
  10981. },
  10982. getLoginState: function getLoginState() {
  10983. return Promise.resolve(!1);
  10984. }
  10985. };
  10986. return t.auth = function () {
  10987. return n;
  10988. }, t.customAuth = t.auth, t;
  10989. }
  10990. };
  10991. var me = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
  10992. var ye;
  10993. !function (e) {
  10994. e.local = "local", e.none = "none", e.session = "session";
  10995. }(ye || (ye = {}));
  10996. var _e = function _e() {};
  10997. var we = function we() {
  10998. var e;
  10999. if (!Promise) {
  11000. e = function e() {}, e.promise = {};
  11001. var _t3 = function _t3() {
  11002. throw new ne({
  11003. message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'
  11004. });
  11005. };
  11006. return Object.defineProperty(e.promise, "then", {
  11007. get: _t3
  11008. }), Object.defineProperty(e.promise, "catch", {
  11009. get: _t3
  11010. }), e;
  11011. }
  11012. var t = new Promise(function (t, n) {
  11013. e = function e(_e6, s) {
  11014. return _e6 ? n(_e6) : t(s);
  11015. };
  11016. });
  11017. return e.promise = t, e;
  11018. };
  11019. function ve(e) {
  11020. return void 0 === e;
  11021. }
  11022. function be(e) {
  11023. return "[object Null]" === Object.prototype.toString.call(e);
  11024. }
  11025. var Se;
  11026. function ke(e) {
  11027. var t = (n = e, "[object Array]" === Object.prototype.toString.call(n) ? e : [e]);
  11028. var n;
  11029. var _iterator = _createForOfIteratorHelper(t),
  11030. _step;
  11031. try {
  11032. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  11033. var _e7 = _step.value;
  11034. var _t4 = _e7.isMatch,
  11035. _n4 = _e7.genAdapter,
  11036. _s4 = _e7.runtime;
  11037. if (_t4()) return {
  11038. adapter: _n4(),
  11039. runtime: _s4
  11040. };
  11041. }
  11042. } catch (err) {
  11043. _iterator.e(err);
  11044. } finally {
  11045. _iterator.f();
  11046. }
  11047. }
  11048. !function (e) {
  11049. e.WEB = "web", e.WX_MP = "wx_mp";
  11050. }(Se || (Se = {}));
  11051. var Ie = {
  11052. adapter: null,
  11053. runtime: void 0
  11054. },
  11055. Te = ["anonymousUuidKey"];
  11056. var Ce = /*#__PURE__*/function (_e8) {
  11057. (0, _inherits2.default)(Ce, _e8);
  11058. var _super2 = _createSuper(Ce);
  11059. function Ce() {
  11060. var _this6;
  11061. (0, _classCallCheck2.default)(this, Ce);
  11062. _this6 = _super2.call(this), Ie.adapter.root.tcbObject || (Ie.adapter.root.tcbObject = {});
  11063. return _this6;
  11064. }
  11065. (0, _createClass2.default)(Ce, [{
  11066. key: "setItem",
  11067. value: function setItem(e, t) {
  11068. Ie.adapter.root.tcbObject[e] = t;
  11069. }
  11070. }, {
  11071. key: "getItem",
  11072. value: function getItem(e) {
  11073. return Ie.adapter.root.tcbObject[e];
  11074. }
  11075. }, {
  11076. key: "removeItem",
  11077. value: function removeItem(e) {
  11078. delete Ie.adapter.root.tcbObject[e];
  11079. }
  11080. }, {
  11081. key: "clear",
  11082. value: function clear() {
  11083. delete Ie.adapter.root.tcbObject;
  11084. }
  11085. }]);
  11086. return Ce;
  11087. }(_e);
  11088. function Ae(e, t) {
  11089. switch (e) {
  11090. case "local":
  11091. return t.localStorage || new Ce();
  11092. case "none":
  11093. return new Ce();
  11094. default:
  11095. return t.sessionStorage || new Ce();
  11096. }
  11097. }
  11098. var Pe = /*#__PURE__*/function () {
  11099. function Pe(e) {
  11100. (0, _classCallCheck2.default)(this, Pe);
  11101. if (!this._storage) {
  11102. this._persistence = Ie.adapter.primaryStorage || e.persistence, this._storage = Ae(this._persistence, Ie.adapter);
  11103. var _t5 = "access_token_".concat(e.env),
  11104. _n5 = "access_token_expire_".concat(e.env),
  11105. _s5 = "refresh_token_".concat(e.env),
  11106. _r = "anonymous_uuid_".concat(e.env),
  11107. _i = "login_type_".concat(e.env),
  11108. _o = "user_info_".concat(e.env);
  11109. this.keys = {
  11110. accessTokenKey: _t5,
  11111. accessTokenExpireKey: _n5,
  11112. refreshTokenKey: _s5,
  11113. anonymousUuidKey: _r,
  11114. loginTypeKey: _i,
  11115. userInfoKey: _o
  11116. };
  11117. }
  11118. }
  11119. (0, _createClass2.default)(Pe, [{
  11120. key: "updatePersistence",
  11121. value: function updatePersistence(e) {
  11122. if (e === this._persistence) return;
  11123. var t = "local" === this._persistence;
  11124. this._persistence = e;
  11125. var n = Ae(e, Ie.adapter);
  11126. for (var _e9 in this.keys) {
  11127. var _s6 = this.keys[_e9];
  11128. if (t && Te.includes(_e9)) continue;
  11129. var _r2 = this._storage.getItem(_s6);
  11130. ve(_r2) || be(_r2) || (n.setItem(_s6, _r2), this._storage.removeItem(_s6));
  11131. }
  11132. this._storage = n;
  11133. }
  11134. }, {
  11135. key: "setStore",
  11136. value: function setStore(e, t, n) {
  11137. if (!this._storage) return;
  11138. var s = {
  11139. version: n || "localCachev1",
  11140. content: t
  11141. },
  11142. r = JSON.stringify(s);
  11143. try {
  11144. this._storage.setItem(e, r);
  11145. } catch (e) {
  11146. throw e;
  11147. }
  11148. }
  11149. }, {
  11150. key: "getStore",
  11151. value: function getStore(e, t) {
  11152. try {
  11153. if (!this._storage) return;
  11154. } catch (e) {
  11155. return "";
  11156. }
  11157. t = t || "localCachev1";
  11158. var n = this._storage.getItem(e);
  11159. if (!n) return "";
  11160. if (n.indexOf(t) >= 0) {
  11161. return JSON.parse(n).content;
  11162. }
  11163. return "";
  11164. }
  11165. }, {
  11166. key: "removeStore",
  11167. value: function removeStore(e) {
  11168. this._storage.removeItem(e);
  11169. }
  11170. }]);
  11171. return Pe;
  11172. }();
  11173. var Ee = {},
  11174. Oe = {};
  11175. function xe(e) {
  11176. return Ee[e];
  11177. }
  11178. var Re = /*#__PURE__*/(0, _createClass2.default)(function Re(e, t) {
  11179. (0, _classCallCheck2.default)(this, Re);
  11180. this.data = t || null, this.name = e;
  11181. });
  11182. var Ue = /*#__PURE__*/function (_Re) {
  11183. (0, _inherits2.default)(Ue, _Re);
  11184. var _super3 = _createSuper(Ue);
  11185. function Ue(e, t) {
  11186. var _this7;
  11187. (0, _classCallCheck2.default)(this, Ue);
  11188. _this7 = _super3.call(this, "error", {
  11189. error: e,
  11190. data: t
  11191. }), _this7.error = e;
  11192. return _this7;
  11193. }
  11194. return (0, _createClass2.default)(Ue);
  11195. }(Re);
  11196. var Le = new ( /*#__PURE__*/function () {
  11197. function _class() {
  11198. (0, _classCallCheck2.default)(this, _class);
  11199. this._listeners = {};
  11200. }
  11201. (0, _createClass2.default)(_class, [{
  11202. key: "on",
  11203. value: function on(e, t) {
  11204. return function (e, t, n) {
  11205. n[e] = n[e] || [], n[e].push(t);
  11206. }(e, t, this._listeners), this;
  11207. }
  11208. }, {
  11209. key: "off",
  11210. value: function off(e, t) {
  11211. return function (e, t, n) {
  11212. if (n && n[e]) {
  11213. var _s7 = n[e].indexOf(t);
  11214. -1 !== _s7 && n[e].splice(_s7, 1);
  11215. }
  11216. }(e, t, this._listeners), this;
  11217. }
  11218. }, {
  11219. key: "fire",
  11220. value: function fire(e, t) {
  11221. if (e instanceof Ue) return console.error(e.error), this;
  11222. var n = "string" == typeof e ? new Re(e, t || {}) : e;
  11223. var s = n.name;
  11224. if (this._listens(s)) {
  11225. n.target = this;
  11226. var _e10 = this._listeners[s] ? (0, _toConsumableArray2.default)(this._listeners[s]) : [];
  11227. var _iterator2 = _createForOfIteratorHelper(_e10),
  11228. _step2;
  11229. try {
  11230. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  11231. var _t6 = _step2.value;
  11232. _t6.call(this, n);
  11233. }
  11234. } catch (err) {
  11235. _iterator2.e(err);
  11236. } finally {
  11237. _iterator2.f();
  11238. }
  11239. }
  11240. return this;
  11241. }
  11242. }, {
  11243. key: "_listens",
  11244. value: function _listens(e) {
  11245. return this._listeners[e] && this._listeners[e].length > 0;
  11246. }
  11247. }]);
  11248. return _class;
  11249. }())();
  11250. function Ne(e, t) {
  11251. Le.on(e, t);
  11252. }
  11253. function De(e) {
  11254. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11255. Le.fire(e, t);
  11256. }
  11257. function Fe(e, t) {
  11258. Le.off(e, t);
  11259. }
  11260. var qe = "loginStateChanged",
  11261. Ke = "loginStateExpire",
  11262. Me = "loginTypeChanged",
  11263. je = "anonymousConverted",
  11264. Be = "refreshAccessToken";
  11265. var $e;
  11266. !function (e) {
  11267. 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";
  11268. }($e || ($e = {}));
  11269. var We = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"],
  11270. ze = {
  11271. "X-SDK-Version": "1.3.5"
  11272. };
  11273. function Je(e, t, n) {
  11274. var s = e[t];
  11275. e[t] = function (t) {
  11276. var r = {},
  11277. i = {};
  11278. n.forEach(function (n) {
  11279. var _n$call = n.call(e, t),
  11280. s = _n$call.data,
  11281. o = _n$call.headers;
  11282. Object.assign(r, s), Object.assign(i, o);
  11283. });
  11284. var o = t.data;
  11285. return o && function () {
  11286. var e;
  11287. if (e = o, "[object FormData]" !== Object.prototype.toString.call(e)) t.data = _objectSpread(_objectSpread({}, o), r);else for (var _e11 in r) {
  11288. o.append(_e11, r[_e11]);
  11289. }
  11290. }(), t.headers = _objectSpread(_objectSpread({}, t.headers || {}), i), s.call(e, t);
  11291. };
  11292. }
  11293. function He() {
  11294. var e = Math.random().toString(16).slice(2);
  11295. return {
  11296. data: {
  11297. seqId: e
  11298. },
  11299. headers: _objectSpread(_objectSpread({}, ze), {}, {
  11300. "x-seqid": e
  11301. })
  11302. };
  11303. }
  11304. var Ge = /*#__PURE__*/function () {
  11305. function Ge() {
  11306. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11307. (0, _classCallCheck2.default)(this, Ge);
  11308. var t;
  11309. this.config = e, this._reqClass = new Ie.adapter.reqClass({
  11310. timeout: this.config.timeout,
  11311. timeoutMsg: "\u8BF7\u6C42\u5728".concat(this.config.timeout / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD"),
  11312. restrictedMethods: ["post"]
  11313. }), this._cache = xe(this.config.env), this._localCache = (t = this.config.env, Oe[t]), Je(this._reqClass, "post", [He]), Je(this._reqClass, "upload", [He]), Je(this._reqClass, "download", [He]);
  11314. }
  11315. (0, _createClass2.default)(Ge, [{
  11316. key: "post",
  11317. value: function () {
  11318. var _post = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(e) {
  11319. return _regenerator.default.wrap(function _callee4$(_context4) {
  11320. while (1) {
  11321. switch (_context4.prev = _context4.next) {
  11322. case 0:
  11323. _context4.next = 2;
  11324. return this._reqClass.post(e);
  11325. case 2:
  11326. return _context4.abrupt("return", _context4.sent);
  11327. case 3:
  11328. case "end":
  11329. return _context4.stop();
  11330. }
  11331. }
  11332. }, _callee4, this);
  11333. }));
  11334. function post(_x2) {
  11335. return _post.apply(this, arguments);
  11336. }
  11337. return post;
  11338. }()
  11339. }, {
  11340. key: "upload",
  11341. value: function () {
  11342. var _upload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(e) {
  11343. return _regenerator.default.wrap(function _callee5$(_context5) {
  11344. while (1) {
  11345. switch (_context5.prev = _context5.next) {
  11346. case 0:
  11347. _context5.next = 2;
  11348. return this._reqClass.upload(e);
  11349. case 2:
  11350. return _context5.abrupt("return", _context5.sent);
  11351. case 3:
  11352. case "end":
  11353. return _context5.stop();
  11354. }
  11355. }
  11356. }, _callee5, this);
  11357. }));
  11358. function upload(_x3) {
  11359. return _upload.apply(this, arguments);
  11360. }
  11361. return upload;
  11362. }()
  11363. }, {
  11364. key: "download",
  11365. value: function () {
  11366. var _download = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(e) {
  11367. return _regenerator.default.wrap(function _callee6$(_context6) {
  11368. while (1) {
  11369. switch (_context6.prev = _context6.next) {
  11370. case 0:
  11371. _context6.next = 2;
  11372. return this._reqClass.download(e);
  11373. case 2:
  11374. return _context6.abrupt("return", _context6.sent);
  11375. case 3:
  11376. case "end":
  11377. return _context6.stop();
  11378. }
  11379. }
  11380. }, _callee6, this);
  11381. }));
  11382. function download(_x4) {
  11383. return _download.apply(this, arguments);
  11384. }
  11385. return download;
  11386. }()
  11387. }, {
  11388. key: "refreshAccessToken",
  11389. value: function () {
  11390. var _refreshAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
  11391. var e, t;
  11392. return _regenerator.default.wrap(function _callee7$(_context7) {
  11393. while (1) {
  11394. switch (_context7.prev = _context7.next) {
  11395. case 0:
  11396. this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
  11397. _context7.prev = 1;
  11398. _context7.next = 4;
  11399. return this._refreshAccessTokenPromise;
  11400. case 4:
  11401. e = _context7.sent;
  11402. _context7.next = 10;
  11403. break;
  11404. case 7:
  11405. _context7.prev = 7;
  11406. _context7.t0 = _context7["catch"](1);
  11407. t = _context7.t0;
  11408. case 10:
  11409. if (!(this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t)) {
  11410. _context7.next = 12;
  11411. break;
  11412. }
  11413. throw t;
  11414. case 12:
  11415. return _context7.abrupt("return", e);
  11416. case 13:
  11417. case "end":
  11418. return _context7.stop();
  11419. }
  11420. }
  11421. }, _callee7, this, [[1, 7]]);
  11422. }));
  11423. function refreshAccessToken() {
  11424. return _refreshAccessToken2.apply(this, arguments);
  11425. }
  11426. return refreshAccessToken;
  11427. }()
  11428. }, {
  11429. key: "_refreshAccessToken",
  11430. value: function () {
  11431. var _refreshAccessToken3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
  11432. var _this$_cache$keys, e, t, n, s, r, i, o, a, _e12, _e13, _t7, _s8;
  11433. return _regenerator.default.wrap(function _callee8$(_context8) {
  11434. while (1) {
  11435. switch (_context8.prev = _context8.next) {
  11436. case 0:
  11437. _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;
  11438. this._cache.removeStore(e), this._cache.removeStore(t);
  11439. i = this._cache.getStore(n);
  11440. if (i) {
  11441. _context8.next = 5;
  11442. break;
  11443. }
  11444. throw new ne({
  11445. message: "未登录CloudBase"
  11446. });
  11447. case 5:
  11448. o = {
  11449. refresh_token: i
  11450. };
  11451. _context8.next = 8;
  11452. return this.request("auth.fetchAccessTokenWithRefreshToken", o);
  11453. case 8:
  11454. a = _context8.sent;
  11455. if (!a.data.code) {
  11456. _context8.next = 21;
  11457. break;
  11458. }
  11459. _e12 = a.data.code;
  11460. if (!("SIGN_PARAM_INVALID" === _e12 || "REFRESH_TOKEN_EXPIRED" === _e12 || "INVALID_REFRESH_TOKEN" === _e12)) {
  11461. _context8.next = 20;
  11462. break;
  11463. }
  11464. if (!(this._cache.getStore(s) === $e.ANONYMOUS && "INVALID_REFRESH_TOKEN" === _e12)) {
  11465. _context8.next = 19;
  11466. break;
  11467. }
  11468. _e13 = this._cache.getStore(r);
  11469. _t7 = this._cache.getStore(n);
  11470. _context8.next = 17;
  11471. return this.send("auth.signInAnonymously", {
  11472. anonymous_uuid: _e13,
  11473. refresh_token: _t7
  11474. });
  11475. case 17:
  11476. _s8 = _context8.sent;
  11477. return _context8.abrupt("return", (this.setRefreshToken(_s8.refresh_token), this._refreshAccessToken()));
  11478. case 19:
  11479. De(Ke), this._cache.removeStore(n);
  11480. case 20:
  11481. throw new ne({
  11482. code: a.data.code,
  11483. message: "\u5237\u65B0access token\u5931\u8D25\uFF1A".concat(a.data.code)
  11484. });
  11485. case 21:
  11486. if (!a.data.access_token) {
  11487. _context8.next = 23;
  11488. break;
  11489. }
  11490. return _context8.abrupt("return", (De(Be), this._cache.setStore(e, a.data.access_token), this._cache.setStore(t, a.data.access_token_expire + Date.now()), {
  11491. accessToken: a.data.access_token,
  11492. accessTokenExpire: a.data.access_token_expire
  11493. }));
  11494. case 23:
  11495. a.data.refresh_token && (this._cache.removeStore(n), this._cache.setStore(n, a.data.refresh_token), this._refreshAccessToken());
  11496. case 24:
  11497. case "end":
  11498. return _context8.stop();
  11499. }
  11500. }
  11501. }, _callee8, this);
  11502. }));
  11503. function _refreshAccessToken() {
  11504. return _refreshAccessToken3.apply(this, arguments);
  11505. }
  11506. return _refreshAccessToken;
  11507. }()
  11508. }, {
  11509. key: "getAccessToken",
  11510. value: function () {
  11511. var _getAccessToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
  11512. var _this$_cache$keys2, e, t, n, s, r, i;
  11513. return _regenerator.default.wrap(function _callee9$(_context9) {
  11514. while (1) {
  11515. switch (_context9.prev = _context9.next) {
  11516. case 0:
  11517. _this$_cache$keys2 = this._cache.keys, e = _this$_cache$keys2.accessTokenKey, t = _this$_cache$keys2.accessTokenExpireKey, n = _this$_cache$keys2.refreshTokenKey;
  11518. if (this._cache.getStore(n)) {
  11519. _context9.next = 3;
  11520. break;
  11521. }
  11522. throw new ne({
  11523. message: "refresh token不存在,登录状态异常"
  11524. });
  11525. case 3:
  11526. s = this._cache.getStore(e), r = this._cache.getStore(t), i = !0;
  11527. _context9.t0 = this._shouldRefreshAccessTokenHook;
  11528. if (!_context9.t0) {
  11529. _context9.next = 9;
  11530. break;
  11531. }
  11532. _context9.next = 8;
  11533. return this._shouldRefreshAccessTokenHook(s, r);
  11534. case 8:
  11535. _context9.t0 = !_context9.sent;
  11536. case 9:
  11537. _context9.t1 = _context9.t0;
  11538. if (!_context9.t1) {
  11539. _context9.next = 12;
  11540. break;
  11541. }
  11542. i = !1;
  11543. case 12:
  11544. return _context9.abrupt("return", (!s || !r || r < Date.now()) && i ? this.refreshAccessToken() : {
  11545. accessToken: s,
  11546. accessTokenExpire: r
  11547. });
  11548. case 13:
  11549. case "end":
  11550. return _context9.stop();
  11551. }
  11552. }
  11553. }, _callee9, this);
  11554. }));
  11555. function getAccessToken() {
  11556. return _getAccessToken.apply(this, arguments);
  11557. }
  11558. return getAccessToken;
  11559. }()
  11560. }, {
  11561. key: "request",
  11562. value: function () {
  11563. var _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(e, t, n) {
  11564. var s, r, i, _e14, o, _e15, _e16, a, c, u, l, h, d, p, f, g;
  11565. return _regenerator.default.wrap(function _callee10$(_context10) {
  11566. while (1) {
  11567. switch (_context10.prev = _context10.next) {
  11568. case 0:
  11569. s = "x-tcb-trace_".concat(this.config.env);
  11570. r = "application/x-www-form-urlencoded";
  11571. i = _objectSpread({
  11572. action: e,
  11573. env: this.config.env,
  11574. dataVersion: "2019-08-16"
  11575. }, t);
  11576. if (!(-1 === We.indexOf(e))) {
  11577. _context10.next = 10;
  11578. break;
  11579. }
  11580. _e14 = this._cache.keys.refreshTokenKey;
  11581. _context10.t0 = this._cache.getStore(_e14);
  11582. if (!_context10.t0) {
  11583. _context10.next = 10;
  11584. break;
  11585. }
  11586. _context10.next = 9;
  11587. return this.getAccessToken();
  11588. case 9:
  11589. i.access_token = _context10.sent.accessToken;
  11590. case 10:
  11591. if ("storage.uploadFile" === e) {
  11592. o = new FormData();
  11593. for (_e15 in o) {
  11594. o.hasOwnProperty(_e15) && void 0 !== o[_e15] && o.append(_e15, i[_e15]);
  11595. }
  11596. r = "multipart/form-data";
  11597. } else {
  11598. r = "application/json", o = {};
  11599. for (_e16 in i) {
  11600. void 0 !== i[_e16] && (o[_e16] = i[_e16]);
  11601. }
  11602. }
  11603. a = {
  11604. headers: {
  11605. "content-type": r
  11606. }
  11607. };
  11608. n && n.onUploadProgress && (a.onUploadProgress = n.onUploadProgress);
  11609. c = this._localCache.getStore(s);
  11610. c && (a.headers["X-TCB-Trace"] = c);
  11611. u = t.parse, l = t.inQuery, h = t.search;
  11612. d = {
  11613. env: this.config.env
  11614. };
  11615. u && (d.parse = !0), l && (d = _objectSpread(_objectSpread({}, l), d));
  11616. p = function (e, t) {
  11617. var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  11618. var s = /\?/.test(t);
  11619. var r = "";
  11620. for (var _e17 in n) {
  11621. "" === r ? !s && (t += "?") : r += "&", r += "".concat(_e17, "=").concat(encodeURIComponent(n[_e17]));
  11622. }
  11623. return /^http(s)?\:\/\//.test(t += r) ? t : "".concat(e).concat(t);
  11624. }(me, "//tcb-api.tencentcloudapi.com/web", d);
  11625. h && (p += h);
  11626. _context10.next = 22;
  11627. return this.post(_objectSpread({
  11628. url: p,
  11629. data: o
  11630. }, a));
  11631. case 22:
  11632. f = _context10.sent;
  11633. g = f.header && f.header["x-tcb-trace"];
  11634. if (!(g && this._localCache.setStore(s, g), 200 !== Number(f.status) && 200 !== Number(f.statusCode) || !f.data)) {
  11635. _context10.next = 26;
  11636. break;
  11637. }
  11638. throw new ne({
  11639. code: "NETWORK_ERROR",
  11640. message: "network request error"
  11641. });
  11642. case 26:
  11643. return _context10.abrupt("return", f);
  11644. case 27:
  11645. case "end":
  11646. return _context10.stop();
  11647. }
  11648. }
  11649. }, _callee10, this);
  11650. }));
  11651. function request(_x5, _x6, _x7) {
  11652. return _request.apply(this, arguments);
  11653. }
  11654. return request;
  11655. }()
  11656. }, {
  11657. key: "send",
  11658. value: function () {
  11659. var _send = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(e) {
  11660. var t,
  11661. n,
  11662. _n6,
  11663. _args11 = arguments;
  11664. return _regenerator.default.wrap(function _callee11$(_context11) {
  11665. while (1) {
  11666. switch (_context11.prev = _context11.next) {
  11667. case 0:
  11668. t = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : {};
  11669. _context11.next = 3;
  11670. return this.request(e, t, {
  11671. onUploadProgress: t.onUploadProgress
  11672. });
  11673. case 3:
  11674. n = _context11.sent;
  11675. if (!("ACCESS_TOKEN_EXPIRED" === n.data.code && -1 === We.indexOf(e))) {
  11676. _context11.next = 13;
  11677. break;
  11678. }
  11679. _context11.next = 7;
  11680. return this.refreshAccessToken();
  11681. case 7:
  11682. _context11.next = 9;
  11683. return this.request(e, t, {
  11684. onUploadProgress: t.onUploadProgress
  11685. });
  11686. case 9:
  11687. _n6 = _context11.sent;
  11688. if (!_n6.data.code) {
  11689. _context11.next = 12;
  11690. break;
  11691. }
  11692. throw new ne({
  11693. code: _n6.data.code,
  11694. message: _n6.data.message
  11695. });
  11696. case 12:
  11697. return _context11.abrupt("return", _n6.data);
  11698. case 13:
  11699. if (!n.data.code) {
  11700. _context11.next = 15;
  11701. break;
  11702. }
  11703. throw new ne({
  11704. code: n.data.code,
  11705. message: n.data.message
  11706. });
  11707. case 15:
  11708. return _context11.abrupt("return", n.data);
  11709. case 16:
  11710. case "end":
  11711. return _context11.stop();
  11712. }
  11713. }
  11714. }, _callee11, this);
  11715. }));
  11716. function send(_x8) {
  11717. return _send.apply(this, arguments);
  11718. }
  11719. return send;
  11720. }()
  11721. }, {
  11722. key: "setRefreshToken",
  11723. value: function setRefreshToken(e) {
  11724. var _this$_cache$keys3 = this._cache.keys,
  11725. t = _this$_cache$keys3.accessTokenKey,
  11726. n = _this$_cache$keys3.accessTokenExpireKey,
  11727. s = _this$_cache$keys3.refreshTokenKey;
  11728. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  11729. }
  11730. }]);
  11731. return Ge;
  11732. }();
  11733. var Ve = {};
  11734. function Ye(e) {
  11735. return Ve[e];
  11736. }
  11737. var Qe = /*#__PURE__*/function () {
  11738. function Qe(e) {
  11739. (0, _classCallCheck2.default)(this, Qe);
  11740. this.config = e, this._cache = xe(e.env), this._request = Ye(e.env);
  11741. }
  11742. (0, _createClass2.default)(Qe, [{
  11743. key: "setRefreshToken",
  11744. value: function setRefreshToken(e) {
  11745. var _this$_cache$keys4 = this._cache.keys,
  11746. t = _this$_cache$keys4.accessTokenKey,
  11747. n = _this$_cache$keys4.accessTokenExpireKey,
  11748. s = _this$_cache$keys4.refreshTokenKey;
  11749. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  11750. }
  11751. }, {
  11752. key: "setAccessToken",
  11753. value: function setAccessToken(e, t) {
  11754. var _this$_cache$keys5 = this._cache.keys,
  11755. n = _this$_cache$keys5.accessTokenKey,
  11756. s = _this$_cache$keys5.accessTokenExpireKey;
  11757. this._cache.setStore(n, e), this._cache.setStore(s, t);
  11758. }
  11759. }, {
  11760. key: "refreshUserInfo",
  11761. value: function () {
  11762. var _refreshUserInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
  11763. var _yield$this$_request$, e;
  11764. return _regenerator.default.wrap(function _callee12$(_context12) {
  11765. while (1) {
  11766. switch (_context12.prev = _context12.next) {
  11767. case 0:
  11768. _context12.next = 2;
  11769. return this._request.send("auth.getUserInfo", {});
  11770. case 2:
  11771. _yield$this$_request$ = _context12.sent;
  11772. e = _yield$this$_request$.data;
  11773. return _context12.abrupt("return", (this.setLocalUserInfo(e), e));
  11774. case 5:
  11775. case "end":
  11776. return _context12.stop();
  11777. }
  11778. }
  11779. }, _callee12, this);
  11780. }));
  11781. function refreshUserInfo() {
  11782. return _refreshUserInfo.apply(this, arguments);
  11783. }
  11784. return refreshUserInfo;
  11785. }()
  11786. }, {
  11787. key: "setLocalUserInfo",
  11788. value: function setLocalUserInfo(e) {
  11789. var t = this._cache.keys.userInfoKey;
  11790. this._cache.setStore(t, e);
  11791. }
  11792. }]);
  11793. return Qe;
  11794. }();
  11795. var Xe = /*#__PURE__*/function () {
  11796. function Xe(e) {
  11797. (0, _classCallCheck2.default)(this, Xe);
  11798. if (!e) throw new ne({
  11799. code: "PARAM_ERROR",
  11800. message: "envId is not defined"
  11801. });
  11802. this._envId = e, this._cache = xe(this._envId), this._request = Ye(this._envId), this.setUserInfo();
  11803. }
  11804. (0, _createClass2.default)(Xe, [{
  11805. key: "linkWithTicket",
  11806. value: function linkWithTicket(e) {
  11807. if ("string" != typeof e) throw new ne({
  11808. code: "PARAM_ERROR",
  11809. message: "ticket must be string"
  11810. });
  11811. return this._request.send("auth.linkWithTicket", {
  11812. ticket: e
  11813. });
  11814. }
  11815. }, {
  11816. key: "linkWithRedirect",
  11817. value: function linkWithRedirect(e) {
  11818. e.signInWithRedirect();
  11819. }
  11820. }, {
  11821. key: "updatePassword",
  11822. value: function updatePassword(e, t) {
  11823. return this._request.send("auth.updatePassword", {
  11824. oldPassword: t,
  11825. newPassword: e
  11826. });
  11827. }
  11828. }, {
  11829. key: "updateEmail",
  11830. value: function updateEmail(e) {
  11831. return this._request.send("auth.updateEmail", {
  11832. newEmail: e
  11833. });
  11834. }
  11835. }, {
  11836. key: "updateUsername",
  11837. value: function updateUsername(e) {
  11838. if ("string" != typeof e) throw new ne({
  11839. code: "PARAM_ERROR",
  11840. message: "username must be a string"
  11841. });
  11842. return this._request.send("auth.updateUsername", {
  11843. username: e
  11844. });
  11845. }
  11846. }, {
  11847. key: "getLinkedUidList",
  11848. value: function () {
  11849. var _getLinkedUidList = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
  11850. var _yield$this$_request$2, e, t, n;
  11851. return _regenerator.default.wrap(function _callee13$(_context13) {
  11852. while (1) {
  11853. switch (_context13.prev = _context13.next) {
  11854. case 0:
  11855. _context13.next = 2;
  11856. return this._request.send("auth.getLinkedUidList", {});
  11857. case 2:
  11858. _yield$this$_request$2 = _context13.sent;
  11859. e = _yield$this$_request$2.data;
  11860. t = !1;
  11861. n = e.users;
  11862. return _context13.abrupt("return", (n.forEach(function (e) {
  11863. e.wxOpenId && e.wxPublicId && (t = !0);
  11864. }), {
  11865. users: n,
  11866. hasPrimaryUid: t
  11867. }));
  11868. case 7:
  11869. case "end":
  11870. return _context13.stop();
  11871. }
  11872. }
  11873. }, _callee13, this);
  11874. }));
  11875. function getLinkedUidList() {
  11876. return _getLinkedUidList.apply(this, arguments);
  11877. }
  11878. return getLinkedUidList;
  11879. }()
  11880. }, {
  11881. key: "setPrimaryUid",
  11882. value: function setPrimaryUid(e) {
  11883. return this._request.send("auth.setPrimaryUid", {
  11884. uid: e
  11885. });
  11886. }
  11887. }, {
  11888. key: "unlink",
  11889. value: function unlink(e) {
  11890. return this._request.send("auth.unlink", {
  11891. platform: e
  11892. });
  11893. }
  11894. }, {
  11895. key: "update",
  11896. value: function () {
  11897. var _update = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(e) {
  11898. var t, n, s, r, i, o, _yield$this$_request$3, a;
  11899. return _regenerator.default.wrap(function _callee14$(_context14) {
  11900. while (1) {
  11901. switch (_context14.prev = _context14.next) {
  11902. case 0:
  11903. t = e.nickName;
  11904. n = e.gender;
  11905. s = e.avatarUrl;
  11906. r = e.province;
  11907. i = e.country;
  11908. o = e.city;
  11909. _context14.next = 8;
  11910. return this._request.send("auth.updateUserInfo", {
  11911. nickName: t,
  11912. gender: n,
  11913. avatarUrl: s,
  11914. province: r,
  11915. country: i,
  11916. city: o
  11917. });
  11918. case 8:
  11919. _yield$this$_request$3 = _context14.sent;
  11920. a = _yield$this$_request$3.data;
  11921. this.setLocalUserInfo(a);
  11922. case 11:
  11923. case "end":
  11924. return _context14.stop();
  11925. }
  11926. }
  11927. }, _callee14, this);
  11928. }));
  11929. function update(_x9) {
  11930. return _update.apply(this, arguments);
  11931. }
  11932. return update;
  11933. }()
  11934. }, {
  11935. key: "refresh",
  11936. value: function () {
  11937. var _refresh = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
  11938. var _yield$this$_request$4, e;
  11939. return _regenerator.default.wrap(function _callee15$(_context15) {
  11940. while (1) {
  11941. switch (_context15.prev = _context15.next) {
  11942. case 0:
  11943. _context15.next = 2;
  11944. return this._request.send("auth.getUserInfo", {});
  11945. case 2:
  11946. _yield$this$_request$4 = _context15.sent;
  11947. e = _yield$this$_request$4.data;
  11948. return _context15.abrupt("return", (this.setLocalUserInfo(e), e));
  11949. case 5:
  11950. case "end":
  11951. return _context15.stop();
  11952. }
  11953. }
  11954. }, _callee15, this);
  11955. }));
  11956. function refresh() {
  11957. return _refresh.apply(this, arguments);
  11958. }
  11959. return refresh;
  11960. }()
  11961. }, {
  11962. key: "setUserInfo",
  11963. value: function setUserInfo() {
  11964. var _this8 = this;
  11965. var e = this._cache.keys.userInfoKey,
  11966. t = this._cache.getStore(e);
  11967. ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach(function (e) {
  11968. _this8[e] = t[e];
  11969. }), this.location = {
  11970. country: t.country,
  11971. province: t.province,
  11972. city: t.city
  11973. };
  11974. }
  11975. }, {
  11976. key: "setLocalUserInfo",
  11977. value: function setLocalUserInfo(e) {
  11978. var t = this._cache.keys.userInfoKey;
  11979. this._cache.setStore(t, e), this.setUserInfo();
  11980. }
  11981. }]);
  11982. return Xe;
  11983. }();
  11984. var Ze = /*#__PURE__*/function () {
  11985. function Ze(e) {
  11986. (0, _classCallCheck2.default)(this, Ze);
  11987. if (!e) throw new ne({
  11988. code: "PARAM_ERROR",
  11989. message: "envId is not defined"
  11990. });
  11991. this._cache = xe(e);
  11992. var _this$_cache$keys6 = this._cache.keys,
  11993. t = _this$_cache$keys6.refreshTokenKey,
  11994. n = _this$_cache$keys6.accessTokenKey,
  11995. s = _this$_cache$keys6.accessTokenExpireKey,
  11996. r = this._cache.getStore(t),
  11997. i = this._cache.getStore(n),
  11998. o = this._cache.getStore(s);
  11999. this.credential = {
  12000. refreshToken: r,
  12001. accessToken: i,
  12002. accessTokenExpire: o
  12003. }, this.user = new Xe(e);
  12004. }
  12005. (0, _createClass2.default)(Ze, [{
  12006. key: "isAnonymousAuth",
  12007. get: function get() {
  12008. return this.loginType === $e.ANONYMOUS;
  12009. }
  12010. }, {
  12011. key: "isCustomAuth",
  12012. get: function get() {
  12013. return this.loginType === $e.CUSTOM;
  12014. }
  12015. }, {
  12016. key: "isWeixinAuth",
  12017. get: function get() {
  12018. return this.loginType === $e.WECHAT || this.loginType === $e.WECHAT_OPEN || this.loginType === $e.WECHAT_PUBLIC;
  12019. }
  12020. }, {
  12021. key: "loginType",
  12022. get: function get() {
  12023. return this._cache.getStore(this._cache.keys.loginTypeKey);
  12024. }
  12025. }]);
  12026. return Ze;
  12027. }();
  12028. var et = /*#__PURE__*/function (_Qe) {
  12029. (0, _inherits2.default)(et, _Qe);
  12030. var _super4 = _createSuper(et);
  12031. function et() {
  12032. (0, _classCallCheck2.default)(this, et);
  12033. return _super4.apply(this, arguments);
  12034. }
  12035. (0, _createClass2.default)(et, [{
  12036. key: "signIn",
  12037. value: function () {
  12038. var _signIn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
  12039. var _this$_cache$keys7, e, t, n, s, r, _e18;
  12040. return _regenerator.default.wrap(function _callee16$(_context16) {
  12041. while (1) {
  12042. switch (_context16.prev = _context16.next) {
  12043. case 0:
  12044. this._cache.updatePersistence("local");
  12045. _this$_cache$keys7 = this._cache.keys;
  12046. e = _this$_cache$keys7.anonymousUuidKey;
  12047. t = _this$_cache$keys7.refreshTokenKey;
  12048. n = this._cache.getStore(e) || void 0;
  12049. s = this._cache.getStore(t) || void 0;
  12050. _context16.next = 8;
  12051. return this._request.send("auth.signInAnonymously", {
  12052. anonymous_uuid: n,
  12053. refresh_token: s
  12054. });
  12055. case 8:
  12056. r = _context16.sent;
  12057. if (!(r.uuid && r.refresh_token)) {
  12058. _context16.next = 20;
  12059. break;
  12060. }
  12061. this._setAnonymousUUID(r.uuid);
  12062. this.setRefreshToken(r.refresh_token);
  12063. _context16.next = 14;
  12064. return this._request.refreshAccessToken();
  12065. case 14:
  12066. De(qe);
  12067. De(Me, {
  12068. env: this.config.env,
  12069. loginType: $e.ANONYMOUS,
  12070. persistence: "local"
  12071. });
  12072. _e18 = new Ze(this.config.env);
  12073. _context16.next = 19;
  12074. return _e18.user.refresh();
  12075. case 19:
  12076. return _context16.abrupt("return", _e18);
  12077. case 20:
  12078. throw new ne({
  12079. message: "匿名登录失败"
  12080. });
  12081. case 21:
  12082. case "end":
  12083. return _context16.stop();
  12084. }
  12085. }
  12086. }, _callee16, this);
  12087. }));
  12088. function signIn() {
  12089. return _signIn.apply(this, arguments);
  12090. }
  12091. return signIn;
  12092. }()
  12093. }, {
  12094. key: "linkAndRetrieveDataWithTicket",
  12095. value: function () {
  12096. var _linkAndRetrieveDataWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(e) {
  12097. var _this$_cache$keys8, t, n, s, r, i;
  12098. return _regenerator.default.wrap(function _callee17$(_context17) {
  12099. while (1) {
  12100. switch (_context17.prev = _context17.next) {
  12101. case 0:
  12102. _this$_cache$keys8 = this._cache.keys;
  12103. t = _this$_cache$keys8.anonymousUuidKey;
  12104. n = _this$_cache$keys8.refreshTokenKey;
  12105. s = this._cache.getStore(t);
  12106. r = this._cache.getStore(n);
  12107. _context17.next = 7;
  12108. return this._request.send("auth.linkAndRetrieveDataWithTicket", {
  12109. anonymous_uuid: s,
  12110. refresh_token: r,
  12111. ticket: e
  12112. });
  12113. case 7:
  12114. i = _context17.sent;
  12115. if (!i.refresh_token) {
  12116. _context17.next = 16;
  12117. break;
  12118. }
  12119. this._clearAnonymousUUID();
  12120. this.setRefreshToken(i.refresh_token);
  12121. _context17.next = 13;
  12122. return this._request.refreshAccessToken();
  12123. case 13:
  12124. De(je, {
  12125. env: this.config.env
  12126. });
  12127. De(Me, {
  12128. loginType: $e.CUSTOM,
  12129. persistence: "local"
  12130. });
  12131. return _context17.abrupt("return", {
  12132. credential: {
  12133. refreshToken: i.refresh_token
  12134. }
  12135. });
  12136. case 16:
  12137. throw new ne({
  12138. message: "匿名转化失败"
  12139. });
  12140. case 17:
  12141. case "end":
  12142. return _context17.stop();
  12143. }
  12144. }
  12145. }, _callee17, this);
  12146. }));
  12147. function linkAndRetrieveDataWithTicket(_x10) {
  12148. return _linkAndRetrieveDataWithTicket.apply(this, arguments);
  12149. }
  12150. return linkAndRetrieveDataWithTicket;
  12151. }()
  12152. }, {
  12153. key: "_setAnonymousUUID",
  12154. value: function _setAnonymousUUID(e) {
  12155. var _this$_cache$keys9 = this._cache.keys,
  12156. t = _this$_cache$keys9.anonymousUuidKey,
  12157. n = _this$_cache$keys9.loginTypeKey;
  12158. this._cache.removeStore(t), this._cache.setStore(t, e), this._cache.setStore(n, $e.ANONYMOUS);
  12159. }
  12160. }, {
  12161. key: "_clearAnonymousUUID",
  12162. value: function _clearAnonymousUUID() {
  12163. this._cache.removeStore(this._cache.keys.anonymousUuidKey);
  12164. }
  12165. }]);
  12166. return et;
  12167. }(Qe);
  12168. var tt = /*#__PURE__*/function (_Qe2) {
  12169. (0, _inherits2.default)(tt, _Qe2);
  12170. var _super5 = _createSuper(tt);
  12171. function tt() {
  12172. (0, _classCallCheck2.default)(this, tt);
  12173. return _super5.apply(this, arguments);
  12174. }
  12175. (0, _createClass2.default)(tt, [{
  12176. key: "signIn",
  12177. value: function () {
  12178. var _signIn2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(e) {
  12179. var t, n;
  12180. return _regenerator.default.wrap(function _callee18$(_context18) {
  12181. while (1) {
  12182. switch (_context18.prev = _context18.next) {
  12183. case 0:
  12184. if (!("string" != typeof e)) {
  12185. _context18.next = 2;
  12186. break;
  12187. }
  12188. throw new ne({
  12189. code: "PARAM_ERROR",
  12190. message: "ticket must be a string"
  12191. });
  12192. case 2:
  12193. t = this._cache.keys.refreshTokenKey;
  12194. _context18.next = 5;
  12195. return this._request.send("auth.signInWithTicket", {
  12196. ticket: e,
  12197. refresh_token: this._cache.getStore(t) || ""
  12198. });
  12199. case 5:
  12200. n = _context18.sent;
  12201. if (!n.refresh_token) {
  12202. _context18.next = 15;
  12203. break;
  12204. }
  12205. this.setRefreshToken(n.refresh_token);
  12206. _context18.next = 10;
  12207. return this._request.refreshAccessToken();
  12208. case 10:
  12209. De(qe);
  12210. De(Me, {
  12211. env: this.config.env,
  12212. loginType: $e.CUSTOM,
  12213. persistence: this.config.persistence
  12214. });
  12215. _context18.next = 14;
  12216. return this.refreshUserInfo();
  12217. case 14:
  12218. return _context18.abrupt("return", new Ze(this.config.env));
  12219. case 15:
  12220. throw new ne({
  12221. message: "自定义登录失败"
  12222. });
  12223. case 16:
  12224. case "end":
  12225. return _context18.stop();
  12226. }
  12227. }
  12228. }, _callee18, this);
  12229. }));
  12230. function signIn(_x11) {
  12231. return _signIn2.apply(this, arguments);
  12232. }
  12233. return signIn;
  12234. }()
  12235. }]);
  12236. return tt;
  12237. }(Qe);
  12238. var nt = /*#__PURE__*/function (_Qe3) {
  12239. (0, _inherits2.default)(nt, _Qe3);
  12240. var _super6 = _createSuper(nt);
  12241. function nt() {
  12242. (0, _classCallCheck2.default)(this, nt);
  12243. return _super6.apply(this, arguments);
  12244. }
  12245. (0, _createClass2.default)(nt, [{
  12246. key: "signIn",
  12247. value: function () {
  12248. var _signIn3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(e, t) {
  12249. var n, s, r, i, o;
  12250. return _regenerator.default.wrap(function _callee19$(_context19) {
  12251. while (1) {
  12252. switch (_context19.prev = _context19.next) {
  12253. case 0:
  12254. if (!("string" != typeof e)) {
  12255. _context19.next = 2;
  12256. break;
  12257. }
  12258. throw new ne({
  12259. code: "PARAM_ERROR",
  12260. message: "email must be a string"
  12261. });
  12262. case 2:
  12263. n = this._cache.keys.refreshTokenKey;
  12264. _context19.next = 5;
  12265. return this._request.send("auth.signIn", {
  12266. loginType: "EMAIL",
  12267. email: e,
  12268. password: t,
  12269. refresh_token: this._cache.getStore(n) || ""
  12270. });
  12271. case 5:
  12272. s = _context19.sent;
  12273. r = s.refresh_token;
  12274. i = s.access_token;
  12275. o = s.access_token_expire;
  12276. if (!r) {
  12277. _context19.next = 22;
  12278. break;
  12279. }
  12280. this.setRefreshToken(r);
  12281. if (!(i && o)) {
  12282. _context19.next = 15;
  12283. break;
  12284. }
  12285. this.setAccessToken(i, o);
  12286. _context19.next = 17;
  12287. break;
  12288. case 15:
  12289. _context19.next = 17;
  12290. return this._request.refreshAccessToken();
  12291. case 17:
  12292. _context19.next = 19;
  12293. return this.refreshUserInfo();
  12294. case 19:
  12295. De(qe);
  12296. De(Me, {
  12297. env: this.config.env,
  12298. loginType: $e.EMAIL,
  12299. persistence: this.config.persistence
  12300. });
  12301. return _context19.abrupt("return", new Ze(this.config.env));
  12302. case 22:
  12303. throw s.code ? new ne({
  12304. code: s.code,
  12305. message: "\u90AE\u7BB1\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  12306. }) : new ne({
  12307. message: "邮箱登录失败"
  12308. });
  12309. case 23:
  12310. case "end":
  12311. return _context19.stop();
  12312. }
  12313. }
  12314. }, _callee19, this);
  12315. }));
  12316. function signIn(_x12, _x13) {
  12317. return _signIn3.apply(this, arguments);
  12318. }
  12319. return signIn;
  12320. }()
  12321. }, {
  12322. key: "activate",
  12323. value: function () {
  12324. var _activate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(e) {
  12325. return _regenerator.default.wrap(function _callee20$(_context20) {
  12326. while (1) {
  12327. switch (_context20.prev = _context20.next) {
  12328. case 0:
  12329. return _context20.abrupt("return", this._request.send("auth.activateEndUserMail", {
  12330. token: e
  12331. }));
  12332. case 1:
  12333. case "end":
  12334. return _context20.stop();
  12335. }
  12336. }
  12337. }, _callee20, this);
  12338. }));
  12339. function activate(_x14) {
  12340. return _activate.apply(this, arguments);
  12341. }
  12342. return activate;
  12343. }()
  12344. }, {
  12345. key: "resetPasswordWithToken",
  12346. value: function () {
  12347. var _resetPasswordWithToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(e, t) {
  12348. return _regenerator.default.wrap(function _callee21$(_context21) {
  12349. while (1) {
  12350. switch (_context21.prev = _context21.next) {
  12351. case 0:
  12352. return _context21.abrupt("return", this._request.send("auth.resetPasswordWithToken", {
  12353. token: e,
  12354. newPassword: t
  12355. }));
  12356. case 1:
  12357. case "end":
  12358. return _context21.stop();
  12359. }
  12360. }
  12361. }, _callee21, this);
  12362. }));
  12363. function resetPasswordWithToken(_x15, _x16) {
  12364. return _resetPasswordWithToken.apply(this, arguments);
  12365. }
  12366. return resetPasswordWithToken;
  12367. }()
  12368. }]);
  12369. return nt;
  12370. }(Qe);
  12371. var st = /*#__PURE__*/function (_Qe4) {
  12372. (0, _inherits2.default)(st, _Qe4);
  12373. var _super7 = _createSuper(st);
  12374. function st() {
  12375. (0, _classCallCheck2.default)(this, st);
  12376. return _super7.apply(this, arguments);
  12377. }
  12378. (0, _createClass2.default)(st, [{
  12379. key: "signIn",
  12380. value: function () {
  12381. var _signIn4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22(e, t) {
  12382. var n, s, r, i, o;
  12383. return _regenerator.default.wrap(function _callee22$(_context22) {
  12384. while (1) {
  12385. switch (_context22.prev = _context22.next) {
  12386. case 0:
  12387. if (!("string" != typeof e)) {
  12388. _context22.next = 2;
  12389. break;
  12390. }
  12391. throw new ne({
  12392. code: "PARAM_ERROR",
  12393. message: "username must be a string"
  12394. });
  12395. case 2:
  12396. "string" != typeof t && (t = "", console.warn("password is empty"));
  12397. n = this._cache.keys.refreshTokenKey;
  12398. _context22.next = 6;
  12399. return this._request.send("auth.signIn", {
  12400. loginType: $e.USERNAME,
  12401. username: e,
  12402. password: t,
  12403. refresh_token: this._cache.getStore(n) || ""
  12404. });
  12405. case 6:
  12406. s = _context22.sent;
  12407. r = s.refresh_token;
  12408. i = s.access_token_expire;
  12409. o = s.access_token;
  12410. if (!r) {
  12411. _context22.next = 23;
  12412. break;
  12413. }
  12414. this.setRefreshToken(r);
  12415. if (!(o && i)) {
  12416. _context22.next = 16;
  12417. break;
  12418. }
  12419. this.setAccessToken(o, i);
  12420. _context22.next = 18;
  12421. break;
  12422. case 16:
  12423. _context22.next = 18;
  12424. return this._request.refreshAccessToken();
  12425. case 18:
  12426. _context22.next = 20;
  12427. return this.refreshUserInfo();
  12428. case 20:
  12429. De(qe);
  12430. De(Me, {
  12431. env: this.config.env,
  12432. loginType: $e.USERNAME,
  12433. persistence: this.config.persistence
  12434. });
  12435. return _context22.abrupt("return", new Ze(this.config.env));
  12436. case 23:
  12437. throw s.code ? new ne({
  12438. code: s.code,
  12439. message: "\u7528\u6237\u540D\u5BC6\u7801\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  12440. }) : new ne({
  12441. message: "用户名密码登录失败"
  12442. });
  12443. case 24:
  12444. case "end":
  12445. return _context22.stop();
  12446. }
  12447. }
  12448. }, _callee22, this);
  12449. }));
  12450. function signIn(_x17, _x18) {
  12451. return _signIn4.apply(this, arguments);
  12452. }
  12453. return signIn;
  12454. }()
  12455. }]);
  12456. return st;
  12457. }(Qe);
  12458. var rt = /*#__PURE__*/function () {
  12459. function rt(e) {
  12460. (0, _classCallCheck2.default)(this, rt);
  12461. this.config = e, this._cache = xe(e.env), this._request = Ye(e.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), Ne(Me, this._onLoginTypeChanged);
  12462. }
  12463. (0, _createClass2.default)(rt, [{
  12464. key: "currentUser",
  12465. get: function get() {
  12466. var e = this.hasLoginState();
  12467. return e && e.user || null;
  12468. }
  12469. }, {
  12470. key: "loginType",
  12471. get: function get() {
  12472. return this._cache.getStore(this._cache.keys.loginTypeKey);
  12473. }
  12474. }, {
  12475. key: "anonymousAuthProvider",
  12476. value: function anonymousAuthProvider() {
  12477. return new et(this.config);
  12478. }
  12479. }, {
  12480. key: "customAuthProvider",
  12481. value: function customAuthProvider() {
  12482. return new tt(this.config);
  12483. }
  12484. }, {
  12485. key: "emailAuthProvider",
  12486. value: function emailAuthProvider() {
  12487. return new nt(this.config);
  12488. }
  12489. }, {
  12490. key: "usernameAuthProvider",
  12491. value: function usernameAuthProvider() {
  12492. return new st(this.config);
  12493. }
  12494. }, {
  12495. key: "signInAnonymously",
  12496. value: function () {
  12497. var _signInAnonymously = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
  12498. return _regenerator.default.wrap(function _callee23$(_context23) {
  12499. while (1) {
  12500. switch (_context23.prev = _context23.next) {
  12501. case 0:
  12502. return _context23.abrupt("return", new et(this.config).signIn());
  12503. case 1:
  12504. case "end":
  12505. return _context23.stop();
  12506. }
  12507. }
  12508. }, _callee23, this);
  12509. }));
  12510. function signInAnonymously() {
  12511. return _signInAnonymously.apply(this, arguments);
  12512. }
  12513. return signInAnonymously;
  12514. }()
  12515. }, {
  12516. key: "signInWithEmailAndPassword",
  12517. value: function () {
  12518. var _signInWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(e, t) {
  12519. return _regenerator.default.wrap(function _callee24$(_context24) {
  12520. while (1) {
  12521. switch (_context24.prev = _context24.next) {
  12522. case 0:
  12523. return _context24.abrupt("return", new nt(this.config).signIn(e, t));
  12524. case 1:
  12525. case "end":
  12526. return _context24.stop();
  12527. }
  12528. }
  12529. }, _callee24, this);
  12530. }));
  12531. function signInWithEmailAndPassword(_x19, _x20) {
  12532. return _signInWithEmailAndPassword.apply(this, arguments);
  12533. }
  12534. return signInWithEmailAndPassword;
  12535. }()
  12536. }, {
  12537. key: "signInWithUsernameAndPassword",
  12538. value: function signInWithUsernameAndPassword(e, t) {
  12539. return new st(this.config).signIn(e, t);
  12540. }
  12541. }, {
  12542. key: "linkAndRetrieveDataWithTicket",
  12543. value: function () {
  12544. var _linkAndRetrieveDataWithTicket2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25(e) {
  12545. return _regenerator.default.wrap(function _callee25$(_context25) {
  12546. while (1) {
  12547. switch (_context25.prev = _context25.next) {
  12548. case 0:
  12549. this._anonymousAuthProvider || (this._anonymousAuthProvider = new et(this.config)), Ne(je, this._onAnonymousConverted);
  12550. _context25.next = 3;
  12551. return this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e);
  12552. case 3:
  12553. return _context25.abrupt("return", _context25.sent);
  12554. case 4:
  12555. case "end":
  12556. return _context25.stop();
  12557. }
  12558. }
  12559. }, _callee25, this);
  12560. }));
  12561. function linkAndRetrieveDataWithTicket(_x21) {
  12562. return _linkAndRetrieveDataWithTicket2.apply(this, arguments);
  12563. }
  12564. return linkAndRetrieveDataWithTicket;
  12565. }()
  12566. }, {
  12567. key: "signOut",
  12568. value: function () {
  12569. var _signOut = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
  12570. var _this$_cache$keys10, e, t, n, s, r;
  12571. return _regenerator.default.wrap(function _callee26$(_context26) {
  12572. while (1) {
  12573. switch (_context26.prev = _context26.next) {
  12574. case 0:
  12575. if (!(this.loginType === $e.ANONYMOUS)) {
  12576. _context26.next = 2;
  12577. break;
  12578. }
  12579. throw new ne({
  12580. message: "匿名用户不支持登出操作"
  12581. });
  12582. case 2:
  12583. _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);
  12584. if (s) {
  12585. _context26.next = 5;
  12586. break;
  12587. }
  12588. return _context26.abrupt("return");
  12589. case 5:
  12590. _context26.next = 7;
  12591. return this._request.send("auth.logout", {
  12592. refresh_token: s
  12593. });
  12594. case 7:
  12595. r = _context26.sent;
  12596. return _context26.abrupt("return", (this._cache.removeStore(e), this._cache.removeStore(t), this._cache.removeStore(n), De(qe), De(Me, {
  12597. env: this.config.env,
  12598. loginType: $e.NULL,
  12599. persistence: this.config.persistence
  12600. }), r));
  12601. case 9:
  12602. case "end":
  12603. return _context26.stop();
  12604. }
  12605. }
  12606. }, _callee26, this);
  12607. }));
  12608. function signOut() {
  12609. return _signOut.apply(this, arguments);
  12610. }
  12611. return signOut;
  12612. }()
  12613. }, {
  12614. key: "signUpWithEmailAndPassword",
  12615. value: function () {
  12616. var _signUpWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27(e, t) {
  12617. return _regenerator.default.wrap(function _callee27$(_context27) {
  12618. while (1) {
  12619. switch (_context27.prev = _context27.next) {
  12620. case 0:
  12621. return _context27.abrupt("return", this._request.send("auth.signUpWithEmailAndPassword", {
  12622. email: e,
  12623. password: t
  12624. }));
  12625. case 1:
  12626. case "end":
  12627. return _context27.stop();
  12628. }
  12629. }
  12630. }, _callee27, this);
  12631. }));
  12632. function signUpWithEmailAndPassword(_x22, _x23) {
  12633. return _signUpWithEmailAndPassword.apply(this, arguments);
  12634. }
  12635. return signUpWithEmailAndPassword;
  12636. }()
  12637. }, {
  12638. key: "sendPasswordResetEmail",
  12639. value: function () {
  12640. var _sendPasswordResetEmail = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28(e) {
  12641. return _regenerator.default.wrap(function _callee28$(_context28) {
  12642. while (1) {
  12643. switch (_context28.prev = _context28.next) {
  12644. case 0:
  12645. return _context28.abrupt("return", this._request.send("auth.sendPasswordResetEmail", {
  12646. email: e
  12647. }));
  12648. case 1:
  12649. case "end":
  12650. return _context28.stop();
  12651. }
  12652. }
  12653. }, _callee28, this);
  12654. }));
  12655. function sendPasswordResetEmail(_x24) {
  12656. return _sendPasswordResetEmail.apply(this, arguments);
  12657. }
  12658. return sendPasswordResetEmail;
  12659. }()
  12660. }, {
  12661. key: "onLoginStateChanged",
  12662. value: function onLoginStateChanged(e) {
  12663. var _this9 = this;
  12664. Ne(qe, function () {
  12665. var t = _this9.hasLoginState();
  12666. e.call(_this9, t);
  12667. });
  12668. var t = this.hasLoginState();
  12669. e.call(this, t);
  12670. }
  12671. }, {
  12672. key: "onLoginStateExpired",
  12673. value: function onLoginStateExpired(e) {
  12674. Ne(Ke, e.bind(this));
  12675. }
  12676. }, {
  12677. key: "onAccessTokenRefreshed",
  12678. value: function onAccessTokenRefreshed(e) {
  12679. Ne(Be, e.bind(this));
  12680. }
  12681. }, {
  12682. key: "onAnonymousConverted",
  12683. value: function onAnonymousConverted(e) {
  12684. Ne(je, e.bind(this));
  12685. }
  12686. }, {
  12687. key: "onLoginTypeChanged",
  12688. value: function onLoginTypeChanged(e) {
  12689. var _this10 = this;
  12690. Ne(Me, function () {
  12691. var t = _this10.hasLoginState();
  12692. e.call(_this10, t);
  12693. });
  12694. }
  12695. }, {
  12696. key: "getAccessToken",
  12697. value: function () {
  12698. var _getAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
  12699. return _regenerator.default.wrap(function _callee29$(_context29) {
  12700. while (1) {
  12701. switch (_context29.prev = _context29.next) {
  12702. case 0:
  12703. _context29.next = 2;
  12704. return this._request.getAccessToken();
  12705. case 2:
  12706. _context29.t0 = _context29.sent.accessToken;
  12707. _context29.t1 = this.config.env;
  12708. return _context29.abrupt("return", {
  12709. accessToken: _context29.t0,
  12710. env: _context29.t1
  12711. });
  12712. case 5:
  12713. case "end":
  12714. return _context29.stop();
  12715. }
  12716. }
  12717. }, _callee29, this);
  12718. }));
  12719. function getAccessToken() {
  12720. return _getAccessToken2.apply(this, arguments);
  12721. }
  12722. return getAccessToken;
  12723. }()
  12724. }, {
  12725. key: "hasLoginState",
  12726. value: function hasLoginState() {
  12727. var e = this._cache.keys.refreshTokenKey;
  12728. return this._cache.getStore(e) ? new Ze(this.config.env) : null;
  12729. }
  12730. }, {
  12731. key: "isUsernameRegistered",
  12732. value: function () {
  12733. var _isUsernameRegistered = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(e) {
  12734. var _yield$this$_request$5, t;
  12735. return _regenerator.default.wrap(function _callee30$(_context30) {
  12736. while (1) {
  12737. switch (_context30.prev = _context30.next) {
  12738. case 0:
  12739. if (!("string" != typeof e)) {
  12740. _context30.next = 2;
  12741. break;
  12742. }
  12743. throw new ne({
  12744. code: "PARAM_ERROR",
  12745. message: "username must be a string"
  12746. });
  12747. case 2:
  12748. _context30.next = 4;
  12749. return this._request.send("auth.isUsernameRegistered", {
  12750. username: e
  12751. });
  12752. case 4:
  12753. _yield$this$_request$5 = _context30.sent;
  12754. t = _yield$this$_request$5.data;
  12755. return _context30.abrupt("return", t && t.isRegistered);
  12756. case 7:
  12757. case "end":
  12758. return _context30.stop();
  12759. }
  12760. }
  12761. }, _callee30, this);
  12762. }));
  12763. function isUsernameRegistered(_x25) {
  12764. return _isUsernameRegistered.apply(this, arguments);
  12765. }
  12766. return isUsernameRegistered;
  12767. }()
  12768. }, {
  12769. key: "getLoginState",
  12770. value: function getLoginState() {
  12771. return Promise.resolve(this.hasLoginState());
  12772. }
  12773. }, {
  12774. key: "signInWithTicket",
  12775. value: function () {
  12776. var _signInWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(e) {
  12777. return _regenerator.default.wrap(function _callee31$(_context31) {
  12778. while (1) {
  12779. switch (_context31.prev = _context31.next) {
  12780. case 0:
  12781. return _context31.abrupt("return", new tt(this.config).signIn(e));
  12782. case 1:
  12783. case "end":
  12784. return _context31.stop();
  12785. }
  12786. }
  12787. }, _callee31, this);
  12788. }));
  12789. function signInWithTicket(_x26) {
  12790. return _signInWithTicket.apply(this, arguments);
  12791. }
  12792. return signInWithTicket;
  12793. }()
  12794. }, {
  12795. key: "shouldRefreshAccessToken",
  12796. value: function shouldRefreshAccessToken(e) {
  12797. this._request._shouldRefreshAccessTokenHook = e.bind(this);
  12798. }
  12799. }, {
  12800. key: "getUserInfo",
  12801. value: function getUserInfo() {
  12802. return this._request.send("auth.getUserInfo", {}).then(function (e) {
  12803. return e.code ? e : _objectSpread(_objectSpread({}, e.data), {}, {
  12804. requestId: e.seqId
  12805. });
  12806. });
  12807. }
  12808. }, {
  12809. key: "getAuthHeader",
  12810. value: function getAuthHeader() {
  12811. var _this$_cache$keys11 = this._cache.keys,
  12812. e = _this$_cache$keys11.refreshTokenKey,
  12813. t = _this$_cache$keys11.accessTokenKey,
  12814. n = this._cache.getStore(e);
  12815. return {
  12816. "x-cloudbase-credentials": this._cache.getStore(t) + "/@@/" + n
  12817. };
  12818. }
  12819. }, {
  12820. key: "_onAnonymousConverted",
  12821. value: function _onAnonymousConverted(e) {
  12822. var t = e.data.env;
  12823. t === this.config.env && this._cache.updatePersistence(this.config.persistence);
  12824. }
  12825. }, {
  12826. key: "_onLoginTypeChanged",
  12827. value: function _onLoginTypeChanged(e) {
  12828. var _e$data = e.data,
  12829. t = _e$data.loginType,
  12830. n = _e$data.persistence,
  12831. s = _e$data.env;
  12832. s === this.config.env && (this._cache.updatePersistence(n), this._cache.setStore(this._cache.keys.loginTypeKey, t));
  12833. }
  12834. }]);
  12835. return rt;
  12836. }();
  12837. var it = function it(e, t) {
  12838. t = t || we();
  12839. var n = Ye(this.config.env),
  12840. s = e.cloudPath,
  12841. r = e.filePath,
  12842. i = e.onUploadProgress,
  12843. _e$fileType = e.fileType,
  12844. o = _e$fileType === void 0 ? "image" : _e$fileType;
  12845. return n.send("storage.getUploadMetadata", {
  12846. path: s
  12847. }).then(function (e) {
  12848. var _e$data2 = e.data,
  12849. a = _e$data2.url,
  12850. c = _e$data2.authorization,
  12851. u = _e$data2.token,
  12852. l = _e$data2.fileId,
  12853. h = _e$data2.cosFileId,
  12854. d = e.requestId,
  12855. p = {
  12856. key: s,
  12857. signature: c,
  12858. "x-cos-meta-fileid": h,
  12859. success_action_status: "201",
  12860. "x-cos-security-token": u
  12861. };
  12862. n.upload({
  12863. url: a,
  12864. data: p,
  12865. file: r,
  12866. name: s,
  12867. fileType: o,
  12868. onUploadProgress: i
  12869. }).then(function (e) {
  12870. 201 === e.statusCode ? t(null, {
  12871. fileID: l,
  12872. requestId: d
  12873. }) : t(new ne({
  12874. code: "STORAGE_REQUEST_FAIL",
  12875. message: "STORAGE_REQUEST_FAIL: ".concat(e.data)
  12876. }));
  12877. }).catch(function (e) {
  12878. t(e);
  12879. });
  12880. }).catch(function (e) {
  12881. t(e);
  12882. }), t.promise;
  12883. },
  12884. ot = function ot(e, t) {
  12885. t = t || we();
  12886. var n = Ye(this.config.env),
  12887. s = e.cloudPath;
  12888. return n.send("storage.getUploadMetadata", {
  12889. path: s
  12890. }).then(function (e) {
  12891. t(null, e);
  12892. }).catch(function (e) {
  12893. t(e);
  12894. }), t.promise;
  12895. },
  12896. at = function at(_ref7, t) {
  12897. var e = _ref7.fileList;
  12898. if (t = t || we(), !e || !Array.isArray(e)) return {
  12899. code: "INVALID_PARAM",
  12900. message: "fileList必须是非空的数组"
  12901. };
  12902. var _iterator3 = _createForOfIteratorHelper(e),
  12903. _step3;
  12904. try {
  12905. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  12906. var _t8 = _step3.value;
  12907. if (!_t8 || "string" != typeof _t8) return {
  12908. code: "INVALID_PARAM",
  12909. message: "fileList的元素必须是非空的字符串"
  12910. };
  12911. }
  12912. } catch (err) {
  12913. _iterator3.e(err);
  12914. } finally {
  12915. _iterator3.f();
  12916. }
  12917. var n = {
  12918. fileid_list: e
  12919. };
  12920. return Ye(this.config.env).send("storage.batchDeleteFile", n).then(function (e) {
  12921. e.code ? t(null, e) : t(null, {
  12922. fileList: e.data.delete_list,
  12923. requestId: e.requestId
  12924. });
  12925. }).catch(function (e) {
  12926. t(e);
  12927. }), t.promise;
  12928. },
  12929. ct = function ct(_ref8, t) {
  12930. var e = _ref8.fileList;
  12931. t = t || we(), e && Array.isArray(e) || t(null, {
  12932. code: "INVALID_PARAM",
  12933. message: "fileList必须是非空的数组"
  12934. });
  12935. var n = [];
  12936. var _iterator4 = _createForOfIteratorHelper(e),
  12937. _step4;
  12938. try {
  12939. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  12940. var _s9 = _step4.value;
  12941. "object" == (0, _typeof2.default)(_s9) ? (_s9.hasOwnProperty("fileID") && _s9.hasOwnProperty("maxAge") || t(null, {
  12942. code: "INVALID_PARAM",
  12943. message: "fileList的元素必须是包含fileID和maxAge的对象"
  12944. }), n.push({
  12945. fileid: _s9.fileID,
  12946. max_age: _s9.maxAge
  12947. })) : "string" == typeof _s9 ? n.push({
  12948. fileid: _s9
  12949. }) : t(null, {
  12950. code: "INVALID_PARAM",
  12951. message: "fileList的元素必须是字符串"
  12952. });
  12953. }
  12954. } catch (err) {
  12955. _iterator4.e(err);
  12956. } finally {
  12957. _iterator4.f();
  12958. }
  12959. var s = {
  12960. file_list: n
  12961. };
  12962. return Ye(this.config.env).send("storage.batchGetDownloadUrl", s).then(function (e) {
  12963. e.code ? t(null, e) : t(null, {
  12964. fileList: e.data.download_list,
  12965. requestId: e.requestId
  12966. });
  12967. }).catch(function (e) {
  12968. t(e);
  12969. }), t.promise;
  12970. },
  12971. ut = /*#__PURE__*/function () {
  12972. var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(_ref9, t) {
  12973. var e, n, s, r;
  12974. return _regenerator.default.wrap(function _callee32$(_context32) {
  12975. while (1) {
  12976. switch (_context32.prev = _context32.next) {
  12977. case 0:
  12978. e = _ref9.fileID;
  12979. _context32.next = 3;
  12980. return ct.call(this, {
  12981. fileList: [{
  12982. fileID: e,
  12983. maxAge: 600
  12984. }]
  12985. });
  12986. case 3:
  12987. n = _context32.sent.fileList[0];
  12988. if (!("SUCCESS" !== n.code)) {
  12989. _context32.next = 6;
  12990. break;
  12991. }
  12992. return _context32.abrupt("return", t ? t(n) : new Promise(function (e) {
  12993. e(n);
  12994. }));
  12995. case 6:
  12996. s = Ye(this.config.env);
  12997. r = n.download_url;
  12998. if (!(r = encodeURI(r), !t)) {
  12999. _context32.next = 10;
  13000. break;
  13001. }
  13002. return _context32.abrupt("return", s.download({
  13003. url: r
  13004. }));
  13005. case 10:
  13006. _context32.t0 = t;
  13007. _context32.next = 13;
  13008. return s.download({
  13009. url: r
  13010. });
  13011. case 13:
  13012. _context32.t1 = _context32.sent;
  13013. (0, _context32.t0)(_context32.t1);
  13014. case 15:
  13015. case "end":
  13016. return _context32.stop();
  13017. }
  13018. }
  13019. }, _callee32, this);
  13020. }));
  13021. return function ut(_x27, _x28) {
  13022. return _ref10.apply(this, arguments);
  13023. };
  13024. }(),
  13025. lt = function lt(_ref11, i) {
  13026. var e = _ref11.name,
  13027. t = _ref11.data,
  13028. n = _ref11.query,
  13029. s = _ref11.parse,
  13030. r = _ref11.search;
  13031. var o = i || we();
  13032. var a;
  13033. try {
  13034. a = t ? JSON.stringify(t) : "";
  13035. } catch (e) {
  13036. return Promise.reject(e);
  13037. }
  13038. if (!e) return Promise.reject(new ne({
  13039. code: "PARAM_ERROR",
  13040. message: "函数名不能为空"
  13041. }));
  13042. var c = {
  13043. inQuery: n,
  13044. parse: s,
  13045. search: r,
  13046. function_name: e,
  13047. request_data: a
  13048. };
  13049. return Ye(this.config.env).send("functions.invokeFunction", c).then(function (e) {
  13050. if (e.code) o(null, e);else {
  13051. var _t9 = e.data.response_data;
  13052. if (s) o(null, {
  13053. result: _t9,
  13054. requestId: e.requestId
  13055. });else try {
  13056. _t9 = JSON.parse(e.data.response_data), o(null, {
  13057. result: _t9,
  13058. requestId: e.requestId
  13059. });
  13060. } catch (e) {
  13061. o(new ne({
  13062. message: "response data must be json"
  13063. }));
  13064. }
  13065. }
  13066. return o.promise;
  13067. }).catch(function (e) {
  13068. o(e);
  13069. }), o.promise;
  13070. },
  13071. ht = {
  13072. timeout: 15e3,
  13073. persistence: "session"
  13074. },
  13075. dt = {};
  13076. var pt = /*#__PURE__*/function () {
  13077. function pt(e) {
  13078. (0, _classCallCheck2.default)(this, pt);
  13079. this.config = e || this.config, this.authObj = void 0;
  13080. }
  13081. (0, _createClass2.default)(pt, [{
  13082. key: "init",
  13083. value: function init(e) {
  13084. switch (Ie.adapter || (this.requestClient = new Ie.adapter.reqClass({
  13085. timeout: e.timeout || 5e3,
  13086. timeoutMsg: "\u8BF7\u6C42\u5728".concat((e.timeout || 5e3) / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD")
  13087. })), this.config = _objectSpread(_objectSpread({}, ht), e), !0) {
  13088. case this.config.timeout > 6e5:
  13089. console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
  13090. break;
  13091. case this.config.timeout < 100:
  13092. console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
  13093. }
  13094. return new pt(this.config);
  13095. }
  13096. }, {
  13097. key: "auth",
  13098. value: function auth() {
  13099. var _ref12 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13100. e = _ref12.persistence;
  13101. if (this.authObj) return this.authObj;
  13102. var t = e || Ie.adapter.primaryStorage || ht.persistence;
  13103. var n;
  13104. return t !== this.config.persistence && (this.config.persistence = t), function (e) {
  13105. var t = e.env;
  13106. Ee[t] = new Pe(e), Oe[t] = new Pe(_objectSpread(_objectSpread({}, e), {}, {
  13107. persistence: "local"
  13108. }));
  13109. }(this.config), n = this.config, Ve[n.env] = new Ge(n), this.authObj = new rt(this.config), this.authObj;
  13110. }
  13111. }, {
  13112. key: "on",
  13113. value: function on(e, t) {
  13114. return Ne.apply(this, [e, t]);
  13115. }
  13116. }, {
  13117. key: "off",
  13118. value: function off(e, t) {
  13119. return Fe.apply(this, [e, t]);
  13120. }
  13121. }, {
  13122. key: "callFunction",
  13123. value: function callFunction(e, t) {
  13124. return lt.apply(this, [e, t]);
  13125. }
  13126. }, {
  13127. key: "deleteFile",
  13128. value: function deleteFile(e, t) {
  13129. return at.apply(this, [e, t]);
  13130. }
  13131. }, {
  13132. key: "getTempFileURL",
  13133. value: function getTempFileURL(e, t) {
  13134. return ct.apply(this, [e, t]);
  13135. }
  13136. }, {
  13137. key: "downloadFile",
  13138. value: function downloadFile(e, t) {
  13139. return ut.apply(this, [e, t]);
  13140. }
  13141. }, {
  13142. key: "uploadFile",
  13143. value: function uploadFile(e, t) {
  13144. return it.apply(this, [e, t]);
  13145. }
  13146. }, {
  13147. key: "getUploadMetadata",
  13148. value: function getUploadMetadata(e, t) {
  13149. return ot.apply(this, [e, t]);
  13150. }
  13151. }, {
  13152. key: "registerExtension",
  13153. value: function registerExtension(e) {
  13154. dt[e.name] = e;
  13155. }
  13156. }, {
  13157. key: "invokeExtension",
  13158. value: function () {
  13159. var _invokeExtension = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(e, t) {
  13160. var n;
  13161. return _regenerator.default.wrap(function _callee33$(_context33) {
  13162. while (1) {
  13163. switch (_context33.prev = _context33.next) {
  13164. case 0:
  13165. n = dt[e];
  13166. if (n) {
  13167. _context33.next = 3;
  13168. break;
  13169. }
  13170. throw new ne({
  13171. message: "\u6269\u5C55".concat(e, " \u5FC5\u987B\u5148\u6CE8\u518C")
  13172. });
  13173. case 3:
  13174. _context33.next = 5;
  13175. return n.invoke(t, this);
  13176. case 5:
  13177. return _context33.abrupt("return", _context33.sent);
  13178. case 6:
  13179. case "end":
  13180. return _context33.stop();
  13181. }
  13182. }
  13183. }, _callee33, this);
  13184. }));
  13185. function invokeExtension(_x29, _x30) {
  13186. return _invokeExtension.apply(this, arguments);
  13187. }
  13188. return invokeExtension;
  13189. }()
  13190. }, {
  13191. key: "useAdapters",
  13192. value: function useAdapters(e) {
  13193. var _ref13 = ke(e) || {},
  13194. t = _ref13.adapter,
  13195. n = _ref13.runtime;
  13196. t && (Ie.adapter = t), n && (Ie.runtime = n);
  13197. }
  13198. }]);
  13199. return pt;
  13200. }();
  13201. var ft = new pt();
  13202. function gt(e, t, n) {
  13203. void 0 === n && (n = {});
  13204. var s = /\?/.test(t),
  13205. r = "";
  13206. for (var i in n) {
  13207. "" === r ? !s && (t += "?") : r += "&", r += i + "=" + encodeURIComponent(n[i]);
  13208. }
  13209. return /^http(s)?:\/\//.test(t += r) ? t : "" + e + t;
  13210. }
  13211. var mt = /*#__PURE__*/function () {
  13212. function mt() {
  13213. (0, _classCallCheck2.default)(this, mt);
  13214. }
  13215. (0, _createClass2.default)(mt, [{
  13216. key: "post",
  13217. value: function post(e) {
  13218. var t = e.url,
  13219. n = e.data,
  13220. s = e.headers;
  13221. return new Promise(function (e, r) {
  13222. se.request({
  13223. url: gt("https:", t),
  13224. data: n,
  13225. method: "POST",
  13226. header: s,
  13227. success: function success(t) {
  13228. e(t);
  13229. },
  13230. fail: function fail(e) {
  13231. r(e);
  13232. }
  13233. });
  13234. });
  13235. }
  13236. }, {
  13237. key: "upload",
  13238. value: function upload(e) {
  13239. return new Promise(function (t, n) {
  13240. var s = e.url,
  13241. r = e.file,
  13242. i = e.data,
  13243. o = e.headers,
  13244. a = e.fileType,
  13245. c = se.uploadFile({
  13246. url: gt("https:", s),
  13247. name: "file",
  13248. formData: Object.assign({}, i),
  13249. filePath: r,
  13250. fileType: a,
  13251. header: o,
  13252. success: function success(e) {
  13253. var n = {
  13254. statusCode: e.statusCode,
  13255. data: e.data || {}
  13256. };
  13257. 200 === e.statusCode && i.success_action_status && (n.statusCode = parseInt(i.success_action_status, 10)), t(n);
  13258. },
  13259. fail: function fail(e) {
  13260. n(new Error(e.errMsg || "uploadFile:fail"));
  13261. }
  13262. });
  13263. "function" == typeof e.onUploadProgress && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (t) {
  13264. e.onUploadProgress({
  13265. loaded: t.totalBytesSent,
  13266. total: t.totalBytesExpectedToSend
  13267. });
  13268. });
  13269. });
  13270. }
  13271. }]);
  13272. return mt;
  13273. }();
  13274. var yt = {
  13275. setItem: function setItem(e, t) {
  13276. se.setStorageSync(e, t);
  13277. },
  13278. getItem: function getItem(e) {
  13279. return se.getStorageSync(e);
  13280. },
  13281. removeItem: function removeItem(e) {
  13282. se.removeStorageSync(e);
  13283. },
  13284. clear: function clear() {
  13285. se.clearStorageSync();
  13286. }
  13287. };
  13288. var _t = {
  13289. genAdapter: function genAdapter() {
  13290. return {
  13291. root: {},
  13292. reqClass: mt,
  13293. localStorage: yt,
  13294. primaryStorage: "local"
  13295. };
  13296. },
  13297. isMatch: function isMatch() {
  13298. return !0;
  13299. },
  13300. runtime: "uni_app"
  13301. };
  13302. ft.useAdapters(_t);
  13303. var wt = ft,
  13304. vt = wt.init;
  13305. wt.init = function (e) {
  13306. e.env = e.spaceId;
  13307. var t = vt.call(this, e);
  13308. t.config.provider = "tencent", t.config.spaceId = e.spaceId;
  13309. var n = t.auth;
  13310. return t.auth = function (e) {
  13311. var t = n.call(this, e);
  13312. return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach(function (e) {
  13313. var n;
  13314. t[e] = (n = t[e], function (e) {
  13315. e = e || {};
  13316. var _te = te(e),
  13317. t = _te.success,
  13318. s = _te.fail,
  13319. r = _te.complete;
  13320. if (!(t || s || r)) return n.call(this, e);
  13321. n.call(this, e).then(function (e) {
  13322. t && t(e), r && r(e);
  13323. }, function (e) {
  13324. s && s(e), r && r(e);
  13325. });
  13326. }).bind(t);
  13327. }), t;
  13328. }, t.customAuth = t.auth, t;
  13329. };
  13330. var bt = wt;
  13331. var St = /*#__PURE__*/function (_fe) {
  13332. (0, _inherits2.default)(St, _fe);
  13333. var _super8 = _createSuper(St);
  13334. function St() {
  13335. (0, _classCallCheck2.default)(this, St);
  13336. return _super8.apply(this, arguments);
  13337. }
  13338. (0, _createClass2.default)(St, [{
  13339. key: "getAccessToken",
  13340. value: function getAccessToken() {
  13341. var _this11 = this;
  13342. return new Promise(function (e, t) {
  13343. var n = "Anonymous_Access_token";
  13344. _this11.setAccessToken(n), e(n);
  13345. });
  13346. }
  13347. }, {
  13348. key: "setupRequest",
  13349. value: function setupRequest(e, t) {
  13350. var n = Object.assign({}, e, {
  13351. spaceId: this.config.spaceId,
  13352. timestamp: Date.now()
  13353. }),
  13354. s = {
  13355. "Content-Type": "application/json"
  13356. };
  13357. "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = he.sign(n, this.config.clientSecret);
  13358. var r = le();
  13359. s["x-client-info"] = encodeURIComponent(JSON.stringify(r));
  13360. var _re = re(),
  13361. i = _re.token;
  13362. return s["x-client-token"] = i, {
  13363. url: this.config.requestUrl,
  13364. method: "POST",
  13365. data: n,
  13366. dataType: "json",
  13367. header: JSON.parse(JSON.stringify(s))
  13368. };
  13369. }
  13370. }, {
  13371. key: "uploadFileToOSS",
  13372. value: function uploadFileToOSS(_ref14) {
  13373. var _this12 = this;
  13374. var e = _ref14.url,
  13375. t = _ref14.formData,
  13376. n = _ref14.name,
  13377. s = _ref14.filePath,
  13378. r = _ref14.fileType,
  13379. i = _ref14.onUploadProgress;
  13380. return new Promise(function (o, a) {
  13381. var c = _this12.adapter.uploadFile({
  13382. url: e,
  13383. formData: t,
  13384. name: n,
  13385. filePath: s,
  13386. fileType: r,
  13387. success: function success(e) {
  13388. e && e.statusCode < 400 ? o(e) : a(new ne({
  13389. code: "UPLOAD_FAILED",
  13390. message: "文件上传失败"
  13391. }));
  13392. },
  13393. fail: function fail(e) {
  13394. a(new ne({
  13395. code: e.code || "UPLOAD_FAILED",
  13396. message: e.message || e.errMsg || "文件上传失败"
  13397. }));
  13398. }
  13399. });
  13400. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  13401. i({
  13402. loaded: e.totalBytesSent,
  13403. total: e.totalBytesExpectedToSend
  13404. });
  13405. });
  13406. });
  13407. }
  13408. }, {
  13409. key: "uploadFile",
  13410. value: function uploadFile(_ref15) {
  13411. var _this13 = this;
  13412. var e = _ref15.filePath,
  13413. t = _ref15.cloudPath,
  13414. _ref15$fileType = _ref15.fileType,
  13415. n = _ref15$fileType === void 0 ? "image" : _ref15$fileType,
  13416. s = _ref15.onUploadProgress;
  13417. if (!t) throw new ne({
  13418. code: "CLOUDPATH_REQUIRED",
  13419. message: "cloudPath不可为空"
  13420. });
  13421. var r;
  13422. return this.getOSSUploadOptionsFromPath({
  13423. cloudPath: t
  13424. }).then(function (t) {
  13425. var _t$result = t.result,
  13426. i = _t$result.url,
  13427. o = _t$result.formData,
  13428. a = _t$result.name;
  13429. r = t.result.fileUrl;
  13430. var c = {
  13431. url: i,
  13432. formData: o,
  13433. name: a,
  13434. filePath: e,
  13435. fileType: n
  13436. };
  13437. return _this13.uploadFileToOSS(Object.assign({}, c, {
  13438. onUploadProgress: s
  13439. }));
  13440. }).then(function () {
  13441. return _this13.reportOSSUpload({
  13442. cloudPath: t
  13443. });
  13444. }).then(function (t) {
  13445. return new Promise(function (n, s) {
  13446. t.success ? n({
  13447. success: !0,
  13448. filePath: e,
  13449. fileID: r
  13450. }) : s(new ne({
  13451. code: "UPLOAD_FAILED",
  13452. message: "文件上传失败"
  13453. }));
  13454. });
  13455. });
  13456. }
  13457. }, {
  13458. key: "deleteFile",
  13459. value: function deleteFile(_ref16) {
  13460. var e = _ref16.fileList;
  13461. var t = {
  13462. method: "serverless.file.resource.delete",
  13463. params: JSON.stringify({
  13464. fileList: e
  13465. })
  13466. };
  13467. return this.request(this.setupRequest(t)).then(function (e) {
  13468. if (e.success) return e.result;
  13469. throw new ne({
  13470. code: "DELETE_FILE_FAILED",
  13471. message: "删除文件失败"
  13472. });
  13473. });
  13474. }
  13475. }, {
  13476. key: "getTempFileURL",
  13477. value: function getTempFileURL() {
  13478. var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13479. e = _ref17.fileList;
  13480. if (!Array.isArray(e) || 0 === e.length) throw new ne({
  13481. code: "INVALID_PARAM",
  13482. message: "fileList的元素必须是非空的字符串"
  13483. });
  13484. var t = {
  13485. method: "serverless.file.resource.getTempFileURL",
  13486. params: JSON.stringify({
  13487. fileList: e
  13488. })
  13489. };
  13490. return this.request(this.setupRequest(t)).then(function (e) {
  13491. if (e.success) return {
  13492. fileList: e.result.fileList.map(function (e) {
  13493. return {
  13494. fileID: e.fileID,
  13495. tempFileURL: e.tempFileURL
  13496. };
  13497. })
  13498. };
  13499. throw new ne({
  13500. code: "GET_TEMP_FILE_URL_FAILED",
  13501. message: "获取临时文件链接失败"
  13502. });
  13503. });
  13504. }
  13505. }]);
  13506. return St;
  13507. }(fe);
  13508. var kt = {
  13509. init: function init(e) {
  13510. var t = new St(e),
  13511. n = {
  13512. signInAnonymously: function signInAnonymously() {
  13513. return t.authorize();
  13514. },
  13515. getLoginState: function getLoginState() {
  13516. return Promise.resolve(!1);
  13517. }
  13518. };
  13519. return t.auth = function () {
  13520. return n;
  13521. }, t.customAuth = t.auth, t;
  13522. }
  13523. };
  13524. function It(_ref18) {
  13525. var e = _ref18.data;
  13526. var t;
  13527. t = le();
  13528. var n = JSON.parse(JSON.stringify(e || {}));
  13529. if (Object.assign(n, {
  13530. clientInfo: t
  13531. }), !n.uniIdToken) {
  13532. var _re2 = re(),
  13533. _e19 = _re2.token;
  13534. _e19 && (n.uniIdToken = _e19);
  13535. }
  13536. return n;
  13537. }
  13538. function Tt() {
  13539. return _Tt.apply(this, arguments);
  13540. }
  13541. function _Tt() {
  13542. _Tt = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53() {
  13543. var _this23 = this;
  13544. var _ref55,
  13545. e,
  13546. t,
  13547. _this$__dev__,
  13548. n,
  13549. s,
  13550. r,
  13551. i,
  13552. o,
  13553. a,
  13554. _args5 = arguments;
  13555. return _regenerator.default.wrap(function _callee53$(_context53) {
  13556. while (1) {
  13557. switch (_context53.prev = _context53.next) {
  13558. case 0:
  13559. _ref55 = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {}, e = _ref55.name, t = _ref55.data;
  13560. _context53.next = 3;
  13561. return this.__dev__.initLocalNetwork();
  13562. case 3:
  13563. _this$__dev__ = this.__dev__, n = _this$__dev__.localAddress, s = _this$__dev__.localPort, r = {
  13564. aliyun: "aliyun",
  13565. tencent: "tcb"
  13566. }[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);
  13567. return _context53.abrupt("return", new Promise(function (t, n) {
  13568. se.request({
  13569. method: "POST",
  13570. url: o,
  13571. data: {
  13572. name: e,
  13573. platform: A,
  13574. provider: r,
  13575. spaceId: i
  13576. },
  13577. timeout: 3e3,
  13578. success: function success(e) {
  13579. t(e);
  13580. },
  13581. fail: function fail() {
  13582. t({
  13583. data: {
  13584. code: "NETWORK_ERROR",
  13585. message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。"
  13586. }
  13587. });
  13588. }
  13589. });
  13590. }).then(function () {
  13591. var _ref56 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13592. e = _ref56.data;
  13593. var _ref57 = e || {},
  13594. t = _ref57.code,
  13595. n = _ref57.message;
  13596. return {
  13597. code: 0 === t ? 0 : t || "SYS_ERR",
  13598. message: n || "SYS_ERR"
  13599. };
  13600. }).then(function (_ref58) {
  13601. var n = _ref58.code,
  13602. s = _ref58.message;
  13603. if (0 !== n) {
  13604. switch (n) {
  13605. case "MODULE_ENCRYPTED":
  13606. 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"));
  13607. break;
  13608. case "FUNCTION_ENCRYPTED":
  13609. 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"));
  13610. break;
  13611. case "ACTION_ENCRYPTED":
  13612. console.error(s || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
  13613. break;
  13614. case "NETWORK_ERROR":
  13615. {
  13616. var _e29 = "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下";
  13617. throw console.error(_e29), new Error(_e29);
  13618. }
  13619. case "SWITCH_TO_CLOUD":
  13620. break;
  13621. default:
  13622. {
  13623. 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");
  13624. throw console.error(_e30), new Error(_e30);
  13625. }
  13626. }
  13627. return _this23._callCloudFunction({
  13628. name: e,
  13629. data: t
  13630. });
  13631. }
  13632. return new Promise(function (e, n) {
  13633. var s = It.call(_this23, {
  13634. data: t
  13635. });
  13636. se.request({
  13637. method: "POST",
  13638. url: a,
  13639. data: {
  13640. provider: r,
  13641. platform: A,
  13642. param: s
  13643. },
  13644. success: function success() {
  13645. var _ref59 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13646. t = _ref59.statusCode,
  13647. s = _ref59.data;
  13648. return !t || t >= 400 ? n(new ne({
  13649. code: s.code || "SYS_ERR",
  13650. message: s.message || "request:fail"
  13651. })) : e({
  13652. result: s
  13653. });
  13654. },
  13655. fail: function fail(e) {
  13656. n(new ne({
  13657. code: e.code || e.errCode || "SYS_ERR",
  13658. message: e.message || e.errMsg || "request:fail"
  13659. }));
  13660. }
  13661. });
  13662. });
  13663. }));
  13664. case 5:
  13665. case "end":
  13666. return _context53.stop();
  13667. }
  13668. }
  13669. }, _callee53, this);
  13670. }));
  13671. return _Tt.apply(this, arguments);
  13672. }
  13673. var Ct = [{
  13674. rule: /fc_function_not_found|FUNCTION_NOT_FOUND/,
  13675. content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",
  13676. mode: "append"
  13677. }];
  13678. var At = /[\\^$.*+?()[\]{}|]/g,
  13679. Pt = RegExp(At.source);
  13680. function Et(e, t, n) {
  13681. return e.replace(new RegExp((s = t) && Pt.test(s) ? s.replace(At, "\\$&") : s, "g"), n);
  13682. var s;
  13683. }
  13684. var Ot = "none",
  13685. xt = "request",
  13686. Rt = "response",
  13687. Ut = "both";
  13688. var Lt = /*#__PURE__*/function () {
  13689. function Lt() {
  13690. var _ref19 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13691. e = _ref19.secretType,
  13692. t = _ref19.uniCloudIns;
  13693. (0, _classCallCheck2.default)(this, Lt);
  13694. this.clientType = "", this.secretType = e || Ot, this.uniCloudIns = t;
  13695. var _this$uniCloudIns$con = this.uniCloudIns.config,
  13696. n = _this$uniCloudIns$con.provider,
  13697. s = _this$uniCloudIns$con.spaceId;
  13698. var r;
  13699. this.provider = n, this.spaceId = s, this.scopedGlobalCache = (r = this.uniCloudIns, U("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", r.config.spaceId)));
  13700. }
  13701. (0, _createClass2.default)(Lt, [{
  13702. key: "getSystemInfo",
  13703. value: function getSystemInfo() {
  13704. return this._systemInfo || (this._systemInfo = ce()), this._systemInfo;
  13705. }
  13706. }, {
  13707. key: "appId",
  13708. get: function get() {
  13709. return this.getSystemInfo().appId;
  13710. }
  13711. }, {
  13712. key: "deviceId",
  13713. get: function get() {
  13714. return this.getSystemInfo().deviceId;
  13715. }
  13716. }, {
  13717. key: "encryptData",
  13718. value: function () {
  13719. var _encryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(e) {
  13720. return _regenerator.default.wrap(function _callee34$(_context34) {
  13721. while (1) {
  13722. switch (_context34.prev = _context34.next) {
  13723. case 0:
  13724. return _context34.abrupt("return", this.secretType === Ot ? e : this.platformEncryptData(e));
  13725. case 1:
  13726. case "end":
  13727. return _context34.stop();
  13728. }
  13729. }
  13730. }, _callee34, this);
  13731. }));
  13732. function encryptData(_x31) {
  13733. return _encryptData.apply(this, arguments);
  13734. }
  13735. return encryptData;
  13736. }()
  13737. }, {
  13738. key: "decryptResult",
  13739. value: function () {
  13740. var _decryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(e) {
  13741. var _ref20, t, n;
  13742. return _regenerator.default.wrap(function _callee35$(_context35) {
  13743. while (1) {
  13744. switch (_context35.prev = _context35.next) {
  13745. case 0:
  13746. if (!(this.secretType === Ot)) {
  13747. _context35.next = 2;
  13748. break;
  13749. }
  13750. return _context35.abrupt("return", e);
  13751. case 2:
  13752. _ref20 = e || {}, t = _ref20.errCode, n = _ref20.content;
  13753. return _context35.abrupt("return", t || !n ? e : this.secretType === xt ? n : this.platformDecryptResult(e));
  13754. case 4:
  13755. case "end":
  13756. return _context35.stop();
  13757. }
  13758. }
  13759. }, _callee35, this);
  13760. }));
  13761. function decryptResult(_x32) {
  13762. return _decryptResult.apply(this, arguments);
  13763. }
  13764. return decryptResult;
  13765. }()
  13766. }, {
  13767. key: "wrapVerifyClientCallFunction",
  13768. value: function wrapVerifyClientCallFunction(e) {
  13769. var t = this;
  13770. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36() {
  13771. var _ref22,
  13772. n,
  13773. _ref22$data,
  13774. s,
  13775. r,
  13776. _args36 = arguments;
  13777. return _regenerator.default.wrap(function _callee36$(_context36) {
  13778. while (1) {
  13779. switch (_context36.prev = _context36.next) {
  13780. case 0:
  13781. _ref22 = _args36.length > 0 && _args36[0] !== undefined ? _args36[0] : {}, n = _ref22.name, _ref22$data = _ref22.data, s = _ref22$data === void 0 ? {} : _ref22$data;
  13782. _context36.next = 3;
  13783. return t.prepare();
  13784. case 3:
  13785. _context36.next = 5;
  13786. return t.platformGetSignOption();
  13787. case 5:
  13788. (s = JSON.parse(JSON.stringify(s)))._uniCloudOptions = _context36.sent;
  13789. _context36.next = 8;
  13790. return e({
  13791. name: n,
  13792. data: s
  13793. });
  13794. case 8:
  13795. r = _context36.sent;
  13796. _context36.t0 = t.isClientKeyNotFound(r);
  13797. if (!_context36.t0) {
  13798. _context36.next = 19;
  13799. break;
  13800. }
  13801. _context36.next = 13;
  13802. return t.prepare({
  13803. forceUpdate: !0
  13804. });
  13805. case 13:
  13806. _context36.next = 15;
  13807. return t.platformGetSignOption();
  13808. case 15:
  13809. s._uniCloudOptions = _context36.sent;
  13810. _context36.next = 18;
  13811. return e({
  13812. name: n,
  13813. data: s
  13814. });
  13815. case 18:
  13816. r = _context36.sent;
  13817. case 19:
  13818. return _context36.abrupt("return", r);
  13819. case 20:
  13820. case "end":
  13821. return _context36.stop();
  13822. }
  13823. }
  13824. }, _callee36);
  13825. }));
  13826. }
  13827. }, {
  13828. key: "wrapEncryptDataCallFunction",
  13829. value: function wrapEncryptDataCallFunction(e) {
  13830. var t = this;
  13831. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37() {
  13832. var _ref24,
  13833. n,
  13834. _ref24$data,
  13835. s,
  13836. r,
  13837. i,
  13838. _r3,
  13839. _args37 = arguments;
  13840. return _regenerator.default.wrap(function _callee37$(_context37) {
  13841. while (1) {
  13842. switch (_context37.prev = _context37.next) {
  13843. case 0:
  13844. _ref24 = _args37.length > 0 && _args37[0] !== undefined ? _args37[0] : {}, n = _ref24.name, _ref24$data = _ref24.data, s = _ref24$data === void 0 ? {} : _ref24$data;
  13845. _context37.next = 3;
  13846. return t.prepare();
  13847. case 3:
  13848. _context37.next = 5;
  13849. return t.encryptData(s);
  13850. case 5:
  13851. r = _context37.sent;
  13852. _context37.next = 8;
  13853. return e({
  13854. name: n,
  13855. data: r
  13856. });
  13857. case 8:
  13858. i = _context37.sent;
  13859. if (!t.isClientKeyNotFound(i)) {
  13860. _context37.next = 21;
  13861. break;
  13862. }
  13863. _context37.next = 12;
  13864. return t.prepare({
  13865. forceUpdate: !0
  13866. });
  13867. case 12:
  13868. _context37.next = 14;
  13869. return t.encryptData(s);
  13870. case 14:
  13871. _r3 = _context37.sent;
  13872. _context37.next = 17;
  13873. return t.platformGetSignOption();
  13874. case 17:
  13875. s._uniCloudOptions = _context37.sent;
  13876. _context37.next = 20;
  13877. return e({
  13878. name: n,
  13879. data: _r3
  13880. });
  13881. case 20:
  13882. i = _context37.sent;
  13883. case 21:
  13884. _context37.next = 23;
  13885. return t.decryptResult(i.result);
  13886. case 23:
  13887. i.result = _context37.sent;
  13888. return _context37.abrupt("return", i);
  13889. case 25:
  13890. case "end":
  13891. return _context37.stop();
  13892. }
  13893. }
  13894. }, _callee37);
  13895. }));
  13896. }
  13897. }]);
  13898. return Lt;
  13899. }();
  13900. /*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */
  13901. function Nt(e) {
  13902. return parseInt(e) === e;
  13903. }
  13904. function Dt(e) {
  13905. if (!Nt(e.length)) return !1;
  13906. for (var t = 0; t < e.length; t++) {
  13907. if (!Nt(e[t]) || e[t] < 0 || e[t] > 255) return !1;
  13908. }
  13909. return !0;
  13910. }
  13911. function Ft(e, t) {
  13912. if (e.buffer && "Uint8Array" === e.name) return t && (e = e.slice ? e.slice() : Array.prototype.slice.call(e)), e;
  13913. if (Array.isArray(e)) {
  13914. if (!Dt(e)) throw new Error("Array contains invalid value: " + e);
  13915. return new Uint8Array(e);
  13916. }
  13917. if (Nt(e.length) && Dt(e)) return new Uint8Array(e);
  13918. throw new Error("unsupported array-like object");
  13919. }
  13920. function qt(e) {
  13921. return new Uint8Array(e);
  13922. }
  13923. function Kt(e, t, n, s, r) {
  13924. null == s && null == r || (e = e.slice ? e.slice(s, r) : Array.prototype.slice.call(e, s, r)), t.set(e, n);
  13925. }
  13926. var Mt,
  13927. jt = {
  13928. toBytes: function toBytes(e) {
  13929. var t = [],
  13930. n = 0;
  13931. for (e = encodeURI(e); n < e.length;) {
  13932. var s = e.charCodeAt(n++);
  13933. 37 === s ? (t.push(parseInt(e.substr(n, 2), 16)), n += 2) : t.push(s);
  13934. }
  13935. return Ft(t);
  13936. },
  13937. fromBytes: function fromBytes(e) {
  13938. for (var t = [], n = 0; n < e.length;) {
  13939. var s = e[n];
  13940. 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);
  13941. }
  13942. return t.join("");
  13943. }
  13944. },
  13945. Bt = (Mt = "0123456789abcdef", {
  13946. toBytes: function toBytes(e) {
  13947. for (var t = [], n = 0; n < e.length; n += 2) {
  13948. t.push(parseInt(e.substr(n, 2), 16));
  13949. }
  13950. return t;
  13951. },
  13952. fromBytes: function fromBytes(e) {
  13953. for (var t = [], n = 0; n < e.length; n++) {
  13954. var s = e[n];
  13955. t.push(Mt[(240 & s) >> 4] + Mt[15 & s]);
  13956. }
  13957. return t.join("");
  13958. }
  13959. }),
  13960. $t = {
  13961. 16: 10,
  13962. 24: 12,
  13963. 32: 14
  13964. },
  13965. Wt = [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],
  13966. zt = [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],
  13967. Jt = [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],
  13968. Ht = [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],
  13969. Gt = [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],
  13970. Vt = [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],
  13971. Yt = [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],
  13972. Qt = [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],
  13973. Xt = [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],
  13974. Zt = [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],
  13975. en = [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],
  13976. tn = [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],
  13977. nn = [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],
  13978. sn = [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],
  13979. rn = [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];
  13980. function on(e) {
  13981. for (var t = [], n = 0; n < e.length; n += 4) {
  13982. t.push(e[n] << 24 | e[n + 1] << 16 | e[n + 2] << 8 | e[n + 3]);
  13983. }
  13984. return t;
  13985. }
  13986. var an = /*#__PURE__*/function () {
  13987. function an(e) {
  13988. (0, _classCallCheck2.default)(this, an);
  13989. if (!(this instanceof an)) throw Error("AES must be instanitated with `new`");
  13990. Object.defineProperty(this, "key", {
  13991. value: Ft(e, !0)
  13992. }), this._prepare();
  13993. }
  13994. (0, _createClass2.default)(an, [{
  13995. key: "_prepare",
  13996. value: function _prepare() {
  13997. var e = $t[this.key.length];
  13998. if (null == e) throw new Error("invalid key size (must be 16, 24 or 32 bytes)");
  13999. this._Ke = [], this._Kd = [];
  14000. for (var t = 0; t <= e; t++) {
  14001. this._Ke.push([0, 0, 0, 0]), this._Kd.push([0, 0, 0, 0]);
  14002. }
  14003. var n,
  14004. s = 4 * (e + 1),
  14005. r = this.key.length / 4,
  14006. i = on(this.key);
  14007. for (t = 0; t < r; t++) {
  14008. n = t >> 2, this._Ke[n][t % 4] = i[t], this._Kd[e - n][t % 4] = i[t];
  14009. }
  14010. for (var o, a = 0, c = r; c < s;) {
  14011. if (o = i[r - 1], i[0] ^= zt[o >> 16 & 255] << 24 ^ zt[o >> 8 & 255] << 16 ^ zt[255 & o] << 8 ^ zt[o >> 24 & 255] ^ Wt[a] << 24, a += 1, 8 != r) for (t = 1; t < r; t++) {
  14012. i[t] ^= i[t - 1];
  14013. } else {
  14014. for (t = 1; t < r / 2; t++) {
  14015. i[t] ^= i[t - 1];
  14016. }
  14017. o = i[r / 2 - 1], i[r / 2] ^= zt[255 & o] ^ zt[o >> 8 & 255] << 8 ^ zt[o >> 16 & 255] << 16 ^ zt[o >> 24 & 255] << 24;
  14018. for (t = r / 2 + 1; t < r; t++) {
  14019. i[t] ^= i[t - 1];
  14020. }
  14021. }
  14022. for (t = 0; t < r && c < s;) {
  14023. u = c >> 2, l = c % 4, this._Ke[u][l] = i[t], this._Kd[e - u][l] = i[t++], c++;
  14024. }
  14025. }
  14026. for (var u = 1; u < e; u++) {
  14027. for (var l = 0; l < 4; l++) {
  14028. o = this._Kd[u][l], this._Kd[u][l] = tn[o >> 24 & 255] ^ nn[o >> 16 & 255] ^ sn[o >> 8 & 255] ^ rn[255 & o];
  14029. }
  14030. }
  14031. }
  14032. }, {
  14033. key: "encrypt",
  14034. value: function encrypt(e) {
  14035. if (16 != e.length) throw new Error("invalid plaintext size (must be 16 bytes)");
  14036. for (var t = this._Ke.length - 1, n = [0, 0, 0, 0], s = on(e), r = 0; r < 4; r++) {
  14037. s[r] ^= this._Ke[0][r];
  14038. }
  14039. for (var i = 1; i < t; i++) {
  14040. for (r = 0; r < 4; r++) {
  14041. n[r] = Ht[s[r] >> 24 & 255] ^ Gt[s[(r + 1) % 4] >> 16 & 255] ^ Vt[s[(r + 2) % 4] >> 8 & 255] ^ Yt[255 & s[(r + 3) % 4]] ^ this._Ke[i][r];
  14042. }
  14043. s = n.slice();
  14044. }
  14045. var o,
  14046. a = qt(16);
  14047. for (r = 0; r < 4; r++) {
  14048. o = this._Ke[t][r], a[4 * r] = 255 & (zt[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (zt[s[(r + 1) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (zt[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (zt[255 & s[(r + 3) % 4]] ^ o);
  14049. }
  14050. return a;
  14051. }
  14052. }, {
  14053. key: "decrypt",
  14054. value: function decrypt(e) {
  14055. if (16 != e.length) throw new Error("invalid ciphertext size (must be 16 bytes)");
  14056. for (var t = this._Kd.length - 1, n = [0, 0, 0, 0], s = on(e), r = 0; r < 4; r++) {
  14057. s[r] ^= this._Kd[0][r];
  14058. }
  14059. for (var i = 1; i < t; i++) {
  14060. for (r = 0; r < 4; r++) {
  14061. n[r] = Qt[s[r] >> 24 & 255] ^ Xt[s[(r + 3) % 4] >> 16 & 255] ^ Zt[s[(r + 2) % 4] >> 8 & 255] ^ en[255 & s[(r + 1) % 4]] ^ this._Kd[i][r];
  14062. }
  14063. s = n.slice();
  14064. }
  14065. var o,
  14066. a = qt(16);
  14067. for (r = 0; r < 4; r++) {
  14068. o = this._Kd[t][r], a[4 * r] = 255 & (Jt[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (Jt[s[(r + 3) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (Jt[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (Jt[255 & s[(r + 1) % 4]] ^ o);
  14069. }
  14070. return a;
  14071. }
  14072. }]);
  14073. return an;
  14074. }();
  14075. var cn = /*#__PURE__*/function () {
  14076. function cn(e) {
  14077. (0, _classCallCheck2.default)(this, cn);
  14078. if (!(this instanceof cn)) throw Error("AES must be instanitated with `new`");
  14079. this.description = "Electronic Code Block", this.name = "ecb", this._aes = new an(e);
  14080. }
  14081. (0, _createClass2.default)(cn, [{
  14082. key: "encrypt",
  14083. value: function encrypt(e) {
  14084. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  14085. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  14086. Kt(e, n, 0, s, s + 16), Kt(n = this._aes.encrypt(n), t, s);
  14087. }
  14088. return t;
  14089. }
  14090. }, {
  14091. key: "decrypt",
  14092. value: function decrypt(e) {
  14093. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  14094. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  14095. Kt(e, n, 0, s, s + 16), Kt(n = this._aes.decrypt(n), t, s);
  14096. }
  14097. return t;
  14098. }
  14099. }]);
  14100. return cn;
  14101. }();
  14102. var un = /*#__PURE__*/function () {
  14103. function un(e, t) {
  14104. (0, _classCallCheck2.default)(this, un);
  14105. if (!(this instanceof un)) throw Error("AES must be instanitated with `new`");
  14106. if (this.description = "Cipher Block Chaining", this.name = "cbc", t) {
  14107. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  14108. } else t = qt(16);
  14109. this._lastCipherblock = Ft(t, !0), this._aes = new an(e);
  14110. }
  14111. (0, _createClass2.default)(un, [{
  14112. key: "encrypt",
  14113. value: function encrypt(e) {
  14114. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  14115. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  14116. Kt(e, n, 0, s, s + 16);
  14117. for (var r = 0; r < 16; r++) {
  14118. n[r] ^= this._lastCipherblock[r];
  14119. }
  14120. this._lastCipherblock = this._aes.encrypt(n), Kt(this._lastCipherblock, t, s);
  14121. }
  14122. return t;
  14123. }
  14124. }, {
  14125. key: "decrypt",
  14126. value: function decrypt(e) {
  14127. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  14128. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  14129. Kt(e, n, 0, s, s + 16), n = this._aes.decrypt(n);
  14130. for (var r = 0; r < 16; r++) {
  14131. t[s + r] = n[r] ^ this._lastCipherblock[r];
  14132. }
  14133. Kt(e, this._lastCipherblock, 0, s, s + 16);
  14134. }
  14135. return t;
  14136. }
  14137. }]);
  14138. return un;
  14139. }();
  14140. var ln = /*#__PURE__*/function () {
  14141. function ln(e, t, n) {
  14142. (0, _classCallCheck2.default)(this, ln);
  14143. if (!(this instanceof ln)) throw Error("AES must be instanitated with `new`");
  14144. if (this.description = "Cipher Feedback", this.name = "cfb", t) {
  14145. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 size)");
  14146. } else t = qt(16);
  14147. n || (n = 1), this.segmentSize = n, this._shiftRegister = Ft(t, !0), this._aes = new an(e);
  14148. }
  14149. (0, _createClass2.default)(ln, [{
  14150. key: "encrypt",
  14151. value: function encrypt(e) {
  14152. if (e.length % this.segmentSize != 0) throw new Error("invalid plaintext size (must be segmentSize bytes)");
  14153. for (var t, n = Ft(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  14154. t = this._aes.encrypt(this._shiftRegister);
  14155. for (var r = 0; r < this.segmentSize; r++) {
  14156. n[s + r] ^= t[r];
  14157. }
  14158. Kt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Kt(n, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  14159. }
  14160. return n;
  14161. }
  14162. }, {
  14163. key: "decrypt",
  14164. value: function decrypt(e) {
  14165. if (e.length % this.segmentSize != 0) throw new Error("invalid ciphertext size (must be segmentSize bytes)");
  14166. for (var t, n = Ft(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  14167. t = this._aes.encrypt(this._shiftRegister);
  14168. for (var r = 0; r < this.segmentSize; r++) {
  14169. n[s + r] ^= t[r];
  14170. }
  14171. Kt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Kt(e, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  14172. }
  14173. return n;
  14174. }
  14175. }]);
  14176. return ln;
  14177. }();
  14178. var hn = /*#__PURE__*/function () {
  14179. function hn(e, t) {
  14180. (0, _classCallCheck2.default)(this, hn);
  14181. if (!(this instanceof hn)) throw Error("AES must be instanitated with `new`");
  14182. if (this.description = "Output Feedback", this.name = "ofb", t) {
  14183. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  14184. } else t = qt(16);
  14185. this._lastPrecipher = Ft(t, !0), this._lastPrecipherIndex = 16, this._aes = new an(e);
  14186. }
  14187. (0, _createClass2.default)(hn, [{
  14188. key: "encrypt",
  14189. value: function encrypt(e) {
  14190. for (var t = Ft(e, !0), n = 0; n < t.length; n++) {
  14191. 16 === this._lastPrecipherIndex && (this._lastPrecipher = this._aes.encrypt(this._lastPrecipher), this._lastPrecipherIndex = 0), t[n] ^= this._lastPrecipher[this._lastPrecipherIndex++];
  14192. }
  14193. return t;
  14194. }
  14195. }, {
  14196. key: "decrypt",
  14197. value: function decrypt(e) {
  14198. return this.encrypt(e);
  14199. }
  14200. }]);
  14201. return hn;
  14202. }();
  14203. var dn = /*#__PURE__*/function () {
  14204. function dn(e) {
  14205. (0, _classCallCheck2.default)(this, dn);
  14206. if (!(this instanceof dn)) throw Error("Counter must be instanitated with `new`");
  14207. 0 === e || e || (e = 1), "number" == typeof e ? (this._counter = qt(16), this.setValue(e)) : this.setBytes(e);
  14208. }
  14209. (0, _createClass2.default)(dn, [{
  14210. key: "setValue",
  14211. value: function setValue(e) {
  14212. if ("number" != typeof e || parseInt(e) != e) throw new Error("invalid counter value (must be an integer)");
  14213. if (e > Number.MAX_SAFE_INTEGER) throw new Error("integer value out of safe range");
  14214. for (var t = 15; t >= 0; --t) {
  14215. this._counter[t] = e % 256, e = parseInt(e / 256);
  14216. }
  14217. }
  14218. }, {
  14219. key: "setBytes",
  14220. value: function setBytes(e) {
  14221. if (16 != (e = Ft(e, !0)).length) throw new Error("invalid counter bytes size (must be 16 bytes)");
  14222. this._counter = e;
  14223. }
  14224. }, {
  14225. key: "increment",
  14226. value: function increment() {
  14227. for (var e = 15; e >= 0; e--) {
  14228. if (255 !== this._counter[e]) {
  14229. this._counter[e]++;
  14230. break;
  14231. }
  14232. this._counter[e] = 0;
  14233. }
  14234. }
  14235. }]);
  14236. return dn;
  14237. }();
  14238. var pn = /*#__PURE__*/function () {
  14239. function pn(e, t) {
  14240. (0, _classCallCheck2.default)(this, pn);
  14241. if (!(this instanceof pn)) throw Error("AES must be instanitated with `new`");
  14242. this.description = "Counter", this.name = "ctr", t instanceof dn || (t = new dn(t)), this._counter = t, this._remainingCounter = null, this._remainingCounterIndex = 16, this._aes = new an(e);
  14243. }
  14244. (0, _createClass2.default)(pn, [{
  14245. key: "encrypt",
  14246. value: function encrypt(e) {
  14247. for (var t = Ft(e, !0), n = 0; n < t.length; n++) {
  14248. 16 === this._remainingCounterIndex && (this._remainingCounter = this._aes.encrypt(this._counter._counter), this._remainingCounterIndex = 0, this._counter.increment()), t[n] ^= this._remainingCounter[this._remainingCounterIndex++];
  14249. }
  14250. return t;
  14251. }
  14252. }, {
  14253. key: "decrypt",
  14254. value: function decrypt(e) {
  14255. return this.encrypt(e);
  14256. }
  14257. }]);
  14258. return pn;
  14259. }();
  14260. var fn = {
  14261. AES: an,
  14262. Counter: dn,
  14263. ModeOfOperation: {
  14264. ecb: cn,
  14265. cbc: un,
  14266. cfb: ln,
  14267. ofb: hn,
  14268. ctr: pn
  14269. },
  14270. utils: {
  14271. hex: Bt,
  14272. utf8: jt
  14273. },
  14274. padding: {
  14275. pkcs7: {
  14276. pad: function pad(e) {
  14277. var t = 16 - (e = Ft(e, !0)).length % 16,
  14278. n = qt(e.length + t);
  14279. Kt(e, n);
  14280. for (var s = e.length; s < n.length; s++) {
  14281. n[s] = t;
  14282. }
  14283. return n;
  14284. },
  14285. strip: function strip(e) {
  14286. if ((e = Ft(e, !0)).length < 16) throw new Error("PKCS#7 invalid length");
  14287. var t = e[e.length - 1];
  14288. if (t > 16) throw new Error("PKCS#7 padding byte out of range");
  14289. for (var n = e.length - t, s = 0; s < t; s++) {
  14290. if (e[n + s] !== t) throw new Error("PKCS#7 invalid padding byte");
  14291. }
  14292. var r = qt(n);
  14293. return Kt(e, r, 0, 0, n), r;
  14294. }
  14295. }
  14296. },
  14297. _arrayTest: {
  14298. coerceArray: Ft,
  14299. createArray: qt,
  14300. copyArray: Kt
  14301. }
  14302. };
  14303. function gn(e, t, n) {
  14304. var s = new Uint8Array(uni.base64ToArrayBuffer(t)),
  14305. r = fn.utils.utf8.toBytes(n),
  14306. i = fn.utils.utf8.toBytes(e),
  14307. o = new fn.ModeOfOperation.cbc(s, r),
  14308. a = fn.padding.pkcs7.pad(i),
  14309. c = o.encrypt(a);
  14310. return uni.arrayBufferToBase64(c);
  14311. }
  14312. var mn = {
  14313. code: 2e4,
  14314. message: "System error"
  14315. },
  14316. yn = {
  14317. code: 20101,
  14318. message: "Invalid client"
  14319. },
  14320. _n = {
  14321. code: 20102,
  14322. message: "Get encrypt key failed"
  14323. },
  14324. wn = {
  14325. 10001: "Secure network is not supported on current playground or unimpsdk",
  14326. 10003: "Config missing in current app. If the problem pesist, please contact DCloud.",
  14327. 10009: "Encrypt payload failed",
  14328. 10010: "Decrypt response failed"
  14329. };
  14330. function vn(e) {
  14331. var _ref25 = e || {},
  14332. t = _ref25.errSubject,
  14333. n = _ref25.subject,
  14334. s = _ref25.errCode,
  14335. r = _ref25.errMsg,
  14336. i = _ref25.code,
  14337. o = _ref25.message,
  14338. a = _ref25.cause;
  14339. return new ne({
  14340. subject: t || n || "uni-secure-network",
  14341. code: s || i || mn.code,
  14342. message: r || o,
  14343. cause: a
  14344. });
  14345. }
  14346. var bn,
  14347. Sn,
  14348. kn = null;
  14349. var In = /*#__PURE__*/function (_Lt) {
  14350. (0, _inherits2.default)(In, _Lt);
  14351. var _super9 = _createSuper(In);
  14352. function In(e) {
  14353. var _this14;
  14354. (0, _classCallCheck2.default)(this, In);
  14355. _this14 = _super9.call(this, e), _this14.clientType = "mp-weixin", _this14.userEncryptKey = null;
  14356. return _this14;
  14357. }
  14358. (0, _createClass2.default)(In, [{
  14359. key: "isLogin",
  14360. value: function isLogin() {
  14361. return !!this.scopedGlobalCache.mpWeixinCode || !!this.scopedGlobalCache.mpWeixinOpenid;
  14362. }
  14363. }, {
  14364. key: "prepare",
  14365. value: function () {
  14366. var _prepare2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38() {
  14367. return _regenerator.default.wrap(function _callee38$(_context38) {
  14368. while (1) {
  14369. switch (_context38.prev = _context38.next) {
  14370. case 0:
  14371. if (this.isLogin()) {
  14372. _context38.next = 7;
  14373. break;
  14374. }
  14375. if (this.scopedGlobalCache.initPromise) {
  14376. _context38.next = 3;
  14377. break;
  14378. }
  14379. throw new Error("`uniCloud.initSecureNetworkByWeixin` has not yet been called");
  14380. case 3:
  14381. _context38.next = 5;
  14382. return this.scopedGlobalCache.initPromise;
  14383. case 5:
  14384. if (this.isLogin()) {
  14385. _context38.next = 7;
  14386. break;
  14387. }
  14388. throw new Error("uniCloud.initSecureNetworkByWeixin` has not yet been called or successfully excuted");
  14389. case 7:
  14390. case "end":
  14391. return _context38.stop();
  14392. }
  14393. }
  14394. }, _callee38, this);
  14395. }));
  14396. function prepare() {
  14397. return _prepare2.apply(this, arguments);
  14398. }
  14399. return prepare;
  14400. }()
  14401. }, {
  14402. key: "getUserEncryptKey",
  14403. value: function () {
  14404. var _getUserEncryptKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39() {
  14405. var _this15 = this;
  14406. var e;
  14407. return _regenerator.default.wrap(function _callee39$(_context39) {
  14408. while (1) {
  14409. switch (_context39.prev = _context39.next) {
  14410. case 0:
  14411. if (!this.userEncryptKey) {
  14412. _context39.next = 2;
  14413. break;
  14414. }
  14415. return _context39.abrupt("return", this.userEncryptKey);
  14416. case 2:
  14417. if (!(kn && kn.expireTime)) {
  14418. _context39.next = 6;
  14419. break;
  14420. }
  14421. e = Date.now();
  14422. if (!(kn.expireTime - e > 0)) {
  14423. _context39.next = 6;
  14424. break;
  14425. }
  14426. return _context39.abrupt("return", (this.userEncryptKey = kn, this.userEncryptKey));
  14427. case 6:
  14428. return _context39.abrupt("return", new Promise(function (e, t) {
  14429. uni.getUserCryptoManager().getLatestUserKey({
  14430. success: function success(t) {
  14431. kn = t, _this15.userEncryptKey = t, e(_this15.userEncryptKey);
  14432. },
  14433. fail: function fail(e) {
  14434. t(vn(_objectSpread(_objectSpread({}, _n), {}, {
  14435. cause: e
  14436. })));
  14437. }
  14438. });
  14439. }));
  14440. case 7:
  14441. case "end":
  14442. return _context39.stop();
  14443. }
  14444. }
  14445. }, _callee39, this);
  14446. }));
  14447. function getUserEncryptKey() {
  14448. return _getUserEncryptKey.apply(this, arguments);
  14449. }
  14450. return getUserEncryptKey;
  14451. }()
  14452. }, {
  14453. key: "getWxAppId",
  14454. value: function getWxAppId() {
  14455. return wx.getAccountInfoSync().miniProgram.appId;
  14456. }
  14457. }, {
  14458. key: "platformGetSignOption",
  14459. value: function () {
  14460. var _platformGetSignOption = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40() {
  14461. var _yield$this$getUserEn, e, t, n;
  14462. return _regenerator.default.wrap(function _callee40$(_context40) {
  14463. while (1) {
  14464. switch (_context40.prev = _context40.next) {
  14465. case 0:
  14466. _context40.next = 2;
  14467. return this.getUserEncryptKey();
  14468. case 2:
  14469. _yield$this$getUserEn = _context40.sent;
  14470. e = _yield$this$getUserEn.encryptKey;
  14471. t = _yield$this$getUserEn.iv;
  14472. n = _yield$this$getUserEn.version;
  14473. return _context40.abrupt("return", {
  14474. verifyClientSign: gn(JSON.stringify({
  14475. data: JSON.stringify({}),
  14476. appId: this.appId,
  14477. deviceId: this.deviceId,
  14478. wxAppId: this.getWxAppId(),
  14479. simulator: "devtools" === ce().platform,
  14480. timestamp: Date.now()
  14481. }), e, t),
  14482. encryptKeyId: n,
  14483. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  14484. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  14485. });
  14486. case 7:
  14487. case "end":
  14488. return _context40.stop();
  14489. }
  14490. }
  14491. }, _callee40, this);
  14492. }));
  14493. function platformGetSignOption() {
  14494. return _platformGetSignOption.apply(this, arguments);
  14495. }
  14496. return platformGetSignOption;
  14497. }()
  14498. }, {
  14499. key: "platformEncryptData",
  14500. value: function () {
  14501. var _platformEncryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41(e) {
  14502. var _yield$this$getUserEn2, t, n, s, r;
  14503. return _regenerator.default.wrap(function _callee41$(_context41) {
  14504. while (1) {
  14505. switch (_context41.prev = _context41.next) {
  14506. case 0:
  14507. _context41.next = 2;
  14508. return this.getUserEncryptKey();
  14509. case 2:
  14510. _yield$this$getUserEn2 = _context41.sent;
  14511. t = _yield$this$getUserEn2.encryptKey;
  14512. n = _yield$this$getUserEn2.iv;
  14513. s = _yield$this$getUserEn2.version;
  14514. r = {
  14515. secretType: this.secretType,
  14516. encryptKeyId: s,
  14517. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  14518. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  14519. };
  14520. return _context41.abrupt("return", this.secretType === Rt ? {
  14521. content: e,
  14522. _uniCloudOptions: r
  14523. } : {
  14524. content: gn(JSON.stringify({
  14525. data: JSON.stringify(e),
  14526. appId: this.appId,
  14527. deviceId: this.deviceId,
  14528. wxAppId: this.getWxAppId(),
  14529. simulator: "devtools" === ce().platform,
  14530. timestamp: Date.now()
  14531. }), t, n),
  14532. _uniCloudOptions: r
  14533. });
  14534. case 8:
  14535. case "end":
  14536. return _context41.stop();
  14537. }
  14538. }
  14539. }, _callee41, this);
  14540. }));
  14541. function platformEncryptData(_x33) {
  14542. return _platformEncryptData.apply(this, arguments);
  14543. }
  14544. return platformEncryptData;
  14545. }()
  14546. }, {
  14547. key: "platformDecryptResult",
  14548. value: function () {
  14549. var _platformDecryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42(e) {
  14550. var t, _yield$this$getUserEn3, n, s;
  14551. return _regenerator.default.wrap(function _callee42$(_context42) {
  14552. while (1) {
  14553. switch (_context42.prev = _context42.next) {
  14554. case 0:
  14555. t = e.content;
  14556. _context42.next = 3;
  14557. return this.getUserEncryptKey();
  14558. case 3:
  14559. _yield$this$getUserEn3 = _context42.sent;
  14560. n = _yield$this$getUserEn3.encryptKey;
  14561. s = _yield$this$getUserEn3.iv;
  14562. return _context42.abrupt("return", JSON.parse(function (e, t, n) {
  14563. var s = new Uint8Array(uni.base64ToArrayBuffer(e)),
  14564. r = new Uint8Array(uni.base64ToArrayBuffer(t)),
  14565. i = fn.utils.utf8.toBytes(n),
  14566. o = new fn.ModeOfOperation.cbc(r, i),
  14567. a = fn.padding.pkcs7.strip(o.decrypt(s));
  14568. return fn.utils.utf8.fromBytes(a);
  14569. }(t, n, s)));
  14570. case 7:
  14571. case "end":
  14572. return _context42.stop();
  14573. }
  14574. }
  14575. }, _callee42, this);
  14576. }));
  14577. function platformDecryptResult(_x34) {
  14578. return _platformDecryptResult.apply(this, arguments);
  14579. }
  14580. return platformDecryptResult;
  14581. }()
  14582. }, {
  14583. key: "isClientKeyNotFound",
  14584. value: function isClientKeyNotFound() {
  14585. return !1;
  14586. }
  14587. }]);
  14588. return In;
  14589. }(Lt);
  14590. function Tn(e) {
  14591. var t = ["hasClientKey", "encryptGetClientKeyPayload", "setClientKey", "encrypt", "decrypt"],
  14592. n = {};
  14593. var _loop = function _loop(_s10) {
  14594. var r = t[_s10];
  14595. n[r] = function () {
  14596. for (var _len = arguments.length, t = new Array(_len), _key = 0; _key < _len; _key++) {
  14597. t[_key] = arguments[_key];
  14598. }
  14599. return new Promise(function (n, s) {
  14600. "function" == typeof e[r] ? e[r].apply(e, t.concat([function () {
  14601. var _ref26 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14602. e = _ref26.type,
  14603. t = _ref26.data,
  14604. r = _ref26.errCode,
  14605. i = _ref26.errMsg,
  14606. o = _ref26.errSubject,
  14607. a = _ref26.message;
  14608. "success" === e ? n(t) : s(vn({
  14609. errCode: r,
  14610. errMsg: wn[r] || i || a,
  14611. errSubject: o
  14612. }));
  14613. }])) : s(vn({
  14614. message: "请检查manifest.json内是否开启安全网络模块,另外注意标准基座不支持安全网络模块"
  14615. }));
  14616. });
  14617. };
  14618. };
  14619. for (var _s10 = 0; _s10 < t.length; _s10++) {
  14620. _loop(_s10);
  14621. }
  14622. return n;
  14623. }
  14624. var Cn = /*#__PURE__*/function (_Lt2) {
  14625. (0, _inherits2.default)(Cn, _Lt2);
  14626. var _super10 = _createSuper(Cn);
  14627. function Cn(e) {
  14628. var _this16;
  14629. (0, _classCallCheck2.default)(this, Cn);
  14630. _this16 = _super10.call(this, e), _this16.clientType = "app", _this16.appUtils = _objectSpread({}, Tn(uni.requireNativePlugin("plus"))), _this16.systemInfo = bn || (bn = ce());
  14631. return _this16;
  14632. }
  14633. (0, _createClass2.default)(Cn, [{
  14634. key: "hasClientKey",
  14635. value: function () {
  14636. var _hasClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43() {
  14637. return _regenerator.default.wrap(function _callee43$(_context43) {
  14638. while (1) {
  14639. switch (_context43.prev = _context43.next) {
  14640. case 0:
  14641. _context43.next = 2;
  14642. return this.appUtils.hasClientKey({
  14643. provider: this.provider,
  14644. spaceId: this.spaceId
  14645. });
  14646. case 2:
  14647. this._hasClientKey = _context43.sent;
  14648. return _context43.abrupt("return", this._hasClientKey);
  14649. case 4:
  14650. case "end":
  14651. return _context43.stop();
  14652. }
  14653. }
  14654. }, _callee43, this);
  14655. }));
  14656. function hasClientKey() {
  14657. return _hasClientKey.apply(this, arguments);
  14658. }
  14659. return hasClientKey;
  14660. }()
  14661. }, {
  14662. key: "getAppClientKey",
  14663. value: function () {
  14664. var _getAppClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44() {
  14665. var _yield$this$appUtils$, e, t, n, s, r;
  14666. return _regenerator.default.wrap(function _callee44$(_context44) {
  14667. while (1) {
  14668. switch (_context44.prev = _context44.next) {
  14669. case 0:
  14670. _context44.next = 2;
  14671. return this.appUtils.encryptGetClientKeyPayload({
  14672. data: JSON.stringify({})
  14673. });
  14674. case 2:
  14675. _yield$this$appUtils$ = _context44.sent;
  14676. e = _yield$this$appUtils$.data;
  14677. t = _yield$this$appUtils$.key;
  14678. _context44.next = 7;
  14679. return this.uniCloudIns.callFunction({
  14680. name: "DCloud-clientDB",
  14681. data: {
  14682. redirectTo: "encryption",
  14683. action: "getAppClientKey",
  14684. data: e,
  14685. key: t
  14686. }
  14687. });
  14688. case 7:
  14689. _context44.t0 = _context44.sent.result;
  14690. if (_context44.t0) {
  14691. _context44.next = 10;
  14692. break;
  14693. }
  14694. _context44.t0 = {};
  14695. case 10:
  14696. n = _context44.t0;
  14697. if (!(0 !== n.errCode)) {
  14698. _context44.next = 13;
  14699. break;
  14700. }
  14701. throw function (e) {
  14702. return new ne({
  14703. subject: e.errSubject || "uni-secure-network",
  14704. code: e.errCode || e.code || mn.code,
  14705. message: e.errMsg || e.message
  14706. });
  14707. }(n);
  14708. case 13:
  14709. s = n.clientKey, r = n.key;
  14710. _context44.next = 16;
  14711. return this.appUtils.setClientKey({
  14712. provider: this.provider,
  14713. spaceId: this.spaceId,
  14714. clientKey: s,
  14715. key: r
  14716. });
  14717. case 16:
  14718. case "end":
  14719. return _context44.stop();
  14720. }
  14721. }
  14722. }, _callee44, this);
  14723. }));
  14724. function getAppClientKey() {
  14725. return _getAppClientKey.apply(this, arguments);
  14726. }
  14727. return getAppClientKey;
  14728. }()
  14729. }, {
  14730. key: "ensureClientKey",
  14731. value: function () {
  14732. var _ensureClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45() {
  14733. var _this17 = this;
  14734. var _ref27,
  14735. _ref27$forceUpdate,
  14736. e,
  14737. _args45 = arguments;
  14738. return _regenerator.default.wrap(function _callee45$(_context45) {
  14739. while (1) {
  14740. switch (_context45.prev = _context45.next) {
  14741. case 0:
  14742. _ref27 = _args45.length > 0 && _args45[0] !== undefined ? _args45[0] : {}, _ref27$forceUpdate = _ref27.forceUpdate, e = _ref27$forceUpdate === void 0 ? !1 : _ref27$forceUpdate;
  14743. _context45.t1 = !0;
  14744. _context45.next = 4;
  14745. return this.hasClientKey();
  14746. case 4:
  14747. _context45.t2 = _context45.sent;
  14748. _context45.t0 = _context45.t1 !== _context45.t2;
  14749. if (_context45.t0) {
  14750. _context45.next = 8;
  14751. break;
  14752. }
  14753. _context45.t0 = e;
  14754. case 8:
  14755. if (!_context45.t0) {
  14756. _context45.next = 10;
  14757. break;
  14758. }
  14759. return _context45.abrupt("return", (e && this.scopedGlobalCache.initPromise && this.scopedGlobalCache.initStatus === d || !e && this.scopedGlobalCache.initPromise && this.scopedGlobalCache.initStatus !== f || (this.scopedGlobalCache.initPromise = this.getAppClientKey(), this.scopedGlobalCache.initPromise.then(function (e) {
  14760. _this17.scopedGlobalCache.initStatus = p;
  14761. }).catch(function (e) {
  14762. throw _this17.scopedGlobalCache.initStatus = f, e;
  14763. }), this.scopedGlobalCache.initStatus = d), this.scopedGlobalCache.initPromise));
  14764. case 10:
  14765. case "end":
  14766. return _context45.stop();
  14767. }
  14768. }
  14769. }, _callee45, this);
  14770. }));
  14771. function ensureClientKey() {
  14772. return _ensureClientKey.apply(this, arguments);
  14773. }
  14774. return ensureClientKey;
  14775. }()
  14776. }, {
  14777. key: "prepare",
  14778. value: function () {
  14779. var _prepare3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46() {
  14780. var _ref28,
  14781. _ref28$forceUpdate,
  14782. e,
  14783. _args46 = arguments;
  14784. return _regenerator.default.wrap(function _callee46$(_context46) {
  14785. while (1) {
  14786. switch (_context46.prev = _context46.next) {
  14787. case 0:
  14788. _ref28 = _args46.length > 0 && _args46[0] !== undefined ? _args46[0] : {}, _ref28$forceUpdate = _ref28.forceUpdate, e = _ref28$forceUpdate === void 0 ? !1 : _ref28$forceUpdate;
  14789. _context46.next = 3;
  14790. return this.ensureClientKey({
  14791. forceUpdate: e
  14792. });
  14793. case 3:
  14794. case "end":
  14795. return _context46.stop();
  14796. }
  14797. }
  14798. }, _callee46, this);
  14799. }));
  14800. function prepare() {
  14801. return _prepare3.apply(this, arguments);
  14802. }
  14803. return prepare;
  14804. }()
  14805. }, {
  14806. key: "platformGetSignOption",
  14807. value: function () {
  14808. var _platformGetSignOption2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47() {
  14809. var _yield$this$appUtils$2, e, t;
  14810. return _regenerator.default.wrap(function _callee47$(_context47) {
  14811. while (1) {
  14812. switch (_context47.prev = _context47.next) {
  14813. case 0:
  14814. _context47.next = 2;
  14815. return this.appUtils.encrypt({
  14816. provider: this.provider,
  14817. spaceId: this.spaceId,
  14818. data: JSON.stringify({})
  14819. });
  14820. case 2:
  14821. _yield$this$appUtils$2 = _context47.sent;
  14822. e = _yield$this$appUtils$2.data;
  14823. t = _yield$this$appUtils$2.key;
  14824. return _context47.abrupt("return", {
  14825. verifyClientSign: e,
  14826. encryptKeyId: t
  14827. });
  14828. case 6:
  14829. case "end":
  14830. return _context47.stop();
  14831. }
  14832. }
  14833. }, _callee47, this);
  14834. }));
  14835. function platformGetSignOption() {
  14836. return _platformGetSignOption2.apply(this, arguments);
  14837. }
  14838. return platformGetSignOption;
  14839. }()
  14840. }, {
  14841. key: "platformEncryptData",
  14842. value: function () {
  14843. var _platformEncryptData2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48(e) {
  14844. var _yield$this$appUtils$3, t, n, s;
  14845. return _regenerator.default.wrap(function _callee48$(_context48) {
  14846. while (1) {
  14847. switch (_context48.prev = _context48.next) {
  14848. case 0:
  14849. _context48.next = 2;
  14850. return this.appUtils.encrypt({
  14851. provider: this.provider,
  14852. spaceId: this.spaceId,
  14853. data: JSON.stringify(e)
  14854. });
  14855. case 2:
  14856. _yield$this$appUtils$3 = _context48.sent;
  14857. t = _yield$this$appUtils$3.data;
  14858. n = _yield$this$appUtils$3.key;
  14859. s = {
  14860. secretType: this.secretType,
  14861. encryptKeyId: n
  14862. };
  14863. return _context48.abrupt("return", this.secretType === Rt ? {
  14864. content: e,
  14865. _uniCloudOptions: s
  14866. } : {
  14867. content: t,
  14868. _uniCloudOptions: s
  14869. });
  14870. case 7:
  14871. case "end":
  14872. return _context48.stop();
  14873. }
  14874. }
  14875. }, _callee48, this);
  14876. }));
  14877. function platformEncryptData(_x35) {
  14878. return _platformEncryptData2.apply(this, arguments);
  14879. }
  14880. return platformEncryptData;
  14881. }()
  14882. }, {
  14883. key: "platformDecryptResult",
  14884. value: function () {
  14885. var _platformDecryptResult2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49(e) {
  14886. var t, _e$_uniCloudOptions, n, s, r;
  14887. return _regenerator.default.wrap(function _callee49$(_context49) {
  14888. while (1) {
  14889. switch (_context49.prev = _context49.next) {
  14890. case 0:
  14891. t = e.content;
  14892. _e$_uniCloudOptions = e._uniCloudOptions;
  14893. n = _e$_uniCloudOptions === void 0 ? {} : _e$_uniCloudOptions;
  14894. s = n.encryptKeyId;
  14895. _context49.next = 6;
  14896. return this.appUtils.decrypt({
  14897. provider: this.provider,
  14898. spaceId: this.spaceId,
  14899. data: t,
  14900. key: s
  14901. });
  14902. case 6:
  14903. r = _context49.sent;
  14904. return _context49.abrupt("return", JSON.parse(r.data));
  14905. case 8:
  14906. case "end":
  14907. return _context49.stop();
  14908. }
  14909. }
  14910. }, _callee49, this);
  14911. }));
  14912. function platformDecryptResult(_x36) {
  14913. return _platformDecryptResult2.apply(this, arguments);
  14914. }
  14915. return platformDecryptResult;
  14916. }()
  14917. }, {
  14918. key: "isClientKeyNotFound",
  14919. value: function isClientKeyNotFound() {
  14920. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  14921. var t = e.result || {};
  14922. return 70009 === t.errCode && "uni-secure-network" === t.errSubject;
  14923. }
  14924. }]);
  14925. return Cn;
  14926. }(Lt);
  14927. function An() {
  14928. var _ref29 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14929. e = _ref29.secretType;
  14930. return e === xt || e === Rt || e === Ut;
  14931. }
  14932. function Pn() {
  14933. var _ref30 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14934. e = _ref30.name,
  14935. _ref30$data = _ref30.data,
  14936. t = _ref30$data === void 0 ? {} : _ref30$data;
  14937. return "app" === A && "DCloud-clientDB" === e && "encryption" === t.redirectTo && "getAppClientKey" === t.action;
  14938. }
  14939. function En() {
  14940. var _ref31 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14941. e = _ref31.provider,
  14942. t = _ref31.spaceId,
  14943. n = _ref31.functionName;
  14944. var _ce = ce(),
  14945. s = _ce.appId,
  14946. r = _ce.uniPlatform,
  14947. i = _ce.osName;
  14948. var o = r;
  14949. "app" === r && (o = i);
  14950. var a = function () {
  14951. var _ref32 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14952. e = _ref32.provider,
  14953. t = _ref32.spaceId;
  14954. var n = C;
  14955. if (!n) return {};
  14956. e = function (e) {
  14957. return "tencent" === e ? "tcb" : e;
  14958. }(e);
  14959. var s = n.find(function (n) {
  14960. return n.provider === e && n.spaceId === t;
  14961. });
  14962. return s && s.config;
  14963. }({
  14964. provider: e,
  14965. spaceId: t
  14966. });
  14967. if (!a || !a.accessControl || !a.accessControl.enable) return !1;
  14968. var c = a.accessControl.function || {},
  14969. u = Object.keys(c);
  14970. if (0 === u.length) return !0;
  14971. var l = function (e, t) {
  14972. var n, s, r;
  14973. for (var _i2 = 0; _i2 < e.length; _i2++) {
  14974. var _o2 = e[_i2];
  14975. _o2 !== t ? "*" !== _o2 ? _o2.split(",").map(function (e) {
  14976. return e.trim();
  14977. }).indexOf(t) > -1 && (s = _o2) : r = _o2 : n = _o2;
  14978. }
  14979. return n || s || r;
  14980. }(u, n);
  14981. if (!l) return !1;
  14982. if ((c[l] || []).find(function () {
  14983. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  14984. return e.appId === s && (e.platform || "").toLowerCase() === o.toLowerCase();
  14985. })) return !0;
  14986. 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")), vn(yn);
  14987. }
  14988. function On(_ref33) {
  14989. var e = _ref33.functionName,
  14990. t = _ref33.result,
  14991. n = _ref33.logPvd;
  14992. if (k && this.__dev__.debugLog && t && t.requestId) {
  14993. var _s11 = JSON.stringify({
  14994. spaceId: this.config.spaceId,
  14995. functionName: e,
  14996. requestId: t.requestId
  14997. });
  14998. console.log("[".concat(n, "-request]").concat(_s11, "[/").concat(n, "-request]"));
  14999. }
  15000. }
  15001. function xn(e) {
  15002. var t = e.callFunction,
  15003. n = function n(_n7) {
  15004. var _this18 = this;
  15005. var s = _n7.name;
  15006. _n7.data = It.call(e, {
  15007. data: _n7.data
  15008. });
  15009. var r = {
  15010. aliyun: "aliyun",
  15011. tencent: "tcb",
  15012. tcb: "tcb"
  15013. }[this.config.provider],
  15014. i = An(_n7),
  15015. o = Pn(_n7),
  15016. a = i || o;
  15017. return t.call(this, _n7).then(function (e) {
  15018. return e.errCode = 0, !a && On.call(_this18, {
  15019. functionName: s,
  15020. result: e,
  15021. logPvd: r
  15022. }), Promise.resolve(e);
  15023. }, function (e) {
  15024. return !a && On.call(_this18, {
  15025. functionName: s,
  15026. result: e,
  15027. logPvd: r
  15028. }), e && e.message && (e.message = function () {
  15029. var _ref34 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15030. _ref34$message = _ref34.message,
  15031. e = _ref34$message === void 0 ? "" : _ref34$message,
  15032. _ref34$extraInfo = _ref34.extraInfo,
  15033. t = _ref34$extraInfo === void 0 ? {} : _ref34$extraInfo,
  15034. _ref34$formatter = _ref34.formatter,
  15035. n = _ref34$formatter === void 0 ? [] : _ref34$formatter;
  15036. for (var _s12 = 0; _s12 < n.length; _s12++) {
  15037. var _n$_s = n[_s12],
  15038. _r4 = _n$_s.rule,
  15039. _i3 = _n$_s.content,
  15040. _o3 = _n$_s.mode,
  15041. _a = e.match(_r4);
  15042. if (!_a) continue;
  15043. var _c = _i3;
  15044. for (var _e20 = 1; _e20 < _a.length; _e20++) {
  15045. _c = Et(_c, "{$".concat(_e20, "}"), _a[_e20]);
  15046. }
  15047. for (var _e21 in t) {
  15048. _c = Et(_c, "{".concat(_e21, "}"), t[_e21]);
  15049. }
  15050. return "replace" === _o3 ? _c : e + _c;
  15051. }
  15052. return e;
  15053. }({
  15054. message: "[".concat(_n7.name, "]: ").concat(e.message),
  15055. formatter: Ct,
  15056. extraInfo: {
  15057. functionName: s
  15058. }
  15059. })), Promise.reject(e);
  15060. });
  15061. };
  15062. e.callFunction = function (t) {
  15063. var _e$config = e.config,
  15064. s = _e$config.provider,
  15065. r = _e$config.spaceId,
  15066. i = t.name;
  15067. var o, a;
  15068. if (t.data = t.data || {}, k && e.__dev__.debugInfo && !e.__dev__.debugInfo.forceRemote && E ? (e._callCloudFunction || (e._callCloudFunction = n, e._callLocalFunction = Tt), o = Tt) : o = n, o = o.bind(e), Pn(t)) a = n.call(e, t);else if (function (_ref35) {
  15069. var e = _ref35.name,
  15070. _ref35$data = _ref35.data,
  15071. t = _ref35$data === void 0 ? {} : _ref35$data;
  15072. return "mp-weixin" === A && "uni-id-co" === e && "secureNetworkHandshakeByWeixin" === t.method;
  15073. }(t)) a = o.call(e, t);else if (An(t)) {
  15074. a = new Sn({
  15075. secretType: t.secretType,
  15076. uniCloudIns: e
  15077. }).wrapEncryptDataCallFunction(n.bind(e))(t);
  15078. } else if (En({
  15079. provider: s,
  15080. spaceId: r,
  15081. functionName: i
  15082. })) {
  15083. a = new Sn({
  15084. secretType: t.secretType,
  15085. uniCloudIns: e
  15086. }).wrapVerifyClientCallFunction(n.bind(e))(t);
  15087. } else a = o(t);
  15088. return Object.defineProperty(a, "result", {
  15089. get: function get() {
  15090. return console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {};
  15091. }
  15092. }), a;
  15093. };
  15094. }
  15095. Sn = "mp-weixin" !== A && "app" !== A ? /*#__PURE__*/function () {
  15096. function _class2() {
  15097. (0, _classCallCheck2.default)(this, _class2);
  15098. throw vn({
  15099. message: "Platform ".concat(A, " is not supported by secure network")
  15100. });
  15101. }
  15102. return (0, _createClass2.default)(_class2);
  15103. }() : T ? "mp-weixin" === A ? In : Cn : /*#__PURE__*/function () {
  15104. function _class3() {
  15105. (0, _classCallCheck2.default)(this, _class3);
  15106. throw vn({
  15107. message: "Platform ".concat(A, " is not enabled, please check whether secure network module is enabled in your manifest.json")
  15108. });
  15109. }
  15110. return (0, _createClass2.default)(_class3);
  15111. }();
  15112. var Rn = Symbol("CLIENT_DB_INTERNAL");
  15113. function Un(e, t) {
  15114. return e.then = "DoNotReturnProxyWithAFunctionNamedThen", e._internalType = Rn, e.inspect = null, e.__ob__ = void 0, new Proxy(e, {
  15115. get: function get(e, n, s) {
  15116. if ("_uniClient" === n) return null;
  15117. if ("symbol" == (0, _typeof2.default)(n)) return e[n];
  15118. if (n in e || "string" != typeof n) {
  15119. var _t10 = e[n];
  15120. return "function" == typeof _t10 ? _t10.bind(e) : _t10;
  15121. }
  15122. return t.get(e, n, s);
  15123. }
  15124. });
  15125. }
  15126. function Ln(e) {
  15127. return {
  15128. on: function on(t, n) {
  15129. e[t] = e[t] || [], e[t].indexOf(n) > -1 || e[t].push(n);
  15130. },
  15131. off: function off(t, n) {
  15132. e[t] = e[t] || [];
  15133. var s = e[t].indexOf(n);
  15134. -1 !== s && e[t].splice(s, 1);
  15135. }
  15136. };
  15137. }
  15138. var Nn = ["db.Geo", "db.command", "command.aggregate"];
  15139. function Dn(e, t) {
  15140. return Nn.indexOf("".concat(e, ".").concat(t)) > -1;
  15141. }
  15142. function Fn(e) {
  15143. switch (g(e)) {
  15144. case "array":
  15145. return e.map(function (e) {
  15146. return Fn(e);
  15147. });
  15148. case "object":
  15149. return e._internalType === Rn || Object.keys(e).forEach(function (t) {
  15150. e[t] = Fn(e[t]);
  15151. }), e;
  15152. case "regexp":
  15153. return {
  15154. $regexp: {
  15155. source: e.source,
  15156. flags: e.flags
  15157. }
  15158. };
  15159. case "date":
  15160. return {
  15161. $date: e.toISOString()
  15162. };
  15163. default:
  15164. return e;
  15165. }
  15166. }
  15167. function qn(e) {
  15168. return e && e.content && e.content.$method;
  15169. }
  15170. var Kn = /*#__PURE__*/function () {
  15171. function Kn(e, t, n) {
  15172. (0, _classCallCheck2.default)(this, Kn);
  15173. this.content = e, this.prevStage = t || null, this.udb = null, this._database = n;
  15174. }
  15175. (0, _createClass2.default)(Kn, [{
  15176. key: "toJSON",
  15177. value: function toJSON() {
  15178. var e = this;
  15179. var t = [e.content];
  15180. for (; e.prevStage;) {
  15181. e = e.prevStage, t.push(e.content);
  15182. }
  15183. return {
  15184. $db: t.reverse().map(function (e) {
  15185. return {
  15186. $method: e.$method,
  15187. $param: Fn(e.$param)
  15188. };
  15189. })
  15190. };
  15191. }
  15192. }, {
  15193. key: "getAction",
  15194. value: function getAction() {
  15195. var e = this.toJSON().$db.find(function (e) {
  15196. return "action" === e.$method;
  15197. });
  15198. return e && e.$param && e.$param[0];
  15199. }
  15200. }, {
  15201. key: "getCommand",
  15202. value: function getCommand() {
  15203. return {
  15204. $db: this.toJSON().$db.filter(function (e) {
  15205. return "action" !== e.$method;
  15206. })
  15207. };
  15208. }
  15209. }, {
  15210. key: "isAggregate",
  15211. get: function get() {
  15212. var e = this;
  15213. for (; e;) {
  15214. var t = qn(e),
  15215. _n8 = qn(e.prevStage);
  15216. if ("aggregate" === t && "collection" === _n8 || "pipeline" === t) return !0;
  15217. e = e.prevStage;
  15218. }
  15219. return !1;
  15220. }
  15221. }, {
  15222. key: "isCommand",
  15223. get: function get() {
  15224. var e = this;
  15225. for (; e;) {
  15226. if ("command" === qn(e)) return !0;
  15227. e = e.prevStage;
  15228. }
  15229. return !1;
  15230. }
  15231. }, {
  15232. key: "isAggregateCommand",
  15233. get: function get() {
  15234. var e = this;
  15235. for (; e;) {
  15236. var t = qn(e),
  15237. _n9 = qn(e.prevStage);
  15238. if ("aggregate" === t && "command" === _n9) return !0;
  15239. e = e.prevStage;
  15240. }
  15241. return !1;
  15242. }
  15243. }, {
  15244. key: "getNextStageFn",
  15245. value: function getNextStageFn(e) {
  15246. var t = this;
  15247. return function () {
  15248. return Mn({
  15249. $method: e,
  15250. $param: Fn(Array.from(arguments))
  15251. }, t, t._database);
  15252. };
  15253. }
  15254. }, {
  15255. key: "count",
  15256. get: function get() {
  15257. return this.isAggregate ? this.getNextStageFn("count") : function () {
  15258. return this._send("count", Array.from(arguments));
  15259. };
  15260. }
  15261. }, {
  15262. key: "remove",
  15263. get: function get() {
  15264. return this.isCommand ? this.getNextStageFn("remove") : function () {
  15265. return this._send("remove", Array.from(arguments));
  15266. };
  15267. }
  15268. }, {
  15269. key: "get",
  15270. value: function get() {
  15271. return this._send("get", Array.from(arguments));
  15272. }
  15273. }, {
  15274. key: "add",
  15275. get: function get() {
  15276. return this.isCommand ? this.getNextStageFn("add") : function () {
  15277. return this._send("add", Array.from(arguments));
  15278. };
  15279. }
  15280. }, {
  15281. key: "update",
  15282. value: function update() {
  15283. return this._send("update", Array.from(arguments));
  15284. }
  15285. }, {
  15286. key: "end",
  15287. value: function end() {
  15288. return this._send("end", Array.from(arguments));
  15289. }
  15290. }, {
  15291. key: "set",
  15292. get: function get() {
  15293. return this.isCommand ? this.getNextStageFn("set") : function () {
  15294. throw new Error("JQL禁止使用set方法");
  15295. };
  15296. }
  15297. }, {
  15298. key: "_send",
  15299. value: function _send(e, t) {
  15300. var n = this.getAction(),
  15301. s = this.getCommand();
  15302. if (s.$db.push({
  15303. $method: e,
  15304. $param: Fn(t)
  15305. }), k) {
  15306. var _e22 = s.$db.find(function (e) {
  15307. return "collection" === e.$method;
  15308. }),
  15309. _t11 = _e22 && _e22.$param;
  15310. _t11 && 1 === _t11.length && "string" == typeof _e22.$param[0] && _e22.$param[0].indexOf(",") > -1 && console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
  15311. }
  15312. return this._database._callCloudFunction({
  15313. action: n,
  15314. command: s
  15315. });
  15316. }
  15317. }]);
  15318. return Kn;
  15319. }();
  15320. function Mn(e, t, n) {
  15321. return Un(new Kn(e, t, n), {
  15322. get: function get(e, t) {
  15323. var s = "db";
  15324. return e && e.content && (s = e.content.$method), Dn(s, t) ? Mn({
  15325. $method: t
  15326. }, e, n) : function () {
  15327. return Mn({
  15328. $method: t,
  15329. $param: Fn(Array.from(arguments))
  15330. }, e, n);
  15331. };
  15332. }
  15333. });
  15334. }
  15335. function jn(_ref36) {
  15336. var e = _ref36.path,
  15337. t = _ref36.method;
  15338. return /*#__PURE__*/function () {
  15339. function _class4() {
  15340. (0, _classCallCheck2.default)(this, _class4);
  15341. this.param = Array.from(arguments);
  15342. }
  15343. (0, _createClass2.default)(_class4, [{
  15344. key: "toJSON",
  15345. value: function toJSON() {
  15346. return {
  15347. $newDb: [].concat((0, _toConsumableArray2.default)(e.map(function (e) {
  15348. return {
  15349. $method: e
  15350. };
  15351. })), [{
  15352. $method: t,
  15353. $param: this.param
  15354. }])
  15355. };
  15356. }
  15357. }]);
  15358. return _class4;
  15359. }();
  15360. }
  15361. function Bn(e) {
  15362. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  15363. return Un(new e(t), {
  15364. get: function get(e, t) {
  15365. return Dn("db", t) ? Mn({
  15366. $method: t
  15367. }, null, e) : function () {
  15368. return Mn({
  15369. $method: t,
  15370. $param: Fn(Array.from(arguments))
  15371. }, null, e);
  15372. };
  15373. }
  15374. });
  15375. }
  15376. var $n = /*#__PURE__*/function (_ref37) {
  15377. (0, _inherits2.default)($n, _ref37);
  15378. var _super11 = _createSuper($n);
  15379. function $n() {
  15380. (0, _classCallCheck2.default)(this, $n);
  15381. return _super11.apply(this, arguments);
  15382. }
  15383. (0, _createClass2.default)($n, [{
  15384. key: "_parseResult",
  15385. value: function _parseResult(e) {
  15386. return this._isJQL ? e.result : e;
  15387. }
  15388. }, {
  15389. key: "_callCloudFunction",
  15390. value: function _callCloudFunction(_ref38) {
  15391. var _this19 = this;
  15392. var e = _ref38.action,
  15393. t = _ref38.command,
  15394. n = _ref38.multiCommand,
  15395. s = _ref38.queryList;
  15396. function r(e, t) {
  15397. if (n && s) for (var _n10 = 0; _n10 < s.length; _n10++) {
  15398. var _r5 = s[_n10];
  15399. _r5.udb && "function" == typeof _r5.udb.setResult && (t ? _r5.udb.setResult(t) : _r5.udb.setResult(e.result.dataList[_n10]));
  15400. }
  15401. }
  15402. var i = this,
  15403. o = this._isJQL ? "databaseForJQL" : "database";
  15404. function a(e) {
  15405. return i._callback("error", [e]), q(K(o, "fail"), e).then(function () {
  15406. return q(K(o, "complete"), e);
  15407. }).then(function () {
  15408. return r(null, e), Q(B, {
  15409. type: z,
  15410. content: e
  15411. }), Promise.reject(e);
  15412. });
  15413. }
  15414. var c = q(K(o, "invoke")),
  15415. u = this._uniClient;
  15416. return c.then(function () {
  15417. return u.callFunction({
  15418. name: "DCloud-clientDB",
  15419. type: h,
  15420. data: {
  15421. action: e,
  15422. command: t,
  15423. multiCommand: n
  15424. }
  15425. });
  15426. }).then(function (e) {
  15427. var _e$result = e.result,
  15428. t = _e$result.code,
  15429. n = _e$result.message,
  15430. s = _e$result.token,
  15431. c = _e$result.tokenExpired,
  15432. _e$result$systemInfo = _e$result.systemInfo,
  15433. u = _e$result$systemInfo === void 0 ? [] : _e$result$systemInfo;
  15434. if (u) for (var _e23 = 0; _e23 < u.length; _e23++) {
  15435. var _u$_e = u[_e23],
  15436. _t12 = _u$_e.level,
  15437. _n11 = _u$_e.message,
  15438. _s13 = _u$_e.detail,
  15439. _r6 = console["app" === A && "warn" === _t12 ? "error" : _t12] || console.log;
  15440. var _i4 = "[System Info]" + _n11;
  15441. _s13 && (_i4 = "".concat(_i4, "\n\u8BE6\u7EC6\u4FE1\u606F\uFF1A").concat(_s13)), _r6(_i4);
  15442. }
  15443. if (t) {
  15444. return a(new ne({
  15445. code: t,
  15446. message: n,
  15447. requestId: e.requestId
  15448. }));
  15449. }
  15450. e.result.errCode = e.result.errCode || e.result.code, e.result.errMsg = e.result.errMsg || e.result.message, s && c && (ie({
  15451. token: s,
  15452. tokenExpired: c
  15453. }), _this19._callbackAuth("refreshToken", [{
  15454. token: s,
  15455. tokenExpired: c
  15456. }]), _this19._callback("refreshToken", [{
  15457. token: s,
  15458. tokenExpired: c
  15459. }]), Q(W, {
  15460. token: s,
  15461. tokenExpired: c
  15462. }));
  15463. var l = [{
  15464. prop: "affectedDocs",
  15465. tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"
  15466. }, {
  15467. prop: "code",
  15468. tips: "code不再推荐使用,请使用errCode替代"
  15469. }, {
  15470. prop: "message",
  15471. tips: "message不再推荐使用,请使用errMsg替代"
  15472. }];
  15473. var _loop2 = function _loop2(_t13) {
  15474. var _l$_t = l[_t13],
  15475. n = _l$_t.prop,
  15476. s = _l$_t.tips;
  15477. if (n in e.result) {
  15478. var _t14 = e.result[n];
  15479. Object.defineProperty(e.result, n, {
  15480. get: function get() {
  15481. return console.warn(s), _t14;
  15482. }
  15483. });
  15484. }
  15485. };
  15486. for (var _t13 = 0; _t13 < l.length; _t13++) {
  15487. _loop2(_t13);
  15488. }
  15489. return function (e) {
  15490. return q(K(o, "success"), e).then(function () {
  15491. return q(K(o, "complete"), e);
  15492. }).then(function () {
  15493. r(e, null);
  15494. var t = i._parseResult(e);
  15495. return Q(B, {
  15496. type: z,
  15497. content: t
  15498. }), Promise.resolve(t);
  15499. });
  15500. }(e);
  15501. }, function (e) {
  15502. /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
  15503. return a(new ne({
  15504. code: e.code || "SYSTEM_ERROR",
  15505. message: e.message,
  15506. requestId: e.requestId
  15507. }));
  15508. });
  15509. }
  15510. }]);
  15511. return $n;
  15512. }( /*#__PURE__*/function () {
  15513. function _class5() {
  15514. var _ref39 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15515. _ref39$uniClient = _ref39.uniClient,
  15516. e = _ref39$uniClient === void 0 ? {} : _ref39$uniClient,
  15517. _ref39$isJQL = _ref39.isJQL,
  15518. t = _ref39$isJQL === void 0 ? !1 : _ref39$isJQL;
  15519. (0, _classCallCheck2.default)(this, _class5);
  15520. this._uniClient = e, this._authCallBacks = {}, this._dbCallBacks = {}, e._isDefault && (this._dbCallBacks = U("_globalUniCloudDatabaseCallback")), t || (this.auth = Ln(this._authCallBacks)), this._isJQL = t, Object.assign(this, Ln(this._dbCallBacks)), this.env = Un({}, {
  15521. get: function get(e, t) {
  15522. return {
  15523. $env: t
  15524. };
  15525. }
  15526. }), this.Geo = Un({}, {
  15527. get: function get(e, t) {
  15528. return jn({
  15529. path: ["Geo"],
  15530. method: t
  15531. });
  15532. }
  15533. }), this.serverDate = jn({
  15534. path: [],
  15535. method: "serverDate"
  15536. }), this.RegExp = jn({
  15537. path: [],
  15538. method: "RegExp"
  15539. });
  15540. }
  15541. (0, _createClass2.default)(_class5, [{
  15542. key: "getCloudEnv",
  15543. value: function getCloudEnv(e) {
  15544. if ("string" != typeof e || !e.trim()) throw new Error("getCloudEnv参数错误");
  15545. return {
  15546. $env: e.replace("$cloudEnv_", "")
  15547. };
  15548. }
  15549. }, {
  15550. key: "_callback",
  15551. value: function _callback(e, t) {
  15552. var n = this._dbCallBacks;
  15553. n[e] && n[e].forEach(function (e) {
  15554. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  15555. });
  15556. }
  15557. }, {
  15558. key: "_callbackAuth",
  15559. value: function _callbackAuth(e, t) {
  15560. var n = this._authCallBacks;
  15561. n[e] && n[e].forEach(function (e) {
  15562. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  15563. });
  15564. }
  15565. }, {
  15566. key: "multiSend",
  15567. value: function multiSend() {
  15568. var e = Array.from(arguments),
  15569. t = e.map(function (e) {
  15570. var t = e.getAction(),
  15571. n = e.getCommand();
  15572. if ("getTemp" !== n.$db[n.$db.length - 1].$method) throw new Error("multiSend只支持子命令内使用getTemp");
  15573. return {
  15574. action: t,
  15575. command: n
  15576. };
  15577. });
  15578. return this._callCloudFunction({
  15579. multiCommand: t,
  15580. queryList: e
  15581. });
  15582. }
  15583. }]);
  15584. return _class5;
  15585. }());
  15586. var Wn = "token无效,跳转登录页面",
  15587. zn = "token过期,跳转登录页面",
  15588. Jn = {
  15589. TOKEN_INVALID_TOKEN_EXPIRED: zn,
  15590. TOKEN_INVALID_INVALID_CLIENTID: Wn,
  15591. TOKEN_INVALID: Wn,
  15592. TOKEN_INVALID_WRONG_TOKEN: Wn,
  15593. TOKEN_INVALID_ANONYMOUS_USER: Wn
  15594. },
  15595. Hn = {
  15596. "uni-id-token-expired": zn,
  15597. "uni-id-check-token-failed": Wn,
  15598. "uni-id-token-not-exist": Wn,
  15599. "uni-id-check-device-feature-failed": Wn
  15600. };
  15601. function Gn(e, t) {
  15602. var n = "";
  15603. return n = e ? "".concat(e, "/").concat(t) : t, n.replace(/^\//, "");
  15604. }
  15605. function Vn() {
  15606. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  15607. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
  15608. var n = [],
  15609. s = [];
  15610. return e.forEach(function (e) {
  15611. !0 === e.needLogin ? n.push(Gn(t, e.path)) : !1 === e.needLogin && s.push(Gn(t, e.path));
  15612. }), {
  15613. needLoginPage: n,
  15614. notNeedLoginPage: s
  15615. };
  15616. }
  15617. function Yn(e) {
  15618. return e.split("?")[0].replace(/^\//, "");
  15619. }
  15620. function Qn() {
  15621. return function (e) {
  15622. var t = e && e.$page && e.$page.fullPath || "";
  15623. return t ? ("/" !== t.charAt(0) && (t = "/" + t), t) : t;
  15624. }(function () {
  15625. var e = getCurrentPages();
  15626. return e[e.length - 1];
  15627. }());
  15628. }
  15629. function Xn() {
  15630. return Yn(Qn());
  15631. }
  15632. function Zn() {
  15633. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  15634. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  15635. if (!e) return !1;
  15636. if (!(t && t.list && t.list.length)) return !1;
  15637. var n = t.list,
  15638. s = Yn(e);
  15639. return n.some(function (e) {
  15640. return e.pagePath === s;
  15641. });
  15642. }
  15643. var es = !!_pages.default.uniIdRouter;
  15644. var _ref40 = function () {
  15645. var _ref21 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _pages.default,
  15646. _ref21$pages = _ref21.pages,
  15647. e = _ref21$pages === void 0 ? [] : _ref21$pages,
  15648. _ref21$subPackages = _ref21.subPackages,
  15649. n = _ref21$subPackages === void 0 ? [] : _ref21$subPackages,
  15650. _ref21$uniIdRouter = _ref21.uniIdRouter,
  15651. s = _ref21$uniIdRouter === void 0 ? {} : _ref21$uniIdRouter,
  15652. _ref21$tabBar = _ref21.tabBar,
  15653. r = _ref21$tabBar === void 0 ? {} : _ref21$tabBar;
  15654. var i = s.loginPage,
  15655. _s$needLogin = s.needLogin,
  15656. o = _s$needLogin === void 0 ? [] : _s$needLogin,
  15657. _s$resToLogin = s.resToLogin,
  15658. a = _s$resToLogin === void 0 ? !0 : _s$resToLogin,
  15659. _Vn = Vn(e),
  15660. c = _Vn.needLoginPage,
  15661. u = _Vn.notNeedLoginPage,
  15662. _ref23 = function () {
  15663. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  15664. var t = [],
  15665. n = [];
  15666. return e.forEach(function (e) {
  15667. var s = e.root,
  15668. _e$pages = e.pages,
  15669. r = _e$pages === void 0 ? [] : _e$pages,
  15670. _Vn2 = Vn(r, s),
  15671. i = _Vn2.needLoginPage,
  15672. o = _Vn2.notNeedLoginPage;
  15673. t.push.apply(t, (0, _toConsumableArray2.default)(i)), n.push.apply(n, (0, _toConsumableArray2.default)(o));
  15674. }), {
  15675. needLoginPage: t,
  15676. notNeedLoginPage: n
  15677. };
  15678. }(n),
  15679. l = _ref23.needLoginPage,
  15680. h = _ref23.notNeedLoginPage;
  15681. return {
  15682. loginPage: i,
  15683. routerNeedLogin: o,
  15684. resToLogin: a,
  15685. needLoginPage: [].concat((0, _toConsumableArray2.default)(c), (0, _toConsumableArray2.default)(l)),
  15686. notNeedLoginPage: [].concat((0, _toConsumableArray2.default)(u), (0, _toConsumableArray2.default)(h)),
  15687. loginPageInTabBar: Zn(i, r)
  15688. };
  15689. }(),
  15690. ts = _ref40.loginPage,
  15691. ns = _ref40.routerNeedLogin,
  15692. ss = _ref40.resToLogin,
  15693. rs = _ref40.needLoginPage,
  15694. is = _ref40.notNeedLoginPage,
  15695. os = _ref40.loginPageInTabBar;
  15696. if (rs.indexOf(ts) > -1) throw new Error("Login page [".concat(ts, "] should not be \"needLogin\", please check your pages.json"));
  15697. function as(e) {
  15698. var t = Xn();
  15699. if ("/" === e.charAt(0)) return e;
  15700. var _e$split = e.split("?"),
  15701. _e$split2 = (0, _slicedToArray2.default)(_e$split, 2),
  15702. n = _e$split2[0],
  15703. s = _e$split2[1],
  15704. r = n.replace(/^\//, "").split("/"),
  15705. i = t.split("/");
  15706. i.pop();
  15707. for (var _e24 = 0; _e24 < r.length; _e24++) {
  15708. var _t15 = r[_e24];
  15709. ".." === _t15 ? i.pop() : "." !== _t15 && i.push(_t15);
  15710. }
  15711. return "" === i[0] && i.shift(), "/" + i.join("/") + (s ? "?" + s : "");
  15712. }
  15713. function cs(e) {
  15714. var t = Yn(as(e));
  15715. return !(is.indexOf(t) > -1) && (rs.indexOf(t) > -1 || ns.some(function (t) {
  15716. return function (e, t) {
  15717. return new RegExp(t).test(e);
  15718. }(e, t);
  15719. }));
  15720. }
  15721. function us(_ref41) {
  15722. var e = _ref41.redirect;
  15723. var t = Yn(e),
  15724. n = Yn(ts);
  15725. return Xn() !== n && t !== n;
  15726. }
  15727. function ls() {
  15728. var _ref42 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15729. e = _ref42.api,
  15730. t = _ref42.redirect;
  15731. if (!t || !us({
  15732. redirect: t
  15733. })) return;
  15734. var n = function (e, t) {
  15735. return "/" !== e.charAt(0) && (e = "/" + e), t ? e.indexOf("?") > -1 ? e + "&uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e + "?uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e;
  15736. }(ts, t);
  15737. os ? "navigateTo" !== e && "redirectTo" !== e || (e = "switchTab") : "switchTab" === e && (e = "navigateTo");
  15738. var s = {
  15739. navigateTo: uni.navigateTo,
  15740. redirectTo: uni.redirectTo,
  15741. switchTab: uni.switchTab,
  15742. reLaunch: uni.reLaunch
  15743. };
  15744. setTimeout(function () {
  15745. s[e]({
  15746. url: n
  15747. });
  15748. });
  15749. }
  15750. function hs() {
  15751. var _ref43 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15752. e = _ref43.url;
  15753. var t = {
  15754. abortLoginPageJump: !1,
  15755. autoToLoginPage: !1
  15756. },
  15757. n = function () {
  15758. var _re3 = re(),
  15759. e = _re3.token,
  15760. t = _re3.tokenExpired;
  15761. var n;
  15762. if (e) {
  15763. if (t < Date.now()) {
  15764. var _e25 = "uni-id-token-expired";
  15765. n = {
  15766. errCode: _e25,
  15767. errMsg: Hn[_e25]
  15768. };
  15769. }
  15770. } else {
  15771. var _e26 = "uni-id-check-token-failed";
  15772. n = {
  15773. errCode: _e26,
  15774. errMsg: Hn[_e26]
  15775. };
  15776. }
  15777. return n;
  15778. }();
  15779. if (cs(e) && n) {
  15780. n.uniIdRedirectUrl = e;
  15781. if (G($).length > 0) return setTimeout(function () {
  15782. Q($, n);
  15783. }, 0), t.abortLoginPageJump = !0, t;
  15784. t.autoToLoginPage = !0;
  15785. }
  15786. return t;
  15787. }
  15788. function ds() {
  15789. !function () {
  15790. var e = Qn(),
  15791. _hs = hs({
  15792. url: e
  15793. }),
  15794. t = _hs.abortLoginPageJump,
  15795. n = _hs.autoToLoginPage;
  15796. t || n && ls({
  15797. api: "redirectTo",
  15798. redirect: e
  15799. });
  15800. }();
  15801. var e = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
  15802. var _loop3 = function _loop3(_t16) {
  15803. var n = e[_t16];
  15804. uni.addInterceptor(n, {
  15805. invoke: function invoke(e) {
  15806. var _hs2 = hs({
  15807. url: e.url
  15808. }),
  15809. t = _hs2.abortLoginPageJump,
  15810. s = _hs2.autoToLoginPage;
  15811. return t ? e : s ? (ls({
  15812. api: n,
  15813. redirect: as(e.url)
  15814. }), !1) : e;
  15815. }
  15816. });
  15817. };
  15818. for (var _t16 = 0; _t16 < e.length; _t16++) {
  15819. _loop3(_t16);
  15820. }
  15821. }
  15822. function ps() {
  15823. this.onResponse(function (e) {
  15824. var t = e.type,
  15825. n = e.content;
  15826. var s = !1;
  15827. switch (t) {
  15828. case "cloudobject":
  15829. s = function (e) {
  15830. if ("object" != (0, _typeof2.default)(e)) return !1;
  15831. var _ref44 = e || {},
  15832. t = _ref44.errCode;
  15833. return t in Hn;
  15834. }(n);
  15835. break;
  15836. case "clientdb":
  15837. s = function (e) {
  15838. if ("object" != (0, _typeof2.default)(e)) return !1;
  15839. var _ref45 = e || {},
  15840. t = _ref45.errCode;
  15841. return t in Jn;
  15842. }(n);
  15843. }
  15844. s && function () {
  15845. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  15846. var t = G($);
  15847. ee().then(function () {
  15848. var n = Qn();
  15849. if (n && us({
  15850. redirect: n
  15851. })) return t.length > 0 ? Q($, Object.assign({
  15852. uniIdRedirectUrl: n
  15853. }, e)) : void (ts && ls({
  15854. api: "navigateTo",
  15855. redirect: n
  15856. }));
  15857. });
  15858. }(n);
  15859. });
  15860. }
  15861. function fs(e) {
  15862. !function (e) {
  15863. e.onResponse = function (e) {
  15864. V(B, e);
  15865. }, e.offResponse = function (e) {
  15866. Y(B, e);
  15867. };
  15868. }(e), function (e) {
  15869. e.onNeedLogin = function (e) {
  15870. V($, e);
  15871. }, e.offNeedLogin = function (e) {
  15872. Y($, e);
  15873. }, es && (U("_globalUniCloudStatus").needLoginInit || (U("_globalUniCloudStatus").needLoginInit = !0, ee().then(function () {
  15874. ds.call(e);
  15875. }), ss && ps.call(e)));
  15876. }(e), function (e) {
  15877. e.onRefreshToken = function (e) {
  15878. V(W, e);
  15879. }, e.offRefreshToken = function (e) {
  15880. Y(W, e);
  15881. };
  15882. }(e);
  15883. }
  15884. var gs;
  15885. var ms = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  15886. ys = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  15887. function _s() {
  15888. var e = re().token || "",
  15889. t = e.split(".");
  15890. if (!e || 3 !== t.length) return {
  15891. uid: null,
  15892. role: [],
  15893. permission: [],
  15894. tokenExpired: 0
  15895. };
  15896. var n;
  15897. try {
  15898. n = JSON.parse((s = t[1], decodeURIComponent(gs(s).split("").map(function (e) {
  15899. return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2);
  15900. }).join(""))));
  15901. } catch (e) {
  15902. throw new Error("获取当前用户信息出错,详细错误信息为:" + e.message);
  15903. }
  15904. var s;
  15905. return n.tokenExpired = 1e3 * n.exp, delete n.exp, delete n.iat, n;
  15906. }
  15907. gs = "function" != typeof atob ? function (e) {
  15908. if (e = String(e).replace(/[\t\n\f\r ]+/g, ""), !ys.test(e)) throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  15909. var t;
  15910. e += "==".slice(2 - (3 & e.length));
  15911. for (var n, s, r = "", i = 0; i < e.length;) {
  15912. t = ms.indexOf(e.charAt(i++)) << 18 | ms.indexOf(e.charAt(i++)) << 12 | (n = ms.indexOf(e.charAt(i++))) << 6 | (s = ms.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);
  15913. }
  15914. return r;
  15915. } : atob;
  15916. var ws = s(function (e, t) {
  15917. Object.defineProperty(t, "__esModule", {
  15918. value: !0
  15919. });
  15920. var n = "chooseAndUploadFile:ok",
  15921. s = "chooseAndUploadFile:fail";
  15922. function r(e, t) {
  15923. return e.tempFiles.forEach(function (e, n) {
  15924. 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("."));
  15925. }), e.tempFilePaths || (e.tempFilePaths = e.tempFiles.map(function (e) {
  15926. return e.path;
  15927. })), e;
  15928. }
  15929. function i(e, t, _ref46) {
  15930. var s = _ref46.onChooseFile,
  15931. r = _ref46.onUploadProgress;
  15932. return t.then(function (e) {
  15933. if (s) {
  15934. var _t17 = s(e);
  15935. if (void 0 !== _t17) return Promise.resolve(_t17).then(function (t) {
  15936. return void 0 === t ? e : t;
  15937. });
  15938. }
  15939. return e;
  15940. }).then(function (t) {
  15941. return !1 === t ? {
  15942. errMsg: n,
  15943. tempFilePaths: [],
  15944. tempFiles: []
  15945. } : function (e, t) {
  15946. var s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;
  15947. var r = arguments.length > 3 ? arguments[3] : undefined;
  15948. (t = Object.assign({}, t)).errMsg = n;
  15949. var i = t.tempFiles,
  15950. o = i.length;
  15951. var a = 0;
  15952. return new Promise(function (n) {
  15953. for (; a < s;) {
  15954. c();
  15955. }
  15956. function c() {
  15957. var s = a++;
  15958. if (s >= o) return void (!i.find(function (e) {
  15959. return !e.url && !e.errMsg;
  15960. }) && n(t));
  15961. var u = i[s];
  15962. e.uploadFile({
  15963. filePath: u.path,
  15964. cloudPath: u.cloudPath,
  15965. fileType: u.fileType,
  15966. onUploadProgress: function onUploadProgress(e) {
  15967. e.index = s, e.tempFile = u, e.tempFilePath = u.path, r && r(e);
  15968. }
  15969. }).then(function (e) {
  15970. u.url = e.fileID, s < o && c();
  15971. }).catch(function (e) {
  15972. u.errMsg = e.errMsg || e.message, s < o && c();
  15973. });
  15974. }
  15975. });
  15976. }(e, t, 5, r);
  15977. });
  15978. }
  15979. t.initChooseAndUploadFile = function (e) {
  15980. return function () {
  15981. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  15982. type: "all"
  15983. };
  15984. return "image" === t.type ? i(e, function (e) {
  15985. var t = e.count,
  15986. n = e.sizeType,
  15987. _e$sourceType = e.sourceType,
  15988. i = _e$sourceType === void 0 ? ["album", "camera"] : _e$sourceType,
  15989. o = e.extension;
  15990. return new Promise(function (e, a) {
  15991. uni.chooseImage({
  15992. count: t,
  15993. sizeType: n,
  15994. sourceType: i,
  15995. extension: o,
  15996. success: function success(t) {
  15997. e(r(t, "image"));
  15998. },
  15999. fail: function fail(e) {
  16000. a({
  16001. errMsg: e.errMsg.replace("chooseImage:fail", s)
  16002. });
  16003. }
  16004. });
  16005. });
  16006. }(t), t) : "video" === t.type ? i(e, function (e) {
  16007. var t = e.camera,
  16008. n = e.compressed,
  16009. i = e.maxDuration,
  16010. _e$sourceType2 = e.sourceType,
  16011. o = _e$sourceType2 === void 0 ? ["album", "camera"] : _e$sourceType2,
  16012. a = e.extension;
  16013. return new Promise(function (e, c) {
  16014. uni.chooseVideo({
  16015. camera: t,
  16016. compressed: n,
  16017. maxDuration: i,
  16018. sourceType: o,
  16019. extension: a,
  16020. success: function success(t) {
  16021. var n = t.tempFilePath,
  16022. s = t.duration,
  16023. i = t.size,
  16024. o = t.height,
  16025. a = t.width;
  16026. e(r({
  16027. errMsg: "chooseVideo:ok",
  16028. tempFilePaths: [n],
  16029. tempFiles: [{
  16030. name: t.tempFile && t.tempFile.name || "",
  16031. path: n,
  16032. size: i,
  16033. type: t.tempFile && t.tempFile.type || "",
  16034. width: a,
  16035. height: o,
  16036. duration: s,
  16037. fileType: "video",
  16038. cloudPath: ""
  16039. }]
  16040. }, "video"));
  16041. },
  16042. fail: function fail(e) {
  16043. c({
  16044. errMsg: e.errMsg.replace("chooseVideo:fail", s)
  16045. });
  16046. }
  16047. });
  16048. });
  16049. }(t), t) : i(e, function (e) {
  16050. var t = e.count,
  16051. n = e.extension;
  16052. return new Promise(function (e, i) {
  16053. var o = uni.chooseFile;
  16054. if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (o = wx.chooseMessageFile), "function" != typeof o) return i({
  16055. errMsg: s + " 请指定 type 类型,该平台仅支持选择 image 或 video。"
  16056. });
  16057. o({
  16058. type: "all",
  16059. count: t,
  16060. extension: n,
  16061. success: function success(t) {
  16062. e(r(t));
  16063. },
  16064. fail: function fail(e) {
  16065. i({
  16066. errMsg: e.errMsg.replace("chooseFile:fail", s)
  16067. });
  16068. }
  16069. });
  16070. });
  16071. }(t), t);
  16072. };
  16073. };
  16074. }),
  16075. vs = n(ws);
  16076. var bs = "manual";
  16077. function Ss(e) {
  16078. return {
  16079. props: {
  16080. localdata: {
  16081. type: Array,
  16082. default: function _default() {
  16083. return [];
  16084. }
  16085. },
  16086. options: {
  16087. type: [Object, Array],
  16088. default: function _default() {
  16089. return {};
  16090. }
  16091. },
  16092. spaceInfo: {
  16093. type: Object,
  16094. default: function _default() {
  16095. return {};
  16096. }
  16097. },
  16098. collection: {
  16099. type: [String, Array],
  16100. default: ""
  16101. },
  16102. action: {
  16103. type: String,
  16104. default: ""
  16105. },
  16106. field: {
  16107. type: String,
  16108. default: ""
  16109. },
  16110. orderby: {
  16111. type: String,
  16112. default: ""
  16113. },
  16114. where: {
  16115. type: [String, Object],
  16116. default: ""
  16117. },
  16118. pageData: {
  16119. type: String,
  16120. default: "add"
  16121. },
  16122. pageCurrent: {
  16123. type: Number,
  16124. default: 1
  16125. },
  16126. pageSize: {
  16127. type: Number,
  16128. default: 20
  16129. },
  16130. getcount: {
  16131. type: [Boolean, String],
  16132. default: !1
  16133. },
  16134. gettree: {
  16135. type: [Boolean, String],
  16136. default: !1
  16137. },
  16138. gettreepath: {
  16139. type: [Boolean, String],
  16140. default: !1
  16141. },
  16142. startwith: {
  16143. type: String,
  16144. default: ""
  16145. },
  16146. limitlevel: {
  16147. type: Number,
  16148. default: 10
  16149. },
  16150. groupby: {
  16151. type: String,
  16152. default: ""
  16153. },
  16154. groupField: {
  16155. type: String,
  16156. default: ""
  16157. },
  16158. distinct: {
  16159. type: [Boolean, String],
  16160. default: !1
  16161. },
  16162. foreignKey: {
  16163. type: String,
  16164. default: ""
  16165. },
  16166. loadtime: {
  16167. type: String,
  16168. default: "auto"
  16169. },
  16170. manual: {
  16171. type: Boolean,
  16172. default: !1
  16173. }
  16174. },
  16175. data: function data() {
  16176. return {
  16177. mixinDatacomLoading: !1,
  16178. mixinDatacomHasMore: !1,
  16179. mixinDatacomResData: [],
  16180. mixinDatacomErrorMessage: "",
  16181. mixinDatacomPage: {}
  16182. };
  16183. },
  16184. created: function created() {
  16185. var _this20 = this;
  16186. this.mixinDatacomPage = {
  16187. current: this.pageCurrent,
  16188. size: this.pageSize,
  16189. count: 0
  16190. }, this.$watch(function () {
  16191. var e = [];
  16192. return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach(function (t) {
  16193. e.push(_this20[t]);
  16194. }), e;
  16195. }, function (e, t) {
  16196. if (_this20.loadtime === bs) return;
  16197. var n = !1;
  16198. var s = [];
  16199. for (var _r7 = 2; _r7 < e.length; _r7++) {
  16200. e[_r7] !== t[_r7] && (s.push(e[_r7]), n = !0);
  16201. }
  16202. e[0] !== t[0] && (_this20.mixinDatacomPage.current = _this20.pageCurrent), _this20.mixinDatacomPage.size = _this20.pageSize, _this20.onMixinDatacomPropsChange(n, s);
  16203. });
  16204. },
  16205. methods: {
  16206. onMixinDatacomPropsChange: function onMixinDatacomPropsChange(e, t) {},
  16207. mixinDatacomEasyGet: function mixinDatacomEasyGet() {
  16208. var _this21 = this;
  16209. var _ref47 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16210. _ref47$getone = _ref47.getone,
  16211. e = _ref47$getone === void 0 ? !1 : _ref47$getone,
  16212. t = _ref47.success,
  16213. n = _ref47.fail;
  16214. this.mixinDatacomLoading || (this.mixinDatacomLoading = !0, this.mixinDatacomErrorMessage = "", this.mixinDatacomGet().then(function (n) {
  16215. _this21.mixinDatacomLoading = !1;
  16216. var _n$result = n.result,
  16217. s = _n$result.data,
  16218. r = _n$result.count;
  16219. _this21.getcount && (_this21.mixinDatacomPage.count = r), _this21.mixinDatacomHasMore = s.length < _this21.pageSize;
  16220. var i = e ? s.length ? s[0] : void 0 : s;
  16221. _this21.mixinDatacomResData = i, t && t(i);
  16222. }).catch(function (e) {
  16223. _this21.mixinDatacomLoading = !1, _this21.mixinDatacomErrorMessage = e, n && n(e);
  16224. }));
  16225. },
  16226. mixinDatacomGet: function mixinDatacomGet() {
  16227. var _n12;
  16228. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  16229. var n = e.database(this.spaceInfo);
  16230. var s = t.action || this.action;
  16231. s && (n = n.action(s));
  16232. var r = t.collection || this.collection;
  16233. n = Array.isArray(r) ? (_n12 = n).collection.apply(_n12, (0, _toConsumableArray2.default)(r)) : n.collection(r);
  16234. var i = t.where || this.where;
  16235. i && Object.keys(i).length && (n = n.where(i));
  16236. var o = t.field || this.field;
  16237. o && (n = n.field(o));
  16238. var a = t.foreignKey || this.foreignKey;
  16239. a && (n = n.foreignKey(a));
  16240. var c = t.groupby || this.groupby;
  16241. c && (n = n.groupBy(c));
  16242. var u = t.groupField || this.groupField;
  16243. u && (n = n.groupField(u));
  16244. !0 === (void 0 !== t.distinct ? t.distinct : this.distinct) && (n = n.distinct());
  16245. var l = t.orderby || this.orderby;
  16246. l && (n = n.orderBy(l));
  16247. var h = void 0 !== t.pageCurrent ? t.pageCurrent : this.mixinDatacomPage.current,
  16248. d = void 0 !== t.pageSize ? t.pageSize : this.mixinDatacomPage.size,
  16249. p = void 0 !== t.getcount ? t.getcount : this.getcount,
  16250. f = void 0 !== t.gettree ? t.gettree : this.gettree,
  16251. g = void 0 !== t.gettreepath ? t.gettreepath : this.gettreepath,
  16252. m = {
  16253. getCount: p
  16254. },
  16255. y = {
  16256. limitLevel: void 0 !== t.limitlevel ? t.limitlevel : this.limitlevel,
  16257. startWith: void 0 !== t.startwith ? t.startwith : this.startwith
  16258. };
  16259. return f && (m.getTree = y), g && (m.getTreePath = y), n = n.skip(d * (h - 1)).limit(d).get(m), n;
  16260. }
  16261. }
  16262. };
  16263. }
  16264. function ks(e) {
  16265. return function (t) {
  16266. var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16267. n = function (e) {
  16268. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16269. 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;
  16270. }({
  16271. customUI: !1,
  16272. loadingOptions: {
  16273. title: "加载中...",
  16274. mask: !0
  16275. },
  16276. errorOptions: {
  16277. type: "modal",
  16278. retry: !1
  16279. }
  16280. }, n);
  16281. var _n13 = n,
  16282. s = _n13.customUI,
  16283. r = _n13.loadingOptions,
  16284. i = _n13.errorOptions,
  16285. o = _n13.parseSystemError,
  16286. a = !s;
  16287. return new Proxy({}, {
  16288. get: function get(s, c) {
  16289. return function () {
  16290. var _ref48 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16291. e = _ref48.fn,
  16292. t = _ref48.interceptorName,
  16293. n = _ref48.getCallbackArgs;
  16294. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50() {
  16295. var _len2,
  16296. s,
  16297. _key2,
  16298. r,
  16299. i,
  16300. o,
  16301. _args = arguments;
  16302. return _regenerator.default.wrap(function _callee50$(_context50) {
  16303. while (1) {
  16304. switch (_context50.prev = _context50.next) {
  16305. case 0:
  16306. for (_len2 = _args.length, s = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  16307. s[_key2] = _args[_key2];
  16308. }
  16309. r = n ? n({
  16310. params: s
  16311. }) : {};
  16312. _context50.prev = 2;
  16313. _context50.next = 5;
  16314. return q(K(t, "invoke"), _objectSpread({}, r));
  16315. case 5:
  16316. _context50.next = 7;
  16317. return e.apply(void 0, s);
  16318. case 7:
  16319. i = _context50.sent;
  16320. _context50.next = 10;
  16321. return q(K(t, "success"), _objectSpread(_objectSpread({}, r), {}, {
  16322. result: i
  16323. }));
  16324. case 10:
  16325. return _context50.abrupt("return", i);
  16326. case 13:
  16327. _context50.prev = 13;
  16328. _context50.t0 = _context50["catch"](2);
  16329. o = _context50.t0;
  16330. _context50.next = 18;
  16331. return q(K(t, "fail"), _objectSpread(_objectSpread({}, r), {}, {
  16332. error: o
  16333. }));
  16334. case 18:
  16335. throw o;
  16336. case 19:
  16337. _context50.prev = 19;
  16338. _context50.next = 22;
  16339. return q(K(t, "complete"), o ? _objectSpread(_objectSpread({}, r), {}, {
  16340. error: o
  16341. }) : _objectSpread(_objectSpread({}, r), {}, {
  16342. result: i
  16343. }));
  16344. case 22:
  16345. return _context50.finish(19);
  16346. case 23:
  16347. case "end":
  16348. return _context50.stop();
  16349. }
  16350. }
  16351. }, _callee50, null, [[2, 13, 19, 23]]);
  16352. }));
  16353. }({
  16354. fn: function () {
  16355. var _s14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52() {
  16356. var h,
  16357. _len3,
  16358. u,
  16359. _key3,
  16360. d,
  16361. p,
  16362. _ref50,
  16363. f,
  16364. g,
  16365. m,
  16366. y,
  16367. _e27,
  16368. _yield,
  16369. _t18,
  16370. _n14,
  16371. _args4 = arguments;
  16372. return _regenerator.default.wrap(function _callee52$(_context52) {
  16373. while (1) {
  16374. switch (_context52.prev = _context52.next) {
  16375. case 0:
  16376. a && uni.showLoading({
  16377. title: r.title,
  16378. mask: r.mask
  16379. });
  16380. for (_len3 = _args4.length, u = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  16381. u[_key3] = _args4[_key3];
  16382. }
  16383. d = {
  16384. name: t,
  16385. type: l,
  16386. data: {
  16387. method: c,
  16388. params: u
  16389. }
  16390. };
  16391. "object" == (0, _typeof2.default)(n.secretMethods) && function (e, t) {
  16392. var n = t.data.method,
  16393. s = e.secretMethods || {},
  16394. r = s[n] || s["*"];
  16395. r && (t.secretType = r);
  16396. }(n, d);
  16397. p = !1;
  16398. _context52.prev = 5;
  16399. _context52.next = 8;
  16400. return e.callFunction(d);
  16401. case 8:
  16402. h = _context52.sent;
  16403. _context52.next = 14;
  16404. break;
  16405. case 11:
  16406. _context52.prev = 11;
  16407. _context52.t0 = _context52["catch"](5);
  16408. p = !0, h = {
  16409. result: new ne(_context52.t0)
  16410. };
  16411. case 14:
  16412. _ref50 = h.result || {}, f = _ref50.errSubject, g = _ref50.errCode, m = _ref50.errMsg, y = _ref50.newToken;
  16413. if (!(a && uni.hideLoading(), y && y.token && y.tokenExpired && (ie(y), Q(W, _objectSpread({}, y))), g)) {
  16414. _context52.next = 39;
  16415. break;
  16416. }
  16417. _e27 = m;
  16418. if (!(p && o)) {
  16419. _context52.next = 24;
  16420. break;
  16421. }
  16422. _context52.next = 20;
  16423. return o({
  16424. objectName: t,
  16425. methodName: c,
  16426. params: u,
  16427. errSubject: f,
  16428. errCode: g,
  16429. errMsg: m
  16430. });
  16431. case 20:
  16432. _context52.t1 = _context52.sent.errMsg;
  16433. if (_context52.t1) {
  16434. _context52.next = 23;
  16435. break;
  16436. }
  16437. _context52.t1 = m;
  16438. case 23:
  16439. _e27 = _context52.t1;
  16440. case 24:
  16441. if (!a) {
  16442. _context52.next = 37;
  16443. break;
  16444. }
  16445. if (!("toast" === i.type)) {
  16446. _context52.next = 29;
  16447. break;
  16448. }
  16449. uni.showToast({
  16450. title: _e27,
  16451. icon: "none"
  16452. });
  16453. _context52.next = 37;
  16454. break;
  16455. case 29:
  16456. if (!("modal" !== i.type)) {
  16457. _context52.next = 31;
  16458. break;
  16459. }
  16460. throw new Error("Invalid errorOptions.type: ".concat(i.type));
  16461. case 31:
  16462. _context52.next = 33;
  16463. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51() {
  16464. var _ref52,
  16465. e,
  16466. t,
  16467. n,
  16468. s,
  16469. r,
  16470. _args2 = arguments;
  16471. return _regenerator.default.wrap(function _callee51$(_context51) {
  16472. while (1) {
  16473. switch (_context51.prev = _context51.next) {
  16474. case 0:
  16475. _ref52 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, e = _ref52.title, t = _ref52.content, n = _ref52.showCancel, s = _ref52.cancelText, r = _ref52.confirmText;
  16476. return _context51.abrupt("return", new Promise(function (i, o) {
  16477. uni.showModal({
  16478. title: e,
  16479. content: t,
  16480. showCancel: n,
  16481. cancelText: s,
  16482. confirmText: r,
  16483. success: function success(e) {
  16484. i(e);
  16485. },
  16486. fail: function fail() {
  16487. i({
  16488. confirm: !1,
  16489. cancel: !0
  16490. });
  16491. }
  16492. });
  16493. }));
  16494. case 2:
  16495. case "end":
  16496. return _context51.stop();
  16497. }
  16498. }
  16499. }, _callee51);
  16500. }))({
  16501. title: "提示",
  16502. content: _e27,
  16503. showCancel: i.retry,
  16504. cancelText: "取消",
  16505. confirmText: i.retry ? "重试" : "确定"
  16506. });
  16507. case 33:
  16508. _yield = _context52.sent;
  16509. _t18 = _yield.confirm;
  16510. if (!(i.retry && _t18)) {
  16511. _context52.next = 37;
  16512. break;
  16513. }
  16514. return _context52.abrupt("return", s.apply(void 0, u));
  16515. case 37:
  16516. _n14 = new ne({
  16517. subject: f,
  16518. code: g,
  16519. message: m,
  16520. requestId: h.requestId
  16521. });
  16522. throw _n14.detail = h.result, Q(B, {
  16523. type: H,
  16524. content: _n14
  16525. }), _n14;
  16526. case 39:
  16527. return _context52.abrupt("return", (Q(B, {
  16528. type: H,
  16529. content: h.result
  16530. }), h.result));
  16531. case 40:
  16532. case "end":
  16533. return _context52.stop();
  16534. }
  16535. }
  16536. }, _callee52, null, [[5, 11]]);
  16537. }));
  16538. function s() {
  16539. return _s14.apply(this, arguments);
  16540. }
  16541. return s;
  16542. }(),
  16543. interceptorName: "callObject",
  16544. getCallbackArgs: function getCallbackArgs() {
  16545. var _ref53 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16546. e = _ref53.params;
  16547. return {
  16548. objectName: t,
  16549. methodName: c,
  16550. params: e
  16551. };
  16552. }
  16553. });
  16554. }
  16555. });
  16556. };
  16557. }
  16558. function Is(e) {
  16559. return U("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e.config.spaceId));
  16560. }
  16561. function Ts() {
  16562. return _Ts.apply(this, arguments);
  16563. }
  16564. function _Ts() {
  16565. _Ts = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54() {
  16566. var _ref60,
  16567. e,
  16568. _ref60$callLoginByWei,
  16569. t,
  16570. n,
  16571. s,
  16572. r,
  16573. _args6 = arguments;
  16574. return _regenerator.default.wrap(function _callee54$(_context54) {
  16575. while (1) {
  16576. switch (_context54.prev = _context54.next) {
  16577. case 0:
  16578. _ref60 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, e = _ref60.openid, _ref60$callLoginByWei = _ref60.callLoginByWeixin, t = _ref60$callLoginByWei === void 0 ? !1 : _ref60$callLoginByWei;
  16579. n = Is(this);
  16580. if (!("mp-weixin" !== A)) {
  16581. _context54.next = 4;
  16582. break;
  16583. }
  16584. throw new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `".concat(A, "`"));
  16585. case 4:
  16586. if (!(e && t)) {
  16587. _context54.next = 6;
  16588. break;
  16589. }
  16590. throw new Error("[SecureNetwork] openid and callLoginByWeixin cannot be passed at the same time");
  16591. case 6:
  16592. if (!e) {
  16593. _context54.next = 8;
  16594. break;
  16595. }
  16596. return _context54.abrupt("return", (n.mpWeixinOpenid = e, {}));
  16597. case 8:
  16598. _context54.next = 10;
  16599. return new Promise(function (e, t) {
  16600. uni.login({
  16601. success: function success(t) {
  16602. e(t.code);
  16603. },
  16604. fail: function fail(e) {
  16605. t(new Error(e.errMsg));
  16606. }
  16607. });
  16608. });
  16609. case 10:
  16610. s = _context54.sent;
  16611. r = this.importObject("uni-id-co", {
  16612. customUI: !0
  16613. });
  16614. _context54.next = 14;
  16615. return r.secureNetworkHandshakeByWeixin({
  16616. code: s,
  16617. callLoginByWeixin: t
  16618. });
  16619. case 14:
  16620. n.mpWeixinCode = s;
  16621. return _context54.abrupt("return", {
  16622. code: s
  16623. });
  16624. case 16:
  16625. case "end":
  16626. return _context54.stop();
  16627. }
  16628. }
  16629. }, _callee54, this);
  16630. }));
  16631. return _Ts.apply(this, arguments);
  16632. }
  16633. function Cs(_x37) {
  16634. return _Cs.apply(this, arguments);
  16635. }
  16636. function _Cs() {
  16637. _Cs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55(e) {
  16638. var t;
  16639. return _regenerator.default.wrap(function _callee55$(_context55) {
  16640. while (1) {
  16641. switch (_context55.prev = _context55.next) {
  16642. case 0:
  16643. t = Is(this);
  16644. return _context55.abrupt("return", (t.initPromise || (t.initPromise = Ts.call(this, e)), t.initPromise));
  16645. case 2:
  16646. case "end":
  16647. return _context55.stop();
  16648. }
  16649. }
  16650. }, _callee55, this);
  16651. }));
  16652. return _Cs.apply(this, arguments);
  16653. }
  16654. function As(e) {
  16655. return function () {
  16656. var _ref54 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16657. t = _ref54.openid,
  16658. _ref54$callLoginByWei = _ref54.callLoginByWeixin,
  16659. n = _ref54$callLoginByWei === void 0 ? !1 : _ref54$callLoginByWei;
  16660. return Cs.call(e, {
  16661. openid: t,
  16662. callLoginByWeixin: n
  16663. });
  16664. };
  16665. }
  16666. function Ps(_x38, _x39) {
  16667. return _Ps.apply(this, arguments);
  16668. }
  16669. function _Ps() {
  16670. _Ps = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee56(e, t) {
  16671. var n, _e31, s;
  16672. return _regenerator.default.wrap(function _callee56$(_context56) {
  16673. while (1) {
  16674. switch (_context56.prev = _context56.next) {
  16675. case 0:
  16676. n = "http://".concat(e, ":").concat(t, "/system/ping");
  16677. _context56.prev = 1;
  16678. _context56.next = 4;
  16679. return s = {
  16680. url: n,
  16681. timeout: 500
  16682. }, new Promise(function (e, t) {
  16683. se.request(_objectSpread(_objectSpread({}, s), {}, {
  16684. success: function success(t) {
  16685. e(t);
  16686. },
  16687. fail: function fail(e) {
  16688. t(e);
  16689. }
  16690. }));
  16691. });
  16692. case 4:
  16693. _e31 = _context56.sent;
  16694. return _context56.abrupt("return", !(!_e31.data || 0 !== _e31.data.code));
  16695. case 8:
  16696. _context56.prev = 8;
  16697. _context56.t0 = _context56["catch"](1);
  16698. return _context56.abrupt("return", !1);
  16699. case 11:
  16700. case "end":
  16701. return _context56.stop();
  16702. }
  16703. }
  16704. }, _callee56, null, [[1, 8]]);
  16705. }));
  16706. return _Ps.apply(this, arguments);
  16707. }
  16708. function Es(_x40) {
  16709. return _Es.apply(this, arguments);
  16710. }
  16711. function _Es() {
  16712. _Es = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58(e) {
  16713. var _ce2, _e32, _t20, t, _t$debugInfo, n, s, _yield2, r, i, o;
  16714. return _regenerator.default.wrap(function _callee58$(_context58) {
  16715. while (1) {
  16716. switch (_context58.prev = _context58.next) {
  16717. case 0:
  16718. if (k) {
  16719. _context58.next = 2;
  16720. break;
  16721. }
  16722. return _context58.abrupt("return", Promise.resolve());
  16723. case 2:
  16724. if ("app" === A) {
  16725. _ce2 = ce(), _e32 = _ce2.osName, _t20 = _ce2.osVersion;
  16726. "ios" === _e32 && function (e) {
  16727. if (!e || "string" != typeof e) return 0;
  16728. var t = e.match(/^(\d+)./);
  16729. return t && t[1] ? parseInt(t[1]) : 0;
  16730. }(_t20) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发模式生效,发行模式会连接uniCloud云端服务)");
  16731. }
  16732. t = e.__dev__;
  16733. if (t.debugInfo) {
  16734. _context58.next = 6;
  16735. break;
  16736. }
  16737. return _context58.abrupt("return");
  16738. case 6:
  16739. _t$debugInfo = t.debugInfo;
  16740. n = _t$debugInfo.address;
  16741. s = _t$debugInfo.servePort;
  16742. _context58.next = 11;
  16743. return function () {
  16744. var _ref61 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57(e, t) {
  16745. var n, _s15, _r8;
  16746. return _regenerator.default.wrap(function _callee57$(_context57) {
  16747. while (1) {
  16748. switch (_context57.prev = _context57.next) {
  16749. case 0:
  16750. _s15 = 0;
  16751. case 1:
  16752. if (!(_s15 < e.length)) {
  16753. _context57.next = 11;
  16754. break;
  16755. }
  16756. _r8 = e[_s15];
  16757. _context57.next = 5;
  16758. return Ps(_r8, t);
  16759. case 5:
  16760. if (!_context57.sent) {
  16761. _context57.next = 8;
  16762. break;
  16763. }
  16764. n = _r8;
  16765. return _context57.abrupt("break", 11);
  16766. case 8:
  16767. _s15++;
  16768. _context57.next = 1;
  16769. break;
  16770. case 11:
  16771. return _context57.abrupt("return", {
  16772. address: n,
  16773. port: t
  16774. });
  16775. case 12:
  16776. case "end":
  16777. return _context57.stop();
  16778. }
  16779. }
  16780. }, _callee57);
  16781. }));
  16782. return function (_x41, _x42) {
  16783. return _ref61.apply(this, arguments);
  16784. };
  16785. }()(n, s);
  16786. case 11:
  16787. _yield2 = _context58.sent;
  16788. r = _yield2.address;
  16789. if (!r) {
  16790. _context58.next = 15;
  16791. break;
  16792. }
  16793. return _context58.abrupt("return", (t.localAddress = r, void (t.localPort = s)));
  16794. case 15:
  16795. i = console["app" === A ? "error" : "warn"];
  16796. o = "";
  16797. 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" === A && (o += "\n- 部分浏览器开启节流模式之后访问本地地址受限,请检查是否启用了节流模式"), 0 === A.indexOf("mp-") && (o += "\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"), !t.debugInfo.forceRemote)) {
  16798. _context58.next = 19;
  16799. break;
  16800. }
  16801. throw new Error(o);
  16802. case 19:
  16803. i(o);
  16804. case 20:
  16805. case "end":
  16806. return _context58.stop();
  16807. }
  16808. }
  16809. }, _callee58);
  16810. }));
  16811. return _Es.apply(this, arguments);
  16812. }
  16813. function Os(e) {
  16814. e._initPromiseHub || (e._initPromiseHub = new b({
  16815. createPromise: function createPromise() {
  16816. var t = Promise.resolve();
  16817. var n;
  16818. n = 1, t = new Promise(function (e) {
  16819. setTimeout(function () {
  16820. e();
  16821. }, n);
  16822. });
  16823. var s = e.auth();
  16824. return t.then(function () {
  16825. return s.getLoginState();
  16826. }).then(function (e) {
  16827. return e ? Promise.resolve() : s.signInAnonymously();
  16828. });
  16829. }
  16830. }));
  16831. }
  16832. var xs = {
  16833. tcb: bt,
  16834. tencent: bt,
  16835. aliyun: ge,
  16836. private: kt
  16837. };
  16838. var Rs = new ( /*#__PURE__*/function () {
  16839. function _class6() {
  16840. (0, _classCallCheck2.default)(this, _class6);
  16841. }
  16842. (0, _createClass2.default)(_class6, [{
  16843. key: "init",
  16844. value: function init(e) {
  16845. var t = {};
  16846. var n = xs[e.provider];
  16847. if (!n) throw new Error("未提供正确的provider参数");
  16848. t = n.init(e), k && function (e) {
  16849. if (!k) return;
  16850. var t = {};
  16851. e.__dev__ = t, t.debugLog = k && ("web" === A && navigator.userAgent.indexOf("HBuilderX") > 0 || "app" === A);
  16852. var n = P;
  16853. n && !n.code && (t.debugInfo = n);
  16854. var s = new b({
  16855. createPromise: function createPromise() {
  16856. return Es(e);
  16857. }
  16858. });
  16859. t.initLocalNetwork = function () {
  16860. return s.exec();
  16861. };
  16862. }(t), Os(t), xn(t), function (e) {
  16863. var t = e.uploadFile;
  16864. e.uploadFile = function (e) {
  16865. return t.call(this, e);
  16866. };
  16867. }(t), function (e) {
  16868. e.database = function (t) {
  16869. if (t && Object.keys(t).length > 0) return e.init(t).database();
  16870. if (this._database) return this._database;
  16871. var n = Bn($n, {
  16872. uniClient: e
  16873. });
  16874. return this._database = n, n;
  16875. }, e.databaseForJQL = function (t) {
  16876. if (t && Object.keys(t).length > 0) return e.init(t).databaseForJQL();
  16877. if (this._databaseForJQL) return this._databaseForJQL;
  16878. var n = Bn($n, {
  16879. uniClient: e,
  16880. isJQL: !0
  16881. });
  16882. return this._databaseForJQL = n, n;
  16883. };
  16884. }(t), function (e) {
  16885. e.getCurrentUserInfo = _s, e.chooseAndUploadFile = vs.initChooseAndUploadFile(e), Object.assign(e, {
  16886. get mixinDatacom() {
  16887. return Ss(e);
  16888. }
  16889. }), e.importObject = ks(e), e.initSecureNetworkByWeixin = As(e);
  16890. }(t);
  16891. return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach(function (e) {
  16892. if (!t[e]) return;
  16893. var n = t[e];
  16894. t[e] = function () {
  16895. return n.apply(t, Array.from(arguments));
  16896. }, t[e] = function (e, t) {
  16897. return function (n) {
  16898. var _this22 = this;
  16899. var s = !1;
  16900. if ("callFunction" === t) {
  16901. var _e28 = n && n.type || u;
  16902. s = _e28 !== u;
  16903. }
  16904. var r = "callFunction" === t && !s,
  16905. i = this._initPromiseHub.exec();
  16906. n = n || {};
  16907. var _te2 = te(n),
  16908. o = _te2.success,
  16909. a = _te2.fail,
  16910. c = _te2.complete,
  16911. l = i.then(function () {
  16912. return s ? Promise.resolve() : q(K(t, "invoke"), n);
  16913. }).then(function () {
  16914. return e.call(_this22, n);
  16915. }).then(function (e) {
  16916. return s ? Promise.resolve(e) : q(K(t, "success"), e).then(function () {
  16917. return q(K(t, "complete"), e);
  16918. }).then(function () {
  16919. return r && Q(B, {
  16920. type: J,
  16921. content: e
  16922. }), Promise.resolve(e);
  16923. });
  16924. }, function (e) {
  16925. return s ? Promise.reject(e) : q(K(t, "fail"), e).then(function () {
  16926. return q(K(t, "complete"), e);
  16927. }).then(function () {
  16928. return Q(B, {
  16929. type: J,
  16930. content: e
  16931. }), Promise.reject(e);
  16932. });
  16933. });
  16934. if (!(o || a || c)) return l;
  16935. l.then(function (e) {
  16936. o && o(e), c && c(e), r && Q(B, {
  16937. type: J,
  16938. content: e
  16939. });
  16940. }, function (e) {
  16941. a && a(e), c && c(e), r && Q(B, {
  16942. type: J,
  16943. content: e
  16944. });
  16945. });
  16946. };
  16947. }(t[e], e).bind(t);
  16948. }), t.init = this.init, t;
  16949. }
  16950. }]);
  16951. return _class6;
  16952. }())();
  16953. (function () {
  16954. var e = E;
  16955. var t = {};
  16956. if (e && 1 === e.length) t = e[0], Rs = Rs.init(t), Rs._isDefault = !0;else {
  16957. var _t19 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
  16958. var _n15;
  16959. _n15 = e && e.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : O ? "应用未关联服务空间,请在uniCloud目录右键关联服务空间" : "uni-app cli项目内使用uniCloud需要使用HBuilderX的运行菜单运行项目,且需要在uniCloud目录关联服务空间", _t19.forEach(function (e) {
  16960. Rs[e] = function () {
  16961. return console.error(_n15), Promise.reject(new ne({
  16962. code: "SYS_ERR",
  16963. message: _n15
  16964. }));
  16965. };
  16966. });
  16967. }
  16968. Object.assign(Rs, {
  16969. get mixinDatacom() {
  16970. return Ss(Rs);
  16971. }
  16972. }), fs(Rs), Rs.addInterceptor = D, Rs.removeInterceptor = F, Rs.interceptObject = M, k && "web" === A && (window.uniCloud = Rs);
  16973. })();
  16974. var Us = Rs;
  16975. exports.default = Us;
  16976. /* 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"]))
  16977. /***/ }),
  16978. /* 93 */
  16979. /*!*********************************************************!*\
  16980. !*** ./node_modules/@babel/runtime/helpers/inherits.js ***!
  16981. \*********************************************************/
  16982. /*! no static exports found */
  16983. /***/ (function(module, exports, __webpack_require__) {
  16984. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  16985. function _inherits(subClass, superClass) {
  16986. if (typeof superClass !== "function" && superClass !== null) {
  16987. throw new TypeError("Super expression must either be null or a function");
  16988. }
  16989. subClass.prototype = Object.create(superClass && superClass.prototype, {
  16990. constructor: {
  16991. value: subClass,
  16992. writable: true,
  16993. configurable: true
  16994. }
  16995. });
  16996. Object.defineProperty(subClass, "prototype", {
  16997. writable: false
  16998. });
  16999. if (superClass) setPrototypeOf(subClass, superClass);
  17000. }
  17001. module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17002. /***/ }),
  17003. /* 94 */
  17004. /*!**************************************************************************!*\
  17005. !*** ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
  17006. \**************************************************************************/
  17007. /*! no static exports found */
  17008. /***/ (function(module, exports, __webpack_require__) {
  17009. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  17010. var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ 95);
  17011. function _possibleConstructorReturn(self, call) {
  17012. if (call && (_typeof(call) === "object" || typeof call === "function")) {
  17013. return call;
  17014. } else if (call !== void 0) {
  17015. throw new TypeError("Derived constructors may only return object or undefined");
  17016. }
  17017. return assertThisInitialized(self);
  17018. }
  17019. module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17020. /***/ }),
  17021. /* 95 */
  17022. /*!**********************************************************************!*\
  17023. !*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
  17024. \**********************************************************************/
  17025. /*! no static exports found */
  17026. /***/ (function(module, exports) {
  17027. function _assertThisInitialized(self) {
  17028. if (self === void 0) {
  17029. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  17030. }
  17031. return self;
  17032. }
  17033. module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17034. /***/ }),
  17035. /* 96 */
  17036. /*!***************************************************************!*\
  17037. !*** ./node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
  17038. \***************************************************************/
  17039. /*! no static exports found */
  17040. /***/ (function(module, exports) {
  17041. function _getPrototypeOf(o) {
  17042. module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
  17043. return o.__proto__ || Object.getPrototypeOf(o);
  17044. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17045. return _getPrototypeOf(o);
  17046. }
  17047. module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17048. /***/ }),
  17049. /* 97 */
  17050. /*!****************************************************************!*\
  17051. !*** ./node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
  17052. \****************************************************************/
  17053. /*! no static exports found */
  17054. /***/ (function(module, exports, __webpack_require__) {
  17055. var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ 96);
  17056. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  17057. var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ 98);
  17058. var construct = __webpack_require__(/*! ./construct.js */ 15);
  17059. function _wrapNativeSuper(Class) {
  17060. var _cache = typeof Map === "function" ? new Map() : undefined;
  17061. module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
  17062. if (Class === null || !isNativeFunction(Class)) return Class;
  17063. if (typeof Class !== "function") {
  17064. throw new TypeError("Super expression must either be null or a function");
  17065. }
  17066. if (typeof _cache !== "undefined") {
  17067. if (_cache.has(Class)) return _cache.get(Class);
  17068. _cache.set(Class, Wrapper);
  17069. }
  17070. function Wrapper() {
  17071. return construct(Class, arguments, getPrototypeOf(this).constructor);
  17072. }
  17073. Wrapper.prototype = Object.create(Class.prototype, {
  17074. constructor: {
  17075. value: Wrapper,
  17076. enumerable: false,
  17077. writable: true,
  17078. configurable: true
  17079. }
  17080. });
  17081. return setPrototypeOf(Wrapper, Class);
  17082. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17083. return _wrapNativeSuper(Class);
  17084. }
  17085. module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17086. /***/ }),
  17087. /* 98 */
  17088. /*!*****************************************************************!*\
  17089. !*** ./node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
  17090. \*****************************************************************/
  17091. /*! no static exports found */
  17092. /***/ (function(module, exports) {
  17093. function _isNativeFunction(fn) {
  17094. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  17095. }
  17096. module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17097. /***/ }),
  17098. /* 99 */
  17099. /*!************************************************************************************!*\
  17100. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/pages.json?{"type":"origin-pages-json"} ***!
  17101. \************************************************************************************/
  17102. /*! no static exports found */
  17103. /***/ (function(module, exports, __webpack_require__) {
  17104. "use strict";
  17105. Object.defineProperty(exports, "__esModule", {
  17106. value: true
  17107. });
  17108. exports.default = void 0;
  17109. var _default = {
  17110. "pages": [{
  17111. "path": "pages/login/index",
  17112. "style": {
  17113. "navigationBarTitleText": "地块管护",
  17114. "navigationStyle": "custom"
  17115. }
  17116. }, {
  17117. "path": "pages/main/index",
  17118. "style": {
  17119. "navigationBarTitleText": "地块管护",
  17120. "navigationStyle": "custom"
  17121. }
  17122. }, {
  17123. "path": "pages/receivedDetail/index",
  17124. "style": {
  17125. "navigationBarTitleText": "地块管护",
  17126. "navigationStyle": "custom"
  17127. }
  17128. }, {
  17129. "path": "pages/nocheckDetail/index",
  17130. "style": {
  17131. "navigationBarTitleText": "地块管护",
  17132. "navigationStyle": "custom"
  17133. }
  17134. }],
  17135. "globalStyle": {
  17136. "navigationBarTextStyle": "black",
  17137. "navigationBarTitleText": "uni-app",
  17138. "navigationBarBackgroundColor": "#F8F8F8",
  17139. "backgroundColor": "#F8F8F8"
  17140. },
  17141. "uniIdRouter": {},
  17142. "condition": {
  17143. "current": 0,
  17144. "list": [{
  17145. "name": "",
  17146. "path": "",
  17147. "query": ""
  17148. }]
  17149. }
  17150. };
  17151. exports.default = _default;
  17152. /***/ }),
  17153. /* 100 */
  17154. /*!***********************************************************************!*\
  17155. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/pages.json?{"type":"stat"} ***!
  17156. \***********************************************************************/
  17157. /*! no static exports found */
  17158. /***/ (function(module, exports, __webpack_require__) {
  17159. "use strict";
  17160. Object.defineProperty(exports, "__esModule", {
  17161. value: true
  17162. });
  17163. exports.default = void 0;
  17164. var _default = {
  17165. "appid": "__UNI__50B3EE1"
  17166. };
  17167. exports.default = _default;
  17168. /***/ }),
  17169. /* 101 */
  17170. /*!*****************************************************************************************************************************!*\
  17171. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js ***!
  17172. \*****************************************************************************************************************************/
  17173. /*! no static exports found */
  17174. /***/ (function(module, exports, __webpack_require__) {
  17175. "use strict";
  17176. /* WEBPACK VAR INJECTION */(function(uni, wx, uniCloud) {
  17177. Object.defineProperty(exports, "__esModule", {
  17178. value: true
  17179. });
  17180. exports.chooseAndUploadFile = chooseAndUploadFile;
  17181. exports.uploadCloudFiles = uploadCloudFiles;
  17182. var ERR_MSG_OK = 'chooseAndUploadFile:ok';
  17183. var ERR_MSG_FAIL = 'chooseAndUploadFile:fail';
  17184. function chooseImage(opts) {
  17185. var count = opts.count,
  17186. _opts$sizeType = opts.sizeType,
  17187. sizeType = _opts$sizeType === void 0 ? ['original', 'compressed'] : _opts$sizeType,
  17188. sourceType = opts.sourceType,
  17189. extension = opts.extension;
  17190. return new Promise(function (resolve, reject) {
  17191. uni.chooseImage({
  17192. count: count,
  17193. sizeType: sizeType,
  17194. sourceType: sourceType,
  17195. extension: extension,
  17196. success: function success(res) {
  17197. resolve(normalizeChooseAndUploadFileRes(res, 'image'));
  17198. },
  17199. fail: function fail(res) {
  17200. reject({
  17201. errMsg: res.errMsg.replace('chooseImage:fail', ERR_MSG_FAIL)
  17202. });
  17203. }
  17204. });
  17205. });
  17206. }
  17207. function chooseVideo(opts) {
  17208. var camera = opts.camera,
  17209. compressed = opts.compressed,
  17210. maxDuration = opts.maxDuration,
  17211. sourceType = opts.sourceType,
  17212. extension = opts.extension;
  17213. return new Promise(function (resolve, reject) {
  17214. uni.chooseVideo({
  17215. camera: camera,
  17216. compressed: compressed,
  17217. maxDuration: maxDuration,
  17218. sourceType: sourceType,
  17219. extension: extension,
  17220. success: function success(res) {
  17221. var tempFilePath = res.tempFilePath,
  17222. duration = res.duration,
  17223. size = res.size,
  17224. height = res.height,
  17225. width = res.width;
  17226. resolve(normalizeChooseAndUploadFileRes({
  17227. errMsg: 'chooseVideo:ok',
  17228. tempFilePaths: [tempFilePath],
  17229. tempFiles: [{
  17230. name: res.tempFile && res.tempFile.name || '',
  17231. path: tempFilePath,
  17232. size: size,
  17233. type: res.tempFile && res.tempFile.type || '',
  17234. width: width,
  17235. height: height,
  17236. duration: duration,
  17237. fileType: 'video',
  17238. cloudPath: ''
  17239. }]
  17240. }, 'video'));
  17241. },
  17242. fail: function fail(res) {
  17243. reject({
  17244. errMsg: res.errMsg.replace('chooseVideo:fail', ERR_MSG_FAIL)
  17245. });
  17246. }
  17247. });
  17248. });
  17249. }
  17250. function chooseAll(opts) {
  17251. var count = opts.count,
  17252. extension = opts.extension;
  17253. return new Promise(function (resolve, reject) {
  17254. var chooseFile = uni.chooseFile;
  17255. if (typeof wx !== 'undefined' && typeof wx.chooseMessageFile === 'function') {
  17256. chooseFile = wx.chooseMessageFile;
  17257. }
  17258. if (typeof chooseFile !== 'function') {
  17259. return reject({
  17260. errMsg: ERR_MSG_FAIL + ' 请指定 type 类型,该平台仅支持选择 image 或 video。'
  17261. });
  17262. }
  17263. chooseFile({
  17264. type: 'all',
  17265. count: count,
  17266. extension: extension,
  17267. success: function success(res) {
  17268. resolve(normalizeChooseAndUploadFileRes(res));
  17269. },
  17270. fail: function fail(res) {
  17271. reject({
  17272. errMsg: res.errMsg.replace('chooseFile:fail', ERR_MSG_FAIL)
  17273. });
  17274. }
  17275. });
  17276. });
  17277. }
  17278. function normalizeChooseAndUploadFileRes(res, fileType) {
  17279. res.tempFiles.forEach(function (item, index) {
  17280. if (!item.name) {
  17281. item.name = item.path.substring(item.path.lastIndexOf('/') + 1);
  17282. }
  17283. if (fileType) {
  17284. item.fileType = fileType;
  17285. }
  17286. item.cloudPath = Date.now() + '_' + index + item.name.substring(item.name.lastIndexOf('.'));
  17287. });
  17288. if (!res.tempFilePaths) {
  17289. res.tempFilePaths = res.tempFiles.map(function (file) {
  17290. return file.path;
  17291. });
  17292. }
  17293. return res;
  17294. }
  17295. function uploadCloudFiles(files) {
  17296. var max = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
  17297. var _onUploadProgress = arguments.length > 2 ? arguments[2] : undefined;
  17298. files = JSON.parse(JSON.stringify(files));
  17299. var len = files.length;
  17300. var count = 0;
  17301. var self = this;
  17302. return new Promise(function (resolve) {
  17303. while (count < max) {
  17304. next();
  17305. }
  17306. function next() {
  17307. var cur = count++;
  17308. if (cur >= len) {
  17309. !files.find(function (item) {
  17310. return !item.url && !item.errMsg;
  17311. }) && resolve(files);
  17312. return;
  17313. }
  17314. var fileItem = files[cur];
  17315. var index = self.files.findIndex(function (v) {
  17316. return v.uuid === fileItem.uuid;
  17317. });
  17318. fileItem.url = '';
  17319. delete fileItem.errMsg;
  17320. uniCloud.uploadFile({
  17321. filePath: fileItem.path,
  17322. cloudPath: fileItem.cloudPath,
  17323. fileType: fileItem.fileType,
  17324. onUploadProgress: function onUploadProgress(res) {
  17325. res.index = index;
  17326. _onUploadProgress && _onUploadProgress(res);
  17327. }
  17328. }).then(function (res) {
  17329. fileItem.url = res.fileID;
  17330. fileItem.index = index;
  17331. if (cur < len) {
  17332. next();
  17333. }
  17334. }).catch(function (res) {
  17335. fileItem.errMsg = res.errMsg || res.message;
  17336. fileItem.index = index;
  17337. if (cur < len) {
  17338. next();
  17339. }
  17340. });
  17341. }
  17342. });
  17343. }
  17344. function uploadFiles(choosePromise, _ref) {
  17345. var onChooseFile = _ref.onChooseFile,
  17346. onUploadProgress = _ref.onUploadProgress;
  17347. return choosePromise.then(function (res) {
  17348. if (onChooseFile) {
  17349. var customChooseRes = onChooseFile(res);
  17350. if (typeof customChooseRes !== 'undefined') {
  17351. return Promise.resolve(customChooseRes).then(function (chooseRes) {
  17352. return typeof chooseRes === 'undefined' ? res : chooseRes;
  17353. });
  17354. }
  17355. }
  17356. return res;
  17357. }).then(function (res) {
  17358. if (res === false) {
  17359. return {
  17360. errMsg: ERR_MSG_OK,
  17361. tempFilePaths: [],
  17362. tempFiles: []
  17363. };
  17364. }
  17365. return res;
  17366. });
  17367. }
  17368. function chooseAndUploadFile() {
  17369. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  17370. type: 'all'
  17371. };
  17372. if (opts.type === 'image') {
  17373. return uploadFiles(chooseImage(opts), opts);
  17374. } else if (opts.type === 'video') {
  17375. return uploadFiles(chooseVideo(opts), opts);
  17376. }
  17377. return uploadFiles(chooseAll(opts), opts);
  17378. }
  17379. /* 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 */ 92)["default"]))
  17380. /***/ }),
  17381. /* 102 */
  17382. /*!************************************************************************************************************!*\
  17383. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/uni_modules/uni-file-picker/components/uni-file-picker/utils.js ***!
  17384. \************************************************************************************************************/
  17385. /*! no static exports found */
  17386. /***/ (function(module, exports, __webpack_require__) {
  17387. "use strict";
  17388. /* WEBPACK VAR INJECTION */(function(uni) {
  17389. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  17390. Object.defineProperty(exports, "__esModule", {
  17391. value: true
  17392. });
  17393. exports.get_files_and_is_max = exports.get_file_info = exports.get_file_ext = exports.get_file_data = exports.get_extname = void 0;
  17394. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 68));
  17395. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 70));
  17396. /**
  17397. * 获取文件名和后缀
  17398. * @param {String} name
  17399. */
  17400. var get_file_ext = function get_file_ext(name) {
  17401. var last_len = name.lastIndexOf('.');
  17402. var len = name.length;
  17403. return {
  17404. name: name.substring(0, last_len),
  17405. ext: name.substring(last_len + 1, len)
  17406. };
  17407. };
  17408. /**
  17409. * 获取扩展名
  17410. * @param {Array} fileExtname
  17411. */
  17412. exports.get_file_ext = get_file_ext;
  17413. var get_extname = function get_extname(fileExtname) {
  17414. if (!Array.isArray(fileExtname)) {
  17415. var extname = fileExtname.replace(/(\[|\])/g, '');
  17416. return extname.split(',');
  17417. } else {
  17418. return fileExtname;
  17419. }
  17420. return [];
  17421. };
  17422. /**
  17423. * 获取文件和检测是否可选
  17424. */
  17425. exports.get_extname = get_extname;
  17426. var get_files_and_is_max = function get_files_and_is_max(res, _extname) {
  17427. var filePaths = [];
  17428. var files = [];
  17429. if (!_extname || _extname.length === 0) {
  17430. return {
  17431. filePaths: filePaths,
  17432. files: files
  17433. };
  17434. }
  17435. res.tempFiles.forEach(function (v) {
  17436. var fileFullName = get_file_ext(v.name);
  17437. var extname = fileFullName.ext.toLowerCase();
  17438. if (_extname.indexOf(extname) !== -1) {
  17439. files.push(v);
  17440. filePaths.push(v.path);
  17441. }
  17442. });
  17443. if (files.length !== res.tempFiles.length) {
  17444. uni.showToast({
  17445. 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"),
  17446. icon: 'none',
  17447. duration: 5000
  17448. });
  17449. }
  17450. return {
  17451. filePaths: filePaths,
  17452. files: files
  17453. };
  17454. };
  17455. /**
  17456. * 获取图片信息
  17457. * @param {Object} filepath
  17458. */
  17459. exports.get_files_and_is_max = get_files_and_is_max;
  17460. var get_file_info = function get_file_info(filepath) {
  17461. return new Promise(function (resolve, reject) {
  17462. uni.getImageInfo({
  17463. src: filepath,
  17464. success: function success(res) {
  17465. resolve(res);
  17466. },
  17467. fail: function fail(err) {
  17468. reject(err);
  17469. }
  17470. });
  17471. });
  17472. };
  17473. /**
  17474. * 获取封装数据
  17475. */
  17476. exports.get_file_info = get_file_info;
  17477. var get_file_data = /*#__PURE__*/function () {
  17478. var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(files) {
  17479. var type,
  17480. fileFullName,
  17481. extname,
  17482. filedata,
  17483. imageinfo,
  17484. _args = arguments;
  17485. return _regenerator.default.wrap(function _callee$(_context) {
  17486. while (1) {
  17487. switch (_context.prev = _context.next) {
  17488. case 0:
  17489. type = _args.length > 1 && _args[1] !== undefined ? _args[1] : 'image';
  17490. // 最终需要上传数据库的数据
  17491. fileFullName = get_file_ext(files.name);
  17492. extname = fileFullName.ext.toLowerCase();
  17493. filedata = {
  17494. name: files.name,
  17495. uuid: files.uuid,
  17496. extname: extname || '',
  17497. cloudPath: files.cloudPath,
  17498. fileType: files.fileType,
  17499. url: files.path || files.path,
  17500. size: files.size,
  17501. //单位是字节
  17502. image: {},
  17503. path: files.path,
  17504. video: {}
  17505. };
  17506. if (!(type === 'image')) {
  17507. _context.next = 14;
  17508. break;
  17509. }
  17510. _context.next = 7;
  17511. return get_file_info(files.path);
  17512. case 7:
  17513. imageinfo = _context.sent;
  17514. delete filedata.video;
  17515. filedata.image.width = imageinfo.width;
  17516. filedata.image.height = imageinfo.height;
  17517. filedata.image.location = imageinfo.path;
  17518. _context.next = 15;
  17519. break;
  17520. case 14:
  17521. delete filedata.image;
  17522. case 15:
  17523. return _context.abrupt("return", filedata);
  17524. case 16:
  17525. case "end":
  17526. return _context.stop();
  17527. }
  17528. }
  17529. }, _callee);
  17530. }));
  17531. return function get_file_data(_x) {
  17532. return _ref.apply(this, arguments);
  17533. };
  17534. }();
  17535. exports.get_file_data = get_file_data;
  17536. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  17537. /***/ })
  17538. ]]);
  17539. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map