vendor.js 694 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690
  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__ED9AEA5",
  753. appName: "app",
  754. appVersion: "1.0.0",
  755. appVersionCode: "100",
  756. appLanguage: getAppLanguage(hostLanguage),
  757. uniCompileVersion: "3.7.11",
  758. uniRuntimeVersion: "3.7.11",
  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__ED9AEA5",
  852. appName: "app",
  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":"app","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":"app","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":"app","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":"app","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":"app","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:/work/Project_newGit/CKQ/app/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:/work/Project_newGit/CKQ/app/api/task.js ***!
  8929. \**************************************************/
  8930. /*! no static exports found */
  8931. /***/ (function(module, exports, __webpack_require__) {
  8932. "use strict";
  8933. Object.defineProperty(exports, "__esModule", {
  8934. value: true
  8935. });
  8936. exports.batchUpdateCheckTaskDoingItem = batchUpdateCheckTaskDoingItem;
  8937. exports.cancelCheckTask = cancelCheckTask;
  8938. exports.completeCheckTask = completeCheckTask;
  8939. exports.getCheckTaskByList = getCheckTaskByList;
  8940. exports.getCheckTaskByPage = getCheckTaskByPage;
  8941. exports.getTaskDetailById = getTaskDetailById;
  8942. exports.goaftaskstatis = goaftaskstatis;
  8943. exports.handleCheckTask = handleCheckTask;
  8944. exports.manageTaskById = manageTaskById;
  8945. exports.transferCheckTask = transferCheckTask;
  8946. var _request = __webpack_require__(/*! ../libs/request.js */ 40);
  8947. /**
  8948. * 获取分页任务列表
  8949. * @param {Object} params
  8950. */
  8951. function getCheckTaskByList(data) {
  8952. return (0, _request.request)({
  8953. url: "/goaf/goaftask/list",
  8954. method: 'GET',
  8955. data: data
  8956. });
  8957. }
  8958. /**
  8959. * 获取分页任务列表
  8960. * @param {Object} data
  8961. */
  8962. function getCheckTaskByPage(data) {
  8963. return (0, _request.request)({
  8964. url: '/check/task/page',
  8965. header: {
  8966. 'content-type': "application/x-www-form-urlencoded"
  8967. },
  8968. data: data
  8969. });
  8970. }
  8971. /**
  8972. * 通过id获取详情
  8973. * @param id
  8974. */
  8975. function getTaskDetailById(id) {
  8976. return (0, _request.request)({
  8977. url: '/check/task/view/' + id
  8978. });
  8979. }
  8980. /**
  8981. * 通过id进行任务的处理操作
  8982. * @param id
  8983. */
  8984. function manageTaskById(id) {
  8985. return (0, _request.request)({
  8986. url: '/check/task/handle/' + id,
  8987. method: 'PUT'
  8988. });
  8989. }
  8990. /**
  8991. * Transfer CheckTask
  8992. * 转交任务
  8993. * @param data
  8994. * @returns {AxiosPromise}
  8995. */
  8996. function transferCheckTask(data) {
  8997. return (0, _request.request)({
  8998. url: "/check/task/transfer",
  8999. method: 'PUT',
  9000. data: data
  9001. });
  9002. }
  9003. /**
  9004. * Cancel CheckTask
  9005. * 取消任务
  9006. * @param data
  9007. * @returns {AxiosPromise}
  9008. */
  9009. function cancelCheckTask(checkTaskId) {
  9010. return (0, _request.request)({
  9011. url: "/check/task/cancel/".concat(checkTaskId),
  9012. method: 'PUT'
  9013. });
  9014. }
  9015. /**
  9016. * Complete CheckTask
  9017. * @param data
  9018. * @returns {AxiosPromise}
  9019. * 完成任务
  9020. */
  9021. function completeCheckTask(checkTaskId) {
  9022. return (0, _request.request)({
  9023. url: "/check/task/complete/".concat(checkTaskId),
  9024. method: 'PUT'
  9025. });
  9026. }
  9027. /**
  9028. * 批量更新CheckTaskDoing Item
  9029. * @param data
  9030. * @returns {AxiosPromise}
  9031. */
  9032. function batchUpdateCheckTaskDoingItem(taskId, checkResult) {
  9033. return (0, _request.request)({
  9034. url: "/check/task/doing/item/batchUpdate/".concat(taskId, "/").concat(checkResult),
  9035. method: 'PUT'
  9036. });
  9037. }
  9038. // 提交任务
  9039. function handleCheckTask(data) {
  9040. return (0, _request.request)({
  9041. url: '/goaf/goaftask/completed',
  9042. method: 'POST',
  9043. data: data
  9044. });
  9045. }
  9046. // 任务统计
  9047. function goaftaskstatis(data) {
  9048. return (0, _request.request)({
  9049. url: "/goaf/goaftaskstatis",
  9050. method: 'GET',
  9051. data: data
  9052. });
  9053. }
  9054. /***/ }),
  9055. /* 40 */
  9056. /*!******************************************************!*\
  9057. !*** E:/work/Project_newGit/CKQ/app/libs/request.js ***!
  9058. \******************************************************/
  9059. /*! no static exports found */
  9060. /***/ (function(module, exports, __webpack_require__) {
  9061. "use strict";
  9062. /* WEBPACK VAR INJECTION */(function(uni) {
  9063. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9064. Object.defineProperty(exports, "__esModule", {
  9065. value: true
  9066. });
  9067. exports.request = request;
  9068. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 41));
  9069. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  9070. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 43));
  9071. var _index = _interopRequireDefault(__webpack_require__(/*! ../config/index.js */ 44));
  9072. var _auth = __webpack_require__(/*! ../libs/auth.js */ 45);
  9073. 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; }
  9074. 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; }
  9075. var baseUrl = true ? _index.default.base.dev : undefined;
  9076. function request(_x) {
  9077. return _request.apply(this, arguments);
  9078. }
  9079. function _request() {
  9080. _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(parmas) {
  9081. return _regenerator.default.wrap(function _callee$(_context) {
  9082. while (1) {
  9083. switch (_context.prev = _context.next) {
  9084. case 0:
  9085. return _context.abrupt("return", new Promise(function (resolve, reject) {
  9086. try {
  9087. uni.showLoading({
  9088. title: '加载中',
  9089. mask: true
  9090. });
  9091. uni.request(_objectSpread(_objectSpread({}, formatRequestBody(parmas)), {}, {
  9092. success: function success(response) {
  9093. var data = response.data;
  9094. var code = data.code;
  9095. var msg = data.msg;
  9096. if (code === 0) {
  9097. resolve(data);
  9098. } else {
  9099. if (code === 401) {
  9100. uni.showToast({
  9101. title: msg || "登录失效!",
  9102. mask: true,
  9103. icon: "none",
  9104. complete: function complete() {
  9105. uni.navigateTo({
  9106. url: '/pages/login/login'
  9107. });
  9108. }
  9109. });
  9110. } else {
  9111. reject(data);
  9112. uni.showToast({
  9113. title: msg,
  9114. mask: true,
  9115. icon: "none"
  9116. });
  9117. }
  9118. }
  9119. },
  9120. fail: function fail(res) {
  9121. uni.showToast({
  9122. title: res,
  9123. mask: true,
  9124. icon: "none"
  9125. });
  9126. reject(res);
  9127. },
  9128. complete: function complete(res) {
  9129. uni.hideLoading();
  9130. }
  9131. }));
  9132. } catch (err) {
  9133. uni.hideLoading();
  9134. reject(err);
  9135. }
  9136. }));
  9137. case 1:
  9138. case "end":
  9139. return _context.stop();
  9140. }
  9141. }
  9142. }, _callee);
  9143. }));
  9144. return _request.apply(this, arguments);
  9145. }
  9146. function formatRequestBody(parmas) {
  9147. var url = parmas.url;
  9148. url = baseUrl + url;
  9149. var data = _objectSpread({}, parmas.data);
  9150. var header = _objectSpread({}, parmas.header);
  9151. header[_index.default.TokenKey] = (0, _auth.getToken)();
  9152. header.appID = _index.default.appID;
  9153. header.appKey = _index.default.appKey;
  9154. header.appSecret = _index.default.appSecret;
  9155. header.permitTplId = _index.default.permitTplId;
  9156. var method = parmas.method || "get";
  9157. var dataType = parmas.dataType || "json";
  9158. var requestBody = {
  9159. url: url,
  9160. data: data,
  9161. header: header,
  9162. method: method,
  9163. dataType: dataType
  9164. };
  9165. return requestBody;
  9166. }
  9167. ;
  9168. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  9169. /***/ }),
  9170. /* 41 */
  9171. /*!************************************************************************************************!*\
  9172. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  9173. \************************************************************************************************/
  9174. /*! no static exports found */
  9175. /***/ (function(module, exports, __webpack_require__) {
  9176. // TODO(Babel 8): Remove this file.
  9177. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 42)();
  9178. module.exports = runtime;
  9179. /***/ }),
  9180. /* 42 */
  9181. /*!*******************************************************************!*\
  9182. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  9183. \*******************************************************************/
  9184. /*! no static exports found */
  9185. /***/ (function(module, exports, __webpack_require__) {
  9186. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  9187. function _regeneratorRuntime() {
  9188. "use strict";
  9189. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  9190. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  9191. return exports;
  9192. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9193. var exports = {},
  9194. Op = Object.prototype,
  9195. hasOwn = Op.hasOwnProperty,
  9196. defineProperty = Object.defineProperty || function (obj, key, desc) {
  9197. obj[key] = desc.value;
  9198. },
  9199. $Symbol = "function" == typeof Symbol ? Symbol : {},
  9200. iteratorSymbol = $Symbol.iterator || "@@iterator",
  9201. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  9202. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  9203. function define(obj, key, value) {
  9204. return Object.defineProperty(obj, key, {
  9205. value: value,
  9206. enumerable: !0,
  9207. configurable: !0,
  9208. writable: !0
  9209. }), obj[key];
  9210. }
  9211. try {
  9212. define({}, "");
  9213. } catch (err) {
  9214. define = function define(obj, key, value) {
  9215. return obj[key] = value;
  9216. };
  9217. }
  9218. function wrap(innerFn, outerFn, self, tryLocsList) {
  9219. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  9220. generator = Object.create(protoGenerator.prototype),
  9221. context = new Context(tryLocsList || []);
  9222. return defineProperty(generator, "_invoke", {
  9223. value: makeInvokeMethod(innerFn, self, context)
  9224. }), generator;
  9225. }
  9226. function tryCatch(fn, obj, arg) {
  9227. try {
  9228. return {
  9229. type: "normal",
  9230. arg: fn.call(obj, arg)
  9231. };
  9232. } catch (err) {
  9233. return {
  9234. type: "throw",
  9235. arg: err
  9236. };
  9237. }
  9238. }
  9239. exports.wrap = wrap;
  9240. var ContinueSentinel = {};
  9241. function Generator() {}
  9242. function GeneratorFunction() {}
  9243. function GeneratorFunctionPrototype() {}
  9244. var IteratorPrototype = {};
  9245. define(IteratorPrototype, iteratorSymbol, function () {
  9246. return this;
  9247. });
  9248. var getProto = Object.getPrototypeOf,
  9249. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  9250. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  9251. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  9252. function defineIteratorMethods(prototype) {
  9253. ["next", "throw", "return"].forEach(function (method) {
  9254. define(prototype, method, function (arg) {
  9255. return this._invoke(method, arg);
  9256. });
  9257. });
  9258. }
  9259. function AsyncIterator(generator, PromiseImpl) {
  9260. function invoke(method, arg, resolve, reject) {
  9261. var record = tryCatch(generator[method], generator, arg);
  9262. if ("throw" !== record.type) {
  9263. var result = record.arg,
  9264. value = result.value;
  9265. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  9266. invoke("next", value, resolve, reject);
  9267. }, function (err) {
  9268. invoke("throw", err, resolve, reject);
  9269. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  9270. result.value = unwrapped, resolve(result);
  9271. }, function (error) {
  9272. return invoke("throw", error, resolve, reject);
  9273. });
  9274. }
  9275. reject(record.arg);
  9276. }
  9277. var previousPromise;
  9278. defineProperty(this, "_invoke", {
  9279. value: function value(method, arg) {
  9280. function callInvokeWithMethodAndArg() {
  9281. return new PromiseImpl(function (resolve, reject) {
  9282. invoke(method, arg, resolve, reject);
  9283. });
  9284. }
  9285. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  9286. }
  9287. });
  9288. }
  9289. function makeInvokeMethod(innerFn, self, context) {
  9290. var state = "suspendedStart";
  9291. return function (method, arg) {
  9292. if ("executing" === state) throw new Error("Generator is already running");
  9293. if ("completed" === state) {
  9294. if ("throw" === method) throw arg;
  9295. return doneResult();
  9296. }
  9297. for (context.method = method, context.arg = arg;;) {
  9298. var delegate = context.delegate;
  9299. if (delegate) {
  9300. var delegateResult = maybeInvokeDelegate(delegate, context);
  9301. if (delegateResult) {
  9302. if (delegateResult === ContinueSentinel) continue;
  9303. return delegateResult;
  9304. }
  9305. }
  9306. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  9307. if ("suspendedStart" === state) throw state = "completed", context.arg;
  9308. context.dispatchException(context.arg);
  9309. } else "return" === context.method && context.abrupt("return", context.arg);
  9310. state = "executing";
  9311. var record = tryCatch(innerFn, self, context);
  9312. if ("normal" === record.type) {
  9313. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  9314. return {
  9315. value: record.arg,
  9316. done: context.done
  9317. };
  9318. }
  9319. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  9320. }
  9321. };
  9322. }
  9323. function maybeInvokeDelegate(delegate, context) {
  9324. var methodName = context.method,
  9325. method = delegate.iterator[methodName];
  9326. 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;
  9327. var record = tryCatch(method, delegate.iterator, context.arg);
  9328. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  9329. var info = record.arg;
  9330. 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);
  9331. }
  9332. function pushTryEntry(locs) {
  9333. var entry = {
  9334. tryLoc: locs[0]
  9335. };
  9336. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  9337. }
  9338. function resetTryEntry(entry) {
  9339. var record = entry.completion || {};
  9340. record.type = "normal", delete record.arg, entry.completion = record;
  9341. }
  9342. function Context(tryLocsList) {
  9343. this.tryEntries = [{
  9344. tryLoc: "root"
  9345. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  9346. }
  9347. function values(iterable) {
  9348. if (iterable) {
  9349. var iteratorMethod = iterable[iteratorSymbol];
  9350. if (iteratorMethod) return iteratorMethod.call(iterable);
  9351. if ("function" == typeof iterable.next) return iterable;
  9352. if (!isNaN(iterable.length)) {
  9353. var i = -1,
  9354. next = function next() {
  9355. for (; ++i < iterable.length;) {
  9356. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  9357. }
  9358. return next.value = undefined, next.done = !0, next;
  9359. };
  9360. return next.next = next;
  9361. }
  9362. }
  9363. return {
  9364. next: doneResult
  9365. };
  9366. }
  9367. function doneResult() {
  9368. return {
  9369. value: undefined,
  9370. done: !0
  9371. };
  9372. }
  9373. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  9374. value: GeneratorFunctionPrototype,
  9375. configurable: !0
  9376. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  9377. value: GeneratorFunction,
  9378. configurable: !0
  9379. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  9380. var ctor = "function" == typeof genFun && genFun.constructor;
  9381. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  9382. }, exports.mark = function (genFun) {
  9383. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  9384. }, exports.awrap = function (arg) {
  9385. return {
  9386. __await: arg
  9387. };
  9388. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  9389. return this;
  9390. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  9391. void 0 === PromiseImpl && (PromiseImpl = Promise);
  9392. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  9393. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  9394. return result.done ? result.value : iter.next();
  9395. });
  9396. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  9397. return this;
  9398. }), define(Gp, "toString", function () {
  9399. return "[object Generator]";
  9400. }), exports.keys = function (val) {
  9401. var object = Object(val),
  9402. keys = [];
  9403. for (var key in object) {
  9404. keys.push(key);
  9405. }
  9406. return keys.reverse(), function next() {
  9407. for (; keys.length;) {
  9408. var key = keys.pop();
  9409. if (key in object) return next.value = key, next.done = !1, next;
  9410. }
  9411. return next.done = !0, next;
  9412. };
  9413. }, exports.values = values, Context.prototype = {
  9414. constructor: Context,
  9415. reset: function reset(skipTempReset) {
  9416. 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) {
  9417. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  9418. }
  9419. },
  9420. stop: function stop() {
  9421. this.done = !0;
  9422. var rootRecord = this.tryEntries[0].completion;
  9423. if ("throw" === rootRecord.type) throw rootRecord.arg;
  9424. return this.rval;
  9425. },
  9426. dispatchException: function dispatchException(exception) {
  9427. if (this.done) throw exception;
  9428. var context = this;
  9429. function handle(loc, caught) {
  9430. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  9431. }
  9432. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9433. var entry = this.tryEntries[i],
  9434. record = entry.completion;
  9435. if ("root" === entry.tryLoc) return handle("end");
  9436. if (entry.tryLoc <= this.prev) {
  9437. var hasCatch = hasOwn.call(entry, "catchLoc"),
  9438. hasFinally = hasOwn.call(entry, "finallyLoc");
  9439. if (hasCatch && hasFinally) {
  9440. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  9441. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  9442. } else if (hasCatch) {
  9443. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  9444. } else {
  9445. if (!hasFinally) throw new Error("try statement without catch or finally");
  9446. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  9447. }
  9448. }
  9449. }
  9450. },
  9451. abrupt: function abrupt(type, arg) {
  9452. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9453. var entry = this.tryEntries[i];
  9454. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  9455. var finallyEntry = entry;
  9456. break;
  9457. }
  9458. }
  9459. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  9460. var record = finallyEntry ? finallyEntry.completion : {};
  9461. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  9462. },
  9463. complete: function complete(record, afterLoc) {
  9464. if ("throw" === record.type) throw record.arg;
  9465. 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;
  9466. },
  9467. finish: function finish(finallyLoc) {
  9468. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9469. var entry = this.tryEntries[i];
  9470. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  9471. }
  9472. },
  9473. "catch": function _catch(tryLoc) {
  9474. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9475. var entry = this.tryEntries[i];
  9476. if (entry.tryLoc === tryLoc) {
  9477. var record = entry.completion;
  9478. if ("throw" === record.type) {
  9479. var thrown = record.arg;
  9480. resetTryEntry(entry);
  9481. }
  9482. return thrown;
  9483. }
  9484. }
  9485. throw new Error("illegal catch attempt");
  9486. },
  9487. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  9488. return this.delegate = {
  9489. iterator: values(iterable),
  9490. resultName: resultName,
  9491. nextLoc: nextLoc
  9492. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  9493. }
  9494. }, exports;
  9495. }
  9496. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9497. /***/ }),
  9498. /* 43 */
  9499. /*!*****************************************************************!*\
  9500. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  9501. \*****************************************************************/
  9502. /*! no static exports found */
  9503. /***/ (function(module, exports) {
  9504. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  9505. try {
  9506. var info = gen[key](arg);
  9507. var value = info.value;
  9508. } catch (error) {
  9509. reject(error);
  9510. return;
  9511. }
  9512. if (info.done) {
  9513. resolve(value);
  9514. } else {
  9515. Promise.resolve(value).then(_next, _throw);
  9516. }
  9517. }
  9518. function _asyncToGenerator(fn) {
  9519. return function () {
  9520. var self = this,
  9521. args = arguments;
  9522. return new Promise(function (resolve, reject) {
  9523. var gen = fn.apply(self, args);
  9524. function _next(value) {
  9525. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  9526. }
  9527. function _throw(err) {
  9528. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  9529. }
  9530. _next(undefined);
  9531. });
  9532. };
  9533. }
  9534. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9535. /***/ }),
  9536. /* 44 */
  9537. /*!******************************************************!*\
  9538. !*** E:/work/Project_newGit/CKQ/app/config/index.js ***!
  9539. \******************************************************/
  9540. /*! no static exports found */
  9541. /***/ (function(module, exports, __webpack_require__) {
  9542. "use strict";
  9543. Object.defineProperty(exports, "__esModule", {
  9544. value: true
  9545. });
  9546. exports.default = void 0;
  9547. var _default = {
  9548. base: {
  9549. dev: 'http://192.168.3.5:8080',
  9550. pro: 'http://192.168.3.5:8080'
  9551. },
  9552. appID: '10001',
  9553. appKey: '82a8bf439373e305',
  9554. appSecret: '82a8bf439373e305',
  9555. permitTplId: 7,
  9556. TokenKey: "Authorization",
  9557. uploadFile: 'http://192.168.3.5:8080'
  9558. };
  9559. exports.default = _default;
  9560. /***/ }),
  9561. /* 45 */
  9562. /*!***************************************************!*\
  9563. !*** E:/work/Project_newGit/CKQ/app/libs/auth.js ***!
  9564. \***************************************************/
  9565. /*! no static exports found */
  9566. /***/ (function(module, exports, __webpack_require__) {
  9567. "use strict";
  9568. /* WEBPACK VAR INJECTION */(function(uni) {
  9569. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9570. Object.defineProperty(exports, "__esModule", {
  9571. value: true
  9572. });
  9573. exports.getToken = getToken;
  9574. exports.removeToken = removeToken;
  9575. exports.setToken = setToken;
  9576. var _index = _interopRequireDefault(__webpack_require__(/*! ../config/index.js */ 44));
  9577. var TokenKey = _index.default.TokenKey;
  9578. function getToken() {
  9579. return uni.getStorageSync(TokenKey);
  9580. }
  9581. function setToken(token) {
  9582. return uni.setStorageSync(TokenKey, token);
  9583. }
  9584. function removeToken() {
  9585. return uni.removeStorageSync(TokenKey);
  9586. }
  9587. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  9588. /***/ }),
  9589. /* 46 */,
  9590. /* 47 */,
  9591. /* 48 */,
  9592. /* 49 */,
  9593. /* 50 */,
  9594. /* 51 */,
  9595. /* 52 */,
  9596. /* 53 */,
  9597. /* 54 */
  9598. /*!*******************************************************!*\
  9599. !*** E:/work/Project_newGit/CKQ/app/api/dangerApi.js ***!
  9600. \*******************************************************/
  9601. /*! no static exports found */
  9602. /***/ (function(module, exports, __webpack_require__) {
  9603. "use strict";
  9604. Object.defineProperty(exports, "__esModule", {
  9605. value: true
  9606. });
  9607. exports.deleteDangerById = deleteDangerById;
  9608. exports.getDangerById = getDangerById;
  9609. exports.getDangerByList = getDangerByList;
  9610. exports.getDangerByPage = getDangerByPage;
  9611. exports.handleDanger = handleDanger;
  9612. exports.updateDanger = updateDanger;
  9613. var _request = __webpack_require__(/*! @/libs/request.js */ 40);
  9614. /**
  9615. * 获取Danger列表
  9616. * @param data
  9617. * @returns
  9618. */
  9619. function getDangerByList(data) {
  9620. return (0, _request.request)({
  9621. url: '/goaf/goafhdanger/list',
  9622. method: 'GET',
  9623. data: data
  9624. });
  9625. }
  9626. /**
  9627. * 获取Danger分页
  9628. * @param data
  9629. * @returns
  9630. */
  9631. function getDangerByPage(data) {
  9632. return (0, _request.request)({
  9633. url: '/goaf/goafhdanger/page',
  9634. method: 'GET',
  9635. params: data
  9636. });
  9637. }
  9638. /**
  9639. * 根据Id获取Danger
  9640. * @param dangerId
  9641. * @returns
  9642. */
  9643. function getDangerById(dangerId) {
  9644. return (0, _request.request)({
  9645. url: "/goaf/goafhdanger/".concat(dangerId),
  9646. method: 'GET'
  9647. });
  9648. }
  9649. // export function getDangerById(dangerId) {
  9650. // return request({
  9651. // url: `/ent/danger/${dangerId}`,
  9652. // method: 'GET'
  9653. // })
  9654. // }
  9655. /**
  9656. * 删除Danger
  9657. * @param dangerId
  9658. * @returns
  9659. */
  9660. function deleteDangerById(dangerId) {
  9661. return (0, _request.request)({
  9662. url: "goaf/goafhdanger/delete/".concat(dangerId),
  9663. method: 'DELETE'
  9664. });
  9665. }
  9666. /**
  9667. * 处理Danger
  9668. * @param data
  9669. * @returns
  9670. */
  9671. function handleDanger(data) {
  9672. return (0, _request.request)({
  9673. url: "/goaf/goafhdanger/add",
  9674. method: 'POST',
  9675. data: data
  9676. });
  9677. }
  9678. /**
  9679. * 修改Danger
  9680. * @param dangerId
  9681. * @returns
  9682. */
  9683. function updateDanger(data) {
  9684. return (0, _request.request)({
  9685. url: "/goaf/goafhdanger/update",
  9686. method: 'PUT',
  9687. data: data
  9688. });
  9689. }
  9690. /***/ }),
  9691. /* 55 */,
  9692. /* 56 */,
  9693. /* 57 */,
  9694. /* 58 */,
  9695. /* 59 */,
  9696. /* 60 */,
  9697. /* 61 */,
  9698. /* 62 */,
  9699. /* 63 */
  9700. /*!**************************************************!*\
  9701. !*** E:/work/Project_newGit/CKQ/app/api/user.js ***!
  9702. \**************************************************/
  9703. /*! no static exports found */
  9704. /***/ (function(module, exports, __webpack_require__) {
  9705. "use strict";
  9706. Object.defineProperty(exports, "__esModule", {
  9707. value: true
  9708. });
  9709. exports.getUserByPage = getUserByPage;
  9710. exports.getUserInfo = getUserInfo;
  9711. exports.getUserList = getUserList;
  9712. exports.login = login;
  9713. exports.logout = logout;
  9714. exports.updatePassword = updatePassword;
  9715. exports.uploadFile = uploadFile;
  9716. exports.wxWorkLogin = wxWorkLogin;
  9717. var _request = __webpack_require__(/*! ../libs/request.js */ 40);
  9718. function login(data) {
  9719. return (0, _request.request)({
  9720. url: '/login',
  9721. method: 'post',
  9722. header: {
  9723. 'content-type': "application/x-www-form-urlencoded"
  9724. },
  9725. data: data
  9726. });
  9727. }
  9728. function getUserInfo() {
  9729. return (0, _request.request)({
  9730. url: '/user/profile'
  9731. });
  9732. }
  9733. function logout() {
  9734. return (0, _request.request)({
  9735. url: '/logout',
  9736. method: 'GET'
  9737. });
  9738. }
  9739. /**公用上传接口 */
  9740. function uploadFile(data) {
  9741. return (0, _request.request)({
  9742. url: '/upload/file',
  9743. method: "post",
  9744. headers: {
  9745. 'Content-Type': 'multipart/form-data'
  9746. },
  9747. data: data
  9748. });
  9749. }
  9750. /**
  9751. * 更新密码
  9752. * @param data
  9753. * @returns
  9754. */
  9755. function updatePassword(data) {
  9756. return (0, _request.request)({
  9757. url: "/user/updatePassword",
  9758. method: 'PUT',
  9759. data: data
  9760. });
  9761. }
  9762. //查询用户的带岗位
  9763. function getUserList() {
  9764. return (0, _request.request)({
  9765. url: '/user/select',
  9766. method: 'get'
  9767. });
  9768. }
  9769. //企业微信登录
  9770. function wxWorkLogin(_ref) {
  9771. var userId = _ref.userId,
  9772. code = _ref.code;
  9773. return (0, _request.request)({
  9774. url: "/user/updateWxUserId/".concat(userId, "/").concat(code),
  9775. method: 'post'
  9776. });
  9777. }
  9778. /**
  9779. * 分页获取用户
  9780. * @param data
  9781. * @returns
  9782. */
  9783. function getUserByPage(data) {
  9784. return (0, _request.request)({
  9785. url: '/user/page',
  9786. method: 'GET',
  9787. header: {
  9788. 'content-type': "application/x-www-form-urlencoded"
  9789. },
  9790. data: data
  9791. });
  9792. }
  9793. /***/ }),
  9794. /* 64 */
  9795. /*!****************************************************************!*\
  9796. !*** E:/work/Project_newGit/CKQ/app/pages/mine/image/head.png ***!
  9797. \****************************************************************/
  9798. /*! no static exports found */
  9799. /***/ (function(module, exports) {
  9800. module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAvSSURBVHgBzVpbcFVXGf7W3idAGkgOFyEIIYd7LbeUVpCqQ7B30EFGp+PojBSr9skSffDBF+BJnVEbHJ8cx7Yz2jqlU+pUpVNsk2IrtmNNwkUuAXIIHQhUSriGJJDlv+7/3ueEhBAu/7Cz91l77bX+77+vtRAYZnquSWZ7e7Gorw81iFAjQHcgC4lcqmteCuTRh056bowiNH9/iXgHw0wCw0AK1JUrWC4l6uhnzcHTyH5EbB87S9c5oKsXOH0JoPfSzTvhLmDCaKA0A8yeAFlVDkH3TurRSO9fe3qpeAHDQDcE0AJbr4C1EqidxyB3dQAXu+3gAoKB8nNSu6R2996RvGsExKLJkMuqCOw40q4gzWaw8buLxVEMkYYE0AG71IO6xjZk326D7OrxzMrU+AmARUC7Po4X/TyhDFg5F/hclW7bKGI8PxSg1w3w901ytbyK+rcPI7ftIGmrJzDrmKc7mGYKQKnfYGD0gywAqWk8mfGqORBLp5BGJWnzOk130ACV1ihwbDh9EXV/aIFs/bj4OBagMkPVqtj2mk0BFVYQxYAVaJ40Kp5ZBowrQz0FpE3r7hWdGC6ABC5HWtvacAQ1SmtdV5KTaw4JiB2tv3eeeanAKuCCaZWB5IgB+yU1jCqBVNpcPp0icITawZjsgAAVOArlDdsOIPe3VjgvM0xe6+skqDBhoflC9jE+rNbdXUQ2IFnBqC4rZ0M8Ngf5vkGAFIMB9+IuVL/fnmSYT1gMmI2S15o48b0DkQDIxkvfl1Dw+dYCHL06AEgxELiXdqP6g2NJ5oGBGU8AkHYe/i1vKwaiWP9Un89WQX5zIYEU/YMU/YDLEndNb7ai+o1W9E9JSSdHlSxQFD4J9sP8Nkw7CQkZZoAf3z7b9/rdY2Suj8xGM0l0RbHAE6EYaoqW77YhRwBFZDq5O38WkbBtgl1R8lmEd6q/tM/qLpV/6Xa6x2Y8oT8x7TKO2JxsLhHGA/Eo/5GnkpB4LoalAOALTXJt52XUvXlYBxHNgDDM6IH9c2Teu5TgJnXPrI3fdaT1/WDHMeqUwoE2II2wo9TY8HP7ObYfglQ8E++rC5TFfyi/I0k2/LQRudNd/UdJbyLJfCW8ybFWn/xh0oIzP2ae+ocPSrIwB6b4TTiDG2fWOIinl6CT/HE6N9WEBqnuXfvhcVSTNGTsTIubB9hvY4LO5ITVpkybrWsTwQy1iSrOYmNmQrXH1jxjZn5FTF+mXUGNr749cgb4ZzuyhGF9WiJeeyVA2893AJ90Adzpi8rTSdsGGadVHj0rRkI8sRBS1ZPzJgFTy818e08CH52DfOMgxJa9RSIrS/Z2PLDoygNPyMf0fBcB+PEX0ZkpCVrMuLHp3Yb/dJAtdxvJWBAi1BEFETGIx3AihSvJ6M9T9wM//DxQPrIwUiuwdIlHZwM/+gJE/XvAlj2ecclml248+0IKJFKVFK6WpbbLV0iLx1Dx0CytxU2q3ZsoSaH2rUPeBIU2ARsAIuvULso5h49cFHTOT3+ypcCzq0haX4IgcANSVQXwy5XArx6HyI5ikdcGGze2dw3XbvnQYEMwxM523VKnUp0H+GKLXJvvRO6s1Z6PUjB+YkFC8EjnoqoVgvOnXxCjX5vXfwHRH319AfDbNQGIi7yaSefDIUq7KCqtLzqfFUqLbWdIzjGWe4CRxFebjpsf+iMUyWNIOT0SQUfnLjJJ+cgsDJmUr65/wIwf23wYOx5gQLJcyAOatALQ75pP6Pq2zgMkedfu/x+LUBxAGEh4U7F3JdHYRENMK9fLmevWXJoUwGkV3iwTgnRR2EZcZzWeXwta7v9Y+2SNMtPo5X1yeZ5U2tPr04G/Jwaw0oyj8FuEQfHMA9euUa+HnrzPzKNN383pCgs7ZyYOLuT5tlcPmWl7J7JlMRZF6EFNx0XLvM1nWkoRMwN2acna55jloiVTb1x7jtbcY/jQ/MggZC5g3R6x3Gvigr86zgN9pMWIRFJLaEM0MpLTzKbLLhdUIrZiV00VFP2mlGPYSEVflTN1AAsBL/Bk/dPzxCK7jcA4dUnnzZoMvch2X7XVBkvSKLZYDe+Nqdjy656JGHaaSjupJ86znJfmRySepW+S5tfJ81pZNRliMHfusg/Junqx2kEBsNQi1m//YfjJ5V/fwNeDUWpRnPxQt/VcpT99VLpRinAAk5tBSK6yWTWRBEn/SNLDTrQlqZdXglUqfFJ9i1LbH7AbXNT3fLfGkcv4hCqCybkx9EqgsBJNrLpV/44LgBpwzCAql8EQjQXaHdcVCwJI7j7wezXqjWRlnQhAXaoJkQmJPCjcaiGdLnjUykQmNO/ID1+aoM1k8LLMR3bGR4JXzjMrAozyhNdWWJzaKAUEc/QlkhWg+05JTUWt1/cNnyv+7t8WGPychg3hF9mIGA8+srK+LsoqDeapQJa+FLI92HrQVDMIEvTlHMudTVQe/fUAbpj+sh9QJu8ZjEIp5rUG8K0Q/T5mz+qbsaP0cHnV1kmHHmYg2DKMDyZCMStSCd5PZExDbt6pQ/uQSX37652skBCeHzABuwrLuYqpmdniW90JoHIxAkjncpVlfvmRHDQpJecLwvqnGSz4pD5V+sHrpIEhgFTfqG/VWYcLDn5sm8gjtjvA6+XYKcbyo74vpQUuOVmn8sHmSWOQ3ukKK4UoWYv6cgghCPC120kq+9a9Crll9+DBvbLHfHPygg8mBdbjTM/N7dancVibequiwIdpYzXQxgzF3uZJZaYzbOKG9+pQRfCd6kQfd8DC8tQlOvD8zfuQr+wF1i2GqJkMVI4p1Ni7R2klv1v7nB45YqHf52Ab7BLzgxUm4W8oUIifyaO1sFoyVy+jpWosOktHoEItFoXvgsTWRGRzpJpISa0PRtoerO8ZiDSCn+0wkW30SMjRI0z7BUriKtf5EitKMYmE8AwgzYDdg7H9db4zfX39oSYbmYGkWvbsVz4jGqM1tDmjtEgnqoKt/7xP8vxiHd1E2bC1EL4RwdRjvuNGzxd7NWChQJOfJf0L3g2SZuniQmQXwCLhk84XpY+0wuzczRmvWWvUVqH/ZFA/b6KfwAUO/WHMPmbRLbkw5qHaRTXW7tdqRb6LBQp2wyO24ewTuwhpKeKLcDZmbKPpfMJCq+PXFDa9q9aTwTvTlJlmUNF9he2eWWMVEdIn7b42db7Ij69ZrVqwEmDnDvC7cfy3O6lIbUci8tuYMkLq7EIGX62gc/6qLPKr5pqTYK3BNdP1HmL94k8jmRqklRZQUBrxlTR/FwuWs5zWpN/m8NsK3jTBrEAyM3f9UWApfDtDuLFdqlg2TX/U6GTm90V7RmDzvZWo23USFV09cKsIHzYikToOE+FMYUElsJD2OWeOA2aOh5xYllqtJe8o8k6T8s9TdLV0QPyrHTh8xq7upF/huGUS3G8edVVyV2tTWYKNRSfYdkBuaDmBDVQ4J9daRc7t1BwPzQQepEsBvBl0inLqH5uBvx+yOwhIgEwIWz0+PBPi7k9h4+NzxSYUA7i1TWZLe9H26n9RcfxschDmZ5hfCfm9+yFmjMMtIaXZn2yHVNp1/DghO6sqJ9/79mLkSzKofXBGOAwtMJvtrXI1Hb5sfXkP0N3LTMN0Ft+gswa6BG4D/WkX8NIuZrKGMTmKyrIn5tNOeimefHRW8r+ZROlBHp4t/lw+CpuXTgESu1ZC71neNnCKaG6Q5SCOA18qNSydCtBiuz4NTlFUbKARGWxaOBkt6kMH7qn7IFbMuH3gHH35bojvLLYrClKA4pF4Pdp1EZuK9e+X4W376DC0BA2NR1C9qJKOwRbgjqLnP4Rs/QSonYGjpMWE3w2aFMj38rJN3qH0Qbtse+uIrL4WhgFNjsbJ0a2BrhzuLMrTVUvR5pqaizAA0QB5uq2wA94pRNlxYHDXRaTJLF3PyttPiocsbhbR4GvpapO3ns7QtRq3gmiiHF0b5K2hM3aum6e1AYA+J2+ORm8fsGIkjelutYzdCKgGulYPF7CbUpkQc7V0W0SXuitGcyhMM3m61Dq02V4t6k6RcVD/k3ew9H+W/lIpU9HkZQAAAABJRU5ErkJggg=="
  9801. /***/ }),
  9802. /* 65 */
  9803. /*!**************************************************************!*\
  9804. !*** E:/work/Project_newGit/CKQ/app/pages/mine/image/bg.png ***!
  9805. \**************************************************************/
  9806. /*! no static exports found */
  9807. /***/ (function(module, exports) {
  9808. module.exports = "/pages/mine/image/bg.png";
  9809. /***/ }),
  9810. /* 66 */,
  9811. /* 67 */,
  9812. /* 68 */,
  9813. /* 69 */,
  9814. /* 70 */,
  9815. /* 71 */,
  9816. /* 72 */,
  9817. /* 73 */,
  9818. /* 74 */,
  9819. /* 75 */,
  9820. /* 76 */,
  9821. /* 77 */,
  9822. /* 78 */,
  9823. /* 79 */,
  9824. /* 80 */,
  9825. /* 81 */,
  9826. /* 82 */,
  9827. /* 83 */,
  9828. /* 84 */,
  9829. /* 85 */,
  9830. /* 86 */,
  9831. /* 87 */,
  9832. /* 88 */,
  9833. /* 89 */,
  9834. /* 90 */
  9835. /*!****************************************************!*\
  9836. !*** E:/work/Project_newGit/CKQ/app/libs/index.js ***!
  9837. \****************************************************/
  9838. /*! no static exports found */
  9839. /***/ (function(module, exports, __webpack_require__) {
  9840. "use strict";
  9841. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9842. Object.defineProperty(exports, "__esModule", {
  9843. value: true
  9844. });
  9845. exports.addClass = addClass;
  9846. exports.byteLength = byteLength;
  9847. exports.cleanArray = cleanArray;
  9848. exports.createUniqueString = createUniqueString;
  9849. exports.debounce = debounce;
  9850. exports.deepClone = deepClone;
  9851. exports.distanceTime = distanceTime;
  9852. exports.formatTime = formatTime;
  9853. exports.getQueryObject = getQueryObject;
  9854. exports.getTime = getTime;
  9855. exports.hasClass = hasClass;
  9856. exports.html2Text = html2Text;
  9857. exports.isEmpty = isEmpty;
  9858. exports.objectMerge = objectMerge;
  9859. exports.param = param;
  9860. exports.param2Obj = param2Obj;
  9861. exports.parseTime = parseTime;
  9862. exports.removeClass = removeClass;
  9863. exports.toggleClass = toggleClass;
  9864. exports.uniqueArr = uniqueArr;
  9865. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  9866. /**
  9867. * Parse the time to string
  9868. * @param {(Object|string|number)} time
  9869. * @param {string} cFormat
  9870. * @returns {string | null}
  9871. */
  9872. function parseTime(time, cFormat) {
  9873. if (arguments.length === 0 || !time) {
  9874. return null;
  9875. }
  9876. var format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}';
  9877. var date;
  9878. if ((0, _typeof2.default)(time) === 'object') {
  9879. date = time;
  9880. } else {
  9881. if (typeof time === 'string') {
  9882. if (/^[0-9]+$/.test(time)) {
  9883. // support "1548221490638"
  9884. time = parseInt(time);
  9885. } else {
  9886. // support safari
  9887. // https://stackoverflow.com/questions/4310953/invalid-date-in-safari
  9888. time = time.replace(new RegExp(/-/gm), '/');
  9889. }
  9890. }
  9891. if (typeof time === 'number' && time.toString().length === 10) {
  9892. time = time * 1000;
  9893. }
  9894. date = new Date(time);
  9895. }
  9896. var formatObj = {
  9897. y: date.getFullYear(),
  9898. m: date.getMonth() + 1,
  9899. d: date.getDate(),
  9900. h: date.getHours(),
  9901. i: date.getMinutes(),
  9902. s: date.getSeconds(),
  9903. a: date.getDay()
  9904. };
  9905. var time_str = format.replace(/{([ymdhisa])+}/g, function (result, key) {
  9906. var value = formatObj[key];
  9907. // Note: getDay() returns 0 on Sunday
  9908. if (key === 'a') {
  9909. return ['日', '一', '二', '三', '四', '五', '六'][value];
  9910. }
  9911. return value.toString().padStart(2, '0');
  9912. });
  9913. return time_str;
  9914. }
  9915. /**
  9916. * @param {number} time
  9917. * @param {string} option
  9918. * @returns {string}
  9919. */
  9920. function formatTime(time, option) {
  9921. if (('' + time).length === 10) {
  9922. time = parseInt(time) * 1000;
  9923. } else {
  9924. time = +time;
  9925. }
  9926. var d = new Date(time);
  9927. var now = Date.now();
  9928. var diff = (now - d) / 1000;
  9929. if (diff < 30) {
  9930. return '刚刚';
  9931. } else if (diff < 3600) {
  9932. // less 1 hour
  9933. return Math.ceil(diff / 60) + '分钟前';
  9934. } else if (diff < 3600 * 24) {
  9935. return Math.ceil(diff / 3600) + '小时前';
  9936. } else if (diff < 3600 * 24 * 2) {
  9937. return '1天前';
  9938. }
  9939. if (option) {
  9940. return parseTime(time, option);
  9941. } else {
  9942. return d.getMonth() + 1 + '月' + d.getDate() + '日' + d.getHours() + '时' + d.getMinutes() + '分';
  9943. }
  9944. }
  9945. /**
  9946. * @param {string} url
  9947. * @returns {Object}
  9948. */
  9949. function getQueryObject(url) {
  9950. url = url == null ? window.location.href : url;
  9951. var search = url.substring(url.lastIndexOf('?') + 1);
  9952. var obj = {};
  9953. var reg = /([^?&=]+)=([^?&=]*)/g;
  9954. search.replace(reg, function (rs, $1, $2) {
  9955. var name = decodeURIComponent($1);
  9956. var val = decodeURIComponent($2);
  9957. val = String(val);
  9958. obj[name] = val;
  9959. return rs;
  9960. });
  9961. return obj;
  9962. }
  9963. /**
  9964. * @param {string} input value
  9965. * @returns {number} output value
  9966. */
  9967. function byteLength(str) {
  9968. // returns the byte length of an utf8 string
  9969. var s = str.length;
  9970. for (var i = str.length - 1; i >= 0; i--) {
  9971. var code = str.charCodeAt(i);
  9972. if (code > 0x7f && code <= 0x7ff) s++;else if (code > 0x7ff && code <= 0xffff) s += 2;
  9973. if (code >= 0xDC00 && code <= 0xDFFF) i--;
  9974. }
  9975. return s;
  9976. }
  9977. /**
  9978. * @param {Array} actual
  9979. * @returns {Array}
  9980. */
  9981. function cleanArray(actual) {
  9982. var newArray = [];
  9983. for (var i = 0; i < actual.length; i++) {
  9984. if (actual[i]) {
  9985. newArray.push(actual[i]);
  9986. }
  9987. }
  9988. return newArray;
  9989. }
  9990. /**
  9991. * @param {Object} json
  9992. * @returns {Array}
  9993. */
  9994. function param(json) {
  9995. if (!json) return '';
  9996. return cleanArray(Object.keys(json).map(function (key) {
  9997. if (json[key] === undefined) return '';
  9998. return encodeURIComponent(key) + '=' + encodeURIComponent(json[key]);
  9999. })).join('&');
  10000. }
  10001. /**
  10002. * @param {string} url
  10003. * @returns {Object}
  10004. */
  10005. function param2Obj(url) {
  10006. var search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ');
  10007. if (!search) {
  10008. return {};
  10009. }
  10010. var obj = {};
  10011. var searchArr = search.split('&');
  10012. searchArr.forEach(function (v) {
  10013. var index = v.indexOf('=');
  10014. if (index !== -1) {
  10015. var name = v.substring(0, index);
  10016. var val = v.substring(index + 1, v.length);
  10017. obj[name] = val;
  10018. }
  10019. });
  10020. return obj;
  10021. }
  10022. /**
  10023. * @param {string} val
  10024. * @returns {string}
  10025. */
  10026. function html2Text(val) {
  10027. var div = document.createElement('div');
  10028. div.innerHTML = val;
  10029. return div.textContent || div.innerText;
  10030. }
  10031. /**
  10032. * Merges two objects, giving the last one precedence
  10033. * @param {Object} target
  10034. * @param {(Object|Array)} source
  10035. * @returns {Object}
  10036. */
  10037. function objectMerge(target, source) {
  10038. if ((0, _typeof2.default)(target) !== 'object') {
  10039. target = {};
  10040. }
  10041. if (Array.isArray(source)) {
  10042. return source.slice();
  10043. }
  10044. Object.keys(source).forEach(function (property) {
  10045. var sourceProperty = source[property];
  10046. if ((0, _typeof2.default)(sourceProperty) === 'object') {
  10047. target[property] = objectMerge(target[property], sourceProperty);
  10048. } else {
  10049. target[property] = sourceProperty;
  10050. }
  10051. });
  10052. return target;
  10053. }
  10054. /**
  10055. * @param {HTMLElement} element
  10056. * @param {string} className
  10057. */
  10058. function toggleClass(element, className) {
  10059. if (!element || !className) {
  10060. return;
  10061. }
  10062. var classString = element.className;
  10063. var nameIndex = classString.indexOf(className);
  10064. if (nameIndex === -1) {
  10065. classString += '' + className;
  10066. } else {
  10067. classString = classString.substr(0, nameIndex) + classString.substr(nameIndex + className.length);
  10068. }
  10069. element.className = classString;
  10070. }
  10071. /**
  10072. * @param {string} type
  10073. * @returns {Date}
  10074. */
  10075. function getTime(type) {
  10076. if (type === 'start') {
  10077. return new Date().getTime() - 3600 * 1000 * 24 * 90;
  10078. } else {
  10079. return new Date(new Date().toDateString());
  10080. }
  10081. }
  10082. /**
  10083. * @param {Function} func
  10084. * @param {number} wait
  10085. * @param {boolean} immediate
  10086. * @return {*}
  10087. */
  10088. function debounce(func, wait, immediate) {
  10089. var timeout, args, context, timestamp, result;
  10090. var later = function later() {
  10091. // 据上一次触发时间间隔
  10092. var last = +new Date() - timestamp;
  10093. // 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait
  10094. if (last < wait && last > 0) {
  10095. timeout = setTimeout(later, wait - last);
  10096. } else {
  10097. timeout = null;
  10098. // 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用
  10099. if (!immediate) {
  10100. result = func.apply(context, args);
  10101. if (!timeout) context = args = null;
  10102. }
  10103. }
  10104. };
  10105. return function () {
  10106. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  10107. args[_key] = arguments[_key];
  10108. }
  10109. context = this;
  10110. timestamp = +new Date();
  10111. var callNow = immediate && !timeout;
  10112. // 如果延时不存在,重新设定延时
  10113. if (!timeout) timeout = setTimeout(later, wait);
  10114. if (callNow) {
  10115. result = func.apply(context, args);
  10116. context = args = null;
  10117. }
  10118. return result;
  10119. };
  10120. }
  10121. /**
  10122. * This is just a simple version of deep copy
  10123. * Has a lot of edge cases bug
  10124. * If you want to use a perfect deep copy, use lodash's _.cloneDeep
  10125. * @param {Object} source
  10126. * @returns {Object}
  10127. */
  10128. function deepClone(source) {
  10129. if (!source && (0, _typeof2.default)(source) !== 'object') {
  10130. throw new Error('error arguments', 'deepClone');
  10131. }
  10132. var targetObj = source.constructor === Array ? [] : {};
  10133. Object.keys(source).forEach(function (keys) {
  10134. if (source[keys] && (0, _typeof2.default)(source[keys]) === 'object') {
  10135. targetObj[keys] = deepClone(source[keys]);
  10136. } else {
  10137. targetObj[keys] = source[keys];
  10138. }
  10139. });
  10140. return targetObj;
  10141. }
  10142. /**
  10143. * @param {Array} arr
  10144. * @returns {Array}
  10145. */
  10146. function uniqueArr(arr) {
  10147. return Array.from(new Set(arr));
  10148. }
  10149. /**
  10150. * @returns {string}
  10151. */
  10152. function createUniqueString() {
  10153. var timestamp = +new Date() + '';
  10154. var randomNum = parseInt((1 + Math.random()) * 65536) + '';
  10155. return (+(randomNum + timestamp)).toString(32);
  10156. }
  10157. /**
  10158. * Check if an element has a class
  10159. * @param {HTMLElement} elm
  10160. * @param {string} cls
  10161. * @returns {boolean}
  10162. */
  10163. function hasClass(ele, cls) {
  10164. return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'));
  10165. }
  10166. /**
  10167. * Add class to element
  10168. * @param {HTMLElement} elm
  10169. * @param {string} cls
  10170. */
  10171. function addClass(ele, cls) {
  10172. if (!hasClass(ele, cls)) ele.className += ' ' + cls;
  10173. }
  10174. /**
  10175. * Remove class from element
  10176. * @param {HTMLElement} elm
  10177. * @param {string} cls
  10178. */
  10179. function removeClass(ele, cls) {
  10180. if (hasClass(ele, cls)) {
  10181. var reg = new RegExp('(\\s|^)' + cls + '(\\s|$)');
  10182. ele.className = ele.className.replace(reg, ' ');
  10183. }
  10184. }
  10185. function distanceTime(time) {
  10186. //获取当前时间
  10187. var date = new Date();
  10188. var now = date.getTime();
  10189. //设置截止时间
  10190. var endDate = new Date();
  10191. if (time) {
  10192. endDate = new Date(time);
  10193. }
  10194. var end = endDate.getTime();
  10195. //获取截止时间和当前时间的时间差
  10196. if (now >= end) {
  10197. return '已过期';
  10198. }
  10199. var leftTime = end - now;
  10200. //定义变量 d,h,m,s分别保存天数,小时,分钟,秒
  10201. var d, h, m, s;
  10202. //判断剩余天数,时,分,秒
  10203. if (leftTime >= 0) {
  10204. d = Math.floor(leftTime / 1000 / 60 / 60 / 24);
  10205. h = Math.floor(leftTime / 1000 / 60 / 60 % 24);
  10206. m = Math.floor(leftTime / 1000 / 60 % 60);
  10207. s = Math.floor(leftTime / 1000 % 60);
  10208. }
  10209. if (d > 0) {
  10210. return "".concat(d, "\u5929").concat(h, "\u5C0F\u65F6").concat(m, "\u5206\u949F");
  10211. } else {
  10212. if (h > 0) {
  10213. return "".concat(h, "\u5C0F\u65F6").concat(m, "\u5206\u949F");
  10214. } else {
  10215. return "".concat(m, "\u5206\u949F");
  10216. }
  10217. }
  10218. }
  10219. function isEmpty(value) {
  10220. if (value === undefined || value === "undefined" || value === "" || value === null) {
  10221. return true;
  10222. }
  10223. return false;
  10224. }
  10225. /***/ }),
  10226. /* 91 */,
  10227. /* 92 */,
  10228. /* 93 */,
  10229. /* 94 */,
  10230. /* 95 */,
  10231. /* 96 */,
  10232. /* 97 */,
  10233. /* 98 */,
  10234. /* 99 */,
  10235. /* 100 */,
  10236. /* 101 */,
  10237. /* 102 */,
  10238. /* 103 */,
  10239. /* 104 */,
  10240. /* 105 */,
  10241. /* 106 */,
  10242. /* 107 */,
  10243. /* 108 */,
  10244. /* 109 */,
  10245. /* 110 */,
  10246. /* 111 */,
  10247. /* 112 */,
  10248. /* 113 */,
  10249. /* 114 */,
  10250. /* 115 */
  10251. /*!***************************************************!*\
  10252. !*** E:/work/Project_newGit/CKQ/app/api/index.js ***!
  10253. \***************************************************/
  10254. /*! no static exports found */
  10255. /***/ (function(module, exports, __webpack_require__) {
  10256. "use strict";
  10257. /* WEBPACK VAR INJECTION */(function(uni) {
  10258. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10259. Object.defineProperty(exports, "__esModule", {
  10260. value: true
  10261. });
  10262. exports.upload = void 0;
  10263. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  10264. var _auth = __webpack_require__(/*! @/libs/auth.js */ 45);
  10265. var _index = _interopRequireDefault(__webpack_require__(/*! @/config/index.js */ 44));
  10266. var upload = function upload(_ref) {
  10267. var formData = _ref.formData,
  10268. filePath = _ref.filePath,
  10269. callback = _ref.callback;
  10270. return new Promise(function (resolve, reject) {
  10271. var uploadTask = uni.uploadFile({
  10272. url: _index.default.uploadFile + '/admin/uploadFile',
  10273. filePath: filePath,
  10274. header: (0, _defineProperty2.default)({}, _index.default.TokenKey, (0, _auth.getToken)()),
  10275. name: 'file',
  10276. formData: formData,
  10277. success: function success(uploadFileRes) {
  10278. resolve(uploadFileRes.data);
  10279. },
  10280. fail: function fail(_ref2) {
  10281. var errMsg = _ref2.errMsg;
  10282. reject(errMsg);
  10283. }
  10284. });
  10285. if (callback) {
  10286. callback(uploadTask);
  10287. }
  10288. });
  10289. };
  10290. exports.upload = upload;
  10291. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  10292. /***/ }),
  10293. /* 116 */
  10294. /*!**********************************************************!*\
  10295. !*** E:/work/Project_newGit/CKQ/app/api/system/wfApi.js ***!
  10296. \**********************************************************/
  10297. /*! no static exports found */
  10298. /***/ (function(module, exports, __webpack_require__) {
  10299. "use strict";
  10300. Object.defineProperty(exports, "__esModule", {
  10301. value: true
  10302. });
  10303. exports.cancelWorkflow = cancelWorkflow;
  10304. exports.completeWorkflow = completeWorkflow;
  10305. exports.getWorkflowById = getWorkflowById;
  10306. exports.handleWorkflow = handleWorkflow;
  10307. exports.startWorkflow = startWorkflow;
  10308. exports.transferWorkflow = transferWorkflow;
  10309. var _request = __webpack_require__(/*! @/libs/request.js */ 40);
  10310. /**
  10311. * 启动Workflow
  10312. * @param wfDefId
  10313. * @returns
  10314. */
  10315. function startWorkflow(wfDefId) {
  10316. return (0, _request.request)({
  10317. url: "/wf/start/".concat(wfDefId),
  10318. method: 'GET'
  10319. });
  10320. }
  10321. function getWorkflowById(wfInsId) {
  10322. return (0, _request.request)({
  10323. url: "/wf/getIns/".concat(wfInsId),
  10324. method: 'GET'
  10325. });
  10326. }
  10327. /**
  10328. * 处理
  10329. * @param data
  10330. * @returns
  10331. */
  10332. function handleWorkflow(data) {
  10333. return (0, _request.request)({
  10334. url: "/wf/handle",
  10335. method: 'POST',
  10336. data: data
  10337. });
  10338. }
  10339. /**
  10340. * 移交
  10341. * @param data
  10342. * @returns
  10343. */
  10344. function transferWorkflow(data) {
  10345. return (0, _request.request)({
  10346. url: "/wf/transfer",
  10347. method: 'POST',
  10348. data: data
  10349. });
  10350. }
  10351. /**
  10352. * 完成
  10353. * @param wfInsId
  10354. * @returns
  10355. */
  10356. function completeWorkflow(wfInsId) {
  10357. return (0, _request.request)({
  10358. url: "/wf/complete/".concat(wfInsId),
  10359. method: 'GET'
  10360. });
  10361. }
  10362. /**
  10363. * 撤消
  10364. * @param wfInsId
  10365. * @returns
  10366. */
  10367. function cancelWorkflow(wfInsId) {
  10368. return (0, _request.request)({
  10369. url: "/wf/cancel/".concat(wfInsId),
  10370. method: 'GET'
  10371. });
  10372. }
  10373. /***/ }),
  10374. /* 117 */,
  10375. /* 118 */,
  10376. /* 119 */,
  10377. /* 120 */,
  10378. /* 121 */,
  10379. /* 122 */,
  10380. /* 123 */,
  10381. /* 124 */,
  10382. /* 125 */,
  10383. /* 126 */,
  10384. /* 127 */,
  10385. /* 128 */,
  10386. /* 129 */,
  10387. /* 130 */,
  10388. /* 131 */,
  10389. /* 132 */,
  10390. /* 133 */,
  10391. /* 134 */,
  10392. /* 135 */,
  10393. /* 136 */,
  10394. /* 137 */,
  10395. /* 138 */,
  10396. /* 139 */,
  10397. /* 140 */,
  10398. /* 141 */,
  10399. /* 142 */,
  10400. /* 143 */,
  10401. /* 144 */,
  10402. /* 145 */,
  10403. /* 146 */,
  10404. /* 147 */,
  10405. /* 148 */,
  10406. /* 149 */,
  10407. /* 150 */,
  10408. /* 151 */,
  10409. /* 152 */,
  10410. /* 153 */,
  10411. /* 154 */,
  10412. /* 155 */,
  10413. /* 156 */,
  10414. /* 157 */,
  10415. /* 158 */,
  10416. /* 159 */,
  10417. /* 160 */,
  10418. /* 161 */,
  10419. /* 162 */,
  10420. /* 163 */,
  10421. /* 164 */,
  10422. /* 165 */
  10423. /*!***************************************************!*\
  10424. !*** E:/work/Project_newGit/CKQ/app/api/check.js ***!
  10425. \***************************************************/
  10426. /*! no static exports found */
  10427. /***/ (function(module, exports, __webpack_require__) {
  10428. "use strict";
  10429. Object.defineProperty(exports, "__esModule", {
  10430. value: true
  10431. });
  10432. exports.createChecklist = createChecklist;
  10433. exports.createChecklistItem = createChecklistItem;
  10434. exports.deleteChecklistById = deleteChecklistById;
  10435. exports.deleteChecklistItemById = deleteChecklistItemById;
  10436. exports.getChecklist = getChecklist;
  10437. exports.getChecklistById = getChecklistById;
  10438. exports.getChecklistByPage = getChecklistByPage;
  10439. exports.getChecklistItemById = getChecklistItemById;
  10440. exports.updateChecklist = updateChecklist;
  10441. exports.updateChecklistItem = updateChecklistItem;
  10442. var _request = __webpack_require__(/*! ../libs/request.js */ 40);
  10443. // 获取所有检查表及其内容
  10444. function getChecklist(params) {
  10445. return (0, _request.request)({
  10446. url: '/goaf/goafChecklist/list',
  10447. params: params
  10448. });
  10449. }
  10450. // 分页获取所有检查表及其内容
  10451. function getChecklistByPage(params) {
  10452. return (0, _request.request)({
  10453. url: '/goaf/goafChecklist/page',
  10454. params: params
  10455. });
  10456. }
  10457. // 获取指定的检查表及其内容
  10458. function getChecklistById(goafchecklistId) {
  10459. return (0, _request.request)({
  10460. url: "/goaf/goafChecklist/".concat(goafchecklistId)
  10461. });
  10462. }
  10463. // 获取指定的检查项
  10464. function getChecklistItemById(goafchecklistId) {
  10465. return (0, _request.request)({
  10466. url: "/goaf/goafChecklist/checklistitem/".concat(goafchecklistId)
  10467. });
  10468. }
  10469. // 增加检查表及其内容
  10470. function createChecklist(data) {
  10471. return (0, _request.request)({
  10472. url: '/goaf/goafChecklist/add',
  10473. method: 'POST',
  10474. data: data
  10475. });
  10476. }
  10477. // 更新
  10478. function updateChecklist(data) {
  10479. return (0, _request.request)({
  10480. url: '/goaf/goafChecklist/update',
  10481. method: 'PUT',
  10482. data: data
  10483. });
  10484. }
  10485. // 删除指定检查表
  10486. function deleteChecklistById(goafchecklistId) {
  10487. return (0, _request.request)({
  10488. url: "/goaf/goafChecklist/deletechecklist/".concat(goafchecklistId),
  10489. method: 'DELETE'
  10490. });
  10491. }
  10492. // .删除指定检查表的某项内容
  10493. function deleteChecklistItemById(goafchecklistitemid) {
  10494. return (0, _request.request)({
  10495. url: "/goaf/goafChecklist/deletecheckitemlist/".concat(goafchecklistitemid),
  10496. method: 'DELETE'
  10497. });
  10498. }
  10499. // 增加检查表及其内容
  10500. function createChecklistItem(data) {
  10501. return (0, _request.request)({
  10502. url: '/goaf/goafChecklist/add',
  10503. method: 'POST',
  10504. data: data
  10505. });
  10506. }
  10507. // 更新
  10508. function updateChecklistItem(data) {
  10509. return (0, _request.request)({
  10510. url: '/goaf/goafChecklist/update',
  10511. method: 'PUT',
  10512. data: data
  10513. });
  10514. }
  10515. /***/ }),
  10516. /* 166 */,
  10517. /* 167 */,
  10518. /* 168 */,
  10519. /* 169 */,
  10520. /* 170 */,
  10521. /* 171 */,
  10522. /* 172 */,
  10523. /* 173 */,
  10524. /* 174 */
  10525. /*!**************************************************!*\
  10526. !*** E:/work/Project_newGit/CKQ/app/api/goaf.js ***!
  10527. \**************************************************/
  10528. /*! no static exports found */
  10529. /***/ (function(module, exports, __webpack_require__) {
  10530. "use strict";
  10531. Object.defineProperty(exports, "__esModule", {
  10532. value: true
  10533. });
  10534. exports.createGoaf = createGoaf;
  10535. exports.delGoaf = delGoaf;
  10536. exports.getGoafBaseInfo = getGoafBaseInfo;
  10537. exports.getGoafBaseInfoByPage = getGoafBaseInfoByPage;
  10538. exports.getGoafInfoById = getGoafInfoById;
  10539. exports.scanCode = scanCode;
  10540. exports.updateGoaf = updateGoaf;
  10541. var _request = __webpack_require__(/*! ../libs/request.js */ 40);
  10542. // 获取所有采空区信息
  10543. function getGoafBaseInfo(params) {
  10544. return (0, _request.request)({
  10545. url: '/goaf/goafbaseinfo/list',
  10546. params: params
  10547. });
  10548. }
  10549. // 获取所有采空区信息分页
  10550. function getGoafBaseInfoByPage(params) {
  10551. return (0, _request.request)({
  10552. url: '/goaf/goafbaseinfo/page',
  10553. params: params
  10554. });
  10555. }
  10556. // 根据采空区id获取信息
  10557. function getGoafInfoById(id) {
  10558. return (0, _request.request)({
  10559. url: "/goaf/goafbaseinfo/".concat(id)
  10560. });
  10561. }
  10562. // 新增
  10563. function createGoaf(data) {
  10564. return (0, _request.request)({
  10565. url: '/goaf/goafbaseinfo/add',
  10566. method: 'POST',
  10567. data: data
  10568. });
  10569. }
  10570. // 更新
  10571. function updateGoaf(data) {
  10572. return (0, _request.request)({
  10573. url: '/goaf/goafbaseinfo/update',
  10574. method: 'PUT',
  10575. data: data
  10576. });
  10577. }
  10578. // 删除
  10579. function delGoaf(goafId) {
  10580. return (0, _request.request)({
  10581. url: "/goaf/goafbaseinfo/delete/".concat(goafId),
  10582. method: 'DELETE'
  10583. });
  10584. }
  10585. // 扫码
  10586. function scanCode(goafQr) {
  10587. return (0, _request.request)({
  10588. url: "/goaf/goafbaseinfo/goafqr/".concat(goafQr),
  10589. method: 'GET'
  10590. });
  10591. }
  10592. /***/ }),
  10593. /* 175 */,
  10594. /* 176 */,
  10595. /* 177 */,
  10596. /* 178 */,
  10597. /* 179 */,
  10598. /* 180 */,
  10599. /* 181 */,
  10600. /* 182 */
  10601. /*!*********************************************************************************************!*\
  10602. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-forms/components/uni-forms/validate.js ***!
  10603. \*********************************************************************************************/
  10604. /*! no static exports found */
  10605. /***/ (function(module, exports, __webpack_require__) {
  10606. "use strict";
  10607. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10608. Object.defineProperty(exports, "__esModule", {
  10609. value: true
  10610. });
  10611. exports.default = void 0;
  10612. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 41));
  10613. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 183));
  10614. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 184));
  10615. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 186));
  10616. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 43));
  10617. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  10618. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  10619. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  10620. 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); }; }
  10621. 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; } }
  10622. var pattern = {
  10623. email: /^\S+?@\S+?\.\S+?$/,
  10624. idcard: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
  10625. url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", 'i')
  10626. };
  10627. var FORMAT_MAPPING = {
  10628. "int": 'integer',
  10629. "bool": 'boolean',
  10630. "double": 'number',
  10631. "long": 'number',
  10632. "password": 'string'
  10633. // "fileurls": 'array'
  10634. };
  10635. function formatMessage(args) {
  10636. var resources = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  10637. var defaultMessage = ['label'];
  10638. defaultMessage.forEach(function (item) {
  10639. if (args[item] === undefined) {
  10640. args[item] = '';
  10641. }
  10642. });
  10643. var str = resources;
  10644. for (var key in args) {
  10645. var reg = new RegExp('{' + key + '}');
  10646. str = str.replace(reg, args[key]);
  10647. }
  10648. return str;
  10649. }
  10650. function isEmptyValue(value, type) {
  10651. if (value === undefined || value === null) {
  10652. return true;
  10653. }
  10654. if (typeof value === 'string' && !value) {
  10655. return true;
  10656. }
  10657. if (Array.isArray(value) && !value.length) {
  10658. return true;
  10659. }
  10660. if (type === 'object' && !Object.keys(value).length) {
  10661. return true;
  10662. }
  10663. return false;
  10664. }
  10665. var types = {
  10666. integer: function integer(value) {
  10667. return types.number(value) && parseInt(value, 10) === value;
  10668. },
  10669. string: function string(value) {
  10670. return typeof value === 'string';
  10671. },
  10672. number: function number(value) {
  10673. if (isNaN(value)) {
  10674. return false;
  10675. }
  10676. return typeof value === 'number';
  10677. },
  10678. "boolean": function boolean(value) {
  10679. return typeof value === 'boolean';
  10680. },
  10681. "float": function float(value) {
  10682. return types.number(value) && !types.integer(value);
  10683. },
  10684. array: function array(value) {
  10685. return Array.isArray(value);
  10686. },
  10687. object: function object(value) {
  10688. return (0, _typeof2.default)(value) === 'object' && !types.array(value);
  10689. },
  10690. date: function date(value) {
  10691. return value instanceof Date;
  10692. },
  10693. timestamp: function timestamp(value) {
  10694. if (!this.integer(value) || Math.abs(value).toString().length > 16) {
  10695. return false;
  10696. }
  10697. return true;
  10698. },
  10699. file: function file(value) {
  10700. return typeof value.url === 'string';
  10701. },
  10702. email: function email(value) {
  10703. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  10704. },
  10705. url: function url(value) {
  10706. return typeof value === 'string' && !!value.match(pattern.url);
  10707. },
  10708. pattern: function pattern(reg, value) {
  10709. try {
  10710. return new RegExp(reg).test(value);
  10711. } catch (e) {
  10712. return false;
  10713. }
  10714. },
  10715. method: function method(value) {
  10716. return typeof value === 'function';
  10717. },
  10718. idcard: function idcard(value) {
  10719. return typeof value === 'string' && !!value.match(pattern.idcard);
  10720. },
  10721. 'url-https': function urlHttps(value) {
  10722. return this.url(value) && value.startsWith('https://');
  10723. },
  10724. 'url-scheme': function urlScheme(value) {
  10725. return value.startsWith('://');
  10726. },
  10727. 'url-web': function urlWeb(value) {
  10728. return false;
  10729. }
  10730. };
  10731. var RuleValidator = /*#__PURE__*/function () {
  10732. function RuleValidator(message) {
  10733. (0, _classCallCheck2.default)(this, RuleValidator);
  10734. this._message = message;
  10735. }
  10736. (0, _createClass2.default)(RuleValidator, [{
  10737. key: "validateRule",
  10738. value: function () {
  10739. var _validateRule = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(fieldKey, fieldValue, value, data, allData) {
  10740. var result, rules, hasRequired, message, i, rule, vt, now, resultExpr;
  10741. return _regenerator.default.wrap(function _callee$(_context) {
  10742. while (1) {
  10743. switch (_context.prev = _context.next) {
  10744. case 0:
  10745. result = null;
  10746. rules = fieldValue.rules;
  10747. hasRequired = rules.findIndex(function (item) {
  10748. return item.required;
  10749. });
  10750. if (!(hasRequired < 0)) {
  10751. _context.next = 8;
  10752. break;
  10753. }
  10754. if (!(value === null || value === undefined)) {
  10755. _context.next = 6;
  10756. break;
  10757. }
  10758. return _context.abrupt("return", result);
  10759. case 6:
  10760. if (!(typeof value === 'string' && !value.length)) {
  10761. _context.next = 8;
  10762. break;
  10763. }
  10764. return _context.abrupt("return", result);
  10765. case 8:
  10766. message = this._message;
  10767. if (!(rules === undefined)) {
  10768. _context.next = 11;
  10769. break;
  10770. }
  10771. return _context.abrupt("return", message['default']);
  10772. case 11:
  10773. i = 0;
  10774. case 12:
  10775. if (!(i < rules.length)) {
  10776. _context.next = 35;
  10777. break;
  10778. }
  10779. rule = rules[i];
  10780. vt = this._getValidateType(rule);
  10781. Object.assign(rule, {
  10782. label: fieldValue.label || "[\"".concat(fieldKey, "\"]")
  10783. });
  10784. if (!RuleValidatorHelper[vt]) {
  10785. _context.next = 20;
  10786. break;
  10787. }
  10788. result = RuleValidatorHelper[vt](rule, value, message);
  10789. if (!(result != null)) {
  10790. _context.next = 20;
  10791. break;
  10792. }
  10793. return _context.abrupt("break", 35);
  10794. case 20:
  10795. if (!rule.validateExpr) {
  10796. _context.next = 26;
  10797. break;
  10798. }
  10799. now = Date.now();
  10800. resultExpr = rule.validateExpr(value, allData, now);
  10801. if (!(resultExpr === false)) {
  10802. _context.next = 26;
  10803. break;
  10804. }
  10805. result = this._getMessage(rule, rule.errorMessage || this._message['default']);
  10806. return _context.abrupt("break", 35);
  10807. case 26:
  10808. if (!rule.validateFunction) {
  10809. _context.next = 32;
  10810. break;
  10811. }
  10812. _context.next = 29;
  10813. return this.validateFunction(rule, value, data, allData, vt);
  10814. case 29:
  10815. result = _context.sent;
  10816. if (!(result !== null)) {
  10817. _context.next = 32;
  10818. break;
  10819. }
  10820. return _context.abrupt("break", 35);
  10821. case 32:
  10822. i++;
  10823. _context.next = 12;
  10824. break;
  10825. case 35:
  10826. if (result !== null) {
  10827. result = message.TAG + result;
  10828. }
  10829. return _context.abrupt("return", result);
  10830. case 37:
  10831. case "end":
  10832. return _context.stop();
  10833. }
  10834. }
  10835. }, _callee, this);
  10836. }));
  10837. function validateRule(_x, _x2, _x3, _x4, _x5) {
  10838. return _validateRule.apply(this, arguments);
  10839. }
  10840. return validateRule;
  10841. }()
  10842. }, {
  10843. key: "validateFunction",
  10844. value: function () {
  10845. var _validateFunction = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(rule, value, data, allData, vt) {
  10846. var result, callbackMessage, res;
  10847. return _regenerator.default.wrap(function _callee2$(_context2) {
  10848. while (1) {
  10849. switch (_context2.prev = _context2.next) {
  10850. case 0:
  10851. result = null;
  10852. _context2.prev = 1;
  10853. callbackMessage = null;
  10854. _context2.next = 5;
  10855. return rule.validateFunction(rule, value, allData || data, function (message) {
  10856. callbackMessage = message;
  10857. });
  10858. case 5:
  10859. res = _context2.sent;
  10860. if (callbackMessage || typeof res === 'string' && res || res === false) {
  10861. result = this._getMessage(rule, callbackMessage || res, vt);
  10862. }
  10863. _context2.next = 12;
  10864. break;
  10865. case 9:
  10866. _context2.prev = 9;
  10867. _context2.t0 = _context2["catch"](1);
  10868. result = this._getMessage(rule, _context2.t0.message, vt);
  10869. case 12:
  10870. return _context2.abrupt("return", result);
  10871. case 13:
  10872. case "end":
  10873. return _context2.stop();
  10874. }
  10875. }
  10876. }, _callee2, this, [[1, 9]]);
  10877. }));
  10878. function validateFunction(_x6, _x7, _x8, _x9, _x10) {
  10879. return _validateFunction.apply(this, arguments);
  10880. }
  10881. return validateFunction;
  10882. }()
  10883. }, {
  10884. key: "_getMessage",
  10885. value: function _getMessage(rule, message, vt) {
  10886. return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default']);
  10887. }
  10888. }, {
  10889. key: "_getValidateType",
  10890. value: function _getValidateType(rule) {
  10891. var result = '';
  10892. if (rule.required) {
  10893. result = 'required';
  10894. } else if (rule.format) {
  10895. result = 'format';
  10896. } else if (rule.arrayType) {
  10897. result = 'arrayTypeFormat';
  10898. } else if (rule.range) {
  10899. result = 'range';
  10900. } else if (rule.maximum !== undefined || rule.minimum !== undefined) {
  10901. result = 'rangeNumber';
  10902. } else if (rule.maxLength !== undefined || rule.minLength !== undefined) {
  10903. result = 'rangeLength';
  10904. } else if (rule.pattern) {
  10905. result = 'pattern';
  10906. } else if (rule.validateFunction) {
  10907. result = 'validateFunction';
  10908. }
  10909. return result;
  10910. }
  10911. }]);
  10912. return RuleValidator;
  10913. }();
  10914. var RuleValidatorHelper = {
  10915. required: function required(rule, value, message) {
  10916. if (rule.required && isEmptyValue(value, rule.format || (0, _typeof2.default)(value))) {
  10917. return formatMessage(rule, rule.errorMessage || message.required);
  10918. }
  10919. return null;
  10920. },
  10921. range: function range(rule, value, message) {
  10922. var range = rule.range,
  10923. errorMessage = rule.errorMessage;
  10924. var list = new Array(range.length);
  10925. for (var i = 0; i < range.length; i++) {
  10926. var item = range[i];
  10927. if (types.object(item) && item.value !== undefined) {
  10928. list[i] = item.value;
  10929. } else {
  10930. list[i] = item;
  10931. }
  10932. }
  10933. var result = false;
  10934. if (Array.isArray(value)) {
  10935. result = new Set(value.concat(list)).size === list.length;
  10936. } else {
  10937. if (list.indexOf(value) > -1) {
  10938. result = true;
  10939. }
  10940. }
  10941. if (!result) {
  10942. return formatMessage(rule, errorMessage || message['enum']);
  10943. }
  10944. return null;
  10945. },
  10946. rangeNumber: function rangeNumber(rule, value, message) {
  10947. if (!types.number(value)) {
  10948. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  10949. }
  10950. var minimum = rule.minimum,
  10951. maximum = rule.maximum,
  10952. exclusiveMinimum = rule.exclusiveMinimum,
  10953. exclusiveMaximum = rule.exclusiveMaximum;
  10954. var min = exclusiveMinimum ? value <= minimum : value < minimum;
  10955. var max = exclusiveMaximum ? value >= maximum : value > maximum;
  10956. if (minimum !== undefined && min) {
  10957. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMinimum ? 'exclusiveMinimum' : 'minimum']);
  10958. } else if (maximum !== undefined && max) {
  10959. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMaximum ? 'exclusiveMaximum' : 'maximum']);
  10960. } else if (minimum !== undefined && maximum !== undefined && (min || max)) {
  10961. return formatMessage(rule, rule.errorMessage || message['number'].range);
  10962. }
  10963. return null;
  10964. },
  10965. rangeLength: function rangeLength(rule, value, message) {
  10966. if (!types.string(value) && !types.array(value)) {
  10967. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  10968. }
  10969. var min = rule.minLength;
  10970. var max = rule.maxLength;
  10971. var val = value.length;
  10972. if (min !== undefined && val < min) {
  10973. return formatMessage(rule, rule.errorMessage || message['length'].minLength);
  10974. } else if (max !== undefined && val > max) {
  10975. return formatMessage(rule, rule.errorMessage || message['length'].maxLength);
  10976. } else if (min !== undefined && max !== undefined && (val < min || val > max)) {
  10977. return formatMessage(rule, rule.errorMessage || message['length'].range);
  10978. }
  10979. return null;
  10980. },
  10981. pattern: function pattern(rule, value, message) {
  10982. if (!types['pattern'](rule.pattern, value)) {
  10983. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  10984. }
  10985. return null;
  10986. },
  10987. format: function format(rule, value, message) {
  10988. var customTypes = Object.keys(types);
  10989. var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format || rule.arrayType;
  10990. if (customTypes.indexOf(format) > -1) {
  10991. if (!types[format](value)) {
  10992. return formatMessage(rule, rule.errorMessage || message.typeError);
  10993. }
  10994. }
  10995. return null;
  10996. },
  10997. arrayTypeFormat: function arrayTypeFormat(rule, value, message) {
  10998. if (!Array.isArray(value)) {
  10999. return formatMessage(rule, rule.errorMessage || message.typeError);
  11000. }
  11001. for (var i = 0; i < value.length; i++) {
  11002. var element = value[i];
  11003. var formatResult = this.format(rule, element, message);
  11004. if (formatResult !== null) {
  11005. return formatResult;
  11006. }
  11007. }
  11008. return null;
  11009. }
  11010. };
  11011. var SchemaValidator = /*#__PURE__*/function (_RuleValidator) {
  11012. (0, _inherits2.default)(SchemaValidator, _RuleValidator);
  11013. var _super = _createSuper(SchemaValidator);
  11014. function SchemaValidator(schema, options) {
  11015. var _this;
  11016. (0, _classCallCheck2.default)(this, SchemaValidator);
  11017. _this = _super.call(this, SchemaValidator.message);
  11018. _this._schema = schema;
  11019. _this._options = options || null;
  11020. return _this;
  11021. }
  11022. (0, _createClass2.default)(SchemaValidator, [{
  11023. key: "updateSchema",
  11024. value: function updateSchema(schema) {
  11025. this._schema = schema;
  11026. }
  11027. }, {
  11028. key: "validate",
  11029. value: function () {
  11030. var _validate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(data, allData) {
  11031. var result;
  11032. return _regenerator.default.wrap(function _callee3$(_context3) {
  11033. while (1) {
  11034. switch (_context3.prev = _context3.next) {
  11035. case 0:
  11036. result = this._checkFieldInSchema(data);
  11037. if (result) {
  11038. _context3.next = 5;
  11039. break;
  11040. }
  11041. _context3.next = 4;
  11042. return this.invokeValidate(data, false, allData);
  11043. case 4:
  11044. result = _context3.sent;
  11045. case 5:
  11046. return _context3.abrupt("return", result.length ? result[0] : null);
  11047. case 6:
  11048. case "end":
  11049. return _context3.stop();
  11050. }
  11051. }
  11052. }, _callee3, this);
  11053. }));
  11054. function validate(_x11, _x12) {
  11055. return _validate.apply(this, arguments);
  11056. }
  11057. return validate;
  11058. }()
  11059. }, {
  11060. key: "validateAll",
  11061. value: function () {
  11062. var _validateAll = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(data, allData) {
  11063. var result;
  11064. return _regenerator.default.wrap(function _callee4$(_context4) {
  11065. while (1) {
  11066. switch (_context4.prev = _context4.next) {
  11067. case 0:
  11068. result = this._checkFieldInSchema(data);
  11069. if (result) {
  11070. _context4.next = 5;
  11071. break;
  11072. }
  11073. _context4.next = 4;
  11074. return this.invokeValidate(data, true, allData);
  11075. case 4:
  11076. result = _context4.sent;
  11077. case 5:
  11078. return _context4.abrupt("return", result);
  11079. case 6:
  11080. case "end":
  11081. return _context4.stop();
  11082. }
  11083. }
  11084. }, _callee4, this);
  11085. }));
  11086. function validateAll(_x13, _x14) {
  11087. return _validateAll.apply(this, arguments);
  11088. }
  11089. return validateAll;
  11090. }()
  11091. }, {
  11092. key: "validateUpdate",
  11093. value: function () {
  11094. var _validateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(data, allData) {
  11095. var result;
  11096. return _regenerator.default.wrap(function _callee5$(_context5) {
  11097. while (1) {
  11098. switch (_context5.prev = _context5.next) {
  11099. case 0:
  11100. result = this._checkFieldInSchema(data);
  11101. if (result) {
  11102. _context5.next = 5;
  11103. break;
  11104. }
  11105. _context5.next = 4;
  11106. return this.invokeValidateUpdate(data, false, allData);
  11107. case 4:
  11108. result = _context5.sent;
  11109. case 5:
  11110. return _context5.abrupt("return", result.length ? result[0] : null);
  11111. case 6:
  11112. case "end":
  11113. return _context5.stop();
  11114. }
  11115. }
  11116. }, _callee5, this);
  11117. }));
  11118. function validateUpdate(_x15, _x16) {
  11119. return _validateUpdate.apply(this, arguments);
  11120. }
  11121. return validateUpdate;
  11122. }()
  11123. }, {
  11124. key: "invokeValidate",
  11125. value: function () {
  11126. var _invokeValidate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(data, all, allData) {
  11127. var result, schema, key, value, errorMessage;
  11128. return _regenerator.default.wrap(function _callee6$(_context6) {
  11129. while (1) {
  11130. switch (_context6.prev = _context6.next) {
  11131. case 0:
  11132. result = [];
  11133. schema = this._schema;
  11134. _context6.t0 = _regenerator.default.keys(schema);
  11135. case 3:
  11136. if ((_context6.t1 = _context6.t0()).done) {
  11137. _context6.next = 15;
  11138. break;
  11139. }
  11140. key = _context6.t1.value;
  11141. value = schema[key];
  11142. _context6.next = 8;
  11143. return this.validateRule(key, value, data[key], data, allData);
  11144. case 8:
  11145. errorMessage = _context6.sent;
  11146. if (!(errorMessage != null)) {
  11147. _context6.next = 13;
  11148. break;
  11149. }
  11150. result.push({
  11151. key: key,
  11152. errorMessage: errorMessage
  11153. });
  11154. if (all) {
  11155. _context6.next = 13;
  11156. break;
  11157. }
  11158. return _context6.abrupt("break", 15);
  11159. case 13:
  11160. _context6.next = 3;
  11161. break;
  11162. case 15:
  11163. return _context6.abrupt("return", result);
  11164. case 16:
  11165. case "end":
  11166. return _context6.stop();
  11167. }
  11168. }
  11169. }, _callee6, this);
  11170. }));
  11171. function invokeValidate(_x17, _x18, _x19) {
  11172. return _invokeValidate.apply(this, arguments);
  11173. }
  11174. return invokeValidate;
  11175. }()
  11176. }, {
  11177. key: "invokeValidateUpdate",
  11178. value: function () {
  11179. var _invokeValidateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(data, all, allData) {
  11180. var result, key, errorMessage;
  11181. return _regenerator.default.wrap(function _callee7$(_context7) {
  11182. while (1) {
  11183. switch (_context7.prev = _context7.next) {
  11184. case 0:
  11185. result = [];
  11186. _context7.t0 = _regenerator.default.keys(data);
  11187. case 2:
  11188. if ((_context7.t1 = _context7.t0()).done) {
  11189. _context7.next = 13;
  11190. break;
  11191. }
  11192. key = _context7.t1.value;
  11193. _context7.next = 6;
  11194. return this.validateRule(key, this._schema[key], data[key], data, allData);
  11195. case 6:
  11196. errorMessage = _context7.sent;
  11197. if (!(errorMessage != null)) {
  11198. _context7.next = 11;
  11199. break;
  11200. }
  11201. result.push({
  11202. key: key,
  11203. errorMessage: errorMessage
  11204. });
  11205. if (all) {
  11206. _context7.next = 11;
  11207. break;
  11208. }
  11209. return _context7.abrupt("break", 13);
  11210. case 11:
  11211. _context7.next = 2;
  11212. break;
  11213. case 13:
  11214. return _context7.abrupt("return", result);
  11215. case 14:
  11216. case "end":
  11217. return _context7.stop();
  11218. }
  11219. }
  11220. }, _callee7, this);
  11221. }));
  11222. function invokeValidateUpdate(_x20, _x21, _x22) {
  11223. return _invokeValidateUpdate.apply(this, arguments);
  11224. }
  11225. return invokeValidateUpdate;
  11226. }()
  11227. }, {
  11228. key: "_checkFieldInSchema",
  11229. value: function _checkFieldInSchema(data) {
  11230. var keys = Object.keys(data);
  11231. var keys2 = Object.keys(this._schema);
  11232. if (new Set(keys.concat(keys2)).size === keys2.length) {
  11233. return '';
  11234. }
  11235. var noExistFields = keys.filter(function (key) {
  11236. return keys2.indexOf(key) < 0;
  11237. });
  11238. var errorMessage = formatMessage({
  11239. field: JSON.stringify(noExistFields)
  11240. }, SchemaValidator.message.TAG + SchemaValidator.message['defaultInvalid']);
  11241. return [{
  11242. key: 'invalid',
  11243. errorMessage: errorMessage
  11244. }];
  11245. }
  11246. }]);
  11247. return SchemaValidator;
  11248. }(RuleValidator);
  11249. function Message() {
  11250. return {
  11251. TAG: "",
  11252. default: '验证错误',
  11253. defaultInvalid: '提交的字段{field}在数据库中并不存在',
  11254. validateFunction: '验证无效',
  11255. required: '{label}必填',
  11256. 'enum': '{label}超出范围',
  11257. timestamp: '{label}格式无效',
  11258. whitespace: '{label}不能为空',
  11259. typeError: '{label}类型无效',
  11260. date: {
  11261. format: '{label}日期{value}格式无效',
  11262. parse: '{label}日期无法解析,{value}无效',
  11263. invalid: '{label}日期{value}无效'
  11264. },
  11265. length: {
  11266. minLength: '{label}长度不能少于{minLength}',
  11267. maxLength: '{label}长度不能超过{maxLength}',
  11268. range: '{label}必须介于{minLength}和{maxLength}之间'
  11269. },
  11270. number: {
  11271. minimum: '{label}不能小于{minimum}',
  11272. maximum: '{label}不能大于{maximum}',
  11273. exclusiveMinimum: '{label}不能小于等于{minimum}',
  11274. exclusiveMaximum: '{label}不能大于等于{maximum}',
  11275. range: '{label}必须介于{minimum}and{maximum}之间'
  11276. },
  11277. pattern: {
  11278. mismatch: '{label}格式不匹配'
  11279. }
  11280. };
  11281. }
  11282. SchemaValidator.message = new Message();
  11283. var _default = SchemaValidator;
  11284. exports.default = _default;
  11285. /***/ }),
  11286. /* 183 */
  11287. /*!*********************************************************!*\
  11288. !*** ./node_modules/@babel/runtime/helpers/inherits.js ***!
  11289. \*********************************************************/
  11290. /*! no static exports found */
  11291. /***/ (function(module, exports, __webpack_require__) {
  11292. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  11293. function _inherits(subClass, superClass) {
  11294. if (typeof superClass !== "function" && superClass !== null) {
  11295. throw new TypeError("Super expression must either be null or a function");
  11296. }
  11297. subClass.prototype = Object.create(superClass && superClass.prototype, {
  11298. constructor: {
  11299. value: subClass,
  11300. writable: true,
  11301. configurable: true
  11302. }
  11303. });
  11304. Object.defineProperty(subClass, "prototype", {
  11305. writable: false
  11306. });
  11307. if (superClass) setPrototypeOf(subClass, superClass);
  11308. }
  11309. module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11310. /***/ }),
  11311. /* 184 */
  11312. /*!**************************************************************************!*\
  11313. !*** ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
  11314. \**************************************************************************/
  11315. /*! no static exports found */
  11316. /***/ (function(module, exports, __webpack_require__) {
  11317. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  11318. var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ 185);
  11319. function _possibleConstructorReturn(self, call) {
  11320. if (call && (_typeof(call) === "object" || typeof call === "function")) {
  11321. return call;
  11322. } else if (call !== void 0) {
  11323. throw new TypeError("Derived constructors may only return object or undefined");
  11324. }
  11325. return assertThisInitialized(self);
  11326. }
  11327. module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11328. /***/ }),
  11329. /* 185 */
  11330. /*!**********************************************************************!*\
  11331. !*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
  11332. \**********************************************************************/
  11333. /*! no static exports found */
  11334. /***/ (function(module, exports) {
  11335. function _assertThisInitialized(self) {
  11336. if (self === void 0) {
  11337. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  11338. }
  11339. return self;
  11340. }
  11341. module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11342. /***/ }),
  11343. /* 186 */
  11344. /*!***************************************************************!*\
  11345. !*** ./node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
  11346. \***************************************************************/
  11347. /*! no static exports found */
  11348. /***/ (function(module, exports) {
  11349. function _getPrototypeOf(o) {
  11350. module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
  11351. return o.__proto__ || Object.getPrototypeOf(o);
  11352. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11353. return _getPrototypeOf(o);
  11354. }
  11355. module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11356. /***/ }),
  11357. /* 187 */
  11358. /*!******************************************************************************************!*\
  11359. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-forms/components/uni-forms/utils.js ***!
  11360. \******************************************************************************************/
  11361. /*! no static exports found */
  11362. /***/ (function(module, exports, __webpack_require__) {
  11363. "use strict";
  11364. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11365. Object.defineProperty(exports, "__esModule", {
  11366. value: true
  11367. });
  11368. exports.typeFilter = exports.type = exports.setDataValue = exports.realName = exports.rawData = exports.objSet = exports.objGet = exports.name2arr = exports.isRequiredField = exports.isRealName = exports.isNumber = exports.isEqual = exports.isBoolean = exports.getValue = exports.getDataValueType = exports.getDataValue = exports.deepCopy = void 0;
  11369. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  11370. /**
  11371. * 简单处理对象拷贝
  11372. * @param {Obejct} 被拷贝对象
  11373. * @@return {Object} 拷贝对象
  11374. */
  11375. var deepCopy = function deepCopy(val) {
  11376. return JSON.parse(JSON.stringify(val));
  11377. };
  11378. /**
  11379. * 过滤数字类型
  11380. * @param {String} format 数字类型
  11381. * @@return {Boolean} 返回是否为数字类型
  11382. */
  11383. exports.deepCopy = deepCopy;
  11384. var typeFilter = function typeFilter(format) {
  11385. return format === 'int' || format === 'double' || format === 'number' || format === 'timestamp';
  11386. };
  11387. /**
  11388. * 把 value 转换成指定的类型,用于处理初始值,原因是初始值需要入库不能为 undefined
  11389. * @param {String} key 字段名
  11390. * @param {any} value 字段值
  11391. * @param {Object} rules 表单校验规则
  11392. */
  11393. exports.typeFilter = typeFilter;
  11394. var getValue = function getValue(key, value, rules) {
  11395. var isRuleNumType = rules.find(function (val) {
  11396. return val.format && typeFilter(val.format);
  11397. });
  11398. var isRuleBoolType = rules.find(function (val) {
  11399. return val.format && val.format === 'boolean' || val.format === 'bool';
  11400. });
  11401. // 输入类型为 number
  11402. if (!!isRuleNumType) {
  11403. if (!value && value !== 0) {
  11404. value = null;
  11405. } else {
  11406. value = isNumber(Number(value)) ? Number(value) : value;
  11407. }
  11408. }
  11409. // 输入类型为 boolean
  11410. if (!!isRuleBoolType) {
  11411. value = isBoolean(value) ? value : false;
  11412. }
  11413. return value;
  11414. };
  11415. /**
  11416. * 获取表单数据
  11417. * @param {String|Array} name 真实名称,需要使用 realName 获取
  11418. * @param {Object} data 原始数据
  11419. * @param {any} value 需要设置的值
  11420. */
  11421. exports.getValue = getValue;
  11422. var setDataValue = function setDataValue(field, formdata, value) {
  11423. formdata[field] = value;
  11424. return value || '';
  11425. };
  11426. /**
  11427. * 获取表单数据
  11428. * @param {String|Array} field 真实名称,需要使用 realName 获取
  11429. * @param {Object} data 原始数据
  11430. */
  11431. exports.setDataValue = setDataValue;
  11432. var getDataValue = function getDataValue(field, data) {
  11433. return objGet(data, field);
  11434. };
  11435. /**
  11436. * 获取表单类型
  11437. * @param {String|Array} field 真实名称,需要使用 realName 获取
  11438. */
  11439. exports.getDataValue = getDataValue;
  11440. var getDataValueType = function getDataValueType(field, data) {
  11441. var value = getDataValue(field, data);
  11442. return {
  11443. type: type(value),
  11444. value: value
  11445. };
  11446. };
  11447. /**
  11448. * 获取表单可用的真实name
  11449. * @param {String|Array} name 表单name
  11450. * @@return {String} 表单可用的真实name
  11451. */
  11452. exports.getDataValueType = getDataValueType;
  11453. var realName = function realName(name) {
  11454. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11455. var base_name = _basePath(name);
  11456. if ((0, _typeof2.default)(base_name) === 'object' && Array.isArray(base_name) && base_name.length > 1) {
  11457. var realname = base_name.reduce(function (a, b) {
  11458. return a += "#".concat(b);
  11459. }, '_formdata_');
  11460. return realname;
  11461. }
  11462. return base_name[0] || name;
  11463. };
  11464. /**
  11465. * 判断是否表单可用的真实name
  11466. * @param {String|Array} name 表单name
  11467. * @@return {String} 表单可用的真实name
  11468. */
  11469. exports.realName = realName;
  11470. var isRealName = function isRealName(name) {
  11471. var reg = /^_formdata_#*/;
  11472. return reg.test(name);
  11473. };
  11474. /**
  11475. * 获取表单数据的原始格式
  11476. * @@return {Object|Array} object 需要解析的数据
  11477. */
  11478. exports.isRealName = isRealName;
  11479. var rawData = function rawData() {
  11480. var object = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11481. var name = arguments.length > 1 ? arguments[1] : undefined;
  11482. var newData = JSON.parse(JSON.stringify(object));
  11483. var formData = {};
  11484. for (var i in newData) {
  11485. var path = name2arr(i);
  11486. objSet(formData, path, newData[i]);
  11487. }
  11488. return formData;
  11489. };
  11490. /**
  11491. * 真实name还原为 array
  11492. * @param {*} name
  11493. */
  11494. exports.rawData = rawData;
  11495. var name2arr = function name2arr(name) {
  11496. var field = name.replace('_formdata_#', '');
  11497. field = field.split('#').map(function (v) {
  11498. return isNumber(v) ? Number(v) : v;
  11499. });
  11500. return field;
  11501. };
  11502. /**
  11503. * 对象中设置值
  11504. * @param {Object|Array} object 源数据
  11505. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  11506. * @param {String} value 需要设置的值
  11507. */
  11508. exports.name2arr = name2arr;
  11509. var objSet = function objSet(object, path, value) {
  11510. if ((0, _typeof2.default)(object) !== 'object') return object;
  11511. _basePath(path).reduce(function (o, k, i, _) {
  11512. if (i === _.length - 1) {
  11513. // 若遍历结束直接赋值
  11514. o[k] = value;
  11515. return null;
  11516. } else if (k in o) {
  11517. // 若存在对应路径,则返回找到的对象,进行下一次遍历
  11518. return o[k];
  11519. } else {
  11520. // 若不存在对应路径,则创建对应对象,若下一路径是数字,新对象赋值为空数组,否则赋值为空对象
  11521. o[k] = /^[0-9]{1,}$/.test(_[i + 1]) ? [] : {};
  11522. return o[k];
  11523. }
  11524. }, object);
  11525. // 返回object
  11526. return object;
  11527. };
  11528. // 处理 path, path有三种形式:'a[0].b.c'、'a.0.b.c' 和 ['a','0','b','c'],需要统一处理成数组,便于后续使用
  11529. exports.objSet = objSet;
  11530. function _basePath(path) {
  11531. // 若是数组,则直接返回
  11532. if (Array.isArray(path)) return path;
  11533. // 若有 '[',']',则替换成将 '[' 替换成 '.',去掉 ']'
  11534. return path.replace(/\[/g, '.').replace(/\]/g, '').split('.');
  11535. }
  11536. /**
  11537. * 从对象中获取值
  11538. * @param {Object|Array} object 源数据
  11539. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  11540. * @param {String} defaultVal 如果无法从调用链中获取值的默认值
  11541. */
  11542. var objGet = function objGet(object, path) {
  11543. var defaultVal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'undefined';
  11544. // 先将path处理成统一格式
  11545. var newPath = _basePath(path);
  11546. // 递归处理,返回最后结果
  11547. var val = newPath.reduce(function (o, k) {
  11548. return (o || {})[k];
  11549. }, object);
  11550. return !val || val !== undefined ? val : defaultVal;
  11551. };
  11552. /**
  11553. * 是否为 number 类型
  11554. * @param {any} num 需要判断的值
  11555. * @return {Boolean} 是否为 number
  11556. */
  11557. exports.objGet = objGet;
  11558. var isNumber = function isNumber(num) {
  11559. return !isNaN(Number(num));
  11560. };
  11561. /**
  11562. * 是否为 boolean 类型
  11563. * @param {any} bool 需要判断的值
  11564. * @return {Boolean} 是否为 boolean
  11565. */
  11566. exports.isNumber = isNumber;
  11567. var isBoolean = function isBoolean(bool) {
  11568. return typeof bool === 'boolean';
  11569. };
  11570. /**
  11571. * 是否有必填字段
  11572. * @param {Object} rules 规则
  11573. * @return {Boolean} 是否有必填字段
  11574. */
  11575. exports.isBoolean = isBoolean;
  11576. var isRequiredField = function isRequiredField(rules) {
  11577. var isNoField = false;
  11578. for (var i = 0; i < rules.length; i++) {
  11579. var ruleData = rules[i];
  11580. if (ruleData.required) {
  11581. isNoField = true;
  11582. break;
  11583. }
  11584. }
  11585. return isNoField;
  11586. };
  11587. /**
  11588. * 获取数据类型
  11589. * @param {Any} obj 需要获取数据类型的值
  11590. */
  11591. exports.isRequiredField = isRequiredField;
  11592. var type = function type(obj) {
  11593. var class2type = {};
  11594. // 生成class2type映射
  11595. "Boolean Number String Function Array Date RegExp Object Error".split(" ").map(function (item, index) {
  11596. class2type["[object " + item + "]"] = item.toLowerCase();
  11597. });
  11598. if (obj == null) {
  11599. return obj + "";
  11600. }
  11601. return (0, _typeof2.default)(obj) === "object" || typeof obj === "function" ? class2type[Object.prototype.toString.call(obj)] || "object" : (0, _typeof2.default)(obj);
  11602. };
  11603. /**
  11604. * 判断两个值是否相等
  11605. * @param {any} a 值
  11606. * @param {any} b 值
  11607. * @return {Boolean} 是否相等
  11608. */
  11609. exports.type = type;
  11610. var isEqual = function isEqual(a, b) {
  11611. //如果a和b本来就全等
  11612. if (a === b) {
  11613. //判断是否为0和-0
  11614. return a !== 0 || 1 / a === 1 / b;
  11615. }
  11616. //判断是否为null和undefined
  11617. if (a == null || b == null) {
  11618. return a === b;
  11619. }
  11620. //接下来判断a和b的数据类型
  11621. var classNameA = toString.call(a),
  11622. classNameB = toString.call(b);
  11623. //如果数据类型不相等,则返回false
  11624. if (classNameA !== classNameB) {
  11625. return false;
  11626. }
  11627. //如果数据类型相等,再根据不同数据类型分别判断
  11628. switch (classNameA) {
  11629. case '[object RegExp]':
  11630. case '[object String]':
  11631. //进行字符串转换比较
  11632. return '' + a === '' + b;
  11633. case '[object Number]':
  11634. //进行数字转换比较,判断是否为NaN
  11635. if (+a !== +a) {
  11636. return +b !== +b;
  11637. }
  11638. //判断是否为0或-0
  11639. return +a === 0 ? 1 / +a === 1 / b : +a === +b;
  11640. case '[object Date]':
  11641. case '[object Boolean]':
  11642. return +a === +b;
  11643. }
  11644. //如果是对象类型
  11645. if (classNameA == '[object Object]') {
  11646. //获取a和b的属性长度
  11647. var propsA = Object.getOwnPropertyNames(a),
  11648. propsB = Object.getOwnPropertyNames(b);
  11649. if (propsA.length != propsB.length) {
  11650. return false;
  11651. }
  11652. for (var i = 0; i < propsA.length; i++) {
  11653. var propName = propsA[i];
  11654. //如果对应属性对应值不相等,则返回false
  11655. if (a[propName] !== b[propName]) {
  11656. return false;
  11657. }
  11658. }
  11659. return true;
  11660. }
  11661. //如果是数组类型
  11662. if (classNameA == '[object Array]') {
  11663. if (a.toString() == b.toString()) {
  11664. return true;
  11665. }
  11666. return false;
  11667. }
  11668. };
  11669. exports.isEqual = isEqual;
  11670. /***/ }),
  11671. /* 188 */,
  11672. /* 189 */,
  11673. /* 190 */,
  11674. /* 191 */,
  11675. /* 192 */,
  11676. /* 193 */,
  11677. /* 194 */,
  11678. /* 195 */,
  11679. /* 196 */,
  11680. /* 197 */,
  11681. /* 198 */,
  11682. /* 199 */,
  11683. /* 200 */,
  11684. /* 201 */,
  11685. /* 202 */,
  11686. /* 203 */,
  11687. /* 204 */,
  11688. /* 205 */,
  11689. /* 206 */,
  11690. /* 207 */,
  11691. /* 208 */,
  11692. /* 209 */
  11693. /*!************************************************************************************!*\
  11694. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js ***!
  11695. \************************************************************************************/
  11696. /*! no static exports found */
  11697. /***/ (function(module, exports, __webpack_require__) {
  11698. "use strict";
  11699. /* WEBPACK VAR INJECTION */(function(global, uni, wx) {
  11700. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11701. Object.defineProperty(exports, "__esModule", {
  11702. value: true
  11703. });
  11704. exports.default = void 0;
  11705. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 41));
  11706. var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ 185));
  11707. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  11708. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  11709. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  11710. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 43));
  11711. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 183));
  11712. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 184));
  11713. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 186));
  11714. var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ 210));
  11715. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  11716. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  11717. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  11718. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  11719. var _pages = _interopRequireDefault(__webpack_require__(/*! @/pages.json */ 212));
  11720. 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(_e34) { throw _e34; }, 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(_e35) { didErr = true; err = _e35; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
  11721. 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); }
  11722. 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; }
  11723. 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); }; }
  11724. 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; } }
  11725. 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; }
  11726. 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; }
  11727. "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self;
  11728. function n(e) {
  11729. return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
  11730. }
  11731. function s(e, t, n) {
  11732. return e(n = {
  11733. path: t,
  11734. exports: {},
  11735. require: function require(e, t) {
  11736. return function () {
  11737. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  11738. }(null == t && n.path);
  11739. }
  11740. }, n.exports), n.exports;
  11741. }
  11742. var r = s(function (e, t) {
  11743. var n;
  11744. e.exports = (n = n || function (e, t) {
  11745. var n = Object.create || function () {
  11746. function e() {}
  11747. return function (t) {
  11748. var n;
  11749. return e.prototype = t, n = new e(), e.prototype = null, n;
  11750. };
  11751. }(),
  11752. s = {},
  11753. r = s.lib = {},
  11754. i = r.Base = {
  11755. extend: function extend(e) {
  11756. var t = n(this);
  11757. return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () {
  11758. t.$super.init.apply(this, arguments);
  11759. }), t.init.prototype = t, t.$super = this, t;
  11760. },
  11761. create: function create() {
  11762. var e = this.extend();
  11763. return e.init.apply(e, arguments), e;
  11764. },
  11765. init: function init() {},
  11766. mixIn: function mixIn(e) {
  11767. for (var t in e) {
  11768. e.hasOwnProperty(t) && (this[t] = e[t]);
  11769. }
  11770. e.hasOwnProperty("toString") && (this.toString = e.toString);
  11771. },
  11772. clone: function clone() {
  11773. return this.init.prototype.extend(this);
  11774. }
  11775. },
  11776. o = r.WordArray = i.extend({
  11777. init: function init(e, n) {
  11778. e = this.words = e || [], this.sigBytes = n != t ? n : 4 * e.length;
  11779. },
  11780. toString: function toString(e) {
  11781. return (e || c).stringify(this);
  11782. },
  11783. concat: function concat(e) {
  11784. var t = this.words,
  11785. n = e.words,
  11786. s = this.sigBytes,
  11787. r = e.sigBytes;
  11788. if (this.clamp(), s % 4) for (var i = 0; i < r; i++) {
  11789. var o = n[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  11790. t[s + i >>> 2] |= o << 24 - (s + i) % 4 * 8;
  11791. } else for (i = 0; i < r; i += 4) {
  11792. t[s + i >>> 2] = n[i >>> 2];
  11793. }
  11794. return this.sigBytes += r, this;
  11795. },
  11796. clamp: function clamp() {
  11797. var t = this.words,
  11798. n = this.sigBytes;
  11799. t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4);
  11800. },
  11801. clone: function clone() {
  11802. var e = i.clone.call(this);
  11803. return e.words = this.words.slice(0), e;
  11804. },
  11805. random: function random(t) {
  11806. for (var n, s = [], r = function r(t) {
  11807. t = t;
  11808. var n = 987654321,
  11809. s = 4294967295;
  11810. return function () {
  11811. var r = ((n = 36969 * (65535 & n) + (n >> 16) & s) << 16) + (t = 18e3 * (65535 & t) + (t >> 16) & s) & s;
  11812. return r /= 4294967296, (r += .5) * (e.random() > .5 ? 1 : -1);
  11813. };
  11814. }, i = 0; i < t; i += 4) {
  11815. var a = r(4294967296 * (n || e.random()));
  11816. n = 987654071 * a(), s.push(4294967296 * a() | 0);
  11817. }
  11818. return new o.init(s, t);
  11819. }
  11820. }),
  11821. a = s.enc = {},
  11822. c = a.Hex = {
  11823. stringify: function stringify(e) {
  11824. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  11825. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  11826. s.push((i >>> 4).toString(16)), s.push((15 & i).toString(16));
  11827. }
  11828. return s.join("");
  11829. },
  11830. parse: function parse(e) {
  11831. for (var t = e.length, n = [], s = 0; s < t; s += 2) {
  11832. n[s >>> 3] |= parseInt(e.substr(s, 2), 16) << 24 - s % 8 * 4;
  11833. }
  11834. return new o.init(n, t / 2);
  11835. }
  11836. },
  11837. u = a.Latin1 = {
  11838. stringify: function stringify(e) {
  11839. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  11840. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  11841. s.push(String.fromCharCode(i));
  11842. }
  11843. return s.join("");
  11844. },
  11845. parse: function parse(e) {
  11846. for (var t = e.length, n = [], s = 0; s < t; s++) {
  11847. n[s >>> 2] |= (255 & e.charCodeAt(s)) << 24 - s % 4 * 8;
  11848. }
  11849. return new o.init(n, t);
  11850. }
  11851. },
  11852. h = a.Utf8 = {
  11853. stringify: function stringify(e) {
  11854. try {
  11855. return decodeURIComponent(escape(u.stringify(e)));
  11856. } catch (e) {
  11857. throw new Error("Malformed UTF-8 data");
  11858. }
  11859. },
  11860. parse: function parse(e) {
  11861. return u.parse(unescape(encodeURIComponent(e)));
  11862. }
  11863. },
  11864. l = r.BufferedBlockAlgorithm = i.extend({
  11865. reset: function reset() {
  11866. this._data = new o.init(), this._nDataBytes = 0;
  11867. },
  11868. _append: function _append(e) {
  11869. "string" == typeof e && (e = h.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
  11870. },
  11871. _process: function _process(t) {
  11872. var n = this._data,
  11873. s = n.words,
  11874. r = n.sigBytes,
  11875. i = this.blockSize,
  11876. a = r / (4 * i),
  11877. c = (a = t ? e.ceil(a) : e.max((0 | a) - this._minBufferSize, 0)) * i,
  11878. u = e.min(4 * c, r);
  11879. if (c) {
  11880. for (var h = 0; h < c; h += i) {
  11881. this._doProcessBlock(s, h);
  11882. }
  11883. var l = s.splice(0, c);
  11884. n.sigBytes -= u;
  11885. }
  11886. return new o.init(l, u);
  11887. },
  11888. clone: function clone() {
  11889. var e = i.clone.call(this);
  11890. return e._data = this._data.clone(), e;
  11891. },
  11892. _minBufferSize: 0
  11893. });
  11894. r.Hasher = l.extend({
  11895. cfg: i.extend(),
  11896. init: function init(e) {
  11897. this.cfg = this.cfg.extend(e), this.reset();
  11898. },
  11899. reset: function reset() {
  11900. l.reset.call(this), this._doReset();
  11901. },
  11902. update: function update(e) {
  11903. return this._append(e), this._process(), this;
  11904. },
  11905. finalize: function finalize(e) {
  11906. return e && this._append(e), this._doFinalize();
  11907. },
  11908. blockSize: 16,
  11909. _createHelper: function _createHelper(e) {
  11910. return function (t, n) {
  11911. return new e.init(n).finalize(t);
  11912. };
  11913. },
  11914. _createHmacHelper: function _createHmacHelper(e) {
  11915. return function (t, n) {
  11916. return new d.HMAC.init(e, n).finalize(t);
  11917. };
  11918. }
  11919. });
  11920. var d = s.algo = {};
  11921. return s;
  11922. }(Math), n);
  11923. }),
  11924. i = r,
  11925. o = (s(function (e, t) {
  11926. var n;
  11927. e.exports = (n = i, function (e) {
  11928. var t = n,
  11929. s = t.lib,
  11930. r = s.WordArray,
  11931. i = s.Hasher,
  11932. o = t.algo,
  11933. a = [];
  11934. !function () {
  11935. for (var t = 0; t < 64; t++) {
  11936. a[t] = 4294967296 * e.abs(e.sin(t + 1)) | 0;
  11937. }
  11938. }();
  11939. var c = o.MD5 = i.extend({
  11940. _doReset: function _doReset() {
  11941. this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878]);
  11942. },
  11943. _doProcessBlock: function _doProcessBlock(e, t) {
  11944. for (var n = 0; n < 16; n++) {
  11945. var s = t + n,
  11946. r = e[s];
  11947. e[s] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8);
  11948. }
  11949. var i = this._hash.words,
  11950. o = e[t + 0],
  11951. c = e[t + 1],
  11952. p = e[t + 2],
  11953. f = e[t + 3],
  11954. g = e[t + 4],
  11955. m = e[t + 5],
  11956. y = e[t + 6],
  11957. _ = e[t + 7],
  11958. w = e[t + 8],
  11959. v = e[t + 9],
  11960. S = e[t + 10],
  11961. I = e[t + 11],
  11962. b = e[t + 12],
  11963. k = e[t + 13],
  11964. T = e[t + 14],
  11965. C = e[t + 15],
  11966. P = i[0],
  11967. A = i[1],
  11968. E = i[2],
  11969. O = i[3];
  11970. P = u(P, A, E, O, o, 7, a[0]), O = u(O, P, A, E, c, 12, a[1]), E = u(E, O, P, A, p, 17, a[2]), A = u(A, E, O, P, f, 22, a[3]), P = u(P, A, E, O, g, 7, a[4]), O = u(O, P, A, E, m, 12, a[5]), E = u(E, O, P, A, y, 17, a[6]), A = u(A, E, O, P, _, 22, a[7]), P = u(P, A, E, O, w, 7, a[8]), O = u(O, P, A, E, v, 12, a[9]), E = u(E, O, P, A, S, 17, a[10]), A = u(A, E, O, P, I, 22, a[11]), P = u(P, A, E, O, b, 7, a[12]), O = u(O, P, A, E, k, 12, a[13]), E = u(E, O, P, A, T, 17, a[14]), P = h(P, A = u(A, E, O, P, C, 22, a[15]), E, O, c, 5, a[16]), O = h(O, P, A, E, y, 9, a[17]), E = h(E, O, P, A, I, 14, a[18]), A = h(A, E, O, P, o, 20, a[19]), P = h(P, A, E, O, m, 5, a[20]), O = h(O, P, A, E, S, 9, a[21]), E = h(E, O, P, A, C, 14, a[22]), A = h(A, E, O, P, g, 20, a[23]), P = h(P, A, E, O, v, 5, a[24]), O = h(O, P, A, E, T, 9, a[25]), E = h(E, O, P, A, f, 14, a[26]), A = h(A, E, O, P, w, 20, a[27]), P = h(P, A, E, O, k, 5, a[28]), O = h(O, P, A, E, p, 9, a[29]), E = h(E, O, P, A, _, 14, a[30]), P = l(P, A = h(A, E, O, P, b, 20, a[31]), E, O, m, 4, a[32]), O = l(O, P, A, E, w, 11, a[33]), E = l(E, O, P, A, I, 16, a[34]), A = l(A, E, O, P, T, 23, a[35]), P = l(P, A, E, O, c, 4, a[36]), O = l(O, P, A, E, g, 11, a[37]), E = l(E, O, P, A, _, 16, a[38]), A = l(A, E, O, P, S, 23, a[39]), P = l(P, A, E, O, k, 4, a[40]), O = l(O, P, A, E, o, 11, a[41]), E = l(E, O, P, A, f, 16, a[42]), A = l(A, E, O, P, y, 23, a[43]), P = l(P, A, E, O, v, 4, a[44]), O = l(O, P, A, E, b, 11, a[45]), E = l(E, O, P, A, C, 16, a[46]), P = d(P, A = l(A, E, O, P, p, 23, a[47]), E, O, o, 6, a[48]), O = d(O, P, A, E, _, 10, a[49]), E = d(E, O, P, A, T, 15, a[50]), A = d(A, E, O, P, m, 21, a[51]), P = d(P, A, E, O, b, 6, a[52]), O = d(O, P, A, E, f, 10, a[53]), E = d(E, O, P, A, S, 15, a[54]), A = d(A, E, O, P, c, 21, a[55]), P = d(P, A, E, O, w, 6, a[56]), O = d(O, P, A, E, C, 10, a[57]), E = d(E, O, P, A, y, 15, a[58]), A = d(A, E, O, P, k, 21, a[59]), P = d(P, A, E, O, g, 6, a[60]), O = d(O, P, A, E, I, 10, a[61]), E = d(E, O, P, A, p, 15, a[62]), A = d(A, E, O, P, v, 21, a[63]), i[0] = i[0] + P | 0, i[1] = i[1] + A | 0, i[2] = i[2] + E | 0, i[3] = i[3] + O | 0;
  11971. },
  11972. _doFinalize: function _doFinalize() {
  11973. var t = this._data,
  11974. n = t.words,
  11975. s = 8 * this._nDataBytes,
  11976. r = 8 * t.sigBytes;
  11977. n[r >>> 5] |= 128 << 24 - r % 32;
  11978. var i = e.floor(s / 4294967296),
  11979. o = s;
  11980. 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();
  11981. for (var a = this._hash, c = a.words, u = 0; u < 4; u++) {
  11982. var h = c[u];
  11983. c[u] = 16711935 & (h << 8 | h >>> 24) | 4278255360 & (h << 24 | h >>> 8);
  11984. }
  11985. return a;
  11986. },
  11987. clone: function clone() {
  11988. var e = i.clone.call(this);
  11989. return e._hash = this._hash.clone(), e;
  11990. }
  11991. });
  11992. function u(e, t, n, s, r, i, o) {
  11993. var a = e + (t & n | ~t & s) + r + o;
  11994. return (a << i | a >>> 32 - i) + t;
  11995. }
  11996. function h(e, t, n, s, r, i, o) {
  11997. var a = e + (t & s | n & ~s) + r + o;
  11998. return (a << i | a >>> 32 - i) + t;
  11999. }
  12000. function l(e, t, n, s, r, i, o) {
  12001. var a = e + (t ^ n ^ s) + r + o;
  12002. return (a << i | a >>> 32 - i) + t;
  12003. }
  12004. function d(e, t, n, s, r, i, o) {
  12005. var a = e + (n ^ (t | ~s)) + r + o;
  12006. return (a << i | a >>> 32 - i) + t;
  12007. }
  12008. t.MD5 = i._createHelper(c), t.HmacMD5 = i._createHmacHelper(c);
  12009. }(Math), n.MD5);
  12010. }), s(function (e, t) {
  12011. var n;
  12012. e.exports = (n = i, void function () {
  12013. var e = n,
  12014. t = e.lib.Base,
  12015. s = e.enc.Utf8;
  12016. e.algo.HMAC = t.extend({
  12017. init: function init(e, t) {
  12018. e = this._hasher = new e.init(), "string" == typeof t && (t = s.parse(t));
  12019. var n = e.blockSize,
  12020. r = 4 * n;
  12021. t.sigBytes > r && (t = e.finalize(t)), t.clamp();
  12022. for (var i = this._oKey = t.clone(), o = this._iKey = t.clone(), a = i.words, c = o.words, u = 0; u < n; u++) {
  12023. a[u] ^= 1549556828, c[u] ^= 909522486;
  12024. }
  12025. i.sigBytes = o.sigBytes = r, this.reset();
  12026. },
  12027. reset: function reset() {
  12028. var e = this._hasher;
  12029. e.reset(), e.update(this._iKey);
  12030. },
  12031. update: function update(e) {
  12032. return this._hasher.update(e), this;
  12033. },
  12034. finalize: function finalize(e) {
  12035. var t = this._hasher,
  12036. n = t.finalize(e);
  12037. return t.reset(), t.finalize(this._oKey.clone().concat(n));
  12038. }
  12039. });
  12040. }());
  12041. }), s(function (e, t) {
  12042. e.exports = i.HmacMD5;
  12043. })),
  12044. a = s(function (e, t) {
  12045. e.exports = i.enc.Utf8;
  12046. }),
  12047. c = s(function (e, t) {
  12048. var n;
  12049. e.exports = (n = i, function () {
  12050. var e = n,
  12051. t = e.lib.WordArray;
  12052. function s(e, n, s) {
  12053. for (var r = [], i = 0, o = 0; o < n; o++) {
  12054. if (o % 4) {
  12055. var a = s[e.charCodeAt(o - 1)] << o % 4 * 2,
  12056. c = s[e.charCodeAt(o)] >>> 6 - o % 4 * 2;
  12057. r[i >>> 2] |= (a | c) << 24 - i % 4 * 8, i++;
  12058. }
  12059. }
  12060. return t.create(r, i);
  12061. }
  12062. e.enc.Base64 = {
  12063. stringify: function stringify(e) {
  12064. var t = e.words,
  12065. n = e.sigBytes,
  12066. s = this._map;
  12067. e.clamp();
  12068. for (var r = [], i = 0; i < n; i += 3) {
  12069. 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++) {
  12070. r.push(s.charAt(o >>> 6 * (3 - a) & 63));
  12071. }
  12072. }
  12073. var c = s.charAt(64);
  12074. if (c) for (; r.length % 4;) {
  12075. r.push(c);
  12076. }
  12077. return r.join("");
  12078. },
  12079. parse: function parse(e) {
  12080. var t = e.length,
  12081. n = this._map,
  12082. r = this._reverseMap;
  12083. if (!r) {
  12084. r = this._reverseMap = [];
  12085. for (var i = 0; i < n.length; i++) {
  12086. r[n.charCodeAt(i)] = i;
  12087. }
  12088. }
  12089. var o = n.charAt(64);
  12090. if (o) {
  12091. var a = e.indexOf(o);
  12092. -1 !== a && (t = a);
  12093. }
  12094. return s(e, t, r);
  12095. },
  12096. _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
  12097. };
  12098. }(), n.enc.Base64);
  12099. });
  12100. var u = "FUNCTION",
  12101. h = "OBJECT",
  12102. l = "CLIENT_DB",
  12103. d = "pending",
  12104. p = "fullfilled",
  12105. f = "rejected";
  12106. function g(e) {
  12107. return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();
  12108. }
  12109. function m(e) {
  12110. return "object" === g(e);
  12111. }
  12112. function y(e) {
  12113. return "function" == typeof e;
  12114. }
  12115. function _(e) {
  12116. return function () {
  12117. try {
  12118. return e.apply(e, arguments);
  12119. } catch (e) {
  12120. console.error(e);
  12121. }
  12122. };
  12123. }
  12124. var w = "REJECTED",
  12125. v = "NOT_PENDING";
  12126. var S = /*#__PURE__*/function () {
  12127. function S() {
  12128. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  12129. e = _ref.createPromise,
  12130. _ref$retryRule = _ref.retryRule,
  12131. t = _ref$retryRule === void 0 ? w : _ref$retryRule;
  12132. (0, _classCallCheck2.default)(this, S);
  12133. this.createPromise = e, this.status = null, this.promise = null, this.retryRule = t;
  12134. }
  12135. (0, _createClass2.default)(S, [{
  12136. key: "needRetry",
  12137. get: function get() {
  12138. if (!this.status) return !0;
  12139. switch (this.retryRule) {
  12140. case w:
  12141. return this.status === f;
  12142. case v:
  12143. return this.status !== d;
  12144. }
  12145. }
  12146. }, {
  12147. key: "exec",
  12148. value: function exec() {
  12149. var _this = this;
  12150. return this.needRetry ? (this.status = d, this.promise = this.createPromise().then(function (e) {
  12151. return _this.status = p, Promise.resolve(e);
  12152. }, function (e) {
  12153. return _this.status = f, Promise.reject(e);
  12154. }), this.promise) : this.promise;
  12155. }
  12156. }]);
  12157. return S;
  12158. }();
  12159. function I(e) {
  12160. return function (t) {
  12161. return new Promise(function (n, s) {
  12162. uni[e](_objectSpread(_objectSpread({}, t), {}, {
  12163. success: function success(e) {
  12164. n(e);
  12165. },
  12166. fail: function fail(e) {
  12167. s(e);
  12168. }
  12169. }));
  12170. });
  12171. };
  12172. }
  12173. function b(e) {
  12174. return e && "string" == typeof e ? JSON.parse(e) : e;
  12175. }
  12176. var k = "development" === "development",
  12177. T = "mp-weixin",
  12178. C = "true" === undefined || !0 === undefined,
  12179. P = b([]),
  12180. A = "h5" === T ? "web" : "app-plus" === T ? "app" : T,
  12181. E = b(undefined),
  12182. O = b([]) || [],
  12183. x = true;
  12184. var R = "";
  12185. try {
  12186. R = (__webpack_require__(/*! uni-stat-config */ 213).default || __webpack_require__(/*! uni-stat-config */ 213)).appid;
  12187. } catch (e) {}
  12188. var U = {};
  12189. function L(e) {
  12190. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  12191. var n, s;
  12192. return n = U, s = e, Object.prototype.hasOwnProperty.call(n, s) || (U[e] = t), U[e];
  12193. }
  12194. "app" === A && (U = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {});
  12195. var N = ["invoke", "success", "fail", "complete"],
  12196. D = L("_globalUniCloudInterceptor");
  12197. function F(e, t) {
  12198. D[e] || (D[e] = {}), m(t) && Object.keys(t).forEach(function (n) {
  12199. N.indexOf(n) > -1 && function (e, t, n) {
  12200. var s = D[e][t];
  12201. s || (s = D[e][t] = []), -1 === s.indexOf(n) && y(n) && s.push(n);
  12202. }(e, n, t[n]);
  12203. });
  12204. }
  12205. function q(e, t) {
  12206. D[e] || (D[e] = {}), m(t) ? Object.keys(t).forEach(function (n) {
  12207. N.indexOf(n) > -1 && function (e, t, n) {
  12208. var s = D[e][t];
  12209. if (!s) return;
  12210. var r = s.indexOf(n);
  12211. r > -1 && s.splice(r, 1);
  12212. }(e, n, t[n]);
  12213. }) : delete D[e];
  12214. }
  12215. function M(e, t) {
  12216. return e && 0 !== e.length ? e.reduce(function (e, n) {
  12217. return e.then(function () {
  12218. return n(t);
  12219. });
  12220. }, Promise.resolve()) : Promise.resolve();
  12221. }
  12222. function K(e, t) {
  12223. return D[e] && D[e][t] || [];
  12224. }
  12225. function j(e) {
  12226. F("callObject", e);
  12227. }
  12228. var B = L("_globalUniCloudListener"),
  12229. $ = "response",
  12230. W = "needLogin",
  12231. z = "refreshToken",
  12232. J = "clientdb",
  12233. H = "cloudfunction",
  12234. G = "cloudobject";
  12235. function V(e) {
  12236. return B[e] || (B[e] = []), B[e];
  12237. }
  12238. function Q(e, t) {
  12239. var n = V(e);
  12240. n.includes(t) || n.push(t);
  12241. }
  12242. function Y(e, t) {
  12243. var n = V(e),
  12244. s = n.indexOf(t);
  12245. -1 !== s && n.splice(s, 1);
  12246. }
  12247. function X(e, t) {
  12248. var n = V(e);
  12249. for (var _e2 = 0; _e2 < n.length; _e2++) {
  12250. (0, n[_e2])(t);
  12251. }
  12252. }
  12253. var Z,
  12254. ee = !1;
  12255. function te() {
  12256. return Z || (Z = new Promise(function (e) {
  12257. ee && e(), function t() {
  12258. if ("function" == typeof getCurrentPages) {
  12259. var _t2 = getCurrentPages();
  12260. _t2 && _t2[0] && (ee = !0, e());
  12261. }
  12262. ee || setTimeout(function () {
  12263. t();
  12264. }, 30);
  12265. }();
  12266. }), Z);
  12267. }
  12268. function ne(e) {
  12269. var t = {};
  12270. for (var _n2 in e) {
  12271. var _s2 = e[_n2];
  12272. y(_s2) && (t[_n2] = _(_s2));
  12273. }
  12274. return t;
  12275. }
  12276. var se = /*#__PURE__*/function (_Error) {
  12277. (0, _inherits2.default)(se, _Error);
  12278. var _super = _createSuper(se);
  12279. function se(e) {
  12280. var _this2;
  12281. (0, _classCallCheck2.default)(this, se);
  12282. _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;
  12283. return _this2;
  12284. }
  12285. (0, _createClass2.default)(se, [{
  12286. key: "toJson",
  12287. value: function toJson() {
  12288. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  12289. if (!(e >= 10)) return e++, {
  12290. errCode: this.errCode,
  12291. errMsg: this.errMsg,
  12292. errSubject: this.errSubject,
  12293. cause: this.cause && this.cause.toJson ? this.cause.toJson(e) : this.cause
  12294. };
  12295. }
  12296. }]);
  12297. return se;
  12298. }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
  12299. var re = {
  12300. request: function request(e) {
  12301. return uni.request(e);
  12302. },
  12303. uploadFile: function uploadFile(e) {
  12304. return uni.uploadFile(e);
  12305. },
  12306. setStorageSync: function setStorageSync(e, t) {
  12307. return uni.setStorageSync(e, t);
  12308. },
  12309. getStorageSync: function getStorageSync(e) {
  12310. return uni.getStorageSync(e);
  12311. },
  12312. removeStorageSync: function removeStorageSync(e) {
  12313. return uni.removeStorageSync(e);
  12314. },
  12315. clearStorageSync: function clearStorageSync() {
  12316. return uni.clearStorageSync();
  12317. }
  12318. };
  12319. function ie() {
  12320. return {
  12321. token: re.getStorageSync("uni_id_token") || re.getStorageSync("uniIdToken"),
  12322. tokenExpired: re.getStorageSync("uni_id_token_expired")
  12323. };
  12324. }
  12325. function oe() {
  12326. var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  12327. e = _ref2.token,
  12328. t = _ref2.tokenExpired;
  12329. e && re.setStorageSync("uni_id_token", e), t && re.setStorageSync("uni_id_token_expired", t);
  12330. }
  12331. var ae, ce;
  12332. function ue() {
  12333. return ae || (ae = uni.getSystemInfoSync()), ae;
  12334. }
  12335. function he() {
  12336. var e, t;
  12337. try {
  12338. if (uni.getLaunchOptionsSync) {
  12339. if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1) return;
  12340. var _uni$getLaunchOptions = uni.getLaunchOptionsSync(),
  12341. _n3 = _uni$getLaunchOptions.scene,
  12342. _s3 = _uni$getLaunchOptions.channel;
  12343. e = _s3, t = _n3;
  12344. }
  12345. } catch (e) {}
  12346. return {
  12347. channel: e,
  12348. scene: t
  12349. };
  12350. }
  12351. function le() {
  12352. var e = uni.getLocale && uni.getLocale() || "en";
  12353. if (ce) return _objectSpread(_objectSpread({}, ce), {}, {
  12354. locale: e,
  12355. LOCALE: e
  12356. });
  12357. var t = ue(),
  12358. n = t.deviceId,
  12359. s = t.osName,
  12360. r = t.uniPlatform,
  12361. i = t.appId,
  12362. o = ["pixelRatio", "brand", "model", "system", "language", "version", "platform", "host", "SDKVersion", "swanNativeVersion", "app", "AppPlatform", "fontSizeSetting"];
  12363. for (var _e3 = 0; _e3 < o.length; _e3++) {
  12364. delete t[o[_e3]];
  12365. }
  12366. return ce = _objectSpread(_objectSpread({
  12367. PLATFORM: r,
  12368. OS: s,
  12369. APPID: i,
  12370. DEVICEID: n
  12371. }, he()), t), _objectSpread(_objectSpread({}, ce), {}, {
  12372. locale: e,
  12373. LOCALE: e
  12374. });
  12375. }
  12376. var de = {
  12377. sign: function sign(e, t) {
  12378. var n = "";
  12379. return Object.keys(e).sort().forEach(function (t) {
  12380. e[t] && (n = n + "&" + t + "=" + e[t]);
  12381. }), n = n.slice(1), o(n, t).toString();
  12382. },
  12383. wrappedRequest: function wrappedRequest(e, t) {
  12384. return new Promise(function (n, s) {
  12385. t(Object.assign(e, {
  12386. complete: function complete(e) {
  12387. 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");
  12388. var t = e.data && e.data.header && e.data.header["x-serverless-request-id"] || e.header && e.header["request-id"];
  12389. if (!e.statusCode || e.statusCode >= 400) return s(new se({
  12390. code: "SYS_ERR",
  12391. message: e.errMsg || "request:fail",
  12392. requestId: t
  12393. }));
  12394. var r = e.data;
  12395. if (r.error) return s(new se({
  12396. code: r.error.code,
  12397. message: r.error.message,
  12398. requestId: t
  12399. }));
  12400. r.result = r.data, r.requestId = t, delete r.data, n(r);
  12401. }
  12402. }));
  12403. });
  12404. },
  12405. toBase64: function toBase64(e) {
  12406. return c.stringify(a.parse(e));
  12407. }
  12408. },
  12409. pe = {
  12410. "uniCloud.init.paramRequired": "{param} required",
  12411. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  12412. };
  12413. var _e4 = (0, _uniI18n.initVueI18n)({
  12414. "zh-Hans": {
  12415. "uniCloud.init.paramRequired": "缺少参数:{param}",
  12416. "uniCloud.uploadFile.fileError": "filePath应为File对象"
  12417. },
  12418. "zh-Hant": {
  12419. "uniCloud.init.paramRequired": "缺少参数:{param}",
  12420. "uniCloud.uploadFile.fileError": "filePath应为File对象"
  12421. },
  12422. en: pe,
  12423. fr: {
  12424. "uniCloud.init.paramRequired": "{param} required",
  12425. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  12426. },
  12427. es: {
  12428. "uniCloud.init.paramRequired": "{param} required",
  12429. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  12430. },
  12431. ja: pe
  12432. }, "zh-Hans"),
  12433. fe = _e4.t;
  12434. var ge = /*#__PURE__*/function () {
  12435. function ge(e) {
  12436. var _this3 = this;
  12437. (0, _classCallCheck2.default)(this, ge);
  12438. ["spaceId", "clientSecret"].forEach(function (t) {
  12439. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error(fe("uniCloud.init.paramRequired", {
  12440. param: t
  12441. }));
  12442. }), this.config = Object.assign({}, {
  12443. endpoint: 0 === e.spaceId.indexOf("mp-") ? "https://api.next.bspapp.com" : "https://api.bspapp.com"
  12444. }, 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 = re, this._getAccessTokenPromiseHub = new S({
  12445. createPromise: function createPromise() {
  12446. return _this3.requestAuth(_this3.setupRequest({
  12447. method: "serverless.auth.user.anonymousAuthorize",
  12448. params: "{}"
  12449. }, "auth")).then(function (e) {
  12450. if (!e.result || !e.result.accessToken) throw new se({
  12451. code: "AUTH_FAILED",
  12452. message: "获取accessToken失败"
  12453. });
  12454. _this3.setAccessToken(e.result.accessToken);
  12455. });
  12456. },
  12457. retryRule: v
  12458. });
  12459. }
  12460. (0, _createClass2.default)(ge, [{
  12461. key: "hasAccessToken",
  12462. get: function get() {
  12463. return !!this.accessToken;
  12464. }
  12465. }, {
  12466. key: "setAccessToken",
  12467. value: function setAccessToken(e) {
  12468. this.accessToken = e;
  12469. }
  12470. }, {
  12471. key: "requestWrapped",
  12472. value: function requestWrapped(e) {
  12473. return de.wrappedRequest(e, this.adapter.request);
  12474. }
  12475. }, {
  12476. key: "requestAuth",
  12477. value: function requestAuth(e) {
  12478. return this.requestWrapped(e);
  12479. }
  12480. }, {
  12481. key: "request",
  12482. value: function request(e, t) {
  12483. var _this4 = this;
  12484. return Promise.resolve().then(function () {
  12485. return _this4.hasAccessToken ? t ? _this4.requestWrapped(e) : _this4.requestWrapped(e).catch(function (t) {
  12486. return new Promise(function (e, n) {
  12487. !t || "GATEWAY_INVALID_TOKEN" !== t.code && "InvalidParameter.InvalidToken" !== t.code ? n(t) : e();
  12488. }).then(function () {
  12489. return _this4.getAccessToken();
  12490. }).then(function () {
  12491. var t = _this4.rebuildRequest(e);
  12492. return _this4.request(t, !0);
  12493. });
  12494. }) : _this4.getAccessToken().then(function () {
  12495. var t = _this4.rebuildRequest(e);
  12496. return _this4.request(t, !0);
  12497. });
  12498. });
  12499. }
  12500. }, {
  12501. key: "rebuildRequest",
  12502. value: function rebuildRequest(e) {
  12503. var t = Object.assign({}, e);
  12504. return t.data.token = this.accessToken, t.header["x-basement-token"] = this.accessToken, t.header["x-serverless-sign"] = de.sign(t.data, this.config.clientSecret), t;
  12505. }
  12506. }, {
  12507. key: "setupRequest",
  12508. value: function setupRequest(e, t) {
  12509. var n = Object.assign({}, e, {
  12510. spaceId: this.config.spaceId,
  12511. timestamp: Date.now()
  12512. }),
  12513. s = {
  12514. "Content-Type": "application/json"
  12515. };
  12516. return "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = de.sign(n, this.config.clientSecret), {
  12517. url: this.config.requestUrl,
  12518. method: "POST",
  12519. data: n,
  12520. dataType: "json",
  12521. header: s
  12522. };
  12523. }
  12524. }, {
  12525. key: "getAccessToken",
  12526. value: function getAccessToken() {
  12527. return this._getAccessTokenPromiseHub.exec();
  12528. }
  12529. }, {
  12530. key: "authorize",
  12531. value: function () {
  12532. var _authorize = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  12533. return _regenerator.default.wrap(function _callee$(_context) {
  12534. while (1) {
  12535. switch (_context.prev = _context.next) {
  12536. case 0:
  12537. _context.next = 2;
  12538. return this.getAccessToken();
  12539. case 2:
  12540. case "end":
  12541. return _context.stop();
  12542. }
  12543. }
  12544. }, _callee, this);
  12545. }));
  12546. function authorize() {
  12547. return _authorize.apply(this, arguments);
  12548. }
  12549. return authorize;
  12550. }()
  12551. }, {
  12552. key: "callFunction",
  12553. value: function callFunction(e) {
  12554. var t = {
  12555. method: "serverless.function.runtime.invoke",
  12556. params: JSON.stringify({
  12557. functionTarget: e.name,
  12558. functionArgs: e.data || {}
  12559. })
  12560. };
  12561. return this.request(this.setupRequest(t));
  12562. }
  12563. }, {
  12564. key: "getOSSUploadOptionsFromPath",
  12565. value: function getOSSUploadOptionsFromPath(e) {
  12566. var t = {
  12567. method: "serverless.file.resource.generateProximalSign",
  12568. params: JSON.stringify(e)
  12569. };
  12570. return this.request(this.setupRequest(t));
  12571. }
  12572. }, {
  12573. key: "uploadFileToOSS",
  12574. value: function uploadFileToOSS(_ref3) {
  12575. var _this5 = this;
  12576. var e = _ref3.url,
  12577. t = _ref3.formData,
  12578. n = _ref3.name,
  12579. s = _ref3.filePath,
  12580. r = _ref3.fileType,
  12581. i = _ref3.onUploadProgress;
  12582. return new Promise(function (o, a) {
  12583. var c = _this5.adapter.uploadFile({
  12584. url: e,
  12585. formData: t,
  12586. name: n,
  12587. filePath: s,
  12588. fileType: r,
  12589. header: {
  12590. "X-OSS-server-side-encrpytion": "AES256"
  12591. },
  12592. success: function success(e) {
  12593. e && e.statusCode < 400 ? o(e) : a(new se({
  12594. code: "UPLOAD_FAILED",
  12595. message: "文件上传失败"
  12596. }));
  12597. },
  12598. fail: function fail(e) {
  12599. a(new se({
  12600. code: e.code || "UPLOAD_FAILED",
  12601. message: e.message || e.errMsg || "文件上传失败"
  12602. }));
  12603. }
  12604. });
  12605. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  12606. i({
  12607. loaded: e.totalBytesSent,
  12608. total: e.totalBytesExpectedToSend
  12609. });
  12610. });
  12611. });
  12612. }
  12613. }, {
  12614. key: "reportOSSUpload",
  12615. value: function reportOSSUpload(e) {
  12616. var t = {
  12617. method: "serverless.file.resource.report",
  12618. params: JSON.stringify(e)
  12619. };
  12620. return this.request(this.setupRequest(t));
  12621. }
  12622. }, {
  12623. key: "uploadFile",
  12624. value: function () {
  12625. var _uploadFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref4) {
  12626. var e, t, _ref4$fileType, n, s, r, i, o, a, c, u, h, l, d, p, f, m, y, _e5, _;
  12627. return _regenerator.default.wrap(function _callee2$(_context2) {
  12628. while (1) {
  12629. switch (_context2.prev = _context2.next) {
  12630. case 0:
  12631. e = _ref4.filePath, t = _ref4.cloudPath, _ref4$fileType = _ref4.fileType, n = _ref4$fileType === void 0 ? "image" : _ref4$fileType, s = _ref4.onUploadProgress, r = _ref4.config;
  12632. if (!("string" !== g(t))) {
  12633. _context2.next = 3;
  12634. break;
  12635. }
  12636. throw new se({
  12637. code: "INVALID_PARAM",
  12638. message: "cloudPath必须为字符串类型"
  12639. });
  12640. case 3:
  12641. if (t = t.trim()) {
  12642. _context2.next = 5;
  12643. break;
  12644. }
  12645. throw new se({
  12646. code: "CLOUDPATH_REQUIRED",
  12647. message: "cloudPath不可为空"
  12648. });
  12649. case 5:
  12650. if (!/:\/\//.test(t)) {
  12651. _context2.next = 7;
  12652. break;
  12653. }
  12654. throw new se({
  12655. code: "INVALID_PARAM",
  12656. message: "cloudPath不合法"
  12657. });
  12658. case 7:
  12659. i = r && r.envType || this.config.envType;
  12660. _context2.next = 10;
  12661. return this.getOSSUploadOptionsFromPath({
  12662. env: i,
  12663. filename: t
  12664. });
  12665. case 10:
  12666. o = _context2.sent.result;
  12667. a = "https://" + o.cdnDomain + "/" + o.ossPath;
  12668. c = o.securityToken;
  12669. u = o.accessKeyId;
  12670. h = o.signature;
  12671. l = o.host;
  12672. d = o.ossPath;
  12673. p = o.id;
  12674. f = o.policy;
  12675. m = o.ossCallbackUrl;
  12676. y = {
  12677. "Cache-Control": "max-age=2592000",
  12678. "Content-Disposition": "attachment",
  12679. OSSAccessKeyId: u,
  12680. Signature: h,
  12681. host: l,
  12682. id: p,
  12683. key: d,
  12684. policy: f,
  12685. success_action_status: 200
  12686. };
  12687. if (c && (y["x-oss-security-token"] = c), m) {
  12688. _e5 = JSON.stringify({
  12689. callbackUrl: m,
  12690. callbackBody: JSON.stringify({
  12691. fileId: p,
  12692. spaceId: this.config.spaceId
  12693. }),
  12694. callbackBodyType: "application/json"
  12695. });
  12696. y.callback = de.toBase64(_e5);
  12697. }
  12698. _ = {
  12699. url: "https://" + o.host,
  12700. formData: y,
  12701. fileName: "file",
  12702. name: "file",
  12703. filePath: e,
  12704. fileType: n
  12705. };
  12706. _context2.next = 25;
  12707. return this.uploadFileToOSS(Object.assign({}, _, {
  12708. onUploadProgress: s
  12709. }));
  12710. case 25:
  12711. if (!m) {
  12712. _context2.next = 27;
  12713. break;
  12714. }
  12715. return _context2.abrupt("return", {
  12716. success: !0,
  12717. filePath: e,
  12718. fileID: a
  12719. });
  12720. case 27:
  12721. _context2.next = 29;
  12722. return this.reportOSSUpload({
  12723. id: p
  12724. });
  12725. case 29:
  12726. if (!_context2.sent.success) {
  12727. _context2.next = 31;
  12728. break;
  12729. }
  12730. return _context2.abrupt("return", {
  12731. success: !0,
  12732. filePath: e,
  12733. fileID: a
  12734. });
  12735. case 31:
  12736. throw new se({
  12737. code: "UPLOAD_FAILED",
  12738. message: "文件上传失败"
  12739. });
  12740. case 32:
  12741. case "end":
  12742. return _context2.stop();
  12743. }
  12744. }
  12745. }, _callee2, this);
  12746. }));
  12747. function uploadFile(_x) {
  12748. return _uploadFile.apply(this, arguments);
  12749. }
  12750. return uploadFile;
  12751. }()
  12752. }, {
  12753. key: "getTempFileURL",
  12754. value: function getTempFileURL() {
  12755. var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  12756. e = _ref5.fileList;
  12757. return new Promise(function (t, n) {
  12758. Array.isArray(e) && 0 !== e.length || n(new se({
  12759. code: "INVALID_PARAM",
  12760. message: "fileList的元素必须是非空的字符串"
  12761. })), t({
  12762. fileList: e.map(function (e) {
  12763. return {
  12764. fileID: e,
  12765. tempFileURL: e
  12766. };
  12767. })
  12768. });
  12769. });
  12770. }
  12771. }, {
  12772. key: "getFileInfo",
  12773. value: function () {
  12774. var _getFileInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
  12775. var _ref6,
  12776. e,
  12777. t,
  12778. _args3 = arguments;
  12779. return _regenerator.default.wrap(function _callee3$(_context3) {
  12780. while (1) {
  12781. switch (_context3.prev = _context3.next) {
  12782. case 0:
  12783. _ref6 = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, e = _ref6.fileList;
  12784. if (!(!Array.isArray(e) || 0 === e.length)) {
  12785. _context3.next = 3;
  12786. break;
  12787. }
  12788. throw new se({
  12789. code: "INVALID_PARAM",
  12790. message: "fileList的元素必须是非空的字符串"
  12791. });
  12792. case 3:
  12793. t = {
  12794. method: "serverless.file.resource.info",
  12795. params: JSON.stringify({
  12796. id: e.map(function (e) {
  12797. return e.split("?")[0];
  12798. }).join(",")
  12799. })
  12800. };
  12801. _context3.next = 6;
  12802. return this.request(this.setupRequest(t));
  12803. case 6:
  12804. _context3.t0 = _context3.sent.result;
  12805. return _context3.abrupt("return", {
  12806. fileList: _context3.t0
  12807. });
  12808. case 8:
  12809. case "end":
  12810. return _context3.stop();
  12811. }
  12812. }
  12813. }, _callee3, this);
  12814. }));
  12815. function getFileInfo() {
  12816. return _getFileInfo.apply(this, arguments);
  12817. }
  12818. return getFileInfo;
  12819. }()
  12820. }]);
  12821. return ge;
  12822. }();
  12823. var me = {
  12824. init: function init(e) {
  12825. var t = new ge(e),
  12826. n = {
  12827. signInAnonymously: function signInAnonymously() {
  12828. return t.authorize();
  12829. },
  12830. getLoginState: function getLoginState() {
  12831. return Promise.resolve(!1);
  12832. }
  12833. };
  12834. return t.auth = function () {
  12835. return n;
  12836. }, t.customAuth = t.auth, t;
  12837. }
  12838. };
  12839. var ye = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
  12840. var _e;
  12841. !function (e) {
  12842. e.local = "local", e.none = "none", e.session = "session";
  12843. }(_e || (_e = {}));
  12844. var we = function we() {};
  12845. var ve = function ve() {
  12846. var e;
  12847. if (!Promise) {
  12848. e = function e() {}, e.promise = {};
  12849. var _t3 = function _t3() {
  12850. throw new se({
  12851. message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'
  12852. });
  12853. };
  12854. return Object.defineProperty(e.promise, "then", {
  12855. get: _t3
  12856. }), Object.defineProperty(e.promise, "catch", {
  12857. get: _t3
  12858. }), e;
  12859. }
  12860. var t = new Promise(function (t, n) {
  12861. e = function e(_e6, s) {
  12862. return _e6 ? n(_e6) : t(s);
  12863. };
  12864. });
  12865. return e.promise = t, e;
  12866. };
  12867. function Se(e) {
  12868. return void 0 === e;
  12869. }
  12870. function Ie(e) {
  12871. return "[object Null]" === Object.prototype.toString.call(e);
  12872. }
  12873. var be;
  12874. function ke(e) {
  12875. var t = (n = e, "[object Array]" === Object.prototype.toString.call(n) ? e : [e]);
  12876. var n;
  12877. var _iterator = _createForOfIteratorHelper(t),
  12878. _step;
  12879. try {
  12880. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  12881. var _e7 = _step.value;
  12882. var _t4 = _e7.isMatch,
  12883. _n4 = _e7.genAdapter,
  12884. _s4 = _e7.runtime;
  12885. if (_t4()) return {
  12886. adapter: _n4(),
  12887. runtime: _s4
  12888. };
  12889. }
  12890. } catch (err) {
  12891. _iterator.e(err);
  12892. } finally {
  12893. _iterator.f();
  12894. }
  12895. }
  12896. !function (e) {
  12897. e.WEB = "web", e.WX_MP = "wx_mp";
  12898. }(be || (be = {}));
  12899. var Te = {
  12900. adapter: null,
  12901. runtime: void 0
  12902. },
  12903. Ce = ["anonymousUuidKey"];
  12904. var Pe = /*#__PURE__*/function (_we) {
  12905. (0, _inherits2.default)(Pe, _we);
  12906. var _super2 = _createSuper(Pe);
  12907. function Pe() {
  12908. var _this6;
  12909. (0, _classCallCheck2.default)(this, Pe);
  12910. _this6 = _super2.call(this), Te.adapter.root.tcbObject || (Te.adapter.root.tcbObject = {});
  12911. return _this6;
  12912. }
  12913. (0, _createClass2.default)(Pe, [{
  12914. key: "setItem",
  12915. value: function setItem(e, t) {
  12916. Te.adapter.root.tcbObject[e] = t;
  12917. }
  12918. }, {
  12919. key: "getItem",
  12920. value: function getItem(e) {
  12921. return Te.adapter.root.tcbObject[e];
  12922. }
  12923. }, {
  12924. key: "removeItem",
  12925. value: function removeItem(e) {
  12926. delete Te.adapter.root.tcbObject[e];
  12927. }
  12928. }, {
  12929. key: "clear",
  12930. value: function clear() {
  12931. delete Te.adapter.root.tcbObject;
  12932. }
  12933. }]);
  12934. return Pe;
  12935. }(we);
  12936. function Ae(e, t) {
  12937. switch (e) {
  12938. case "local":
  12939. return t.localStorage || new Pe();
  12940. case "none":
  12941. return new Pe();
  12942. default:
  12943. return t.sessionStorage || new Pe();
  12944. }
  12945. }
  12946. var Ee = /*#__PURE__*/function () {
  12947. function Ee(e) {
  12948. (0, _classCallCheck2.default)(this, Ee);
  12949. if (!this._storage) {
  12950. this._persistence = Te.adapter.primaryStorage || e.persistence, this._storage = Ae(this._persistence, Te.adapter);
  12951. var _t5 = "access_token_".concat(e.env),
  12952. _n5 = "access_token_expire_".concat(e.env),
  12953. _s5 = "refresh_token_".concat(e.env),
  12954. _r = "anonymous_uuid_".concat(e.env),
  12955. _i = "login_type_".concat(e.env),
  12956. _o = "user_info_".concat(e.env);
  12957. this.keys = {
  12958. accessTokenKey: _t5,
  12959. accessTokenExpireKey: _n5,
  12960. refreshTokenKey: _s5,
  12961. anonymousUuidKey: _r,
  12962. loginTypeKey: _i,
  12963. userInfoKey: _o
  12964. };
  12965. }
  12966. }
  12967. (0, _createClass2.default)(Ee, [{
  12968. key: "updatePersistence",
  12969. value: function updatePersistence(e) {
  12970. if (e === this._persistence) return;
  12971. var t = "local" === this._persistence;
  12972. this._persistence = e;
  12973. var n = Ae(e, Te.adapter);
  12974. for (var _e8 in this.keys) {
  12975. var _s6 = this.keys[_e8];
  12976. if (t && Ce.includes(_e8)) continue;
  12977. var _r2 = this._storage.getItem(_s6);
  12978. Se(_r2) || Ie(_r2) || (n.setItem(_s6, _r2), this._storage.removeItem(_s6));
  12979. }
  12980. this._storage = n;
  12981. }
  12982. }, {
  12983. key: "setStore",
  12984. value: function setStore(e, t, n) {
  12985. if (!this._storage) return;
  12986. var s = {
  12987. version: n || "localCachev1",
  12988. content: t
  12989. },
  12990. r = JSON.stringify(s);
  12991. try {
  12992. this._storage.setItem(e, r);
  12993. } catch (e) {
  12994. throw e;
  12995. }
  12996. }
  12997. }, {
  12998. key: "getStore",
  12999. value: function getStore(e, t) {
  13000. try {
  13001. if (!this._storage) return;
  13002. } catch (e) {
  13003. return "";
  13004. }
  13005. t = t || "localCachev1";
  13006. var n = this._storage.getItem(e);
  13007. if (!n) return "";
  13008. if (n.indexOf(t) >= 0) {
  13009. return JSON.parse(n).content;
  13010. }
  13011. return "";
  13012. }
  13013. }, {
  13014. key: "removeStore",
  13015. value: function removeStore(e) {
  13016. this._storage.removeItem(e);
  13017. }
  13018. }]);
  13019. return Ee;
  13020. }();
  13021. var Oe = {},
  13022. xe = {};
  13023. function Re(e) {
  13024. return Oe[e];
  13025. }
  13026. var Ue = /*#__PURE__*/(0, _createClass2.default)(function Ue(e, t) {
  13027. (0, _classCallCheck2.default)(this, Ue);
  13028. this.data = t || null, this.name = e;
  13029. });
  13030. var Le = /*#__PURE__*/function (_Ue) {
  13031. (0, _inherits2.default)(Le, _Ue);
  13032. var _super3 = _createSuper(Le);
  13033. function Le(e, t) {
  13034. var _this7;
  13035. (0, _classCallCheck2.default)(this, Le);
  13036. _this7 = _super3.call(this, "error", {
  13037. error: e,
  13038. data: t
  13039. }), _this7.error = e;
  13040. return _this7;
  13041. }
  13042. return (0, _createClass2.default)(Le);
  13043. }(Ue);
  13044. var Ne = new ( /*#__PURE__*/function () {
  13045. function _class() {
  13046. (0, _classCallCheck2.default)(this, _class);
  13047. this._listeners = {};
  13048. }
  13049. (0, _createClass2.default)(_class, [{
  13050. key: "on",
  13051. value: function on(e, t) {
  13052. return function (e, t, n) {
  13053. n[e] = n[e] || [], n[e].push(t);
  13054. }(e, t, this._listeners), this;
  13055. }
  13056. }, {
  13057. key: "off",
  13058. value: function off(e, t) {
  13059. return function (e, t, n) {
  13060. if (n && n[e]) {
  13061. var _s7 = n[e].indexOf(t);
  13062. -1 !== _s7 && n[e].splice(_s7, 1);
  13063. }
  13064. }(e, t, this._listeners), this;
  13065. }
  13066. }, {
  13067. key: "fire",
  13068. value: function fire(e, t) {
  13069. if (e instanceof Le) return console.error(e.error), this;
  13070. var n = "string" == typeof e ? new Ue(e, t || {}) : e;
  13071. var s = n.name;
  13072. if (this._listens(s)) {
  13073. n.target = this;
  13074. var _e9 = this._listeners[s] ? (0, _toConsumableArray2.default)(this._listeners[s]) : [];
  13075. var _iterator2 = _createForOfIteratorHelper(_e9),
  13076. _step2;
  13077. try {
  13078. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  13079. var _t6 = _step2.value;
  13080. _t6.call(this, n);
  13081. }
  13082. } catch (err) {
  13083. _iterator2.e(err);
  13084. } finally {
  13085. _iterator2.f();
  13086. }
  13087. }
  13088. return this;
  13089. }
  13090. }, {
  13091. key: "_listens",
  13092. value: function _listens(e) {
  13093. return this._listeners[e] && this._listeners[e].length > 0;
  13094. }
  13095. }]);
  13096. return _class;
  13097. }())();
  13098. function De(e, t) {
  13099. Ne.on(e, t);
  13100. }
  13101. function Fe(e) {
  13102. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  13103. Ne.fire(e, t);
  13104. }
  13105. function qe(e, t) {
  13106. Ne.off(e, t);
  13107. }
  13108. var Me = "loginStateChanged",
  13109. Ke = "loginStateExpire",
  13110. je = "loginTypeChanged",
  13111. Be = "anonymousConverted",
  13112. $e = "refreshAccessToken";
  13113. var We;
  13114. !function (e) {
  13115. 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";
  13116. }(We || (We = {}));
  13117. var ze = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"],
  13118. Je = {
  13119. "X-SDK-Version": "1.3.5"
  13120. };
  13121. function He(e, t, n) {
  13122. var s = e[t];
  13123. e[t] = function (t) {
  13124. var r = {},
  13125. i = {};
  13126. n.forEach(function (n) {
  13127. var _n$call = n.call(e, t),
  13128. s = _n$call.data,
  13129. o = _n$call.headers;
  13130. Object.assign(r, s), Object.assign(i, o);
  13131. });
  13132. var o = t.data;
  13133. return o && function () {
  13134. var e;
  13135. if (e = o, "[object FormData]" !== Object.prototype.toString.call(e)) t.data = _objectSpread(_objectSpread({}, o), r);else for (var _e10 in r) {
  13136. o.append(_e10, r[_e10]);
  13137. }
  13138. }(), t.headers = _objectSpread(_objectSpread({}, t.headers || {}), i), s.call(e, t);
  13139. };
  13140. }
  13141. function Ge() {
  13142. var e = Math.random().toString(16).slice(2);
  13143. return {
  13144. data: {
  13145. seqId: e
  13146. },
  13147. headers: _objectSpread(_objectSpread({}, Je), {}, {
  13148. "x-seqid": e
  13149. })
  13150. };
  13151. }
  13152. var Ve = /*#__PURE__*/function () {
  13153. function Ve() {
  13154. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  13155. (0, _classCallCheck2.default)(this, Ve);
  13156. var t;
  13157. this.config = e, this._reqClass = new Te.adapter.reqClass({
  13158. timeout: this.config.timeout,
  13159. timeoutMsg: "\u8BF7\u6C42\u5728".concat(this.config.timeout / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD"),
  13160. restrictedMethods: ["post"]
  13161. }), this._cache = Re(this.config.env), this._localCache = (t = this.config.env, xe[t]), He(this._reqClass, "post", [Ge]), He(this._reqClass, "upload", [Ge]), He(this._reqClass, "download", [Ge]);
  13162. }
  13163. (0, _createClass2.default)(Ve, [{
  13164. key: "post",
  13165. value: function () {
  13166. var _post = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(e) {
  13167. return _regenerator.default.wrap(function _callee4$(_context4) {
  13168. while (1) {
  13169. switch (_context4.prev = _context4.next) {
  13170. case 0:
  13171. _context4.next = 2;
  13172. return this._reqClass.post(e);
  13173. case 2:
  13174. return _context4.abrupt("return", _context4.sent);
  13175. case 3:
  13176. case "end":
  13177. return _context4.stop();
  13178. }
  13179. }
  13180. }, _callee4, this);
  13181. }));
  13182. function post(_x2) {
  13183. return _post.apply(this, arguments);
  13184. }
  13185. return post;
  13186. }()
  13187. }, {
  13188. key: "upload",
  13189. value: function () {
  13190. var _upload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(e) {
  13191. return _regenerator.default.wrap(function _callee5$(_context5) {
  13192. while (1) {
  13193. switch (_context5.prev = _context5.next) {
  13194. case 0:
  13195. _context5.next = 2;
  13196. return this._reqClass.upload(e);
  13197. case 2:
  13198. return _context5.abrupt("return", _context5.sent);
  13199. case 3:
  13200. case "end":
  13201. return _context5.stop();
  13202. }
  13203. }
  13204. }, _callee5, this);
  13205. }));
  13206. function upload(_x3) {
  13207. return _upload.apply(this, arguments);
  13208. }
  13209. return upload;
  13210. }()
  13211. }, {
  13212. key: "download",
  13213. value: function () {
  13214. var _download = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(e) {
  13215. return _regenerator.default.wrap(function _callee6$(_context6) {
  13216. while (1) {
  13217. switch (_context6.prev = _context6.next) {
  13218. case 0:
  13219. _context6.next = 2;
  13220. return this._reqClass.download(e);
  13221. case 2:
  13222. return _context6.abrupt("return", _context6.sent);
  13223. case 3:
  13224. case "end":
  13225. return _context6.stop();
  13226. }
  13227. }
  13228. }, _callee6, this);
  13229. }));
  13230. function download(_x4) {
  13231. return _download.apply(this, arguments);
  13232. }
  13233. return download;
  13234. }()
  13235. }, {
  13236. key: "refreshAccessToken",
  13237. value: function () {
  13238. var _refreshAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
  13239. var e, t;
  13240. return _regenerator.default.wrap(function _callee7$(_context7) {
  13241. while (1) {
  13242. switch (_context7.prev = _context7.next) {
  13243. case 0:
  13244. this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
  13245. _context7.prev = 1;
  13246. _context7.next = 4;
  13247. return this._refreshAccessTokenPromise;
  13248. case 4:
  13249. e = _context7.sent;
  13250. _context7.next = 10;
  13251. break;
  13252. case 7:
  13253. _context7.prev = 7;
  13254. _context7.t0 = _context7["catch"](1);
  13255. t = _context7.t0;
  13256. case 10:
  13257. if (!(this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t)) {
  13258. _context7.next = 12;
  13259. break;
  13260. }
  13261. throw t;
  13262. case 12:
  13263. return _context7.abrupt("return", e);
  13264. case 13:
  13265. case "end":
  13266. return _context7.stop();
  13267. }
  13268. }
  13269. }, _callee7, this, [[1, 7]]);
  13270. }));
  13271. function refreshAccessToken() {
  13272. return _refreshAccessToken2.apply(this, arguments);
  13273. }
  13274. return refreshAccessToken;
  13275. }()
  13276. }, {
  13277. key: "_refreshAccessToken",
  13278. value: function () {
  13279. var _refreshAccessToken3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
  13280. var _this$_cache$keys, e, t, n, s, r, i, o, a, _e11, _e12, _t7, _s8;
  13281. return _regenerator.default.wrap(function _callee8$(_context8) {
  13282. while (1) {
  13283. switch (_context8.prev = _context8.next) {
  13284. case 0:
  13285. _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;
  13286. this._cache.removeStore(e), this._cache.removeStore(t);
  13287. i = this._cache.getStore(n);
  13288. if (i) {
  13289. _context8.next = 5;
  13290. break;
  13291. }
  13292. throw new se({
  13293. message: "未登录CloudBase"
  13294. });
  13295. case 5:
  13296. o = {
  13297. refresh_token: i
  13298. };
  13299. _context8.next = 8;
  13300. return this.request("auth.fetchAccessTokenWithRefreshToken", o);
  13301. case 8:
  13302. a = _context8.sent;
  13303. if (!a.data.code) {
  13304. _context8.next = 21;
  13305. break;
  13306. }
  13307. _e11 = a.data.code;
  13308. if (!("SIGN_PARAM_INVALID" === _e11 || "REFRESH_TOKEN_EXPIRED" === _e11 || "INVALID_REFRESH_TOKEN" === _e11)) {
  13309. _context8.next = 20;
  13310. break;
  13311. }
  13312. if (!(this._cache.getStore(s) === We.ANONYMOUS && "INVALID_REFRESH_TOKEN" === _e11)) {
  13313. _context8.next = 19;
  13314. break;
  13315. }
  13316. _e12 = this._cache.getStore(r);
  13317. _t7 = this._cache.getStore(n);
  13318. _context8.next = 17;
  13319. return this.send("auth.signInAnonymously", {
  13320. anonymous_uuid: _e12,
  13321. refresh_token: _t7
  13322. });
  13323. case 17:
  13324. _s8 = _context8.sent;
  13325. return _context8.abrupt("return", (this.setRefreshToken(_s8.refresh_token), this._refreshAccessToken()));
  13326. case 19:
  13327. Fe(Ke), this._cache.removeStore(n);
  13328. case 20:
  13329. throw new se({
  13330. code: a.data.code,
  13331. message: "\u5237\u65B0access token\u5931\u8D25\uFF1A".concat(a.data.code)
  13332. });
  13333. case 21:
  13334. if (!a.data.access_token) {
  13335. _context8.next = 23;
  13336. break;
  13337. }
  13338. return _context8.abrupt("return", (Fe($e), this._cache.setStore(e, a.data.access_token), this._cache.setStore(t, a.data.access_token_expire + Date.now()), {
  13339. accessToken: a.data.access_token,
  13340. accessTokenExpire: a.data.access_token_expire
  13341. }));
  13342. case 23:
  13343. a.data.refresh_token && (this._cache.removeStore(n), this._cache.setStore(n, a.data.refresh_token), this._refreshAccessToken());
  13344. case 24:
  13345. case "end":
  13346. return _context8.stop();
  13347. }
  13348. }
  13349. }, _callee8, this);
  13350. }));
  13351. function _refreshAccessToken() {
  13352. return _refreshAccessToken3.apply(this, arguments);
  13353. }
  13354. return _refreshAccessToken;
  13355. }()
  13356. }, {
  13357. key: "getAccessToken",
  13358. value: function () {
  13359. var _getAccessToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
  13360. var _this$_cache$keys2, e, t, n, s, r, i;
  13361. return _regenerator.default.wrap(function _callee9$(_context9) {
  13362. while (1) {
  13363. switch (_context9.prev = _context9.next) {
  13364. case 0:
  13365. _this$_cache$keys2 = this._cache.keys, e = _this$_cache$keys2.accessTokenKey, t = _this$_cache$keys2.accessTokenExpireKey, n = _this$_cache$keys2.refreshTokenKey;
  13366. if (this._cache.getStore(n)) {
  13367. _context9.next = 3;
  13368. break;
  13369. }
  13370. throw new se({
  13371. message: "refresh token不存在,登录状态异常"
  13372. });
  13373. case 3:
  13374. s = this._cache.getStore(e), r = this._cache.getStore(t), i = !0;
  13375. _context9.t0 = this._shouldRefreshAccessTokenHook;
  13376. if (!_context9.t0) {
  13377. _context9.next = 9;
  13378. break;
  13379. }
  13380. _context9.next = 8;
  13381. return this._shouldRefreshAccessTokenHook(s, r);
  13382. case 8:
  13383. _context9.t0 = !_context9.sent;
  13384. case 9:
  13385. _context9.t1 = _context9.t0;
  13386. if (!_context9.t1) {
  13387. _context9.next = 12;
  13388. break;
  13389. }
  13390. i = !1;
  13391. case 12:
  13392. return _context9.abrupt("return", (!s || !r || r < Date.now()) && i ? this.refreshAccessToken() : {
  13393. accessToken: s,
  13394. accessTokenExpire: r
  13395. });
  13396. case 13:
  13397. case "end":
  13398. return _context9.stop();
  13399. }
  13400. }
  13401. }, _callee9, this);
  13402. }));
  13403. function getAccessToken() {
  13404. return _getAccessToken.apply(this, arguments);
  13405. }
  13406. return getAccessToken;
  13407. }()
  13408. }, {
  13409. key: "request",
  13410. value: function () {
  13411. var _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(e, t, n) {
  13412. var s, r, i, _e13, o, _e14, _e15, a, c, u, h, l, d, p, f, g;
  13413. return _regenerator.default.wrap(function _callee10$(_context10) {
  13414. while (1) {
  13415. switch (_context10.prev = _context10.next) {
  13416. case 0:
  13417. s = "x-tcb-trace_".concat(this.config.env);
  13418. r = "application/x-www-form-urlencoded";
  13419. i = _objectSpread({
  13420. action: e,
  13421. env: this.config.env,
  13422. dataVersion: "2019-08-16"
  13423. }, t);
  13424. if (!(-1 === ze.indexOf(e))) {
  13425. _context10.next = 10;
  13426. break;
  13427. }
  13428. _e13 = this._cache.keys.refreshTokenKey;
  13429. _context10.t0 = this._cache.getStore(_e13);
  13430. if (!_context10.t0) {
  13431. _context10.next = 10;
  13432. break;
  13433. }
  13434. _context10.next = 9;
  13435. return this.getAccessToken();
  13436. case 9:
  13437. i.access_token = _context10.sent.accessToken;
  13438. case 10:
  13439. if ("storage.uploadFile" === e) {
  13440. o = new FormData();
  13441. for (_e14 in o) {
  13442. o.hasOwnProperty(_e14) && void 0 !== o[_e14] && o.append(_e14, i[_e14]);
  13443. }
  13444. r = "multipart/form-data";
  13445. } else {
  13446. r = "application/json", o = {};
  13447. for (_e15 in i) {
  13448. void 0 !== i[_e15] && (o[_e15] = i[_e15]);
  13449. }
  13450. }
  13451. a = {
  13452. headers: {
  13453. "content-type": r
  13454. }
  13455. };
  13456. n && n.onUploadProgress && (a.onUploadProgress = n.onUploadProgress);
  13457. c = this._localCache.getStore(s);
  13458. c && (a.headers["X-TCB-Trace"] = c);
  13459. u = t.parse, h = t.inQuery, l = t.search;
  13460. d = {
  13461. env: this.config.env
  13462. };
  13463. u && (d.parse = !0), h && (d = _objectSpread(_objectSpread({}, h), d));
  13464. p = function (e, t) {
  13465. var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  13466. var s = /\?/.test(t);
  13467. var r = "";
  13468. for (var _e16 in n) {
  13469. "" === r ? !s && (t += "?") : r += "&", r += "".concat(_e16, "=").concat(encodeURIComponent(n[_e16]));
  13470. }
  13471. return /^http(s)?\:\/\//.test(t += r) ? t : "".concat(e).concat(t);
  13472. }(ye, "//tcb-api.tencentcloudapi.com/web", d);
  13473. l && (p += l);
  13474. _context10.next = 22;
  13475. return this.post(_objectSpread({
  13476. url: p,
  13477. data: o
  13478. }, a));
  13479. case 22:
  13480. f = _context10.sent;
  13481. g = f.header && f.header["x-tcb-trace"];
  13482. if (!(g && this._localCache.setStore(s, g), 200 !== Number(f.status) && 200 !== Number(f.statusCode) || !f.data)) {
  13483. _context10.next = 26;
  13484. break;
  13485. }
  13486. throw new se({
  13487. code: "NETWORK_ERROR",
  13488. message: "network request error"
  13489. });
  13490. case 26:
  13491. return _context10.abrupt("return", f);
  13492. case 27:
  13493. case "end":
  13494. return _context10.stop();
  13495. }
  13496. }
  13497. }, _callee10, this);
  13498. }));
  13499. function request(_x5, _x6, _x7) {
  13500. return _request.apply(this, arguments);
  13501. }
  13502. return request;
  13503. }()
  13504. }, {
  13505. key: "send",
  13506. value: function () {
  13507. var _send = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(e) {
  13508. var t,
  13509. n,
  13510. _n6,
  13511. _args11 = arguments;
  13512. return _regenerator.default.wrap(function _callee11$(_context11) {
  13513. while (1) {
  13514. switch (_context11.prev = _context11.next) {
  13515. case 0:
  13516. t = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : {};
  13517. _context11.next = 3;
  13518. return this.request(e, t, {
  13519. onUploadProgress: t.onUploadProgress
  13520. });
  13521. case 3:
  13522. n = _context11.sent;
  13523. if (!("ACCESS_TOKEN_EXPIRED" === n.data.code && -1 === ze.indexOf(e))) {
  13524. _context11.next = 13;
  13525. break;
  13526. }
  13527. _context11.next = 7;
  13528. return this.refreshAccessToken();
  13529. case 7:
  13530. _context11.next = 9;
  13531. return this.request(e, t, {
  13532. onUploadProgress: t.onUploadProgress
  13533. });
  13534. case 9:
  13535. _n6 = _context11.sent;
  13536. if (!_n6.data.code) {
  13537. _context11.next = 12;
  13538. break;
  13539. }
  13540. throw new se({
  13541. code: _n6.data.code,
  13542. message: _n6.data.message
  13543. });
  13544. case 12:
  13545. return _context11.abrupt("return", _n6.data);
  13546. case 13:
  13547. if (!n.data.code) {
  13548. _context11.next = 15;
  13549. break;
  13550. }
  13551. throw new se({
  13552. code: n.data.code,
  13553. message: n.data.message
  13554. });
  13555. case 15:
  13556. return _context11.abrupt("return", n.data);
  13557. case 16:
  13558. case "end":
  13559. return _context11.stop();
  13560. }
  13561. }
  13562. }, _callee11, this);
  13563. }));
  13564. function send(_x8) {
  13565. return _send.apply(this, arguments);
  13566. }
  13567. return send;
  13568. }()
  13569. }, {
  13570. key: "setRefreshToken",
  13571. value: function setRefreshToken(e) {
  13572. var _this$_cache$keys3 = this._cache.keys,
  13573. t = _this$_cache$keys3.accessTokenKey,
  13574. n = _this$_cache$keys3.accessTokenExpireKey,
  13575. s = _this$_cache$keys3.refreshTokenKey;
  13576. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  13577. }
  13578. }]);
  13579. return Ve;
  13580. }();
  13581. var Qe = {};
  13582. function Ye(e) {
  13583. return Qe[e];
  13584. }
  13585. var Xe = /*#__PURE__*/function () {
  13586. function Xe(e) {
  13587. (0, _classCallCheck2.default)(this, Xe);
  13588. this.config = e, this._cache = Re(e.env), this._request = Ye(e.env);
  13589. }
  13590. (0, _createClass2.default)(Xe, [{
  13591. key: "setRefreshToken",
  13592. value: function setRefreshToken(e) {
  13593. var _this$_cache$keys4 = this._cache.keys,
  13594. t = _this$_cache$keys4.accessTokenKey,
  13595. n = _this$_cache$keys4.accessTokenExpireKey,
  13596. s = _this$_cache$keys4.refreshTokenKey;
  13597. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  13598. }
  13599. }, {
  13600. key: "setAccessToken",
  13601. value: function setAccessToken(e, t) {
  13602. var _this$_cache$keys5 = this._cache.keys,
  13603. n = _this$_cache$keys5.accessTokenKey,
  13604. s = _this$_cache$keys5.accessTokenExpireKey;
  13605. this._cache.setStore(n, e), this._cache.setStore(s, t);
  13606. }
  13607. }, {
  13608. key: "refreshUserInfo",
  13609. value: function () {
  13610. var _refreshUserInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
  13611. var _yield$this$_request$, e;
  13612. return _regenerator.default.wrap(function _callee12$(_context12) {
  13613. while (1) {
  13614. switch (_context12.prev = _context12.next) {
  13615. case 0:
  13616. _context12.next = 2;
  13617. return this._request.send("auth.getUserInfo", {});
  13618. case 2:
  13619. _yield$this$_request$ = _context12.sent;
  13620. e = _yield$this$_request$.data;
  13621. return _context12.abrupt("return", (this.setLocalUserInfo(e), e));
  13622. case 5:
  13623. case "end":
  13624. return _context12.stop();
  13625. }
  13626. }
  13627. }, _callee12, this);
  13628. }));
  13629. function refreshUserInfo() {
  13630. return _refreshUserInfo.apply(this, arguments);
  13631. }
  13632. return refreshUserInfo;
  13633. }()
  13634. }, {
  13635. key: "setLocalUserInfo",
  13636. value: function setLocalUserInfo(e) {
  13637. var t = this._cache.keys.userInfoKey;
  13638. this._cache.setStore(t, e);
  13639. }
  13640. }]);
  13641. return Xe;
  13642. }();
  13643. var Ze = /*#__PURE__*/function () {
  13644. function Ze(e) {
  13645. (0, _classCallCheck2.default)(this, Ze);
  13646. if (!e) throw new se({
  13647. code: "PARAM_ERROR",
  13648. message: "envId is not defined"
  13649. });
  13650. this._envId = e, this._cache = Re(this._envId), this._request = Ye(this._envId), this.setUserInfo();
  13651. }
  13652. (0, _createClass2.default)(Ze, [{
  13653. key: "linkWithTicket",
  13654. value: function linkWithTicket(e) {
  13655. if ("string" != typeof e) throw new se({
  13656. code: "PARAM_ERROR",
  13657. message: "ticket must be string"
  13658. });
  13659. return this._request.send("auth.linkWithTicket", {
  13660. ticket: e
  13661. });
  13662. }
  13663. }, {
  13664. key: "linkWithRedirect",
  13665. value: function linkWithRedirect(e) {
  13666. e.signInWithRedirect();
  13667. }
  13668. }, {
  13669. key: "updatePassword",
  13670. value: function updatePassword(e, t) {
  13671. return this._request.send("auth.updatePassword", {
  13672. oldPassword: t,
  13673. newPassword: e
  13674. });
  13675. }
  13676. }, {
  13677. key: "updateEmail",
  13678. value: function updateEmail(e) {
  13679. return this._request.send("auth.updateEmail", {
  13680. newEmail: e
  13681. });
  13682. }
  13683. }, {
  13684. key: "updateUsername",
  13685. value: function updateUsername(e) {
  13686. if ("string" != typeof e) throw new se({
  13687. code: "PARAM_ERROR",
  13688. message: "username must be a string"
  13689. });
  13690. return this._request.send("auth.updateUsername", {
  13691. username: e
  13692. });
  13693. }
  13694. }, {
  13695. key: "getLinkedUidList",
  13696. value: function () {
  13697. var _getLinkedUidList = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
  13698. var _yield$this$_request$2, e, t, n;
  13699. return _regenerator.default.wrap(function _callee13$(_context13) {
  13700. while (1) {
  13701. switch (_context13.prev = _context13.next) {
  13702. case 0:
  13703. _context13.next = 2;
  13704. return this._request.send("auth.getLinkedUidList", {});
  13705. case 2:
  13706. _yield$this$_request$2 = _context13.sent;
  13707. e = _yield$this$_request$2.data;
  13708. t = !1;
  13709. n = e.users;
  13710. return _context13.abrupt("return", (n.forEach(function (e) {
  13711. e.wxOpenId && e.wxPublicId && (t = !0);
  13712. }), {
  13713. users: n,
  13714. hasPrimaryUid: t
  13715. }));
  13716. case 7:
  13717. case "end":
  13718. return _context13.stop();
  13719. }
  13720. }
  13721. }, _callee13, this);
  13722. }));
  13723. function getLinkedUidList() {
  13724. return _getLinkedUidList.apply(this, arguments);
  13725. }
  13726. return getLinkedUidList;
  13727. }()
  13728. }, {
  13729. key: "setPrimaryUid",
  13730. value: function setPrimaryUid(e) {
  13731. return this._request.send("auth.setPrimaryUid", {
  13732. uid: e
  13733. });
  13734. }
  13735. }, {
  13736. key: "unlink",
  13737. value: function unlink(e) {
  13738. return this._request.send("auth.unlink", {
  13739. platform: e
  13740. });
  13741. }
  13742. }, {
  13743. key: "update",
  13744. value: function () {
  13745. var _update = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(e) {
  13746. var t, n, s, r, i, o, _yield$this$_request$3, a;
  13747. return _regenerator.default.wrap(function _callee14$(_context14) {
  13748. while (1) {
  13749. switch (_context14.prev = _context14.next) {
  13750. case 0:
  13751. t = e.nickName;
  13752. n = e.gender;
  13753. s = e.avatarUrl;
  13754. r = e.province;
  13755. i = e.country;
  13756. o = e.city;
  13757. _context14.next = 8;
  13758. return this._request.send("auth.updateUserInfo", {
  13759. nickName: t,
  13760. gender: n,
  13761. avatarUrl: s,
  13762. province: r,
  13763. country: i,
  13764. city: o
  13765. });
  13766. case 8:
  13767. _yield$this$_request$3 = _context14.sent;
  13768. a = _yield$this$_request$3.data;
  13769. this.setLocalUserInfo(a);
  13770. case 11:
  13771. case "end":
  13772. return _context14.stop();
  13773. }
  13774. }
  13775. }, _callee14, this);
  13776. }));
  13777. function update(_x9) {
  13778. return _update.apply(this, arguments);
  13779. }
  13780. return update;
  13781. }()
  13782. }, {
  13783. key: "refresh",
  13784. value: function () {
  13785. var _refresh = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
  13786. var _yield$this$_request$4, e;
  13787. return _regenerator.default.wrap(function _callee15$(_context15) {
  13788. while (1) {
  13789. switch (_context15.prev = _context15.next) {
  13790. case 0:
  13791. _context15.next = 2;
  13792. return this._request.send("auth.getUserInfo", {});
  13793. case 2:
  13794. _yield$this$_request$4 = _context15.sent;
  13795. e = _yield$this$_request$4.data;
  13796. return _context15.abrupt("return", (this.setLocalUserInfo(e), e));
  13797. case 5:
  13798. case "end":
  13799. return _context15.stop();
  13800. }
  13801. }
  13802. }, _callee15, this);
  13803. }));
  13804. function refresh() {
  13805. return _refresh.apply(this, arguments);
  13806. }
  13807. return refresh;
  13808. }()
  13809. }, {
  13810. key: "setUserInfo",
  13811. value: function setUserInfo() {
  13812. var _this8 = this;
  13813. var e = this._cache.keys.userInfoKey,
  13814. t = this._cache.getStore(e);
  13815. ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach(function (e) {
  13816. _this8[e] = t[e];
  13817. }), this.location = {
  13818. country: t.country,
  13819. province: t.province,
  13820. city: t.city
  13821. };
  13822. }
  13823. }, {
  13824. key: "setLocalUserInfo",
  13825. value: function setLocalUserInfo(e) {
  13826. var t = this._cache.keys.userInfoKey;
  13827. this._cache.setStore(t, e), this.setUserInfo();
  13828. }
  13829. }]);
  13830. return Ze;
  13831. }();
  13832. var et = /*#__PURE__*/function () {
  13833. function et(e) {
  13834. (0, _classCallCheck2.default)(this, et);
  13835. if (!e) throw new se({
  13836. code: "PARAM_ERROR",
  13837. message: "envId is not defined"
  13838. });
  13839. this._cache = Re(e);
  13840. var _this$_cache$keys6 = this._cache.keys,
  13841. t = _this$_cache$keys6.refreshTokenKey,
  13842. n = _this$_cache$keys6.accessTokenKey,
  13843. s = _this$_cache$keys6.accessTokenExpireKey,
  13844. r = this._cache.getStore(t),
  13845. i = this._cache.getStore(n),
  13846. o = this._cache.getStore(s);
  13847. this.credential = {
  13848. refreshToken: r,
  13849. accessToken: i,
  13850. accessTokenExpire: o
  13851. }, this.user = new Ze(e);
  13852. }
  13853. (0, _createClass2.default)(et, [{
  13854. key: "isAnonymousAuth",
  13855. get: function get() {
  13856. return this.loginType === We.ANONYMOUS;
  13857. }
  13858. }, {
  13859. key: "isCustomAuth",
  13860. get: function get() {
  13861. return this.loginType === We.CUSTOM;
  13862. }
  13863. }, {
  13864. key: "isWeixinAuth",
  13865. get: function get() {
  13866. return this.loginType === We.WECHAT || this.loginType === We.WECHAT_OPEN || this.loginType === We.WECHAT_PUBLIC;
  13867. }
  13868. }, {
  13869. key: "loginType",
  13870. get: function get() {
  13871. return this._cache.getStore(this._cache.keys.loginTypeKey);
  13872. }
  13873. }]);
  13874. return et;
  13875. }();
  13876. var tt = /*#__PURE__*/function (_Xe) {
  13877. (0, _inherits2.default)(tt, _Xe);
  13878. var _super4 = _createSuper(tt);
  13879. function tt() {
  13880. (0, _classCallCheck2.default)(this, tt);
  13881. return _super4.apply(this, arguments);
  13882. }
  13883. (0, _createClass2.default)(tt, [{
  13884. key: "signIn",
  13885. value: function () {
  13886. var _signIn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
  13887. var _this$_cache$keys7, e, t, n, s, r, _e17;
  13888. return _regenerator.default.wrap(function _callee16$(_context16) {
  13889. while (1) {
  13890. switch (_context16.prev = _context16.next) {
  13891. case 0:
  13892. this._cache.updatePersistence("local");
  13893. _this$_cache$keys7 = this._cache.keys;
  13894. e = _this$_cache$keys7.anonymousUuidKey;
  13895. t = _this$_cache$keys7.refreshTokenKey;
  13896. n = this._cache.getStore(e) || void 0;
  13897. s = this._cache.getStore(t) || void 0;
  13898. _context16.next = 8;
  13899. return this._request.send("auth.signInAnonymously", {
  13900. anonymous_uuid: n,
  13901. refresh_token: s
  13902. });
  13903. case 8:
  13904. r = _context16.sent;
  13905. if (!(r.uuid && r.refresh_token)) {
  13906. _context16.next = 20;
  13907. break;
  13908. }
  13909. this._setAnonymousUUID(r.uuid);
  13910. this.setRefreshToken(r.refresh_token);
  13911. _context16.next = 14;
  13912. return this._request.refreshAccessToken();
  13913. case 14:
  13914. Fe(Me);
  13915. Fe(je, {
  13916. env: this.config.env,
  13917. loginType: We.ANONYMOUS,
  13918. persistence: "local"
  13919. });
  13920. _e17 = new et(this.config.env);
  13921. _context16.next = 19;
  13922. return _e17.user.refresh();
  13923. case 19:
  13924. return _context16.abrupt("return", _e17);
  13925. case 20:
  13926. throw new se({
  13927. message: "匿名登录失败"
  13928. });
  13929. case 21:
  13930. case "end":
  13931. return _context16.stop();
  13932. }
  13933. }
  13934. }, _callee16, this);
  13935. }));
  13936. function signIn() {
  13937. return _signIn.apply(this, arguments);
  13938. }
  13939. return signIn;
  13940. }()
  13941. }, {
  13942. key: "linkAndRetrieveDataWithTicket",
  13943. value: function () {
  13944. var _linkAndRetrieveDataWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(e) {
  13945. var _this$_cache$keys8, t, n, s, r, i;
  13946. return _regenerator.default.wrap(function _callee17$(_context17) {
  13947. while (1) {
  13948. switch (_context17.prev = _context17.next) {
  13949. case 0:
  13950. _this$_cache$keys8 = this._cache.keys;
  13951. t = _this$_cache$keys8.anonymousUuidKey;
  13952. n = _this$_cache$keys8.refreshTokenKey;
  13953. s = this._cache.getStore(t);
  13954. r = this._cache.getStore(n);
  13955. _context17.next = 7;
  13956. return this._request.send("auth.linkAndRetrieveDataWithTicket", {
  13957. anonymous_uuid: s,
  13958. refresh_token: r,
  13959. ticket: e
  13960. });
  13961. case 7:
  13962. i = _context17.sent;
  13963. if (!i.refresh_token) {
  13964. _context17.next = 16;
  13965. break;
  13966. }
  13967. this._clearAnonymousUUID();
  13968. this.setRefreshToken(i.refresh_token);
  13969. _context17.next = 13;
  13970. return this._request.refreshAccessToken();
  13971. case 13:
  13972. Fe(Be, {
  13973. env: this.config.env
  13974. });
  13975. Fe(je, {
  13976. loginType: We.CUSTOM,
  13977. persistence: "local"
  13978. });
  13979. return _context17.abrupt("return", {
  13980. credential: {
  13981. refreshToken: i.refresh_token
  13982. }
  13983. });
  13984. case 16:
  13985. throw new se({
  13986. message: "匿名转化失败"
  13987. });
  13988. case 17:
  13989. case "end":
  13990. return _context17.stop();
  13991. }
  13992. }
  13993. }, _callee17, this);
  13994. }));
  13995. function linkAndRetrieveDataWithTicket(_x10) {
  13996. return _linkAndRetrieveDataWithTicket.apply(this, arguments);
  13997. }
  13998. return linkAndRetrieveDataWithTicket;
  13999. }()
  14000. }, {
  14001. key: "_setAnonymousUUID",
  14002. value: function _setAnonymousUUID(e) {
  14003. var _this$_cache$keys9 = this._cache.keys,
  14004. t = _this$_cache$keys9.anonymousUuidKey,
  14005. n = _this$_cache$keys9.loginTypeKey;
  14006. this._cache.removeStore(t), this._cache.setStore(t, e), this._cache.setStore(n, We.ANONYMOUS);
  14007. }
  14008. }, {
  14009. key: "_clearAnonymousUUID",
  14010. value: function _clearAnonymousUUID() {
  14011. this._cache.removeStore(this._cache.keys.anonymousUuidKey);
  14012. }
  14013. }]);
  14014. return tt;
  14015. }(Xe);
  14016. var nt = /*#__PURE__*/function (_Xe2) {
  14017. (0, _inherits2.default)(nt, _Xe2);
  14018. var _super5 = _createSuper(nt);
  14019. function nt() {
  14020. (0, _classCallCheck2.default)(this, nt);
  14021. return _super5.apply(this, arguments);
  14022. }
  14023. (0, _createClass2.default)(nt, [{
  14024. key: "signIn",
  14025. value: function () {
  14026. var _signIn2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(e) {
  14027. var t, n;
  14028. return _regenerator.default.wrap(function _callee18$(_context18) {
  14029. while (1) {
  14030. switch (_context18.prev = _context18.next) {
  14031. case 0:
  14032. if (!("string" != typeof e)) {
  14033. _context18.next = 2;
  14034. break;
  14035. }
  14036. throw new se({
  14037. code: "PARAM_ERROR",
  14038. message: "ticket must be a string"
  14039. });
  14040. case 2:
  14041. t = this._cache.keys.refreshTokenKey;
  14042. _context18.next = 5;
  14043. return this._request.send("auth.signInWithTicket", {
  14044. ticket: e,
  14045. refresh_token: this._cache.getStore(t) || ""
  14046. });
  14047. case 5:
  14048. n = _context18.sent;
  14049. if (!n.refresh_token) {
  14050. _context18.next = 15;
  14051. break;
  14052. }
  14053. this.setRefreshToken(n.refresh_token);
  14054. _context18.next = 10;
  14055. return this._request.refreshAccessToken();
  14056. case 10:
  14057. Fe(Me);
  14058. Fe(je, {
  14059. env: this.config.env,
  14060. loginType: We.CUSTOM,
  14061. persistence: this.config.persistence
  14062. });
  14063. _context18.next = 14;
  14064. return this.refreshUserInfo();
  14065. case 14:
  14066. return _context18.abrupt("return", new et(this.config.env));
  14067. case 15:
  14068. throw new se({
  14069. message: "自定义登录失败"
  14070. });
  14071. case 16:
  14072. case "end":
  14073. return _context18.stop();
  14074. }
  14075. }
  14076. }, _callee18, this);
  14077. }));
  14078. function signIn(_x11) {
  14079. return _signIn2.apply(this, arguments);
  14080. }
  14081. return signIn;
  14082. }()
  14083. }]);
  14084. return nt;
  14085. }(Xe);
  14086. var st = /*#__PURE__*/function (_Xe3) {
  14087. (0, _inherits2.default)(st, _Xe3);
  14088. var _super6 = _createSuper(st);
  14089. function st() {
  14090. (0, _classCallCheck2.default)(this, st);
  14091. return _super6.apply(this, arguments);
  14092. }
  14093. (0, _createClass2.default)(st, [{
  14094. key: "signIn",
  14095. value: function () {
  14096. var _signIn3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(e, t) {
  14097. var n, s, r, i, o;
  14098. return _regenerator.default.wrap(function _callee19$(_context19) {
  14099. while (1) {
  14100. switch (_context19.prev = _context19.next) {
  14101. case 0:
  14102. if (!("string" != typeof e)) {
  14103. _context19.next = 2;
  14104. break;
  14105. }
  14106. throw new se({
  14107. code: "PARAM_ERROR",
  14108. message: "email must be a string"
  14109. });
  14110. case 2:
  14111. n = this._cache.keys.refreshTokenKey;
  14112. _context19.next = 5;
  14113. return this._request.send("auth.signIn", {
  14114. loginType: "EMAIL",
  14115. email: e,
  14116. password: t,
  14117. refresh_token: this._cache.getStore(n) || ""
  14118. });
  14119. case 5:
  14120. s = _context19.sent;
  14121. r = s.refresh_token;
  14122. i = s.access_token;
  14123. o = s.access_token_expire;
  14124. if (!r) {
  14125. _context19.next = 22;
  14126. break;
  14127. }
  14128. this.setRefreshToken(r);
  14129. if (!(i && o)) {
  14130. _context19.next = 15;
  14131. break;
  14132. }
  14133. this.setAccessToken(i, o);
  14134. _context19.next = 17;
  14135. break;
  14136. case 15:
  14137. _context19.next = 17;
  14138. return this._request.refreshAccessToken();
  14139. case 17:
  14140. _context19.next = 19;
  14141. return this.refreshUserInfo();
  14142. case 19:
  14143. Fe(Me);
  14144. Fe(je, {
  14145. env: this.config.env,
  14146. loginType: We.EMAIL,
  14147. persistence: this.config.persistence
  14148. });
  14149. return _context19.abrupt("return", new et(this.config.env));
  14150. case 22:
  14151. throw s.code ? new se({
  14152. code: s.code,
  14153. message: "\u90AE\u7BB1\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  14154. }) : new se({
  14155. message: "邮箱登录失败"
  14156. });
  14157. case 23:
  14158. case "end":
  14159. return _context19.stop();
  14160. }
  14161. }
  14162. }, _callee19, this);
  14163. }));
  14164. function signIn(_x12, _x13) {
  14165. return _signIn3.apply(this, arguments);
  14166. }
  14167. return signIn;
  14168. }()
  14169. }, {
  14170. key: "activate",
  14171. value: function () {
  14172. var _activate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(e) {
  14173. return _regenerator.default.wrap(function _callee20$(_context20) {
  14174. while (1) {
  14175. switch (_context20.prev = _context20.next) {
  14176. case 0:
  14177. return _context20.abrupt("return", this._request.send("auth.activateEndUserMail", {
  14178. token: e
  14179. }));
  14180. case 1:
  14181. case "end":
  14182. return _context20.stop();
  14183. }
  14184. }
  14185. }, _callee20, this);
  14186. }));
  14187. function activate(_x14) {
  14188. return _activate.apply(this, arguments);
  14189. }
  14190. return activate;
  14191. }()
  14192. }, {
  14193. key: "resetPasswordWithToken",
  14194. value: function () {
  14195. var _resetPasswordWithToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(e, t) {
  14196. return _regenerator.default.wrap(function _callee21$(_context21) {
  14197. while (1) {
  14198. switch (_context21.prev = _context21.next) {
  14199. case 0:
  14200. return _context21.abrupt("return", this._request.send("auth.resetPasswordWithToken", {
  14201. token: e,
  14202. newPassword: t
  14203. }));
  14204. case 1:
  14205. case "end":
  14206. return _context21.stop();
  14207. }
  14208. }
  14209. }, _callee21, this);
  14210. }));
  14211. function resetPasswordWithToken(_x15, _x16) {
  14212. return _resetPasswordWithToken.apply(this, arguments);
  14213. }
  14214. return resetPasswordWithToken;
  14215. }()
  14216. }]);
  14217. return st;
  14218. }(Xe);
  14219. var rt = /*#__PURE__*/function (_Xe4) {
  14220. (0, _inherits2.default)(rt, _Xe4);
  14221. var _super7 = _createSuper(rt);
  14222. function rt() {
  14223. (0, _classCallCheck2.default)(this, rt);
  14224. return _super7.apply(this, arguments);
  14225. }
  14226. (0, _createClass2.default)(rt, [{
  14227. key: "signIn",
  14228. value: function () {
  14229. var _signIn4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22(e, t) {
  14230. var n, s, r, i, o;
  14231. return _regenerator.default.wrap(function _callee22$(_context22) {
  14232. while (1) {
  14233. switch (_context22.prev = _context22.next) {
  14234. case 0:
  14235. if (!("string" != typeof e)) {
  14236. _context22.next = 2;
  14237. break;
  14238. }
  14239. throw new se({
  14240. code: "PARAM_ERROR",
  14241. message: "username must be a string"
  14242. });
  14243. case 2:
  14244. "string" != typeof t && (t = "", console.warn("password is empty"));
  14245. n = this._cache.keys.refreshTokenKey;
  14246. _context22.next = 6;
  14247. return this._request.send("auth.signIn", {
  14248. loginType: We.USERNAME,
  14249. username: e,
  14250. password: t,
  14251. refresh_token: this._cache.getStore(n) || ""
  14252. });
  14253. case 6:
  14254. s = _context22.sent;
  14255. r = s.refresh_token;
  14256. i = s.access_token_expire;
  14257. o = s.access_token;
  14258. if (!r) {
  14259. _context22.next = 23;
  14260. break;
  14261. }
  14262. this.setRefreshToken(r);
  14263. if (!(o && i)) {
  14264. _context22.next = 16;
  14265. break;
  14266. }
  14267. this.setAccessToken(o, i);
  14268. _context22.next = 18;
  14269. break;
  14270. case 16:
  14271. _context22.next = 18;
  14272. return this._request.refreshAccessToken();
  14273. case 18:
  14274. _context22.next = 20;
  14275. return this.refreshUserInfo();
  14276. case 20:
  14277. Fe(Me);
  14278. Fe(je, {
  14279. env: this.config.env,
  14280. loginType: We.USERNAME,
  14281. persistence: this.config.persistence
  14282. });
  14283. return _context22.abrupt("return", new et(this.config.env));
  14284. case 23:
  14285. throw s.code ? new se({
  14286. code: s.code,
  14287. message: "\u7528\u6237\u540D\u5BC6\u7801\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  14288. }) : new se({
  14289. message: "用户名密码登录失败"
  14290. });
  14291. case 24:
  14292. case "end":
  14293. return _context22.stop();
  14294. }
  14295. }
  14296. }, _callee22, this);
  14297. }));
  14298. function signIn(_x17, _x18) {
  14299. return _signIn4.apply(this, arguments);
  14300. }
  14301. return signIn;
  14302. }()
  14303. }]);
  14304. return rt;
  14305. }(Xe);
  14306. var it = /*#__PURE__*/function () {
  14307. function it(e) {
  14308. (0, _classCallCheck2.default)(this, it);
  14309. this.config = e, this._cache = Re(e.env), this._request = Ye(e.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), De(je, this._onLoginTypeChanged);
  14310. }
  14311. (0, _createClass2.default)(it, [{
  14312. key: "currentUser",
  14313. get: function get() {
  14314. var e = this.hasLoginState();
  14315. return e && e.user || null;
  14316. }
  14317. }, {
  14318. key: "loginType",
  14319. get: function get() {
  14320. return this._cache.getStore(this._cache.keys.loginTypeKey);
  14321. }
  14322. }, {
  14323. key: "anonymousAuthProvider",
  14324. value: function anonymousAuthProvider() {
  14325. return new tt(this.config);
  14326. }
  14327. }, {
  14328. key: "customAuthProvider",
  14329. value: function customAuthProvider() {
  14330. return new nt(this.config);
  14331. }
  14332. }, {
  14333. key: "emailAuthProvider",
  14334. value: function emailAuthProvider() {
  14335. return new st(this.config);
  14336. }
  14337. }, {
  14338. key: "usernameAuthProvider",
  14339. value: function usernameAuthProvider() {
  14340. return new rt(this.config);
  14341. }
  14342. }, {
  14343. key: "signInAnonymously",
  14344. value: function () {
  14345. var _signInAnonymously = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
  14346. return _regenerator.default.wrap(function _callee23$(_context23) {
  14347. while (1) {
  14348. switch (_context23.prev = _context23.next) {
  14349. case 0:
  14350. return _context23.abrupt("return", new tt(this.config).signIn());
  14351. case 1:
  14352. case "end":
  14353. return _context23.stop();
  14354. }
  14355. }
  14356. }, _callee23, this);
  14357. }));
  14358. function signInAnonymously() {
  14359. return _signInAnonymously.apply(this, arguments);
  14360. }
  14361. return signInAnonymously;
  14362. }()
  14363. }, {
  14364. key: "signInWithEmailAndPassword",
  14365. value: function () {
  14366. var _signInWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(e, t) {
  14367. return _regenerator.default.wrap(function _callee24$(_context24) {
  14368. while (1) {
  14369. switch (_context24.prev = _context24.next) {
  14370. case 0:
  14371. return _context24.abrupt("return", new st(this.config).signIn(e, t));
  14372. case 1:
  14373. case "end":
  14374. return _context24.stop();
  14375. }
  14376. }
  14377. }, _callee24, this);
  14378. }));
  14379. function signInWithEmailAndPassword(_x19, _x20) {
  14380. return _signInWithEmailAndPassword.apply(this, arguments);
  14381. }
  14382. return signInWithEmailAndPassword;
  14383. }()
  14384. }, {
  14385. key: "signInWithUsernameAndPassword",
  14386. value: function signInWithUsernameAndPassword(e, t) {
  14387. return new rt(this.config).signIn(e, t);
  14388. }
  14389. }, {
  14390. key: "linkAndRetrieveDataWithTicket",
  14391. value: function () {
  14392. var _linkAndRetrieveDataWithTicket2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25(e) {
  14393. return _regenerator.default.wrap(function _callee25$(_context25) {
  14394. while (1) {
  14395. switch (_context25.prev = _context25.next) {
  14396. case 0:
  14397. this._anonymousAuthProvider || (this._anonymousAuthProvider = new tt(this.config)), De(Be, this._onAnonymousConverted);
  14398. _context25.next = 3;
  14399. return this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e);
  14400. case 3:
  14401. return _context25.abrupt("return", _context25.sent);
  14402. case 4:
  14403. case "end":
  14404. return _context25.stop();
  14405. }
  14406. }
  14407. }, _callee25, this);
  14408. }));
  14409. function linkAndRetrieveDataWithTicket(_x21) {
  14410. return _linkAndRetrieveDataWithTicket2.apply(this, arguments);
  14411. }
  14412. return linkAndRetrieveDataWithTicket;
  14413. }()
  14414. }, {
  14415. key: "signOut",
  14416. value: function () {
  14417. var _signOut = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
  14418. var _this$_cache$keys10, e, t, n, s, r;
  14419. return _regenerator.default.wrap(function _callee26$(_context26) {
  14420. while (1) {
  14421. switch (_context26.prev = _context26.next) {
  14422. case 0:
  14423. if (!(this.loginType === We.ANONYMOUS)) {
  14424. _context26.next = 2;
  14425. break;
  14426. }
  14427. throw new se({
  14428. message: "匿名用户不支持登出操作"
  14429. });
  14430. case 2:
  14431. _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);
  14432. if (s) {
  14433. _context26.next = 5;
  14434. break;
  14435. }
  14436. return _context26.abrupt("return");
  14437. case 5:
  14438. _context26.next = 7;
  14439. return this._request.send("auth.logout", {
  14440. refresh_token: s
  14441. });
  14442. case 7:
  14443. r = _context26.sent;
  14444. return _context26.abrupt("return", (this._cache.removeStore(e), this._cache.removeStore(t), this._cache.removeStore(n), Fe(Me), Fe(je, {
  14445. env: this.config.env,
  14446. loginType: We.NULL,
  14447. persistence: this.config.persistence
  14448. }), r));
  14449. case 9:
  14450. case "end":
  14451. return _context26.stop();
  14452. }
  14453. }
  14454. }, _callee26, this);
  14455. }));
  14456. function signOut() {
  14457. return _signOut.apply(this, arguments);
  14458. }
  14459. return signOut;
  14460. }()
  14461. }, {
  14462. key: "signUpWithEmailAndPassword",
  14463. value: function () {
  14464. var _signUpWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27(e, t) {
  14465. return _regenerator.default.wrap(function _callee27$(_context27) {
  14466. while (1) {
  14467. switch (_context27.prev = _context27.next) {
  14468. case 0:
  14469. return _context27.abrupt("return", this._request.send("auth.signUpWithEmailAndPassword", {
  14470. email: e,
  14471. password: t
  14472. }));
  14473. case 1:
  14474. case "end":
  14475. return _context27.stop();
  14476. }
  14477. }
  14478. }, _callee27, this);
  14479. }));
  14480. function signUpWithEmailAndPassword(_x22, _x23) {
  14481. return _signUpWithEmailAndPassword.apply(this, arguments);
  14482. }
  14483. return signUpWithEmailAndPassword;
  14484. }()
  14485. }, {
  14486. key: "sendPasswordResetEmail",
  14487. value: function () {
  14488. var _sendPasswordResetEmail = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28(e) {
  14489. return _regenerator.default.wrap(function _callee28$(_context28) {
  14490. while (1) {
  14491. switch (_context28.prev = _context28.next) {
  14492. case 0:
  14493. return _context28.abrupt("return", this._request.send("auth.sendPasswordResetEmail", {
  14494. email: e
  14495. }));
  14496. case 1:
  14497. case "end":
  14498. return _context28.stop();
  14499. }
  14500. }
  14501. }, _callee28, this);
  14502. }));
  14503. function sendPasswordResetEmail(_x24) {
  14504. return _sendPasswordResetEmail.apply(this, arguments);
  14505. }
  14506. return sendPasswordResetEmail;
  14507. }()
  14508. }, {
  14509. key: "onLoginStateChanged",
  14510. value: function onLoginStateChanged(e) {
  14511. var _this9 = this;
  14512. De(Me, function () {
  14513. var t = _this9.hasLoginState();
  14514. e.call(_this9, t);
  14515. });
  14516. var t = this.hasLoginState();
  14517. e.call(this, t);
  14518. }
  14519. }, {
  14520. key: "onLoginStateExpired",
  14521. value: function onLoginStateExpired(e) {
  14522. De(Ke, e.bind(this));
  14523. }
  14524. }, {
  14525. key: "onAccessTokenRefreshed",
  14526. value: function onAccessTokenRefreshed(e) {
  14527. De($e, e.bind(this));
  14528. }
  14529. }, {
  14530. key: "onAnonymousConverted",
  14531. value: function onAnonymousConverted(e) {
  14532. De(Be, e.bind(this));
  14533. }
  14534. }, {
  14535. key: "onLoginTypeChanged",
  14536. value: function onLoginTypeChanged(e) {
  14537. var _this10 = this;
  14538. De(je, function () {
  14539. var t = _this10.hasLoginState();
  14540. e.call(_this10, t);
  14541. });
  14542. }
  14543. }, {
  14544. key: "getAccessToken",
  14545. value: function () {
  14546. var _getAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
  14547. return _regenerator.default.wrap(function _callee29$(_context29) {
  14548. while (1) {
  14549. switch (_context29.prev = _context29.next) {
  14550. case 0:
  14551. _context29.next = 2;
  14552. return this._request.getAccessToken();
  14553. case 2:
  14554. _context29.t0 = _context29.sent.accessToken;
  14555. _context29.t1 = this.config.env;
  14556. return _context29.abrupt("return", {
  14557. accessToken: _context29.t0,
  14558. env: _context29.t1
  14559. });
  14560. case 5:
  14561. case "end":
  14562. return _context29.stop();
  14563. }
  14564. }
  14565. }, _callee29, this);
  14566. }));
  14567. function getAccessToken() {
  14568. return _getAccessToken2.apply(this, arguments);
  14569. }
  14570. return getAccessToken;
  14571. }()
  14572. }, {
  14573. key: "hasLoginState",
  14574. value: function hasLoginState() {
  14575. var e = this._cache.keys.refreshTokenKey;
  14576. return this._cache.getStore(e) ? new et(this.config.env) : null;
  14577. }
  14578. }, {
  14579. key: "isUsernameRegistered",
  14580. value: function () {
  14581. var _isUsernameRegistered = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(e) {
  14582. var _yield$this$_request$5, t;
  14583. return _regenerator.default.wrap(function _callee30$(_context30) {
  14584. while (1) {
  14585. switch (_context30.prev = _context30.next) {
  14586. case 0:
  14587. if (!("string" != typeof e)) {
  14588. _context30.next = 2;
  14589. break;
  14590. }
  14591. throw new se({
  14592. code: "PARAM_ERROR",
  14593. message: "username must be a string"
  14594. });
  14595. case 2:
  14596. _context30.next = 4;
  14597. return this._request.send("auth.isUsernameRegistered", {
  14598. username: e
  14599. });
  14600. case 4:
  14601. _yield$this$_request$5 = _context30.sent;
  14602. t = _yield$this$_request$5.data;
  14603. return _context30.abrupt("return", t && t.isRegistered);
  14604. case 7:
  14605. case "end":
  14606. return _context30.stop();
  14607. }
  14608. }
  14609. }, _callee30, this);
  14610. }));
  14611. function isUsernameRegistered(_x25) {
  14612. return _isUsernameRegistered.apply(this, arguments);
  14613. }
  14614. return isUsernameRegistered;
  14615. }()
  14616. }, {
  14617. key: "getLoginState",
  14618. value: function getLoginState() {
  14619. return Promise.resolve(this.hasLoginState());
  14620. }
  14621. }, {
  14622. key: "signInWithTicket",
  14623. value: function () {
  14624. var _signInWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(e) {
  14625. return _regenerator.default.wrap(function _callee31$(_context31) {
  14626. while (1) {
  14627. switch (_context31.prev = _context31.next) {
  14628. case 0:
  14629. return _context31.abrupt("return", new nt(this.config).signIn(e));
  14630. case 1:
  14631. case "end":
  14632. return _context31.stop();
  14633. }
  14634. }
  14635. }, _callee31, this);
  14636. }));
  14637. function signInWithTicket(_x26) {
  14638. return _signInWithTicket.apply(this, arguments);
  14639. }
  14640. return signInWithTicket;
  14641. }()
  14642. }, {
  14643. key: "shouldRefreshAccessToken",
  14644. value: function shouldRefreshAccessToken(e) {
  14645. this._request._shouldRefreshAccessTokenHook = e.bind(this);
  14646. }
  14647. }, {
  14648. key: "getUserInfo",
  14649. value: function getUserInfo() {
  14650. return this._request.send("auth.getUserInfo", {}).then(function (e) {
  14651. return e.code ? e : _objectSpread(_objectSpread({}, e.data), {}, {
  14652. requestId: e.seqId
  14653. });
  14654. });
  14655. }
  14656. }, {
  14657. key: "getAuthHeader",
  14658. value: function getAuthHeader() {
  14659. var _this$_cache$keys11 = this._cache.keys,
  14660. e = _this$_cache$keys11.refreshTokenKey,
  14661. t = _this$_cache$keys11.accessTokenKey,
  14662. n = this._cache.getStore(e);
  14663. return {
  14664. "x-cloudbase-credentials": this._cache.getStore(t) + "/@@/" + n
  14665. };
  14666. }
  14667. }, {
  14668. key: "_onAnonymousConverted",
  14669. value: function _onAnonymousConverted(e) {
  14670. var t = e.data.env;
  14671. t === this.config.env && this._cache.updatePersistence(this.config.persistence);
  14672. }
  14673. }, {
  14674. key: "_onLoginTypeChanged",
  14675. value: function _onLoginTypeChanged(e) {
  14676. var _e$data = e.data,
  14677. t = _e$data.loginType,
  14678. n = _e$data.persistence,
  14679. s = _e$data.env;
  14680. s === this.config.env && (this._cache.updatePersistence(n), this._cache.setStore(this._cache.keys.loginTypeKey, t));
  14681. }
  14682. }]);
  14683. return it;
  14684. }();
  14685. var ot = function ot(e, t) {
  14686. t = t || ve();
  14687. var n = Ye(this.config.env),
  14688. s = e.cloudPath,
  14689. r = e.filePath,
  14690. i = e.onUploadProgress,
  14691. _e$fileType = e.fileType,
  14692. o = _e$fileType === void 0 ? "image" : _e$fileType;
  14693. return n.send("storage.getUploadMetadata", {
  14694. path: s
  14695. }).then(function (e) {
  14696. var _e$data2 = e.data,
  14697. a = _e$data2.url,
  14698. c = _e$data2.authorization,
  14699. u = _e$data2.token,
  14700. h = _e$data2.fileId,
  14701. l = _e$data2.cosFileId,
  14702. d = e.requestId,
  14703. p = {
  14704. key: s,
  14705. signature: c,
  14706. "x-cos-meta-fileid": l,
  14707. success_action_status: "201",
  14708. "x-cos-security-token": u
  14709. };
  14710. n.upload({
  14711. url: a,
  14712. data: p,
  14713. file: r,
  14714. name: s,
  14715. fileType: o,
  14716. onUploadProgress: i
  14717. }).then(function (e) {
  14718. 201 === e.statusCode ? t(null, {
  14719. fileID: h,
  14720. requestId: d
  14721. }) : t(new se({
  14722. code: "STORAGE_REQUEST_FAIL",
  14723. message: "STORAGE_REQUEST_FAIL: ".concat(e.data)
  14724. }));
  14725. }).catch(function (e) {
  14726. t(e);
  14727. });
  14728. }).catch(function (e) {
  14729. t(e);
  14730. }), t.promise;
  14731. },
  14732. at = function at(e, t) {
  14733. t = t || ve();
  14734. var n = Ye(this.config.env),
  14735. s = e.cloudPath;
  14736. return n.send("storage.getUploadMetadata", {
  14737. path: s
  14738. }).then(function (e) {
  14739. t(null, e);
  14740. }).catch(function (e) {
  14741. t(e);
  14742. }), t.promise;
  14743. },
  14744. ct = function ct(_ref7, t) {
  14745. var e = _ref7.fileList;
  14746. if (t = t || ve(), !e || !Array.isArray(e)) return {
  14747. code: "INVALID_PARAM",
  14748. message: "fileList必须是非空的数组"
  14749. };
  14750. var _iterator3 = _createForOfIteratorHelper(e),
  14751. _step3;
  14752. try {
  14753. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  14754. var _t8 = _step3.value;
  14755. if (!_t8 || "string" != typeof _t8) return {
  14756. code: "INVALID_PARAM",
  14757. message: "fileList的元素必须是非空的字符串"
  14758. };
  14759. }
  14760. } catch (err) {
  14761. _iterator3.e(err);
  14762. } finally {
  14763. _iterator3.f();
  14764. }
  14765. var n = {
  14766. fileid_list: e
  14767. };
  14768. return Ye(this.config.env).send("storage.batchDeleteFile", n).then(function (e) {
  14769. e.code ? t(null, e) : t(null, {
  14770. fileList: e.data.delete_list,
  14771. requestId: e.requestId
  14772. });
  14773. }).catch(function (e) {
  14774. t(e);
  14775. }), t.promise;
  14776. },
  14777. ut = function ut(_ref8, t) {
  14778. var e = _ref8.fileList;
  14779. t = t || ve(), e && Array.isArray(e) || t(null, {
  14780. code: "INVALID_PARAM",
  14781. message: "fileList必须是非空的数组"
  14782. });
  14783. var n = [];
  14784. var _iterator4 = _createForOfIteratorHelper(e),
  14785. _step4;
  14786. try {
  14787. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  14788. var _s9 = _step4.value;
  14789. "object" == (0, _typeof2.default)(_s9) ? (_s9.hasOwnProperty("fileID") && _s9.hasOwnProperty("maxAge") || t(null, {
  14790. code: "INVALID_PARAM",
  14791. message: "fileList的元素必须是包含fileID和maxAge的对象"
  14792. }), n.push({
  14793. fileid: _s9.fileID,
  14794. max_age: _s9.maxAge
  14795. })) : "string" == typeof _s9 ? n.push({
  14796. fileid: _s9
  14797. }) : t(null, {
  14798. code: "INVALID_PARAM",
  14799. message: "fileList的元素必须是字符串"
  14800. });
  14801. }
  14802. } catch (err) {
  14803. _iterator4.e(err);
  14804. } finally {
  14805. _iterator4.f();
  14806. }
  14807. var s = {
  14808. file_list: n
  14809. };
  14810. return Ye(this.config.env).send("storage.batchGetDownloadUrl", s).then(function (e) {
  14811. e.code ? t(null, e) : t(null, {
  14812. fileList: e.data.download_list,
  14813. requestId: e.requestId
  14814. });
  14815. }).catch(function (e) {
  14816. t(e);
  14817. }), t.promise;
  14818. },
  14819. ht = /*#__PURE__*/function () {
  14820. var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(_ref9, t) {
  14821. var e, n, s, r;
  14822. return _regenerator.default.wrap(function _callee32$(_context32) {
  14823. while (1) {
  14824. switch (_context32.prev = _context32.next) {
  14825. case 0:
  14826. e = _ref9.fileID;
  14827. _context32.next = 3;
  14828. return ut.call(this, {
  14829. fileList: [{
  14830. fileID: e,
  14831. maxAge: 600
  14832. }]
  14833. });
  14834. case 3:
  14835. n = _context32.sent.fileList[0];
  14836. if (!("SUCCESS" !== n.code)) {
  14837. _context32.next = 6;
  14838. break;
  14839. }
  14840. return _context32.abrupt("return", t ? t(n) : new Promise(function (e) {
  14841. e(n);
  14842. }));
  14843. case 6:
  14844. s = Ye(this.config.env);
  14845. r = n.download_url;
  14846. if (!(r = encodeURI(r), !t)) {
  14847. _context32.next = 10;
  14848. break;
  14849. }
  14850. return _context32.abrupt("return", s.download({
  14851. url: r
  14852. }));
  14853. case 10:
  14854. _context32.t0 = t;
  14855. _context32.next = 13;
  14856. return s.download({
  14857. url: r
  14858. });
  14859. case 13:
  14860. _context32.t1 = _context32.sent;
  14861. (0, _context32.t0)(_context32.t1);
  14862. case 15:
  14863. case "end":
  14864. return _context32.stop();
  14865. }
  14866. }
  14867. }, _callee32, this);
  14868. }));
  14869. return function ht(_x27, _x28) {
  14870. return _ref10.apply(this, arguments);
  14871. };
  14872. }(),
  14873. lt = function lt(_ref11, i) {
  14874. var e = _ref11.name,
  14875. t = _ref11.data,
  14876. n = _ref11.query,
  14877. s = _ref11.parse,
  14878. r = _ref11.search;
  14879. var o = i || ve();
  14880. var a;
  14881. try {
  14882. a = t ? JSON.stringify(t) : "";
  14883. } catch (e) {
  14884. return Promise.reject(e);
  14885. }
  14886. if (!e) return Promise.reject(new se({
  14887. code: "PARAM_ERROR",
  14888. message: "函数名不能为空"
  14889. }));
  14890. var c = {
  14891. inQuery: n,
  14892. parse: s,
  14893. search: r,
  14894. function_name: e,
  14895. request_data: a
  14896. };
  14897. return Ye(this.config.env).send("functions.invokeFunction", c).then(function (e) {
  14898. if (e.code) o(null, e);else {
  14899. var _t9 = e.data.response_data;
  14900. if (s) o(null, {
  14901. result: _t9,
  14902. requestId: e.requestId
  14903. });else try {
  14904. _t9 = JSON.parse(e.data.response_data), o(null, {
  14905. result: _t9,
  14906. requestId: e.requestId
  14907. });
  14908. } catch (e) {
  14909. o(new se({
  14910. message: "response data must be json"
  14911. }));
  14912. }
  14913. }
  14914. return o.promise;
  14915. }).catch(function (e) {
  14916. o(e);
  14917. }), o.promise;
  14918. },
  14919. dt = {
  14920. timeout: 15e3,
  14921. persistence: "session"
  14922. },
  14923. pt = {};
  14924. var ft = /*#__PURE__*/function () {
  14925. function ft(e) {
  14926. (0, _classCallCheck2.default)(this, ft);
  14927. this.config = e || this.config, this.authObj = void 0;
  14928. }
  14929. (0, _createClass2.default)(ft, [{
  14930. key: "init",
  14931. value: function init(e) {
  14932. switch (Te.adapter || (this.requestClient = new Te.adapter.reqClass({
  14933. timeout: e.timeout || 5e3,
  14934. timeoutMsg: "\u8BF7\u6C42\u5728".concat((e.timeout || 5e3) / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD")
  14935. })), this.config = _objectSpread(_objectSpread({}, dt), e), !0) {
  14936. case this.config.timeout > 6e5:
  14937. console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
  14938. break;
  14939. case this.config.timeout < 100:
  14940. console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
  14941. }
  14942. return new ft(this.config);
  14943. }
  14944. }, {
  14945. key: "auth",
  14946. value: function auth() {
  14947. var _ref12 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14948. e = _ref12.persistence;
  14949. if (this.authObj) return this.authObj;
  14950. var t = e || Te.adapter.primaryStorage || dt.persistence;
  14951. var n;
  14952. return t !== this.config.persistence && (this.config.persistence = t), function (e) {
  14953. var t = e.env;
  14954. Oe[t] = new Ee(e), xe[t] = new Ee(_objectSpread(_objectSpread({}, e), {}, {
  14955. persistence: "local"
  14956. }));
  14957. }(this.config), n = this.config, Qe[n.env] = new Ve(n), this.authObj = new it(this.config), this.authObj;
  14958. }
  14959. }, {
  14960. key: "on",
  14961. value: function on(e, t) {
  14962. return De.apply(this, [e, t]);
  14963. }
  14964. }, {
  14965. key: "off",
  14966. value: function off(e, t) {
  14967. return qe.apply(this, [e, t]);
  14968. }
  14969. }, {
  14970. key: "callFunction",
  14971. value: function callFunction(e, t) {
  14972. return lt.apply(this, [e, t]);
  14973. }
  14974. }, {
  14975. key: "deleteFile",
  14976. value: function deleteFile(e, t) {
  14977. return ct.apply(this, [e, t]);
  14978. }
  14979. }, {
  14980. key: "getTempFileURL",
  14981. value: function getTempFileURL(e, t) {
  14982. return ut.apply(this, [e, t]);
  14983. }
  14984. }, {
  14985. key: "downloadFile",
  14986. value: function downloadFile(e, t) {
  14987. return ht.apply(this, [e, t]);
  14988. }
  14989. }, {
  14990. key: "uploadFile",
  14991. value: function uploadFile(e, t) {
  14992. return ot.apply(this, [e, t]);
  14993. }
  14994. }, {
  14995. key: "getUploadMetadata",
  14996. value: function getUploadMetadata(e, t) {
  14997. return at.apply(this, [e, t]);
  14998. }
  14999. }, {
  15000. key: "registerExtension",
  15001. value: function registerExtension(e) {
  15002. pt[e.name] = e;
  15003. }
  15004. }, {
  15005. key: "invokeExtension",
  15006. value: function () {
  15007. var _invokeExtension = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(e, t) {
  15008. var n;
  15009. return _regenerator.default.wrap(function _callee33$(_context33) {
  15010. while (1) {
  15011. switch (_context33.prev = _context33.next) {
  15012. case 0:
  15013. n = pt[e];
  15014. if (n) {
  15015. _context33.next = 3;
  15016. break;
  15017. }
  15018. throw new se({
  15019. message: "\u6269\u5C55".concat(e, " \u5FC5\u987B\u5148\u6CE8\u518C")
  15020. });
  15021. case 3:
  15022. _context33.next = 5;
  15023. return n.invoke(t, this);
  15024. case 5:
  15025. return _context33.abrupt("return", _context33.sent);
  15026. case 6:
  15027. case "end":
  15028. return _context33.stop();
  15029. }
  15030. }
  15031. }, _callee33, this);
  15032. }));
  15033. function invokeExtension(_x29, _x30) {
  15034. return _invokeExtension.apply(this, arguments);
  15035. }
  15036. return invokeExtension;
  15037. }()
  15038. }, {
  15039. key: "useAdapters",
  15040. value: function useAdapters(e) {
  15041. var _ref13 = ke(e) || {},
  15042. t = _ref13.adapter,
  15043. n = _ref13.runtime;
  15044. t && (Te.adapter = t), n && (Te.runtime = n);
  15045. }
  15046. }]);
  15047. return ft;
  15048. }();
  15049. var gt = new ft();
  15050. function mt(e, t, n) {
  15051. void 0 === n && (n = {});
  15052. var s = /\?/.test(t),
  15053. r = "";
  15054. for (var i in n) {
  15055. "" === r ? !s && (t += "?") : r += "&", r += i + "=" + encodeURIComponent(n[i]);
  15056. }
  15057. return /^http(s)?:\/\//.test(t += r) ? t : "" + e + t;
  15058. }
  15059. var yt = /*#__PURE__*/function () {
  15060. function yt() {
  15061. (0, _classCallCheck2.default)(this, yt);
  15062. }
  15063. (0, _createClass2.default)(yt, [{
  15064. key: "post",
  15065. value: function post(e) {
  15066. var t = e.url,
  15067. n = e.data,
  15068. s = e.headers;
  15069. return new Promise(function (e, r) {
  15070. re.request({
  15071. url: mt("https:", t),
  15072. data: n,
  15073. method: "POST",
  15074. header: s,
  15075. success: function success(t) {
  15076. e(t);
  15077. },
  15078. fail: function fail(e) {
  15079. r(e);
  15080. }
  15081. });
  15082. });
  15083. }
  15084. }, {
  15085. key: "upload",
  15086. value: function upload(e) {
  15087. return new Promise(function (t, n) {
  15088. var s = e.url,
  15089. r = e.file,
  15090. i = e.data,
  15091. o = e.headers,
  15092. a = e.fileType,
  15093. c = re.uploadFile({
  15094. url: mt("https:", s),
  15095. name: "file",
  15096. formData: Object.assign({}, i),
  15097. filePath: r,
  15098. fileType: a,
  15099. header: o,
  15100. success: function success(e) {
  15101. var n = {
  15102. statusCode: e.statusCode,
  15103. data: e.data || {}
  15104. };
  15105. 200 === e.statusCode && i.success_action_status && (n.statusCode = parseInt(i.success_action_status, 10)), t(n);
  15106. },
  15107. fail: function fail(e) {
  15108. n(new Error(e.errMsg || "uploadFile:fail"));
  15109. }
  15110. });
  15111. "function" == typeof e.onUploadProgress && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (t) {
  15112. e.onUploadProgress({
  15113. loaded: t.totalBytesSent,
  15114. total: t.totalBytesExpectedToSend
  15115. });
  15116. });
  15117. });
  15118. }
  15119. }]);
  15120. return yt;
  15121. }();
  15122. var _t = {
  15123. setItem: function setItem(e, t) {
  15124. re.setStorageSync(e, t);
  15125. },
  15126. getItem: function getItem(e) {
  15127. return re.getStorageSync(e);
  15128. },
  15129. removeItem: function removeItem(e) {
  15130. re.removeStorageSync(e);
  15131. },
  15132. clear: function clear() {
  15133. re.clearStorageSync();
  15134. }
  15135. };
  15136. var wt = {
  15137. genAdapter: function genAdapter() {
  15138. return {
  15139. root: {},
  15140. reqClass: yt,
  15141. localStorage: _t,
  15142. primaryStorage: "local"
  15143. };
  15144. },
  15145. isMatch: function isMatch() {
  15146. return !0;
  15147. },
  15148. runtime: "uni_app"
  15149. };
  15150. gt.useAdapters(wt);
  15151. var vt = gt,
  15152. St = vt.init;
  15153. vt.init = function (e) {
  15154. e.env = e.spaceId;
  15155. var t = St.call(this, e);
  15156. t.config.provider = "tencent", t.config.spaceId = e.spaceId;
  15157. var n = t.auth;
  15158. return t.auth = function (e) {
  15159. var t = n.call(this, e);
  15160. return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach(function (e) {
  15161. var n;
  15162. t[e] = (n = t[e], function (e) {
  15163. e = e || {};
  15164. var _ne = ne(e),
  15165. t = _ne.success,
  15166. s = _ne.fail,
  15167. r = _ne.complete;
  15168. if (!(t || s || r)) return n.call(this, e);
  15169. n.call(this, e).then(function (e) {
  15170. t && t(e), r && r(e);
  15171. }, function (e) {
  15172. s && s(e), r && r(e);
  15173. });
  15174. }).bind(t);
  15175. }), t;
  15176. }, t.customAuth = t.auth, t;
  15177. };
  15178. var It = vt;
  15179. var bt = /*#__PURE__*/function (_ge) {
  15180. (0, _inherits2.default)(bt, _ge);
  15181. var _super8 = _createSuper(bt);
  15182. function bt() {
  15183. (0, _classCallCheck2.default)(this, bt);
  15184. return _super8.apply(this, arguments);
  15185. }
  15186. (0, _createClass2.default)(bt, [{
  15187. key: "getAccessToken",
  15188. value: function getAccessToken() {
  15189. var _this11 = this;
  15190. return new Promise(function (e, t) {
  15191. var n = "Anonymous_Access_token";
  15192. _this11.setAccessToken(n), e(n);
  15193. });
  15194. }
  15195. }, {
  15196. key: "setupRequest",
  15197. value: function setupRequest(e, t) {
  15198. var n = Object.assign({}, e, {
  15199. spaceId: this.config.spaceId,
  15200. timestamp: Date.now()
  15201. }),
  15202. s = {
  15203. "Content-Type": "application/json"
  15204. };
  15205. "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = de.sign(n, this.config.clientSecret);
  15206. var r = le();
  15207. s["x-client-info"] = encodeURIComponent(JSON.stringify(r));
  15208. var _ie = ie(),
  15209. i = _ie.token;
  15210. return s["x-client-token"] = i, {
  15211. url: this.config.requestUrl,
  15212. method: "POST",
  15213. data: n,
  15214. dataType: "json",
  15215. header: JSON.parse(JSON.stringify(s))
  15216. };
  15217. }
  15218. }, {
  15219. key: "uploadFileToOSS",
  15220. value: function uploadFileToOSS(_ref14) {
  15221. var _this12 = this;
  15222. var e = _ref14.url,
  15223. t = _ref14.formData,
  15224. n = _ref14.name,
  15225. s = _ref14.filePath,
  15226. r = _ref14.fileType,
  15227. i = _ref14.onUploadProgress;
  15228. return new Promise(function (o, a) {
  15229. var c = _this12.adapter.uploadFile({
  15230. url: e,
  15231. formData: t,
  15232. name: n,
  15233. filePath: s,
  15234. fileType: r,
  15235. success: function success(e) {
  15236. e && e.statusCode < 400 ? o(e) : a(new se({
  15237. code: "UPLOAD_FAILED",
  15238. message: "文件上传失败"
  15239. }));
  15240. },
  15241. fail: function fail(e) {
  15242. a(new se({
  15243. code: e.code || "UPLOAD_FAILED",
  15244. message: e.message || e.errMsg || "文件上传失败"
  15245. }));
  15246. }
  15247. });
  15248. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  15249. i({
  15250. loaded: e.totalBytesSent,
  15251. total: e.totalBytesExpectedToSend
  15252. });
  15253. });
  15254. });
  15255. }
  15256. }, {
  15257. key: "uploadFile",
  15258. value: function uploadFile(_ref15) {
  15259. var _this13 = this;
  15260. var e = _ref15.filePath,
  15261. t = _ref15.cloudPath,
  15262. _ref15$fileType = _ref15.fileType,
  15263. n = _ref15$fileType === void 0 ? "image" : _ref15$fileType,
  15264. s = _ref15.onUploadProgress;
  15265. if (!t) throw new se({
  15266. code: "CLOUDPATH_REQUIRED",
  15267. message: "cloudPath不可为空"
  15268. });
  15269. var r;
  15270. return this.getOSSUploadOptionsFromPath({
  15271. cloudPath: t
  15272. }).then(function (t) {
  15273. var _t$result = t.result,
  15274. i = _t$result.url,
  15275. o = _t$result.formData,
  15276. a = _t$result.name;
  15277. r = t.result.fileUrl;
  15278. var c = {
  15279. url: i,
  15280. formData: o,
  15281. name: a,
  15282. filePath: e,
  15283. fileType: n
  15284. };
  15285. return _this13.uploadFileToOSS(Object.assign({}, c, {
  15286. onUploadProgress: s
  15287. }));
  15288. }).then(function () {
  15289. return _this13.reportOSSUpload({
  15290. cloudPath: t
  15291. });
  15292. }).then(function (t) {
  15293. return new Promise(function (n, s) {
  15294. t.success ? n({
  15295. success: !0,
  15296. filePath: e,
  15297. fileID: r
  15298. }) : s(new se({
  15299. code: "UPLOAD_FAILED",
  15300. message: "文件上传失败"
  15301. }));
  15302. });
  15303. });
  15304. }
  15305. }, {
  15306. key: "deleteFile",
  15307. value: function deleteFile(_ref16) {
  15308. var e = _ref16.fileList;
  15309. var t = {
  15310. method: "serverless.file.resource.delete",
  15311. params: JSON.stringify({
  15312. fileList: e
  15313. })
  15314. };
  15315. return this.request(this.setupRequest(t)).then(function (e) {
  15316. if (e.success) return e.result;
  15317. throw new se({
  15318. code: "DELETE_FILE_FAILED",
  15319. message: "删除文件失败"
  15320. });
  15321. });
  15322. }
  15323. }, {
  15324. key: "getTempFileURL",
  15325. value: function getTempFileURL() {
  15326. var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15327. e = _ref17.fileList;
  15328. if (!Array.isArray(e) || 0 === e.length) throw new se({
  15329. code: "INVALID_PARAM",
  15330. message: "fileList的元素必须是非空的字符串"
  15331. });
  15332. var t = {
  15333. method: "serverless.file.resource.getTempFileURL",
  15334. params: JSON.stringify({
  15335. fileList: e
  15336. })
  15337. };
  15338. return this.request(this.setupRequest(t)).then(function (e) {
  15339. if (e.success) return {
  15340. fileList: e.result.fileList.map(function (e) {
  15341. return {
  15342. fileID: e.fileID,
  15343. tempFileURL: e.tempFileURL
  15344. };
  15345. })
  15346. };
  15347. throw new se({
  15348. code: "GET_TEMP_FILE_URL_FAILED",
  15349. message: "获取临时文件链接失败"
  15350. });
  15351. });
  15352. }
  15353. }]);
  15354. return bt;
  15355. }(ge);
  15356. var kt = {
  15357. init: function init(e) {
  15358. var t = new bt(e),
  15359. n = {
  15360. signInAnonymously: function signInAnonymously() {
  15361. return t.authorize();
  15362. },
  15363. getLoginState: function getLoginState() {
  15364. return Promise.resolve(!1);
  15365. }
  15366. };
  15367. return t.auth = function () {
  15368. return n;
  15369. }, t.customAuth = t.auth, t;
  15370. }
  15371. };
  15372. function Tt(_ref18) {
  15373. var e = _ref18.data;
  15374. var t;
  15375. t = le();
  15376. var n = JSON.parse(JSON.stringify(e || {}));
  15377. if (Object.assign(n, {
  15378. clientInfo: t
  15379. }), !n.uniIdToken) {
  15380. var _ie2 = ie(),
  15381. _e18 = _ie2.token;
  15382. _e18 && (n.uniIdToken = _e18);
  15383. }
  15384. return n;
  15385. }
  15386. function Ct() {
  15387. return _Ct.apply(this, arguments);
  15388. }
  15389. function _Ct() {
  15390. _Ct = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54() {
  15391. var _this26 = this;
  15392. var _ref60,
  15393. e,
  15394. t,
  15395. _this$__dev__,
  15396. n,
  15397. s,
  15398. r,
  15399. i,
  15400. o,
  15401. a,
  15402. _args6 = arguments;
  15403. return _regenerator.default.wrap(function _callee54$(_context54) {
  15404. while (1) {
  15405. switch (_context54.prev = _context54.next) {
  15406. case 0:
  15407. _ref60 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, e = _ref60.name, t = _ref60.data;
  15408. _context54.next = 3;
  15409. return this.__dev__.initLocalNetwork();
  15410. case 3:
  15411. _this$__dev__ = this.__dev__, n = _this$__dev__.localAddress, s = _this$__dev__.localPort, r = {
  15412. aliyun: "aliyun",
  15413. tencent: "tcb"
  15414. }[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);
  15415. return _context54.abrupt("return", new Promise(function (t, n) {
  15416. re.request({
  15417. method: "POST",
  15418. url: o,
  15419. data: {
  15420. name: e,
  15421. platform: A,
  15422. provider: r,
  15423. spaceId: i
  15424. },
  15425. timeout: 3e3,
  15426. success: function success(e) {
  15427. t(e);
  15428. },
  15429. fail: function fail() {
  15430. t({
  15431. data: {
  15432. code: "NETWORK_ERROR",
  15433. message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。"
  15434. }
  15435. });
  15436. }
  15437. });
  15438. }).then(function () {
  15439. var _ref61 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15440. e = _ref61.data;
  15441. var _ref62 = e || {},
  15442. t = _ref62.code,
  15443. n = _ref62.message;
  15444. return {
  15445. code: 0 === t ? 0 : t || "SYS_ERR",
  15446. message: n || "SYS_ERR"
  15447. };
  15448. }).then(function (_ref63) {
  15449. var n = _ref63.code,
  15450. s = _ref63.message;
  15451. if (0 !== n) {
  15452. switch (n) {
  15453. case "MODULE_ENCRYPTED":
  15454. 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"));
  15455. break;
  15456. case "FUNCTION_ENCRYPTED":
  15457. 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"));
  15458. break;
  15459. case "ACTION_ENCRYPTED":
  15460. console.error(s || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
  15461. break;
  15462. case "NETWORK_ERROR":
  15463. {
  15464. var _e30 = "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下";
  15465. throw console.error(_e30), new Error(_e30);
  15466. }
  15467. case "SWITCH_TO_CLOUD":
  15468. break;
  15469. default:
  15470. {
  15471. var _e31 = "\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");
  15472. throw console.error(_e31), new Error(_e31);
  15473. }
  15474. }
  15475. return _this26._callCloudFunction({
  15476. name: e,
  15477. data: t
  15478. });
  15479. }
  15480. return new Promise(function (e, n) {
  15481. var s = Tt.call(_this26, {
  15482. data: t
  15483. });
  15484. re.request({
  15485. method: "POST",
  15486. url: a,
  15487. data: {
  15488. provider: r,
  15489. platform: A,
  15490. param: s
  15491. },
  15492. success: function success() {
  15493. var _ref64 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15494. t = _ref64.statusCode,
  15495. s = _ref64.data;
  15496. return !t || t >= 400 ? n(new se({
  15497. code: s.code || "SYS_ERR",
  15498. message: s.message || "request:fail"
  15499. })) : e({
  15500. result: s
  15501. });
  15502. },
  15503. fail: function fail(e) {
  15504. n(new se({
  15505. code: e.code || e.errCode || "SYS_ERR",
  15506. message: e.message || e.errMsg || "request:fail"
  15507. }));
  15508. }
  15509. });
  15510. });
  15511. }));
  15512. case 5:
  15513. case "end":
  15514. return _context54.stop();
  15515. }
  15516. }
  15517. }, _callee54, this);
  15518. }));
  15519. return _Ct.apply(this, arguments);
  15520. }
  15521. var Pt = [{
  15522. rule: /fc_function_not_found|FUNCTION_NOT_FOUND/,
  15523. content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",
  15524. mode: "append"
  15525. }];
  15526. var At = /[\\^$.*+?()[\]{}|]/g,
  15527. Et = RegExp(At.source);
  15528. function Ot(e, t, n) {
  15529. return e.replace(new RegExp((s = t) && Et.test(s) ? s.replace(At, "\\$&") : s, "g"), n);
  15530. var s;
  15531. }
  15532. var xt = "none",
  15533. Rt = "request",
  15534. Ut = "response",
  15535. Lt = "both";
  15536. var Nt = /*#__PURE__*/function () {
  15537. function Nt() {
  15538. var _ref19 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15539. e = _ref19.secretType,
  15540. t = _ref19.uniCloudIns;
  15541. (0, _classCallCheck2.default)(this, Nt);
  15542. this.clientType = "", this.secretType = e || xt, this.uniCloudIns = t;
  15543. var _this$uniCloudIns$con = this.uniCloudIns.config,
  15544. n = _this$uniCloudIns$con.provider,
  15545. s = _this$uniCloudIns$con.spaceId;
  15546. var r;
  15547. this.provider = n, this.spaceId = s, this.scopedGlobalCache = (r = this.uniCloudIns, L("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", r.config.spaceId)));
  15548. }
  15549. (0, _createClass2.default)(Nt, [{
  15550. key: "getSystemInfo",
  15551. value: function getSystemInfo() {
  15552. return this._systemInfo || (this._systemInfo = ue()), this._systemInfo;
  15553. }
  15554. }, {
  15555. key: "appId",
  15556. get: function get() {
  15557. return this.getSystemInfo().appId;
  15558. }
  15559. }, {
  15560. key: "deviceId",
  15561. get: function get() {
  15562. return this.getSystemInfo().deviceId;
  15563. }
  15564. }, {
  15565. key: "encryptData",
  15566. value: function () {
  15567. var _encryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(e) {
  15568. return _regenerator.default.wrap(function _callee34$(_context34) {
  15569. while (1) {
  15570. switch (_context34.prev = _context34.next) {
  15571. case 0:
  15572. return _context34.abrupt("return", this.secretType === xt ? e : this.platformEncryptData(e));
  15573. case 1:
  15574. case "end":
  15575. return _context34.stop();
  15576. }
  15577. }
  15578. }, _callee34, this);
  15579. }));
  15580. function encryptData(_x31) {
  15581. return _encryptData.apply(this, arguments);
  15582. }
  15583. return encryptData;
  15584. }()
  15585. }, {
  15586. key: "decryptResult",
  15587. value: function () {
  15588. var _decryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(e) {
  15589. var _ref20, t, n;
  15590. return _regenerator.default.wrap(function _callee35$(_context35) {
  15591. while (1) {
  15592. switch (_context35.prev = _context35.next) {
  15593. case 0:
  15594. if (!(this.secretType === xt)) {
  15595. _context35.next = 2;
  15596. break;
  15597. }
  15598. return _context35.abrupt("return", e);
  15599. case 2:
  15600. _ref20 = e || {}, t = _ref20.errCode, n = _ref20.content;
  15601. return _context35.abrupt("return", t || !n ? e : this.secretType === Rt ? n : this.platformDecryptResult(e));
  15602. case 4:
  15603. case "end":
  15604. return _context35.stop();
  15605. }
  15606. }
  15607. }, _callee35, this);
  15608. }));
  15609. function decryptResult(_x32) {
  15610. return _decryptResult.apply(this, arguments);
  15611. }
  15612. return decryptResult;
  15613. }()
  15614. }, {
  15615. key: "wrapVerifyClientCallFunction",
  15616. value: function wrapVerifyClientCallFunction(e) {
  15617. var t = this;
  15618. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36() {
  15619. var _ref22,
  15620. n,
  15621. _ref22$data,
  15622. s,
  15623. r,
  15624. _args36 = arguments;
  15625. return _regenerator.default.wrap(function _callee36$(_context36) {
  15626. while (1) {
  15627. switch (_context36.prev = _context36.next) {
  15628. case 0:
  15629. _ref22 = _args36.length > 0 && _args36[0] !== undefined ? _args36[0] : {}, n = _ref22.name, _ref22$data = _ref22.data, s = _ref22$data === void 0 ? {} : _ref22$data;
  15630. _context36.next = 3;
  15631. return t.prepare();
  15632. case 3:
  15633. _context36.next = 5;
  15634. return t.platformGetSignOption();
  15635. case 5:
  15636. (s = JSON.parse(JSON.stringify(s)))._uniCloudOptions = _context36.sent;
  15637. _context36.next = 8;
  15638. return e({
  15639. name: n,
  15640. data: s
  15641. });
  15642. case 8:
  15643. r = _context36.sent;
  15644. _context36.t0 = t.isClientKeyNotFound(r);
  15645. if (!_context36.t0) {
  15646. _context36.next = 19;
  15647. break;
  15648. }
  15649. _context36.next = 13;
  15650. return t.prepare({
  15651. forceUpdate: !0
  15652. });
  15653. case 13:
  15654. _context36.next = 15;
  15655. return t.platformGetSignOption();
  15656. case 15:
  15657. s._uniCloudOptions = _context36.sent;
  15658. _context36.next = 18;
  15659. return e({
  15660. name: n,
  15661. data: s
  15662. });
  15663. case 18:
  15664. r = _context36.sent;
  15665. case 19:
  15666. return _context36.abrupt("return", r);
  15667. case 20:
  15668. case "end":
  15669. return _context36.stop();
  15670. }
  15671. }
  15672. }, _callee36);
  15673. }));
  15674. }
  15675. }, {
  15676. key: "wrapEncryptDataCallFunction",
  15677. value: function wrapEncryptDataCallFunction(e) {
  15678. var t = this;
  15679. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37() {
  15680. var _ref24,
  15681. n,
  15682. _ref24$data,
  15683. s,
  15684. r,
  15685. i,
  15686. _r3,
  15687. _args37 = arguments;
  15688. return _regenerator.default.wrap(function _callee37$(_context37) {
  15689. while (1) {
  15690. switch (_context37.prev = _context37.next) {
  15691. case 0:
  15692. _ref24 = _args37.length > 0 && _args37[0] !== undefined ? _args37[0] : {}, n = _ref24.name, _ref24$data = _ref24.data, s = _ref24$data === void 0 ? {} : _ref24$data;
  15693. _context37.next = 3;
  15694. return t.prepare();
  15695. case 3:
  15696. _context37.next = 5;
  15697. return t.encryptData(s);
  15698. case 5:
  15699. r = _context37.sent;
  15700. _context37.next = 8;
  15701. return e({
  15702. name: n,
  15703. data: r
  15704. });
  15705. case 8:
  15706. i = _context37.sent;
  15707. if (!t.isClientKeyNotFound(i)) {
  15708. _context37.next = 21;
  15709. break;
  15710. }
  15711. _context37.next = 12;
  15712. return t.prepare({
  15713. forceUpdate: !0
  15714. });
  15715. case 12:
  15716. _context37.next = 14;
  15717. return t.encryptData(s);
  15718. case 14:
  15719. _r3 = _context37.sent;
  15720. _context37.next = 17;
  15721. return t.platformGetSignOption();
  15722. case 17:
  15723. s._uniCloudOptions = _context37.sent;
  15724. _context37.next = 20;
  15725. return e({
  15726. name: n,
  15727. data: _r3
  15728. });
  15729. case 20:
  15730. i = _context37.sent;
  15731. case 21:
  15732. _context37.next = 23;
  15733. return t.decryptResult(i.result);
  15734. case 23:
  15735. i.result = _context37.sent;
  15736. return _context37.abrupt("return", i);
  15737. case 25:
  15738. case "end":
  15739. return _context37.stop();
  15740. }
  15741. }
  15742. }, _callee37);
  15743. }));
  15744. }
  15745. }]);
  15746. return Nt;
  15747. }();
  15748. /*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */
  15749. function Dt(e) {
  15750. return parseInt(e) === e;
  15751. }
  15752. function Ft(e) {
  15753. if (!Dt(e.length)) return !1;
  15754. for (var t = 0; t < e.length; t++) {
  15755. if (!Dt(e[t]) || e[t] < 0 || e[t] > 255) return !1;
  15756. }
  15757. return !0;
  15758. }
  15759. function qt(e, t) {
  15760. if (e.buffer && "Uint8Array" === e.name) return t && (e = e.slice ? e.slice() : Array.prototype.slice.call(e)), e;
  15761. if (Array.isArray(e)) {
  15762. if (!Ft(e)) throw new Error("Array contains invalid value: " + e);
  15763. return new Uint8Array(e);
  15764. }
  15765. if (Dt(e.length) && Ft(e)) return new Uint8Array(e);
  15766. throw new Error("unsupported array-like object");
  15767. }
  15768. function Mt(e) {
  15769. return new Uint8Array(e);
  15770. }
  15771. function Kt(e, t, n, s, r) {
  15772. null == s && null == r || (e = e.slice ? e.slice(s, r) : Array.prototype.slice.call(e, s, r)), t.set(e, n);
  15773. }
  15774. var jt,
  15775. Bt = {
  15776. toBytes: function toBytes(e) {
  15777. var t = [],
  15778. n = 0;
  15779. for (e = encodeURI(e); n < e.length;) {
  15780. var s = e.charCodeAt(n++);
  15781. 37 === s ? (t.push(parseInt(e.substr(n, 2), 16)), n += 2) : t.push(s);
  15782. }
  15783. return qt(t);
  15784. },
  15785. fromBytes: function fromBytes(e) {
  15786. for (var t = [], n = 0; n < e.length;) {
  15787. var s = e[n];
  15788. 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);
  15789. }
  15790. return t.join("");
  15791. }
  15792. },
  15793. $t = (jt = "0123456789abcdef", {
  15794. toBytes: function toBytes(e) {
  15795. for (var t = [], n = 0; n < e.length; n += 2) {
  15796. t.push(parseInt(e.substr(n, 2), 16));
  15797. }
  15798. return t;
  15799. },
  15800. fromBytes: function fromBytes(e) {
  15801. for (var t = [], n = 0; n < e.length; n++) {
  15802. var s = e[n];
  15803. t.push(jt[(240 & s) >> 4] + jt[15 & s]);
  15804. }
  15805. return t.join("");
  15806. }
  15807. }),
  15808. Wt = {
  15809. 16: 10,
  15810. 24: 12,
  15811. 32: 14
  15812. },
  15813. zt = [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],
  15814. Jt = [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22],
  15815. Ht = [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],
  15816. Gt = [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],
  15817. Vt = [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],
  15818. Qt = [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],
  15819. 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],
  15820. Xt = [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],
  15821. Zt = [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],
  15822. en = [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],
  15823. tn = [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],
  15824. nn = [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],
  15825. sn = [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],
  15826. rn = [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],
  15827. on = [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];
  15828. function an(e) {
  15829. for (var t = [], n = 0; n < e.length; n += 4) {
  15830. t.push(e[n] << 24 | e[n + 1] << 16 | e[n + 2] << 8 | e[n + 3]);
  15831. }
  15832. return t;
  15833. }
  15834. var cn = /*#__PURE__*/function () {
  15835. function cn(e) {
  15836. (0, _classCallCheck2.default)(this, cn);
  15837. if (!(this instanceof cn)) throw Error("AES must be instanitated with `new`");
  15838. Object.defineProperty(this, "key", {
  15839. value: qt(e, !0)
  15840. }), this._prepare();
  15841. }
  15842. (0, _createClass2.default)(cn, [{
  15843. key: "_prepare",
  15844. value: function _prepare() {
  15845. var e = Wt[this.key.length];
  15846. if (null == e) throw new Error("invalid key size (must be 16, 24 or 32 bytes)");
  15847. this._Ke = [], this._Kd = [];
  15848. for (var t = 0; t <= e; t++) {
  15849. this._Ke.push([0, 0, 0, 0]), this._Kd.push([0, 0, 0, 0]);
  15850. }
  15851. var n,
  15852. s = 4 * (e + 1),
  15853. r = this.key.length / 4,
  15854. i = an(this.key);
  15855. for (t = 0; t < r; t++) {
  15856. n = t >> 2, this._Ke[n][t % 4] = i[t], this._Kd[e - n][t % 4] = i[t];
  15857. }
  15858. for (var o, a = 0, c = r; c < s;) {
  15859. if (o = i[r - 1], i[0] ^= Jt[o >> 16 & 255] << 24 ^ Jt[o >> 8 & 255] << 16 ^ Jt[255 & o] << 8 ^ Jt[o >> 24 & 255] ^ zt[a] << 24, a += 1, 8 != r) for (t = 1; t < r; t++) {
  15860. i[t] ^= i[t - 1];
  15861. } else {
  15862. for (t = 1; t < r / 2; t++) {
  15863. i[t] ^= i[t - 1];
  15864. }
  15865. o = i[r / 2 - 1], i[r / 2] ^= Jt[255 & o] ^ Jt[o >> 8 & 255] << 8 ^ Jt[o >> 16 & 255] << 16 ^ Jt[o >> 24 & 255] << 24;
  15866. for (t = r / 2 + 1; t < r; t++) {
  15867. i[t] ^= i[t - 1];
  15868. }
  15869. }
  15870. for (t = 0; t < r && c < s;) {
  15871. u = c >> 2, h = c % 4, this._Ke[u][h] = i[t], this._Kd[e - u][h] = i[t++], c++;
  15872. }
  15873. }
  15874. for (var u = 1; u < e; u++) {
  15875. for (var h = 0; h < 4; h++) {
  15876. o = this._Kd[u][h], this._Kd[u][h] = nn[o >> 24 & 255] ^ sn[o >> 16 & 255] ^ rn[o >> 8 & 255] ^ on[255 & o];
  15877. }
  15878. }
  15879. }
  15880. }, {
  15881. key: "encrypt",
  15882. value: function encrypt(e) {
  15883. if (16 != e.length) throw new Error("invalid plaintext size (must be 16 bytes)");
  15884. for (var t = this._Ke.length - 1, n = [0, 0, 0, 0], s = an(e), r = 0; r < 4; r++) {
  15885. s[r] ^= this._Ke[0][r];
  15886. }
  15887. for (var i = 1; i < t; i++) {
  15888. for (r = 0; r < 4; r++) {
  15889. n[r] = Gt[s[r] >> 24 & 255] ^ Vt[s[(r + 1) % 4] >> 16 & 255] ^ Qt[s[(r + 2) % 4] >> 8 & 255] ^ Yt[255 & s[(r + 3) % 4]] ^ this._Ke[i][r];
  15890. }
  15891. s = n.slice();
  15892. }
  15893. var o,
  15894. a = Mt(16);
  15895. for (r = 0; r < 4; r++) {
  15896. o = this._Ke[t][r], a[4 * r] = 255 & (Jt[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (Jt[s[(r + 1) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (Jt[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (Jt[255 & s[(r + 3) % 4]] ^ o);
  15897. }
  15898. return a;
  15899. }
  15900. }, {
  15901. key: "decrypt",
  15902. value: function decrypt(e) {
  15903. if (16 != e.length) throw new Error("invalid ciphertext size (must be 16 bytes)");
  15904. for (var t = this._Kd.length - 1, n = [0, 0, 0, 0], s = an(e), r = 0; r < 4; r++) {
  15905. s[r] ^= this._Kd[0][r];
  15906. }
  15907. for (var i = 1; i < t; i++) {
  15908. for (r = 0; r < 4; r++) {
  15909. n[r] = Xt[s[r] >> 24 & 255] ^ Zt[s[(r + 3) % 4] >> 16 & 255] ^ en[s[(r + 2) % 4] >> 8 & 255] ^ tn[255 & s[(r + 1) % 4]] ^ this._Kd[i][r];
  15910. }
  15911. s = n.slice();
  15912. }
  15913. var o,
  15914. a = Mt(16);
  15915. for (r = 0; r < 4; r++) {
  15916. o = this._Kd[t][r], a[4 * r] = 255 & (Ht[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (Ht[s[(r + 3) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (Ht[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (Ht[255 & s[(r + 1) % 4]] ^ o);
  15917. }
  15918. return a;
  15919. }
  15920. }]);
  15921. return cn;
  15922. }();
  15923. var un = /*#__PURE__*/function () {
  15924. function un(e) {
  15925. (0, _classCallCheck2.default)(this, un);
  15926. if (!(this instanceof un)) throw Error("AES must be instanitated with `new`");
  15927. this.description = "Electronic Code Block", this.name = "ecb", this._aes = new cn(e);
  15928. }
  15929. (0, _createClass2.default)(un, [{
  15930. key: "encrypt",
  15931. value: function encrypt(e) {
  15932. if ((e = qt(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  15933. for (var t = Mt(e.length), n = Mt(16), s = 0; s < e.length; s += 16) {
  15934. Kt(e, n, 0, s, s + 16), Kt(n = this._aes.encrypt(n), t, s);
  15935. }
  15936. return t;
  15937. }
  15938. }, {
  15939. key: "decrypt",
  15940. value: function decrypt(e) {
  15941. if ((e = qt(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  15942. for (var t = Mt(e.length), n = Mt(16), s = 0; s < e.length; s += 16) {
  15943. Kt(e, n, 0, s, s + 16), Kt(n = this._aes.decrypt(n), t, s);
  15944. }
  15945. return t;
  15946. }
  15947. }]);
  15948. return un;
  15949. }();
  15950. var hn = /*#__PURE__*/function () {
  15951. function hn(e, t) {
  15952. (0, _classCallCheck2.default)(this, hn);
  15953. if (!(this instanceof hn)) throw Error("AES must be instanitated with `new`");
  15954. if (this.description = "Cipher Block Chaining", this.name = "cbc", t) {
  15955. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  15956. } else t = Mt(16);
  15957. this._lastCipherblock = qt(t, !0), this._aes = new cn(e);
  15958. }
  15959. (0, _createClass2.default)(hn, [{
  15960. key: "encrypt",
  15961. value: function encrypt(e) {
  15962. if ((e = qt(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  15963. for (var t = Mt(e.length), n = Mt(16), s = 0; s < e.length; s += 16) {
  15964. Kt(e, n, 0, s, s + 16);
  15965. for (var r = 0; r < 16; r++) {
  15966. n[r] ^= this._lastCipherblock[r];
  15967. }
  15968. this._lastCipherblock = this._aes.encrypt(n), Kt(this._lastCipherblock, t, s);
  15969. }
  15970. return t;
  15971. }
  15972. }, {
  15973. key: "decrypt",
  15974. value: function decrypt(e) {
  15975. if ((e = qt(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  15976. for (var t = Mt(e.length), n = Mt(16), s = 0; s < e.length; s += 16) {
  15977. Kt(e, n, 0, s, s + 16), n = this._aes.decrypt(n);
  15978. for (var r = 0; r < 16; r++) {
  15979. t[s + r] = n[r] ^ this._lastCipherblock[r];
  15980. }
  15981. Kt(e, this._lastCipherblock, 0, s, s + 16);
  15982. }
  15983. return t;
  15984. }
  15985. }]);
  15986. return hn;
  15987. }();
  15988. var ln = /*#__PURE__*/function () {
  15989. function ln(e, t, n) {
  15990. (0, _classCallCheck2.default)(this, ln);
  15991. if (!(this instanceof ln)) throw Error("AES must be instanitated with `new`");
  15992. if (this.description = "Cipher Feedback", this.name = "cfb", t) {
  15993. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 size)");
  15994. } else t = Mt(16);
  15995. n || (n = 1), this.segmentSize = n, this._shiftRegister = qt(t, !0), this._aes = new cn(e);
  15996. }
  15997. (0, _createClass2.default)(ln, [{
  15998. key: "encrypt",
  15999. value: function encrypt(e) {
  16000. if (e.length % this.segmentSize != 0) throw new Error("invalid plaintext size (must be segmentSize bytes)");
  16001. for (var t, n = qt(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  16002. t = this._aes.encrypt(this._shiftRegister);
  16003. for (var r = 0; r < this.segmentSize; r++) {
  16004. n[s + r] ^= t[r];
  16005. }
  16006. Kt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Kt(n, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  16007. }
  16008. return n;
  16009. }
  16010. }, {
  16011. key: "decrypt",
  16012. value: function decrypt(e) {
  16013. if (e.length % this.segmentSize != 0) throw new Error("invalid ciphertext size (must be segmentSize bytes)");
  16014. for (var t, n = qt(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  16015. t = this._aes.encrypt(this._shiftRegister);
  16016. for (var r = 0; r < this.segmentSize; r++) {
  16017. n[s + r] ^= t[r];
  16018. }
  16019. Kt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Kt(e, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  16020. }
  16021. return n;
  16022. }
  16023. }]);
  16024. return ln;
  16025. }();
  16026. var dn = /*#__PURE__*/function () {
  16027. function dn(e, t) {
  16028. (0, _classCallCheck2.default)(this, dn);
  16029. if (!(this instanceof dn)) throw Error("AES must be instanitated with `new`");
  16030. if (this.description = "Output Feedback", this.name = "ofb", t) {
  16031. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  16032. } else t = Mt(16);
  16033. this._lastPrecipher = qt(t, !0), this._lastPrecipherIndex = 16, this._aes = new cn(e);
  16034. }
  16035. (0, _createClass2.default)(dn, [{
  16036. key: "encrypt",
  16037. value: function encrypt(e) {
  16038. for (var t = qt(e, !0), n = 0; n < t.length; n++) {
  16039. 16 === this._lastPrecipherIndex && (this._lastPrecipher = this._aes.encrypt(this._lastPrecipher), this._lastPrecipherIndex = 0), t[n] ^= this._lastPrecipher[this._lastPrecipherIndex++];
  16040. }
  16041. return t;
  16042. }
  16043. }, {
  16044. key: "decrypt",
  16045. value: function decrypt(e) {
  16046. return this.encrypt(e);
  16047. }
  16048. }]);
  16049. return dn;
  16050. }();
  16051. var pn = /*#__PURE__*/function () {
  16052. function pn(e) {
  16053. (0, _classCallCheck2.default)(this, pn);
  16054. if (!(this instanceof pn)) throw Error("Counter must be instanitated with `new`");
  16055. 0 === e || e || (e = 1), "number" == typeof e ? (this._counter = Mt(16), this.setValue(e)) : this.setBytes(e);
  16056. }
  16057. (0, _createClass2.default)(pn, [{
  16058. key: "setValue",
  16059. value: function setValue(e) {
  16060. if ("number" != typeof e || parseInt(e) != e) throw new Error("invalid counter value (must be an integer)");
  16061. if (e > Number.MAX_SAFE_INTEGER) throw new Error("integer value out of safe range");
  16062. for (var t = 15; t >= 0; --t) {
  16063. this._counter[t] = e % 256, e = parseInt(e / 256);
  16064. }
  16065. }
  16066. }, {
  16067. key: "setBytes",
  16068. value: function setBytes(e) {
  16069. if (16 != (e = qt(e, !0)).length) throw new Error("invalid counter bytes size (must be 16 bytes)");
  16070. this._counter = e;
  16071. }
  16072. }, {
  16073. key: "increment",
  16074. value: function increment() {
  16075. for (var e = 15; e >= 0; e--) {
  16076. if (255 !== this._counter[e]) {
  16077. this._counter[e]++;
  16078. break;
  16079. }
  16080. this._counter[e] = 0;
  16081. }
  16082. }
  16083. }]);
  16084. return pn;
  16085. }();
  16086. var fn = /*#__PURE__*/function () {
  16087. function fn(e, t) {
  16088. (0, _classCallCheck2.default)(this, fn);
  16089. if (!(this instanceof fn)) throw Error("AES must be instanitated with `new`");
  16090. this.description = "Counter", this.name = "ctr", t instanceof pn || (t = new pn(t)), this._counter = t, this._remainingCounter = null, this._remainingCounterIndex = 16, this._aes = new cn(e);
  16091. }
  16092. (0, _createClass2.default)(fn, [{
  16093. key: "encrypt",
  16094. value: function encrypt(e) {
  16095. for (var t = qt(e, !0), n = 0; n < t.length; n++) {
  16096. 16 === this._remainingCounterIndex && (this._remainingCounter = this._aes.encrypt(this._counter._counter), this._remainingCounterIndex = 0, this._counter.increment()), t[n] ^= this._remainingCounter[this._remainingCounterIndex++];
  16097. }
  16098. return t;
  16099. }
  16100. }, {
  16101. key: "decrypt",
  16102. value: function decrypt(e) {
  16103. return this.encrypt(e);
  16104. }
  16105. }]);
  16106. return fn;
  16107. }();
  16108. var gn = {
  16109. AES: cn,
  16110. Counter: pn,
  16111. ModeOfOperation: {
  16112. ecb: un,
  16113. cbc: hn,
  16114. cfb: ln,
  16115. ofb: dn,
  16116. ctr: fn
  16117. },
  16118. utils: {
  16119. hex: $t,
  16120. utf8: Bt
  16121. },
  16122. padding: {
  16123. pkcs7: {
  16124. pad: function pad(e) {
  16125. var t = 16 - (e = qt(e, !0)).length % 16,
  16126. n = Mt(e.length + t);
  16127. Kt(e, n);
  16128. for (var s = e.length; s < n.length; s++) {
  16129. n[s] = t;
  16130. }
  16131. return n;
  16132. },
  16133. strip: function strip(e) {
  16134. if ((e = qt(e, !0)).length < 16) throw new Error("PKCS#7 invalid length");
  16135. var t = e[e.length - 1];
  16136. if (t > 16) throw new Error("PKCS#7 padding byte out of range");
  16137. for (var n = e.length - t, s = 0; s < t; s++) {
  16138. if (e[n + s] !== t) throw new Error("PKCS#7 invalid padding byte");
  16139. }
  16140. var r = Mt(n);
  16141. return Kt(e, r, 0, 0, n), r;
  16142. }
  16143. }
  16144. },
  16145. _arrayTest: {
  16146. coerceArray: qt,
  16147. createArray: Mt,
  16148. copyArray: Kt
  16149. }
  16150. };
  16151. function mn(e, t, n) {
  16152. var s = new Uint8Array(uni.base64ToArrayBuffer(t)),
  16153. r = gn.utils.utf8.toBytes(n),
  16154. i = gn.utils.utf8.toBytes(e),
  16155. o = new gn.ModeOfOperation.cbc(s, r),
  16156. a = gn.padding.pkcs7.pad(i),
  16157. c = o.encrypt(a);
  16158. return uni.arrayBufferToBase64(c);
  16159. }
  16160. var yn = {
  16161. code: 2e4,
  16162. message: "System error"
  16163. },
  16164. _n = {
  16165. code: 20101,
  16166. message: "Invalid client"
  16167. },
  16168. wn = {
  16169. code: 20102,
  16170. message: "Get encrypt key failed"
  16171. },
  16172. vn = {
  16173. 10001: "Secure network is not supported on current playground or unimpsdk",
  16174. 10003: "Config missing in current app. If the problem pesist, please contact DCloud.",
  16175. 10009: "Encrypt payload failed",
  16176. 10010: "Decrypt response failed"
  16177. };
  16178. function Sn(e) {
  16179. var _ref25 = e || {},
  16180. t = _ref25.errSubject,
  16181. n = _ref25.subject,
  16182. s = _ref25.errCode,
  16183. r = _ref25.errMsg,
  16184. i = _ref25.code,
  16185. o = _ref25.message,
  16186. a = _ref25.cause;
  16187. return new se({
  16188. subject: t || n || "uni-secure-network",
  16189. code: s || i || yn.code,
  16190. message: r || o,
  16191. cause: a
  16192. });
  16193. }
  16194. var In,
  16195. bn,
  16196. kn = null;
  16197. var Tn = /*#__PURE__*/function (_Nt) {
  16198. (0, _inherits2.default)(Tn, _Nt);
  16199. var _super9 = _createSuper(Tn);
  16200. function Tn(e) {
  16201. var _this14;
  16202. (0, _classCallCheck2.default)(this, Tn);
  16203. _this14 = _super9.call(this, e), _this14.clientType = "mp-weixin", _this14.userEncryptKey = null;
  16204. return _this14;
  16205. }
  16206. (0, _createClass2.default)(Tn, [{
  16207. key: "isLogin",
  16208. value: function isLogin() {
  16209. return !!this.scopedGlobalCache.mpWeixinCode || !!this.scopedGlobalCache.mpWeixinOpenid;
  16210. }
  16211. }, {
  16212. key: "prepare",
  16213. value: function () {
  16214. var _prepare2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38() {
  16215. return _regenerator.default.wrap(function _callee38$(_context38) {
  16216. while (1) {
  16217. switch (_context38.prev = _context38.next) {
  16218. case 0:
  16219. if (this.isLogin()) {
  16220. _context38.next = 7;
  16221. break;
  16222. }
  16223. if (this.scopedGlobalCache.initPromise) {
  16224. _context38.next = 3;
  16225. break;
  16226. }
  16227. throw new Error("`uniCloud.initSecureNetworkByWeixin` has not yet been called");
  16228. case 3:
  16229. _context38.next = 5;
  16230. return this.scopedGlobalCache.initPromise;
  16231. case 5:
  16232. if (this.isLogin()) {
  16233. _context38.next = 7;
  16234. break;
  16235. }
  16236. throw new Error("uniCloud.initSecureNetworkByWeixin` has not yet been called or successfully excuted");
  16237. case 7:
  16238. case "end":
  16239. return _context38.stop();
  16240. }
  16241. }
  16242. }, _callee38, this);
  16243. }));
  16244. function prepare() {
  16245. return _prepare2.apply(this, arguments);
  16246. }
  16247. return prepare;
  16248. }()
  16249. }, {
  16250. key: "getUserEncryptKey",
  16251. value: function () {
  16252. var _getUserEncryptKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39() {
  16253. var _this15 = this;
  16254. var e;
  16255. return _regenerator.default.wrap(function _callee39$(_context39) {
  16256. while (1) {
  16257. switch (_context39.prev = _context39.next) {
  16258. case 0:
  16259. if (!this.userEncryptKey) {
  16260. _context39.next = 2;
  16261. break;
  16262. }
  16263. return _context39.abrupt("return", this.userEncryptKey);
  16264. case 2:
  16265. if (!(kn && kn.expireTime)) {
  16266. _context39.next = 6;
  16267. break;
  16268. }
  16269. e = Date.now();
  16270. if (!(kn.expireTime - e > 0)) {
  16271. _context39.next = 6;
  16272. break;
  16273. }
  16274. return _context39.abrupt("return", (this.userEncryptKey = kn, this.userEncryptKey));
  16275. case 6:
  16276. return _context39.abrupt("return", new Promise(function (e, t) {
  16277. uni.getUserCryptoManager().getLatestUserKey({
  16278. success: function success(t) {
  16279. kn = t, _this15.userEncryptKey = t, e(_this15.userEncryptKey);
  16280. },
  16281. fail: function fail(e) {
  16282. t(Sn(_objectSpread(_objectSpread({}, wn), {}, {
  16283. cause: e
  16284. })));
  16285. }
  16286. });
  16287. }));
  16288. case 7:
  16289. case "end":
  16290. return _context39.stop();
  16291. }
  16292. }
  16293. }, _callee39, this);
  16294. }));
  16295. function getUserEncryptKey() {
  16296. return _getUserEncryptKey.apply(this, arguments);
  16297. }
  16298. return getUserEncryptKey;
  16299. }()
  16300. }, {
  16301. key: "getWxAppId",
  16302. value: function getWxAppId() {
  16303. return wx.getAccountInfoSync().miniProgram.appId;
  16304. }
  16305. }, {
  16306. key: "platformGetSignOption",
  16307. value: function () {
  16308. var _platformGetSignOption = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40() {
  16309. var _yield$this$getUserEn, e, t, n;
  16310. return _regenerator.default.wrap(function _callee40$(_context40) {
  16311. while (1) {
  16312. switch (_context40.prev = _context40.next) {
  16313. case 0:
  16314. _context40.next = 2;
  16315. return this.getUserEncryptKey();
  16316. case 2:
  16317. _yield$this$getUserEn = _context40.sent;
  16318. e = _yield$this$getUserEn.encryptKey;
  16319. t = _yield$this$getUserEn.iv;
  16320. n = _yield$this$getUserEn.version;
  16321. return _context40.abrupt("return", {
  16322. verifyClientSign: mn(JSON.stringify({
  16323. data: JSON.stringify({}),
  16324. appId: this.appId,
  16325. deviceId: this.deviceId,
  16326. wxAppId: this.getWxAppId(),
  16327. simulator: "devtools" === ue().platform,
  16328. timestamp: Date.now()
  16329. }), e, t),
  16330. encryptKeyId: n,
  16331. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  16332. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  16333. });
  16334. case 7:
  16335. case "end":
  16336. return _context40.stop();
  16337. }
  16338. }
  16339. }, _callee40, this);
  16340. }));
  16341. function platformGetSignOption() {
  16342. return _platformGetSignOption.apply(this, arguments);
  16343. }
  16344. return platformGetSignOption;
  16345. }()
  16346. }, {
  16347. key: "platformEncryptData",
  16348. value: function () {
  16349. var _platformEncryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41(e) {
  16350. var _yield$this$getUserEn2, t, n, s, r;
  16351. return _regenerator.default.wrap(function _callee41$(_context41) {
  16352. while (1) {
  16353. switch (_context41.prev = _context41.next) {
  16354. case 0:
  16355. _context41.next = 2;
  16356. return this.getUserEncryptKey();
  16357. case 2:
  16358. _yield$this$getUserEn2 = _context41.sent;
  16359. t = _yield$this$getUserEn2.encryptKey;
  16360. n = _yield$this$getUserEn2.iv;
  16361. s = _yield$this$getUserEn2.version;
  16362. r = {
  16363. secretType: this.secretType,
  16364. encryptKeyId: s,
  16365. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  16366. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  16367. };
  16368. return _context41.abrupt("return", this.secretType === Ut ? {
  16369. content: e,
  16370. _uniCloudOptions: r
  16371. } : {
  16372. content: mn(JSON.stringify({
  16373. data: JSON.stringify(e),
  16374. appId: this.appId,
  16375. deviceId: this.deviceId,
  16376. wxAppId: this.getWxAppId(),
  16377. simulator: "devtools" === ue().platform,
  16378. timestamp: Date.now()
  16379. }), t, n),
  16380. _uniCloudOptions: r
  16381. });
  16382. case 8:
  16383. case "end":
  16384. return _context41.stop();
  16385. }
  16386. }
  16387. }, _callee41, this);
  16388. }));
  16389. function platformEncryptData(_x33) {
  16390. return _platformEncryptData.apply(this, arguments);
  16391. }
  16392. return platformEncryptData;
  16393. }()
  16394. }, {
  16395. key: "platformDecryptResult",
  16396. value: function () {
  16397. var _platformDecryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42(e) {
  16398. var t, _yield$this$getUserEn3, n, s;
  16399. return _regenerator.default.wrap(function _callee42$(_context42) {
  16400. while (1) {
  16401. switch (_context42.prev = _context42.next) {
  16402. case 0:
  16403. t = e.content;
  16404. _context42.next = 3;
  16405. return this.getUserEncryptKey();
  16406. case 3:
  16407. _yield$this$getUserEn3 = _context42.sent;
  16408. n = _yield$this$getUserEn3.encryptKey;
  16409. s = _yield$this$getUserEn3.iv;
  16410. return _context42.abrupt("return", JSON.parse(function (e, t, n) {
  16411. var s = new Uint8Array(uni.base64ToArrayBuffer(e)),
  16412. r = new Uint8Array(uni.base64ToArrayBuffer(t)),
  16413. i = gn.utils.utf8.toBytes(n),
  16414. o = new gn.ModeOfOperation.cbc(r, i),
  16415. a = gn.padding.pkcs7.strip(o.decrypt(s));
  16416. return gn.utils.utf8.fromBytes(a);
  16417. }(t, n, s)));
  16418. case 7:
  16419. case "end":
  16420. return _context42.stop();
  16421. }
  16422. }
  16423. }, _callee42, this);
  16424. }));
  16425. function platformDecryptResult(_x34) {
  16426. return _platformDecryptResult.apply(this, arguments);
  16427. }
  16428. return platformDecryptResult;
  16429. }()
  16430. }, {
  16431. key: "isClientKeyNotFound",
  16432. value: function isClientKeyNotFound() {
  16433. return !1;
  16434. }
  16435. }]);
  16436. return Tn;
  16437. }(Nt);
  16438. function Cn(e) {
  16439. var t = ["hasClientKey", "encryptGetClientKeyPayload", "setClientKey", "encrypt", "decrypt"],
  16440. n = {};
  16441. var _loop = function _loop(_s10) {
  16442. var r = t[_s10];
  16443. n[r] = function () {
  16444. for (var _len = arguments.length, t = new Array(_len), _key = 0; _key < _len; _key++) {
  16445. t[_key] = arguments[_key];
  16446. }
  16447. return new Promise(function (n, s) {
  16448. "function" == typeof e[r] ? e[r].apply(e, t.concat([function () {
  16449. var _ref26 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16450. e = _ref26.type,
  16451. t = _ref26.data,
  16452. r = _ref26.errCode,
  16453. i = _ref26.errMsg,
  16454. o = _ref26.errSubject,
  16455. a = _ref26.message;
  16456. "success" === e ? n(t) : s(Sn({
  16457. errCode: r,
  16458. errMsg: vn[r] || i || a,
  16459. errSubject: o
  16460. }));
  16461. }])) : s(Sn({
  16462. message: "请检查manifest.json内是否开启安全网络模块,另外注意标准基座不支持安全网络模块"
  16463. }));
  16464. });
  16465. };
  16466. };
  16467. for (var _s10 = 0; _s10 < t.length; _s10++) {
  16468. _loop(_s10);
  16469. }
  16470. return n;
  16471. }
  16472. var Pn = /*#__PURE__*/function (_Nt2) {
  16473. (0, _inherits2.default)(Pn, _Nt2);
  16474. var _super10 = _createSuper(Pn);
  16475. function Pn(e) {
  16476. var _this16;
  16477. (0, _classCallCheck2.default)(this, Pn);
  16478. _this16 = _super10.call(this, e), _this16.clientType = "app", _this16.appUtils = _objectSpread({}, Cn(uni.requireNativePlugin("plus"))), _this16.systemInfo = In || (In = ue());
  16479. return _this16;
  16480. }
  16481. (0, _createClass2.default)(Pn, [{
  16482. key: "hasClientKey",
  16483. value: function () {
  16484. var _hasClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43() {
  16485. return _regenerator.default.wrap(function _callee43$(_context43) {
  16486. while (1) {
  16487. switch (_context43.prev = _context43.next) {
  16488. case 0:
  16489. _context43.next = 2;
  16490. return this.appUtils.hasClientKey({
  16491. provider: this.provider,
  16492. spaceId: this.spaceId
  16493. });
  16494. case 2:
  16495. this._hasClientKey = _context43.sent;
  16496. return _context43.abrupt("return", this._hasClientKey);
  16497. case 4:
  16498. case "end":
  16499. return _context43.stop();
  16500. }
  16501. }
  16502. }, _callee43, this);
  16503. }));
  16504. function hasClientKey() {
  16505. return _hasClientKey.apply(this, arguments);
  16506. }
  16507. return hasClientKey;
  16508. }()
  16509. }, {
  16510. key: "getAppClientKey",
  16511. value: function () {
  16512. var _getAppClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44() {
  16513. var _yield$this$appUtils$, e, t, n, s, r;
  16514. return _regenerator.default.wrap(function _callee44$(_context44) {
  16515. while (1) {
  16516. switch (_context44.prev = _context44.next) {
  16517. case 0:
  16518. _context44.next = 2;
  16519. return this.appUtils.encryptGetClientKeyPayload({
  16520. data: JSON.stringify({})
  16521. });
  16522. case 2:
  16523. _yield$this$appUtils$ = _context44.sent;
  16524. e = _yield$this$appUtils$.data;
  16525. t = _yield$this$appUtils$.key;
  16526. _context44.next = 7;
  16527. return this.uniCloudIns.callFunction({
  16528. name: "DCloud-clientDB",
  16529. data: {
  16530. redirectTo: "encryption",
  16531. action: "getAppClientKey",
  16532. data: e,
  16533. key: t
  16534. }
  16535. });
  16536. case 7:
  16537. _context44.t0 = _context44.sent.result;
  16538. if (_context44.t0) {
  16539. _context44.next = 10;
  16540. break;
  16541. }
  16542. _context44.t0 = {};
  16543. case 10:
  16544. n = _context44.t0;
  16545. if (!(0 !== n.errCode)) {
  16546. _context44.next = 13;
  16547. break;
  16548. }
  16549. throw function (e) {
  16550. return new se({
  16551. subject: e.errSubject || "uni-secure-network",
  16552. code: e.errCode || e.code || yn.code,
  16553. message: e.errMsg || e.message
  16554. });
  16555. }(n);
  16556. case 13:
  16557. s = n.clientKey, r = n.key;
  16558. _context44.next = 16;
  16559. return this.appUtils.setClientKey({
  16560. provider: this.provider,
  16561. spaceId: this.spaceId,
  16562. clientKey: s,
  16563. key: r
  16564. });
  16565. case 16:
  16566. case "end":
  16567. return _context44.stop();
  16568. }
  16569. }
  16570. }, _callee44, this);
  16571. }));
  16572. function getAppClientKey() {
  16573. return _getAppClientKey.apply(this, arguments);
  16574. }
  16575. return getAppClientKey;
  16576. }()
  16577. }, {
  16578. key: "ensureClientKey",
  16579. value: function () {
  16580. var _ensureClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45() {
  16581. var _this17 = this;
  16582. var _ref27,
  16583. _ref27$forceUpdate,
  16584. e,
  16585. _args45 = arguments;
  16586. return _regenerator.default.wrap(function _callee45$(_context45) {
  16587. while (1) {
  16588. switch (_context45.prev = _context45.next) {
  16589. case 0:
  16590. _ref27 = _args45.length > 0 && _args45[0] !== undefined ? _args45[0] : {}, _ref27$forceUpdate = _ref27.forceUpdate, e = _ref27$forceUpdate === void 0 ? !1 : _ref27$forceUpdate;
  16591. _context45.t1 = !0;
  16592. _context45.next = 4;
  16593. return this.hasClientKey();
  16594. case 4:
  16595. _context45.t2 = _context45.sent;
  16596. _context45.t0 = _context45.t1 !== _context45.t2;
  16597. if (_context45.t0) {
  16598. _context45.next = 8;
  16599. break;
  16600. }
  16601. _context45.t0 = e;
  16602. case 8:
  16603. if (!_context45.t0) {
  16604. _context45.next = 10;
  16605. break;
  16606. }
  16607. 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) {
  16608. _this17.scopedGlobalCache.initStatus = p;
  16609. }).catch(function (e) {
  16610. throw _this17.scopedGlobalCache.initStatus = f, e;
  16611. }), this.scopedGlobalCache.initStatus = d), this.scopedGlobalCache.initPromise));
  16612. case 10:
  16613. case "end":
  16614. return _context45.stop();
  16615. }
  16616. }
  16617. }, _callee45, this);
  16618. }));
  16619. function ensureClientKey() {
  16620. return _ensureClientKey.apply(this, arguments);
  16621. }
  16622. return ensureClientKey;
  16623. }()
  16624. }, {
  16625. key: "prepare",
  16626. value: function () {
  16627. var _prepare3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46() {
  16628. var _ref28,
  16629. _ref28$forceUpdate,
  16630. e,
  16631. _args46 = arguments;
  16632. return _regenerator.default.wrap(function _callee46$(_context46) {
  16633. while (1) {
  16634. switch (_context46.prev = _context46.next) {
  16635. case 0:
  16636. _ref28 = _args46.length > 0 && _args46[0] !== undefined ? _args46[0] : {}, _ref28$forceUpdate = _ref28.forceUpdate, e = _ref28$forceUpdate === void 0 ? !1 : _ref28$forceUpdate;
  16637. _context46.next = 3;
  16638. return this.ensureClientKey({
  16639. forceUpdate: e
  16640. });
  16641. case 3:
  16642. case "end":
  16643. return _context46.stop();
  16644. }
  16645. }
  16646. }, _callee46, this);
  16647. }));
  16648. function prepare() {
  16649. return _prepare3.apply(this, arguments);
  16650. }
  16651. return prepare;
  16652. }()
  16653. }, {
  16654. key: "platformGetSignOption",
  16655. value: function () {
  16656. var _platformGetSignOption2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47() {
  16657. var _yield$this$appUtils$2, e, t;
  16658. return _regenerator.default.wrap(function _callee47$(_context47) {
  16659. while (1) {
  16660. switch (_context47.prev = _context47.next) {
  16661. case 0:
  16662. _context47.next = 2;
  16663. return this.appUtils.encrypt({
  16664. provider: this.provider,
  16665. spaceId: this.spaceId,
  16666. data: JSON.stringify({})
  16667. });
  16668. case 2:
  16669. _yield$this$appUtils$2 = _context47.sent;
  16670. e = _yield$this$appUtils$2.data;
  16671. t = _yield$this$appUtils$2.key;
  16672. return _context47.abrupt("return", {
  16673. verifyClientSign: e,
  16674. encryptKeyId: t
  16675. });
  16676. case 6:
  16677. case "end":
  16678. return _context47.stop();
  16679. }
  16680. }
  16681. }, _callee47, this);
  16682. }));
  16683. function platformGetSignOption() {
  16684. return _platformGetSignOption2.apply(this, arguments);
  16685. }
  16686. return platformGetSignOption;
  16687. }()
  16688. }, {
  16689. key: "platformEncryptData",
  16690. value: function () {
  16691. var _platformEncryptData2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48(e) {
  16692. var _yield$this$appUtils$3, t, n, s;
  16693. return _regenerator.default.wrap(function _callee48$(_context48) {
  16694. while (1) {
  16695. switch (_context48.prev = _context48.next) {
  16696. case 0:
  16697. _context48.next = 2;
  16698. return this.appUtils.encrypt({
  16699. provider: this.provider,
  16700. spaceId: this.spaceId,
  16701. data: JSON.stringify(e)
  16702. });
  16703. case 2:
  16704. _yield$this$appUtils$3 = _context48.sent;
  16705. t = _yield$this$appUtils$3.data;
  16706. n = _yield$this$appUtils$3.key;
  16707. s = {
  16708. secretType: this.secretType,
  16709. encryptKeyId: n
  16710. };
  16711. return _context48.abrupt("return", this.secretType === Ut ? {
  16712. content: e,
  16713. _uniCloudOptions: s
  16714. } : {
  16715. content: t,
  16716. _uniCloudOptions: s
  16717. });
  16718. case 7:
  16719. case "end":
  16720. return _context48.stop();
  16721. }
  16722. }
  16723. }, _callee48, this);
  16724. }));
  16725. function platformEncryptData(_x35) {
  16726. return _platformEncryptData2.apply(this, arguments);
  16727. }
  16728. return platformEncryptData;
  16729. }()
  16730. }, {
  16731. key: "platformDecryptResult",
  16732. value: function () {
  16733. var _platformDecryptResult2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49(e) {
  16734. var t, _e$_uniCloudOptions, n, s, r;
  16735. return _regenerator.default.wrap(function _callee49$(_context49) {
  16736. while (1) {
  16737. switch (_context49.prev = _context49.next) {
  16738. case 0:
  16739. t = e.content;
  16740. _e$_uniCloudOptions = e._uniCloudOptions;
  16741. n = _e$_uniCloudOptions === void 0 ? {} : _e$_uniCloudOptions;
  16742. s = n.encryptKeyId;
  16743. _context49.next = 6;
  16744. return this.appUtils.decrypt({
  16745. provider: this.provider,
  16746. spaceId: this.spaceId,
  16747. data: t,
  16748. key: s
  16749. });
  16750. case 6:
  16751. r = _context49.sent;
  16752. return _context49.abrupt("return", JSON.parse(r.data));
  16753. case 8:
  16754. case "end":
  16755. return _context49.stop();
  16756. }
  16757. }
  16758. }, _callee49, this);
  16759. }));
  16760. function platformDecryptResult(_x36) {
  16761. return _platformDecryptResult2.apply(this, arguments);
  16762. }
  16763. return platformDecryptResult;
  16764. }()
  16765. }, {
  16766. key: "isClientKeyNotFound",
  16767. value: function isClientKeyNotFound() {
  16768. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  16769. var t = e.result || {};
  16770. return 70009 === t.errCode && "uni-secure-network" === t.errSubject;
  16771. }
  16772. }]);
  16773. return Pn;
  16774. }(Nt);
  16775. function An() {
  16776. var _ref29 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16777. e = _ref29.secretType;
  16778. return e === Rt || e === Ut || e === Lt;
  16779. }
  16780. function En() {
  16781. var _ref30 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16782. e = _ref30.name,
  16783. _ref30$data = _ref30.data,
  16784. t = _ref30$data === void 0 ? {} : _ref30$data;
  16785. return "app" === A && "DCloud-clientDB" === e && "encryption" === t.redirectTo && "getAppClientKey" === t.action;
  16786. }
  16787. function On() {
  16788. var _ref31 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16789. e = _ref31.provider,
  16790. t = _ref31.spaceId,
  16791. n = _ref31.functionName;
  16792. var _ue = ue(),
  16793. s = _ue.appId,
  16794. r = _ue.uniPlatform,
  16795. i = _ue.osName;
  16796. var o = r;
  16797. "app" === r && (o = i);
  16798. var a = function () {
  16799. var _ref32 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16800. e = _ref32.provider,
  16801. t = _ref32.spaceId;
  16802. var n = P;
  16803. if (!n) return {};
  16804. e = function (e) {
  16805. return "tencent" === e ? "tcb" : e;
  16806. }(e);
  16807. var s = n.find(function (n) {
  16808. return n.provider === e && n.spaceId === t;
  16809. });
  16810. return s && s.config;
  16811. }({
  16812. provider: e,
  16813. spaceId: t
  16814. });
  16815. if (!a || !a.accessControl || !a.accessControl.enable) return !1;
  16816. var c = a.accessControl.function || {},
  16817. u = Object.keys(c);
  16818. if (0 === u.length) return !0;
  16819. var h = function (e, t) {
  16820. var n, s, r;
  16821. for (var _i2 = 0; _i2 < e.length; _i2++) {
  16822. var _o2 = e[_i2];
  16823. _o2 !== t ? "*" !== _o2 ? _o2.split(",").map(function (e) {
  16824. return e.trim();
  16825. }).indexOf(t) > -1 && (s = _o2) : r = _o2 : n = _o2;
  16826. }
  16827. return n || s || r;
  16828. }(u, n);
  16829. if (!h) return !1;
  16830. if ((c[h] || []).find(function () {
  16831. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  16832. return e.appId === s && (e.platform || "").toLowerCase() === o.toLowerCase();
  16833. })) return !0;
  16834. 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")), Sn(_n);
  16835. }
  16836. function xn(_ref33) {
  16837. var e = _ref33.functionName,
  16838. t = _ref33.result,
  16839. n = _ref33.logPvd;
  16840. if (k && this.__dev__.debugLog && t && t.requestId) {
  16841. var _s11 = JSON.stringify({
  16842. spaceId: this.config.spaceId,
  16843. functionName: e,
  16844. requestId: t.requestId
  16845. });
  16846. console.log("[".concat(n, "-request]").concat(_s11, "[/").concat(n, "-request]"));
  16847. }
  16848. }
  16849. function Rn(e) {
  16850. var t = e.callFunction,
  16851. n = function n(_n7) {
  16852. var _this18 = this;
  16853. var s = _n7.name;
  16854. _n7.data = Tt.call(e, {
  16855. data: _n7.data
  16856. });
  16857. var r = {
  16858. aliyun: "aliyun",
  16859. tencent: "tcb",
  16860. tcb: "tcb"
  16861. }[this.config.provider],
  16862. i = An(_n7),
  16863. o = En(_n7),
  16864. a = i || o;
  16865. return t.call(this, _n7).then(function (e) {
  16866. return e.errCode = 0, !a && xn.call(_this18, {
  16867. functionName: s,
  16868. result: e,
  16869. logPvd: r
  16870. }), Promise.resolve(e);
  16871. }, function (e) {
  16872. return !a && xn.call(_this18, {
  16873. functionName: s,
  16874. result: e,
  16875. logPvd: r
  16876. }), e && e.message && (e.message = function () {
  16877. var _ref34 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16878. _ref34$message = _ref34.message,
  16879. e = _ref34$message === void 0 ? "" : _ref34$message,
  16880. _ref34$extraInfo = _ref34.extraInfo,
  16881. t = _ref34$extraInfo === void 0 ? {} : _ref34$extraInfo,
  16882. _ref34$formatter = _ref34.formatter,
  16883. n = _ref34$formatter === void 0 ? [] : _ref34$formatter;
  16884. for (var _s12 = 0; _s12 < n.length; _s12++) {
  16885. var _n$_s = n[_s12],
  16886. _r4 = _n$_s.rule,
  16887. _i3 = _n$_s.content,
  16888. _o3 = _n$_s.mode,
  16889. _a = e.match(_r4);
  16890. if (!_a) continue;
  16891. var _c = _i3;
  16892. for (var _e19 = 1; _e19 < _a.length; _e19++) {
  16893. _c = Ot(_c, "{$".concat(_e19, "}"), _a[_e19]);
  16894. }
  16895. for (var _e20 in t) {
  16896. _c = Ot(_c, "{".concat(_e20, "}"), t[_e20]);
  16897. }
  16898. return "replace" === _o3 ? _c : e + _c;
  16899. }
  16900. return e;
  16901. }({
  16902. message: "[".concat(_n7.name, "]: ").concat(e.message),
  16903. formatter: Pt,
  16904. extraInfo: {
  16905. functionName: s
  16906. }
  16907. })), Promise.reject(e);
  16908. });
  16909. };
  16910. e.callFunction = function (t) {
  16911. var _e$config = e.config,
  16912. s = _e$config.provider,
  16913. r = _e$config.spaceId,
  16914. i = t.name;
  16915. var o, a;
  16916. if (t.data = t.data || {}, k && e.__dev__.debugInfo && !e.__dev__.debugInfo.forceRemote && O ? (e._callCloudFunction || (e._callCloudFunction = n, e._callLocalFunction = Ct), o = Ct) : o = n, o = o.bind(e), En(t)) a = n.call(e, t);else if (function (_ref35) {
  16917. var e = _ref35.name,
  16918. _ref35$data = _ref35.data,
  16919. t = _ref35$data === void 0 ? {} : _ref35$data;
  16920. return "mp-weixin" === A && "uni-id-co" === e && "secureNetworkHandshakeByWeixin" === t.method;
  16921. }(t)) a = o.call(e, t);else if (An(t)) {
  16922. a = new bn({
  16923. secretType: t.secretType,
  16924. uniCloudIns: e
  16925. }).wrapEncryptDataCallFunction(n.bind(e))(t);
  16926. } else if (On({
  16927. provider: s,
  16928. spaceId: r,
  16929. functionName: i
  16930. })) {
  16931. a = new bn({
  16932. secretType: t.secretType,
  16933. uniCloudIns: e
  16934. }).wrapVerifyClientCallFunction(n.bind(e))(t);
  16935. } else a = o(t);
  16936. return Object.defineProperty(a, "result", {
  16937. get: function get() {
  16938. return console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {};
  16939. }
  16940. }), a;
  16941. };
  16942. }
  16943. bn = "mp-weixin" !== A && "app" !== A ? /*#__PURE__*/function () {
  16944. function _class2() {
  16945. (0, _classCallCheck2.default)(this, _class2);
  16946. throw Sn({
  16947. message: "Platform ".concat(A, " is not supported by secure network")
  16948. });
  16949. }
  16950. return (0, _createClass2.default)(_class2);
  16951. }() : C ? "mp-weixin" === A ? Tn : Pn : /*#__PURE__*/function () {
  16952. function _class3() {
  16953. (0, _classCallCheck2.default)(this, _class3);
  16954. throw Sn({
  16955. message: "Platform ".concat(A, " is not enabled, please check whether secure network module is enabled in your manifest.json")
  16956. });
  16957. }
  16958. return (0, _createClass2.default)(_class3);
  16959. }();
  16960. var Un = Symbol("CLIENT_DB_INTERNAL");
  16961. function Ln(e, t) {
  16962. return e.then = "DoNotReturnProxyWithAFunctionNamedThen", e._internalType = Un, e.inspect = null, e.__ob__ = void 0, new Proxy(e, {
  16963. get: function get(e, n, s) {
  16964. if ("_uniClient" === n) return null;
  16965. if ("symbol" == (0, _typeof2.default)(n)) return e[n];
  16966. if (n in e || "string" != typeof n) {
  16967. var _t10 = e[n];
  16968. return "function" == typeof _t10 ? _t10.bind(e) : _t10;
  16969. }
  16970. return t.get(e, n, s);
  16971. }
  16972. });
  16973. }
  16974. function Nn(e) {
  16975. return {
  16976. on: function on(t, n) {
  16977. e[t] = e[t] || [], e[t].indexOf(n) > -1 || e[t].push(n);
  16978. },
  16979. off: function off(t, n) {
  16980. e[t] = e[t] || [];
  16981. var s = e[t].indexOf(n);
  16982. -1 !== s && e[t].splice(s, 1);
  16983. }
  16984. };
  16985. }
  16986. var Dn = ["db.Geo", "db.command", "command.aggregate"];
  16987. function Fn(e, t) {
  16988. return Dn.indexOf("".concat(e, ".").concat(t)) > -1;
  16989. }
  16990. function qn(e) {
  16991. switch (g(e)) {
  16992. case "array":
  16993. return e.map(function (e) {
  16994. return qn(e);
  16995. });
  16996. case "object":
  16997. return e._internalType === Un || Object.keys(e).forEach(function (t) {
  16998. e[t] = qn(e[t]);
  16999. }), e;
  17000. case "regexp":
  17001. return {
  17002. $regexp: {
  17003. source: e.source,
  17004. flags: e.flags
  17005. }
  17006. };
  17007. case "date":
  17008. return {
  17009. $date: e.toISOString()
  17010. };
  17011. default:
  17012. return e;
  17013. }
  17014. }
  17015. function Mn(e) {
  17016. return e && e.content && e.content.$method;
  17017. }
  17018. var Kn = /*#__PURE__*/function () {
  17019. function Kn(e, t, n) {
  17020. (0, _classCallCheck2.default)(this, Kn);
  17021. this.content = e, this.prevStage = t || null, this.udb = null, this._database = n;
  17022. }
  17023. (0, _createClass2.default)(Kn, [{
  17024. key: "toJSON",
  17025. value: function toJSON() {
  17026. var e = this;
  17027. var t = [e.content];
  17028. for (; e.prevStage;) {
  17029. e = e.prevStage, t.push(e.content);
  17030. }
  17031. return {
  17032. $db: t.reverse().map(function (e) {
  17033. return {
  17034. $method: e.$method,
  17035. $param: qn(e.$param)
  17036. };
  17037. })
  17038. };
  17039. }
  17040. }, {
  17041. key: "toString",
  17042. value: function toString() {
  17043. return JSON.stringify(this.toJSON());
  17044. }
  17045. }, {
  17046. key: "getAction",
  17047. value: function getAction() {
  17048. var e = this.toJSON().$db.find(function (e) {
  17049. return "action" === e.$method;
  17050. });
  17051. return e && e.$param && e.$param[0];
  17052. }
  17053. }, {
  17054. key: "getCommand",
  17055. value: function getCommand() {
  17056. return {
  17057. $db: this.toJSON().$db.filter(function (e) {
  17058. return "action" !== e.$method;
  17059. })
  17060. };
  17061. }
  17062. }, {
  17063. key: "isAggregate",
  17064. get: function get() {
  17065. var e = this;
  17066. for (; e;) {
  17067. var t = Mn(e),
  17068. _n8 = Mn(e.prevStage);
  17069. if ("aggregate" === t && "collection" === _n8 || "pipeline" === t) return !0;
  17070. e = e.prevStage;
  17071. }
  17072. return !1;
  17073. }
  17074. }, {
  17075. key: "isCommand",
  17076. get: function get() {
  17077. var e = this;
  17078. for (; e;) {
  17079. if ("command" === Mn(e)) return !0;
  17080. e = e.prevStage;
  17081. }
  17082. return !1;
  17083. }
  17084. }, {
  17085. key: "isAggregateCommand",
  17086. get: function get() {
  17087. var e = this;
  17088. for (; e;) {
  17089. var t = Mn(e),
  17090. _n9 = Mn(e.prevStage);
  17091. if ("aggregate" === t && "command" === _n9) return !0;
  17092. e = e.prevStage;
  17093. }
  17094. return !1;
  17095. }
  17096. }, {
  17097. key: "getNextStageFn",
  17098. value: function getNextStageFn(e) {
  17099. var t = this;
  17100. return function () {
  17101. return jn({
  17102. $method: e,
  17103. $param: qn(Array.from(arguments))
  17104. }, t, t._database);
  17105. };
  17106. }
  17107. }, {
  17108. key: "count",
  17109. get: function get() {
  17110. return this.isAggregate ? this.getNextStageFn("count") : function () {
  17111. return this._send("count", Array.from(arguments));
  17112. };
  17113. }
  17114. }, {
  17115. key: "remove",
  17116. get: function get() {
  17117. return this.isCommand ? this.getNextStageFn("remove") : function () {
  17118. return this._send("remove", Array.from(arguments));
  17119. };
  17120. }
  17121. }, {
  17122. key: "get",
  17123. value: function get() {
  17124. return this._send("get", Array.from(arguments));
  17125. }
  17126. }, {
  17127. key: "add",
  17128. get: function get() {
  17129. return this.isCommand ? this.getNextStageFn("add") : function () {
  17130. return this._send("add", Array.from(arguments));
  17131. };
  17132. }
  17133. }, {
  17134. key: "update",
  17135. value: function update() {
  17136. return this._send("update", Array.from(arguments));
  17137. }
  17138. }, {
  17139. key: "end",
  17140. value: function end() {
  17141. return this._send("end", Array.from(arguments));
  17142. }
  17143. }, {
  17144. key: "set",
  17145. get: function get() {
  17146. return this.isCommand ? this.getNextStageFn("set") : function () {
  17147. throw new Error("JQL禁止使用set方法");
  17148. };
  17149. }
  17150. }, {
  17151. key: "_send",
  17152. value: function _send(e, t) {
  17153. var n = this.getAction(),
  17154. s = this.getCommand();
  17155. if (s.$db.push({
  17156. $method: e,
  17157. $param: qn(t)
  17158. }), k) {
  17159. var _e21 = s.$db.find(function (e) {
  17160. return "collection" === e.$method;
  17161. }),
  17162. _t11 = _e21 && _e21.$param;
  17163. _t11 && 1 === _t11.length && "string" == typeof _e21.$param[0] && _e21.$param[0].indexOf(",") > -1 && console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
  17164. }
  17165. return this._database._callCloudFunction({
  17166. action: n,
  17167. command: s
  17168. });
  17169. }
  17170. }]);
  17171. return Kn;
  17172. }();
  17173. function jn(e, t, n) {
  17174. return Ln(new Kn(e, t, n), {
  17175. get: function get(e, t) {
  17176. var s = "db";
  17177. return e && e.content && (s = e.content.$method), Fn(s, t) ? jn({
  17178. $method: t
  17179. }, e, n) : function () {
  17180. return jn({
  17181. $method: t,
  17182. $param: qn(Array.from(arguments))
  17183. }, e, n);
  17184. };
  17185. }
  17186. });
  17187. }
  17188. function Bn(_ref36) {
  17189. var e = _ref36.path,
  17190. t = _ref36.method;
  17191. return /*#__PURE__*/function () {
  17192. function _class4() {
  17193. (0, _classCallCheck2.default)(this, _class4);
  17194. this.param = Array.from(arguments);
  17195. }
  17196. (0, _createClass2.default)(_class4, [{
  17197. key: "toJSON",
  17198. value: function toJSON() {
  17199. return {
  17200. $newDb: [].concat((0, _toConsumableArray2.default)(e.map(function (e) {
  17201. return {
  17202. $method: e
  17203. };
  17204. })), [{
  17205. $method: t,
  17206. $param: this.param
  17207. }])
  17208. };
  17209. }
  17210. }, {
  17211. key: "toString",
  17212. value: function toString() {
  17213. return JSON.stringify(this.toJSON());
  17214. }
  17215. }]);
  17216. return _class4;
  17217. }();
  17218. }
  17219. function $n(e) {
  17220. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17221. return Ln(new e(t), {
  17222. get: function get(e, t) {
  17223. return Fn("db", t) ? jn({
  17224. $method: t
  17225. }, null, e) : function () {
  17226. return jn({
  17227. $method: t,
  17228. $param: qn(Array.from(arguments))
  17229. }, null, e);
  17230. };
  17231. }
  17232. });
  17233. }
  17234. var Wn = /*#__PURE__*/function (_ref37) {
  17235. (0, _inherits2.default)(Wn, _ref37);
  17236. var _super11 = _createSuper(Wn);
  17237. function Wn() {
  17238. (0, _classCallCheck2.default)(this, Wn);
  17239. return _super11.apply(this, arguments);
  17240. }
  17241. (0, _createClass2.default)(Wn, [{
  17242. key: "_parseResult",
  17243. value: function _parseResult(e) {
  17244. return this._isJQL ? e.result : e;
  17245. }
  17246. }, {
  17247. key: "_callCloudFunction",
  17248. value: function _callCloudFunction(_ref38) {
  17249. var _this19 = this;
  17250. var e = _ref38.action,
  17251. t = _ref38.command,
  17252. n = _ref38.multiCommand,
  17253. s = _ref38.queryList;
  17254. function r(e, t) {
  17255. if (n && s) for (var _n10 = 0; _n10 < s.length; _n10++) {
  17256. var _r5 = s[_n10];
  17257. _r5.udb && "function" == typeof _r5.udb.setResult && (t ? _r5.udb.setResult(t) : _r5.udb.setResult(e.result.dataList[_n10]));
  17258. }
  17259. }
  17260. var i = this,
  17261. o = this._isJQL ? "databaseForJQL" : "database";
  17262. function a(e) {
  17263. return i._callback("error", [e]), M(K(o, "fail"), e).then(function () {
  17264. return M(K(o, "complete"), e);
  17265. }).then(function () {
  17266. return r(null, e), X($, {
  17267. type: J,
  17268. content: e
  17269. }), Promise.reject(e);
  17270. });
  17271. }
  17272. var c = M(K(o, "invoke")),
  17273. u = this._uniClient;
  17274. return c.then(function () {
  17275. return u.callFunction({
  17276. name: "DCloud-clientDB",
  17277. type: l,
  17278. data: {
  17279. action: e,
  17280. command: t,
  17281. multiCommand: n
  17282. }
  17283. });
  17284. }).then(function (e) {
  17285. var _e$result = e.result,
  17286. t = _e$result.code,
  17287. n = _e$result.message,
  17288. s = _e$result.token,
  17289. c = _e$result.tokenExpired,
  17290. _e$result$systemInfo = _e$result.systemInfo,
  17291. u = _e$result$systemInfo === void 0 ? [] : _e$result$systemInfo;
  17292. if (u) for (var _e22 = 0; _e22 < u.length; _e22++) {
  17293. var _u$_e = u[_e22],
  17294. _t12 = _u$_e.level,
  17295. _n11 = _u$_e.message,
  17296. _s13 = _u$_e.detail,
  17297. _r6 = console["app" === A && "warn" === _t12 ? "error" : _t12] || console.log;
  17298. var _i4 = "[System Info]" + _n11;
  17299. _s13 && (_i4 = "".concat(_i4, "\n\u8BE6\u7EC6\u4FE1\u606F\uFF1A").concat(_s13)), _r6(_i4);
  17300. }
  17301. if (t) {
  17302. return a(new se({
  17303. code: t,
  17304. message: n,
  17305. requestId: e.requestId
  17306. }));
  17307. }
  17308. e.result.errCode = e.result.errCode || e.result.code, e.result.errMsg = e.result.errMsg || e.result.message, s && c && (oe({
  17309. token: s,
  17310. tokenExpired: c
  17311. }), _this19._callbackAuth("refreshToken", [{
  17312. token: s,
  17313. tokenExpired: c
  17314. }]), _this19._callback("refreshToken", [{
  17315. token: s,
  17316. tokenExpired: c
  17317. }]), X(z, {
  17318. token: s,
  17319. tokenExpired: c
  17320. }));
  17321. var h = [{
  17322. prop: "affectedDocs",
  17323. tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"
  17324. }, {
  17325. prop: "code",
  17326. tips: "code不再推荐使用,请使用errCode替代"
  17327. }, {
  17328. prop: "message",
  17329. tips: "message不再推荐使用,请使用errMsg替代"
  17330. }];
  17331. var _loop2 = function _loop2(_t13) {
  17332. var _h$_t = h[_t13],
  17333. n = _h$_t.prop,
  17334. s = _h$_t.tips;
  17335. if (n in e.result) {
  17336. var _t14 = e.result[n];
  17337. Object.defineProperty(e.result, n, {
  17338. get: function get() {
  17339. return console.warn(s), _t14;
  17340. }
  17341. });
  17342. }
  17343. };
  17344. for (var _t13 = 0; _t13 < h.length; _t13++) {
  17345. _loop2(_t13);
  17346. }
  17347. return function (e) {
  17348. return M(K(o, "success"), e).then(function () {
  17349. return M(K(o, "complete"), e);
  17350. }).then(function () {
  17351. r(e, null);
  17352. var t = i._parseResult(e);
  17353. return X($, {
  17354. type: J,
  17355. content: t
  17356. }), Promise.resolve(t);
  17357. });
  17358. }(e);
  17359. }, function (e) {
  17360. /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
  17361. return a(new se({
  17362. code: e.code || "SYSTEM_ERROR",
  17363. message: e.message,
  17364. requestId: e.requestId
  17365. }));
  17366. });
  17367. }
  17368. }]);
  17369. return Wn;
  17370. }( /*#__PURE__*/function () {
  17371. function _class5() {
  17372. var _ref39 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17373. _ref39$uniClient = _ref39.uniClient,
  17374. e = _ref39$uniClient === void 0 ? {} : _ref39$uniClient,
  17375. _ref39$isJQL = _ref39.isJQL,
  17376. t = _ref39$isJQL === void 0 ? !1 : _ref39$isJQL;
  17377. (0, _classCallCheck2.default)(this, _class5);
  17378. this._uniClient = e, this._authCallBacks = {}, this._dbCallBacks = {}, e._isDefault && (this._dbCallBacks = L("_globalUniCloudDatabaseCallback")), t || (this.auth = Nn(this._authCallBacks)), this._isJQL = t, Object.assign(this, Nn(this._dbCallBacks)), this.env = Ln({}, {
  17379. get: function get(e, t) {
  17380. return {
  17381. $env: t
  17382. };
  17383. }
  17384. }), this.Geo = Ln({}, {
  17385. get: function get(e, t) {
  17386. return Bn({
  17387. path: ["Geo"],
  17388. method: t
  17389. });
  17390. }
  17391. }), this.serverDate = Bn({
  17392. path: [],
  17393. method: "serverDate"
  17394. }), this.RegExp = Bn({
  17395. path: [],
  17396. method: "RegExp"
  17397. });
  17398. }
  17399. (0, _createClass2.default)(_class5, [{
  17400. key: "getCloudEnv",
  17401. value: function getCloudEnv(e) {
  17402. if ("string" != typeof e || !e.trim()) throw new Error("getCloudEnv参数错误");
  17403. return {
  17404. $env: e.replace("$cloudEnv_", "")
  17405. };
  17406. }
  17407. }, {
  17408. key: "_callback",
  17409. value: function _callback(e, t) {
  17410. var n = this._dbCallBacks;
  17411. n[e] && n[e].forEach(function (e) {
  17412. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  17413. });
  17414. }
  17415. }, {
  17416. key: "_callbackAuth",
  17417. value: function _callbackAuth(e, t) {
  17418. var n = this._authCallBacks;
  17419. n[e] && n[e].forEach(function (e) {
  17420. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  17421. });
  17422. }
  17423. }, {
  17424. key: "multiSend",
  17425. value: function multiSend() {
  17426. var e = Array.from(arguments),
  17427. t = e.map(function (e) {
  17428. var t = e.getAction(),
  17429. n = e.getCommand();
  17430. if ("getTemp" !== n.$db[n.$db.length - 1].$method) throw new Error("multiSend只支持子命令内使用getTemp");
  17431. return {
  17432. action: t,
  17433. command: n
  17434. };
  17435. });
  17436. return this._callCloudFunction({
  17437. multiCommand: t,
  17438. queryList: e
  17439. });
  17440. }
  17441. }]);
  17442. return _class5;
  17443. }());
  17444. var zn = "token无效,跳转登录页面",
  17445. Jn = "token过期,跳转登录页面",
  17446. Hn = {
  17447. TOKEN_INVALID_TOKEN_EXPIRED: Jn,
  17448. TOKEN_INVALID_INVALID_CLIENTID: zn,
  17449. TOKEN_INVALID: zn,
  17450. TOKEN_INVALID_WRONG_TOKEN: zn,
  17451. TOKEN_INVALID_ANONYMOUS_USER: zn
  17452. },
  17453. Gn = {
  17454. "uni-id-token-expired": Jn,
  17455. "uni-id-check-token-failed": zn,
  17456. "uni-id-token-not-exist": zn,
  17457. "uni-id-check-device-feature-failed": zn
  17458. };
  17459. function Vn(e, t) {
  17460. var n = "";
  17461. return n = e ? "".concat(e, "/").concat(t) : t, n.replace(/^\//, "");
  17462. }
  17463. function Qn() {
  17464. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  17465. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
  17466. var n = [],
  17467. s = [];
  17468. return e.forEach(function (e) {
  17469. !0 === e.needLogin ? n.push(Vn(t, e.path)) : !1 === e.needLogin && s.push(Vn(t, e.path));
  17470. }), {
  17471. needLoginPage: n,
  17472. notNeedLoginPage: s
  17473. };
  17474. }
  17475. function Yn(e) {
  17476. return e.split("?")[0].replace(/^\//, "");
  17477. }
  17478. function Xn() {
  17479. return function (e) {
  17480. var t = e && e.$page && e.$page.fullPath || "";
  17481. return t ? ("/" !== t.charAt(0) && (t = "/" + t), t) : t;
  17482. }(function () {
  17483. var e = getCurrentPages();
  17484. return e[e.length - 1];
  17485. }());
  17486. }
  17487. function Zn() {
  17488. return Yn(Xn());
  17489. }
  17490. function es() {
  17491. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  17492. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17493. if (!e) return !1;
  17494. if (!(t && t.list && t.list.length)) return !1;
  17495. var n = t.list,
  17496. s = Yn(e);
  17497. return n.some(function (e) {
  17498. return e.pagePath === s;
  17499. });
  17500. }
  17501. var ts = !!_pages.default.uniIdRouter;
  17502. var _ref40 = function () {
  17503. var _ref21 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _pages.default,
  17504. _ref21$pages = _ref21.pages,
  17505. e = _ref21$pages === void 0 ? [] : _ref21$pages,
  17506. _ref21$subPackages = _ref21.subPackages,
  17507. n = _ref21$subPackages === void 0 ? [] : _ref21$subPackages,
  17508. _ref21$uniIdRouter = _ref21.uniIdRouter,
  17509. s = _ref21$uniIdRouter === void 0 ? {} : _ref21$uniIdRouter,
  17510. _ref21$tabBar = _ref21.tabBar,
  17511. r = _ref21$tabBar === void 0 ? {} : _ref21$tabBar;
  17512. var i = s.loginPage,
  17513. _s$needLogin = s.needLogin,
  17514. o = _s$needLogin === void 0 ? [] : _s$needLogin,
  17515. _s$resToLogin = s.resToLogin,
  17516. a = _s$resToLogin === void 0 ? !0 : _s$resToLogin,
  17517. _Qn = Qn(e),
  17518. c = _Qn.needLoginPage,
  17519. u = _Qn.notNeedLoginPage,
  17520. _ref23 = function () {
  17521. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  17522. var t = [],
  17523. n = [];
  17524. return e.forEach(function (e) {
  17525. var s = e.root,
  17526. _e$pages = e.pages,
  17527. r = _e$pages === void 0 ? [] : _e$pages,
  17528. _Qn2 = Qn(r, s),
  17529. i = _Qn2.needLoginPage,
  17530. o = _Qn2.notNeedLoginPage;
  17531. t.push.apply(t, (0, _toConsumableArray2.default)(i)), n.push.apply(n, (0, _toConsumableArray2.default)(o));
  17532. }), {
  17533. needLoginPage: t,
  17534. notNeedLoginPage: n
  17535. };
  17536. }(n),
  17537. h = _ref23.needLoginPage,
  17538. l = _ref23.notNeedLoginPage;
  17539. return {
  17540. loginPage: i,
  17541. routerNeedLogin: o,
  17542. resToLogin: a,
  17543. needLoginPage: [].concat((0, _toConsumableArray2.default)(c), (0, _toConsumableArray2.default)(h)),
  17544. notNeedLoginPage: [].concat((0, _toConsumableArray2.default)(u), (0, _toConsumableArray2.default)(l)),
  17545. loginPageInTabBar: es(i, r)
  17546. };
  17547. }(),
  17548. ns = _ref40.loginPage,
  17549. ss = _ref40.routerNeedLogin,
  17550. rs = _ref40.resToLogin,
  17551. is = _ref40.needLoginPage,
  17552. os = _ref40.notNeedLoginPage,
  17553. as = _ref40.loginPageInTabBar;
  17554. if (is.indexOf(ns) > -1) throw new Error("Login page [".concat(ns, "] should not be \"needLogin\", please check your pages.json"));
  17555. function cs(e) {
  17556. var t = Zn();
  17557. if ("/" === e.charAt(0)) return e;
  17558. var _e$split = e.split("?"),
  17559. _e$split2 = (0, _slicedToArray2.default)(_e$split, 2),
  17560. n = _e$split2[0],
  17561. s = _e$split2[1],
  17562. r = n.replace(/^\//, "").split("/"),
  17563. i = t.split("/");
  17564. i.pop();
  17565. for (var _e23 = 0; _e23 < r.length; _e23++) {
  17566. var _t15 = r[_e23];
  17567. ".." === _t15 ? i.pop() : "." !== _t15 && i.push(_t15);
  17568. }
  17569. return "" === i[0] && i.shift(), "/" + i.join("/") + (s ? "?" + s : "");
  17570. }
  17571. function us(e) {
  17572. var t = Yn(cs(e));
  17573. return !(os.indexOf(t) > -1) && (is.indexOf(t) > -1 || ss.some(function (t) {
  17574. return function (e, t) {
  17575. return new RegExp(t).test(e);
  17576. }(e, t);
  17577. }));
  17578. }
  17579. function hs(_ref41) {
  17580. var e = _ref41.redirect;
  17581. var t = Yn(e),
  17582. n = Yn(ns);
  17583. return Zn() !== n && t !== n;
  17584. }
  17585. function ls() {
  17586. var _ref42 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17587. e = _ref42.api,
  17588. t = _ref42.redirect;
  17589. if (!t || !hs({
  17590. redirect: t
  17591. })) return;
  17592. var n = function (e, t) {
  17593. return "/" !== e.charAt(0) && (e = "/" + e), t ? e.indexOf("?") > -1 ? e + "&uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e + "?uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e;
  17594. }(ns, t);
  17595. as ? "navigateTo" !== e && "redirectTo" !== e || (e = "switchTab") : "switchTab" === e && (e = "navigateTo");
  17596. var s = {
  17597. navigateTo: uni.navigateTo,
  17598. redirectTo: uni.redirectTo,
  17599. switchTab: uni.switchTab,
  17600. reLaunch: uni.reLaunch
  17601. };
  17602. setTimeout(function () {
  17603. s[e]({
  17604. url: n
  17605. });
  17606. });
  17607. }
  17608. function ds() {
  17609. var _ref43 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17610. e = _ref43.url;
  17611. var t = {
  17612. abortLoginPageJump: !1,
  17613. autoToLoginPage: !1
  17614. },
  17615. n = function () {
  17616. var _ie3 = ie(),
  17617. e = _ie3.token,
  17618. t = _ie3.tokenExpired;
  17619. var n;
  17620. if (e) {
  17621. if (t < Date.now()) {
  17622. var _e24 = "uni-id-token-expired";
  17623. n = {
  17624. errCode: _e24,
  17625. errMsg: Gn[_e24]
  17626. };
  17627. }
  17628. } else {
  17629. var _e25 = "uni-id-check-token-failed";
  17630. n = {
  17631. errCode: _e25,
  17632. errMsg: Gn[_e25]
  17633. };
  17634. }
  17635. return n;
  17636. }();
  17637. if (us(e) && n) {
  17638. n.uniIdRedirectUrl = e;
  17639. if (V(W).length > 0) return setTimeout(function () {
  17640. X(W, n);
  17641. }, 0), t.abortLoginPageJump = !0, t;
  17642. t.autoToLoginPage = !0;
  17643. }
  17644. return t;
  17645. }
  17646. function ps() {
  17647. !function () {
  17648. var e = Xn(),
  17649. _ds = ds({
  17650. url: e
  17651. }),
  17652. t = _ds.abortLoginPageJump,
  17653. n = _ds.autoToLoginPage;
  17654. t || n && ls({
  17655. api: "redirectTo",
  17656. redirect: e
  17657. });
  17658. }();
  17659. var e = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
  17660. var _loop3 = function _loop3(_t16) {
  17661. var n = e[_t16];
  17662. uni.addInterceptor(n, {
  17663. invoke: function invoke(e) {
  17664. var _ds2 = ds({
  17665. url: e.url
  17666. }),
  17667. t = _ds2.abortLoginPageJump,
  17668. s = _ds2.autoToLoginPage;
  17669. return t ? e : s ? (ls({
  17670. api: n,
  17671. redirect: cs(e.url)
  17672. }), !1) : e;
  17673. }
  17674. });
  17675. };
  17676. for (var _t16 = 0; _t16 < e.length; _t16++) {
  17677. _loop3(_t16);
  17678. }
  17679. }
  17680. function fs() {
  17681. this.onResponse(function (e) {
  17682. var t = e.type,
  17683. n = e.content;
  17684. var s = !1;
  17685. switch (t) {
  17686. case "cloudobject":
  17687. s = function (e) {
  17688. if ("object" != (0, _typeof2.default)(e)) return !1;
  17689. var _ref44 = e || {},
  17690. t = _ref44.errCode;
  17691. return t in Gn;
  17692. }(n);
  17693. break;
  17694. case "clientdb":
  17695. s = function (e) {
  17696. if ("object" != (0, _typeof2.default)(e)) return !1;
  17697. var _ref45 = e || {},
  17698. t = _ref45.errCode;
  17699. return t in Hn;
  17700. }(n);
  17701. }
  17702. s && function () {
  17703. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  17704. var t = V(W);
  17705. te().then(function () {
  17706. var n = Xn();
  17707. if (n && hs({
  17708. redirect: n
  17709. })) return t.length > 0 ? X(W, Object.assign({
  17710. uniIdRedirectUrl: n
  17711. }, e)) : void (ns && ls({
  17712. api: "navigateTo",
  17713. redirect: n
  17714. }));
  17715. });
  17716. }(n);
  17717. });
  17718. }
  17719. function gs(e) {
  17720. !function (e) {
  17721. e.onResponse = function (e) {
  17722. Q($, e);
  17723. }, e.offResponse = function (e) {
  17724. Y($, e);
  17725. };
  17726. }(e), function (e) {
  17727. e.onNeedLogin = function (e) {
  17728. Q(W, e);
  17729. }, e.offNeedLogin = function (e) {
  17730. Y(W, e);
  17731. }, ts && (L("_globalUniCloudStatus").needLoginInit || (L("_globalUniCloudStatus").needLoginInit = !0, te().then(function () {
  17732. ps.call(e);
  17733. }), rs && fs.call(e)));
  17734. }(e), function (e) {
  17735. e.onRefreshToken = function (e) {
  17736. Q(z, e);
  17737. }, e.offRefreshToken = function (e) {
  17738. Y(z, e);
  17739. };
  17740. }(e);
  17741. }
  17742. var ms;
  17743. var ys = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  17744. _s = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  17745. function ws() {
  17746. var e = ie().token || "",
  17747. t = e.split(".");
  17748. if (!e || 3 !== t.length) return {
  17749. uid: null,
  17750. role: [],
  17751. permission: [],
  17752. tokenExpired: 0
  17753. };
  17754. var n;
  17755. try {
  17756. n = JSON.parse((s = t[1], decodeURIComponent(ms(s).split("").map(function (e) {
  17757. return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2);
  17758. }).join(""))));
  17759. } catch (e) {
  17760. throw new Error("获取当前用户信息出错,详细错误信息为:" + e.message);
  17761. }
  17762. var s;
  17763. return n.tokenExpired = 1e3 * n.exp, delete n.exp, delete n.iat, n;
  17764. }
  17765. ms = "function" != typeof atob ? function (e) {
  17766. if (e = String(e).replace(/[\t\n\f\r ]+/g, ""), !_s.test(e)) throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  17767. var t;
  17768. e += "==".slice(2 - (3 & e.length));
  17769. for (var n, s, r = "", i = 0; i < e.length;) {
  17770. t = ys.indexOf(e.charAt(i++)) << 18 | ys.indexOf(e.charAt(i++)) << 12 | (n = ys.indexOf(e.charAt(i++))) << 6 | (s = ys.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);
  17771. }
  17772. return r;
  17773. } : atob;
  17774. var vs = s(function (e, t) {
  17775. Object.defineProperty(t, "__esModule", {
  17776. value: !0
  17777. });
  17778. var n = "chooseAndUploadFile:ok",
  17779. s = "chooseAndUploadFile:fail";
  17780. function r(e, t) {
  17781. return e.tempFiles.forEach(function (e, n) {
  17782. 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("."));
  17783. }), e.tempFilePaths || (e.tempFilePaths = e.tempFiles.map(function (e) {
  17784. return e.path;
  17785. })), e;
  17786. }
  17787. function i(e, t, _ref46) {
  17788. var s = _ref46.onChooseFile,
  17789. r = _ref46.onUploadProgress;
  17790. return t.then(function (e) {
  17791. if (s) {
  17792. var _t17 = s(e);
  17793. if (void 0 !== _t17) return Promise.resolve(_t17).then(function (t) {
  17794. return void 0 === t ? e : t;
  17795. });
  17796. }
  17797. return e;
  17798. }).then(function (t) {
  17799. return !1 === t ? {
  17800. errMsg: n,
  17801. tempFilePaths: [],
  17802. tempFiles: []
  17803. } : function (e, t) {
  17804. var s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;
  17805. var r = arguments.length > 3 ? arguments[3] : undefined;
  17806. (t = Object.assign({}, t)).errMsg = n;
  17807. var i = t.tempFiles,
  17808. o = i.length;
  17809. var a = 0;
  17810. return new Promise(function (n) {
  17811. for (; a < s;) {
  17812. c();
  17813. }
  17814. function c() {
  17815. var s = a++;
  17816. if (s >= o) return void (!i.find(function (e) {
  17817. return !e.url && !e.errMsg;
  17818. }) && n(t));
  17819. var u = i[s];
  17820. e.uploadFile({
  17821. filePath: u.path,
  17822. cloudPath: u.cloudPath,
  17823. fileType: u.fileType,
  17824. onUploadProgress: function onUploadProgress(e) {
  17825. e.index = s, e.tempFile = u, e.tempFilePath = u.path, r && r(e);
  17826. }
  17827. }).then(function (e) {
  17828. u.url = e.fileID, s < o && c();
  17829. }).catch(function (e) {
  17830. u.errMsg = e.errMsg || e.message, s < o && c();
  17831. });
  17832. }
  17833. });
  17834. }(e, t, 5, r);
  17835. });
  17836. }
  17837. t.initChooseAndUploadFile = function (e) {
  17838. return function () {
  17839. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  17840. type: "all"
  17841. };
  17842. return "image" === t.type ? i(e, function (e) {
  17843. var t = e.count,
  17844. n = e.sizeType,
  17845. _e$sourceType = e.sourceType,
  17846. i = _e$sourceType === void 0 ? ["album", "camera"] : _e$sourceType,
  17847. o = e.extension;
  17848. return new Promise(function (e, a) {
  17849. uni.chooseImage({
  17850. count: t,
  17851. sizeType: n,
  17852. sourceType: i,
  17853. extension: o,
  17854. success: function success(t) {
  17855. e(r(t, "image"));
  17856. },
  17857. fail: function fail(e) {
  17858. a({
  17859. errMsg: e.errMsg.replace("chooseImage:fail", s)
  17860. });
  17861. }
  17862. });
  17863. });
  17864. }(t), t) : "video" === t.type ? i(e, function (e) {
  17865. var t = e.camera,
  17866. n = e.compressed,
  17867. i = e.maxDuration,
  17868. _e$sourceType2 = e.sourceType,
  17869. o = _e$sourceType2 === void 0 ? ["album", "camera"] : _e$sourceType2,
  17870. a = e.extension;
  17871. return new Promise(function (e, c) {
  17872. uni.chooseVideo({
  17873. camera: t,
  17874. compressed: n,
  17875. maxDuration: i,
  17876. sourceType: o,
  17877. extension: a,
  17878. success: function success(t) {
  17879. var n = t.tempFilePath,
  17880. s = t.duration,
  17881. i = t.size,
  17882. o = t.height,
  17883. a = t.width;
  17884. e(r({
  17885. errMsg: "chooseVideo:ok",
  17886. tempFilePaths: [n],
  17887. tempFiles: [{
  17888. name: t.tempFile && t.tempFile.name || "",
  17889. path: n,
  17890. size: i,
  17891. type: t.tempFile && t.tempFile.type || "",
  17892. width: a,
  17893. height: o,
  17894. duration: s,
  17895. fileType: "video",
  17896. cloudPath: ""
  17897. }]
  17898. }, "video"));
  17899. },
  17900. fail: function fail(e) {
  17901. c({
  17902. errMsg: e.errMsg.replace("chooseVideo:fail", s)
  17903. });
  17904. }
  17905. });
  17906. });
  17907. }(t), t) : i(e, function (e) {
  17908. var t = e.count,
  17909. n = e.extension;
  17910. return new Promise(function (e, i) {
  17911. var o = uni.chooseFile;
  17912. if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (o = wx.chooseMessageFile), "function" != typeof o) return i({
  17913. errMsg: s + " 请指定 type 类型,该平台仅支持选择 image 或 video。"
  17914. });
  17915. o({
  17916. type: "all",
  17917. count: t,
  17918. extension: n,
  17919. success: function success(t) {
  17920. e(r(t));
  17921. },
  17922. fail: function fail(e) {
  17923. i({
  17924. errMsg: e.errMsg.replace("chooseFile:fail", s)
  17925. });
  17926. }
  17927. });
  17928. });
  17929. }(t), t);
  17930. };
  17931. };
  17932. }),
  17933. Ss = n(vs);
  17934. var Is = "manual";
  17935. function bs(e) {
  17936. return {
  17937. props: {
  17938. localdata: {
  17939. type: Array,
  17940. default: function _default() {
  17941. return [];
  17942. }
  17943. },
  17944. options: {
  17945. type: [Object, Array],
  17946. default: function _default() {
  17947. return {};
  17948. }
  17949. },
  17950. spaceInfo: {
  17951. type: Object,
  17952. default: function _default() {
  17953. return {};
  17954. }
  17955. },
  17956. collection: {
  17957. type: [String, Array],
  17958. default: ""
  17959. },
  17960. action: {
  17961. type: String,
  17962. default: ""
  17963. },
  17964. field: {
  17965. type: String,
  17966. default: ""
  17967. },
  17968. orderby: {
  17969. type: String,
  17970. default: ""
  17971. },
  17972. where: {
  17973. type: [String, Object],
  17974. default: ""
  17975. },
  17976. pageData: {
  17977. type: String,
  17978. default: "add"
  17979. },
  17980. pageCurrent: {
  17981. type: Number,
  17982. default: 1
  17983. },
  17984. pageSize: {
  17985. type: Number,
  17986. default: 20
  17987. },
  17988. getcount: {
  17989. type: [Boolean, String],
  17990. default: !1
  17991. },
  17992. gettree: {
  17993. type: [Boolean, String],
  17994. default: !1
  17995. },
  17996. gettreepath: {
  17997. type: [Boolean, String],
  17998. default: !1
  17999. },
  18000. startwith: {
  18001. type: String,
  18002. default: ""
  18003. },
  18004. limitlevel: {
  18005. type: Number,
  18006. default: 10
  18007. },
  18008. groupby: {
  18009. type: String,
  18010. default: ""
  18011. },
  18012. groupField: {
  18013. type: String,
  18014. default: ""
  18015. },
  18016. distinct: {
  18017. type: [Boolean, String],
  18018. default: !1
  18019. },
  18020. foreignKey: {
  18021. type: String,
  18022. default: ""
  18023. },
  18024. loadtime: {
  18025. type: String,
  18026. default: "auto"
  18027. },
  18028. manual: {
  18029. type: Boolean,
  18030. default: !1
  18031. }
  18032. },
  18033. data: function data() {
  18034. return {
  18035. mixinDatacomLoading: !1,
  18036. mixinDatacomHasMore: !1,
  18037. mixinDatacomResData: [],
  18038. mixinDatacomErrorMessage: "",
  18039. mixinDatacomPage: {}
  18040. };
  18041. },
  18042. created: function created() {
  18043. var _this20 = this;
  18044. this.mixinDatacomPage = {
  18045. current: this.pageCurrent,
  18046. size: this.pageSize,
  18047. count: 0
  18048. }, this.$watch(function () {
  18049. var e = [];
  18050. return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach(function (t) {
  18051. e.push(_this20[t]);
  18052. }), e;
  18053. }, function (e, t) {
  18054. if (_this20.loadtime === Is) return;
  18055. var n = !1;
  18056. var s = [];
  18057. for (var _r7 = 2; _r7 < e.length; _r7++) {
  18058. e[_r7] !== t[_r7] && (s.push(e[_r7]), n = !0);
  18059. }
  18060. e[0] !== t[0] && (_this20.mixinDatacomPage.current = _this20.pageCurrent), _this20.mixinDatacomPage.size = _this20.pageSize, _this20.onMixinDatacomPropsChange(n, s);
  18061. });
  18062. },
  18063. methods: {
  18064. onMixinDatacomPropsChange: function onMixinDatacomPropsChange(e, t) {},
  18065. mixinDatacomEasyGet: function mixinDatacomEasyGet() {
  18066. var _this21 = this;
  18067. var _ref47 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18068. _ref47$getone = _ref47.getone,
  18069. e = _ref47$getone === void 0 ? !1 : _ref47$getone,
  18070. t = _ref47.success,
  18071. n = _ref47.fail;
  18072. this.mixinDatacomLoading || (this.mixinDatacomLoading = !0, this.mixinDatacomErrorMessage = "", this.mixinDatacomGet().then(function (n) {
  18073. _this21.mixinDatacomLoading = !1;
  18074. var _n$result = n.result,
  18075. s = _n$result.data,
  18076. r = _n$result.count;
  18077. _this21.getcount && (_this21.mixinDatacomPage.count = r), _this21.mixinDatacomHasMore = s.length < _this21.pageSize;
  18078. var i = e ? s.length ? s[0] : void 0 : s;
  18079. _this21.mixinDatacomResData = i, t && t(i);
  18080. }).catch(function (e) {
  18081. _this21.mixinDatacomLoading = !1, _this21.mixinDatacomErrorMessage = e, n && n(e);
  18082. }));
  18083. },
  18084. mixinDatacomGet: function mixinDatacomGet() {
  18085. var _n12;
  18086. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  18087. var n = e.database(this.spaceInfo);
  18088. var s = t.action || this.action;
  18089. s && (n = n.action(s));
  18090. var r = t.collection || this.collection;
  18091. n = Array.isArray(r) ? (_n12 = n).collection.apply(_n12, (0, _toConsumableArray2.default)(r)) : n.collection(r);
  18092. var i = t.where || this.where;
  18093. i && Object.keys(i).length && (n = n.where(i));
  18094. var o = t.field || this.field;
  18095. o && (n = n.field(o));
  18096. var a = t.foreignKey || this.foreignKey;
  18097. a && (n = n.foreignKey(a));
  18098. var c = t.groupby || this.groupby;
  18099. c && (n = n.groupBy(c));
  18100. var u = t.groupField || this.groupField;
  18101. u && (n = n.groupField(u));
  18102. !0 === (void 0 !== t.distinct ? t.distinct : this.distinct) && (n = n.distinct());
  18103. var h = t.orderby || this.orderby;
  18104. h && (n = n.orderBy(h));
  18105. var l = void 0 !== t.pageCurrent ? t.pageCurrent : this.mixinDatacomPage.current,
  18106. d = void 0 !== t.pageSize ? t.pageSize : this.mixinDatacomPage.size,
  18107. p = void 0 !== t.getcount ? t.getcount : this.getcount,
  18108. f = void 0 !== t.gettree ? t.gettree : this.gettree,
  18109. g = void 0 !== t.gettreepath ? t.gettreepath : this.gettreepath,
  18110. m = {
  18111. getCount: p
  18112. },
  18113. y = {
  18114. limitLevel: void 0 !== t.limitlevel ? t.limitlevel : this.limitlevel,
  18115. startWith: void 0 !== t.startwith ? t.startwith : this.startwith
  18116. };
  18117. return f && (m.getTree = y), g && (m.getTreePath = y), n = n.skip(d * (l - 1)).limit(d).get(m), n;
  18118. }
  18119. }
  18120. };
  18121. }
  18122. function ks(e) {
  18123. return function (t) {
  18124. var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  18125. n = function (e) {
  18126. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  18127. 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;
  18128. }({
  18129. customUI: !1,
  18130. loadingOptions: {
  18131. title: "加载中...",
  18132. mask: !0
  18133. },
  18134. errorOptions: {
  18135. type: "modal",
  18136. retry: !1
  18137. }
  18138. }, n);
  18139. var _n13 = n,
  18140. s = _n13.customUI,
  18141. r = _n13.loadingOptions,
  18142. i = _n13.errorOptions,
  18143. o = _n13.parseSystemError,
  18144. a = !s;
  18145. return new Proxy({}, {
  18146. get: function get(s, c) {
  18147. return function () {
  18148. var _ref48 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18149. e = _ref48.fn,
  18150. t = _ref48.interceptorName,
  18151. n = _ref48.getCallbackArgs;
  18152. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50() {
  18153. var _len2,
  18154. s,
  18155. _key2,
  18156. r,
  18157. i,
  18158. o,
  18159. _args = arguments;
  18160. return _regenerator.default.wrap(function _callee50$(_context50) {
  18161. while (1) {
  18162. switch (_context50.prev = _context50.next) {
  18163. case 0:
  18164. for (_len2 = _args.length, s = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  18165. s[_key2] = _args[_key2];
  18166. }
  18167. r = n ? n({
  18168. params: s
  18169. }) : {};
  18170. _context50.prev = 2;
  18171. _context50.next = 5;
  18172. return M(K(t, "invoke"), _objectSpread({}, r));
  18173. case 5:
  18174. _context50.next = 7;
  18175. return e.apply(void 0, s);
  18176. case 7:
  18177. i = _context50.sent;
  18178. _context50.next = 10;
  18179. return M(K(t, "success"), _objectSpread(_objectSpread({}, r), {}, {
  18180. result: i
  18181. }));
  18182. case 10:
  18183. return _context50.abrupt("return", i);
  18184. case 13:
  18185. _context50.prev = 13;
  18186. _context50.t0 = _context50["catch"](2);
  18187. o = _context50.t0;
  18188. _context50.next = 18;
  18189. return M(K(t, "fail"), _objectSpread(_objectSpread({}, r), {}, {
  18190. error: o
  18191. }));
  18192. case 18:
  18193. throw o;
  18194. case 19:
  18195. _context50.prev = 19;
  18196. _context50.next = 22;
  18197. return M(K(t, "complete"), o ? _objectSpread(_objectSpread({}, r), {}, {
  18198. error: o
  18199. }) : _objectSpread(_objectSpread({}, r), {}, {
  18200. result: i
  18201. }));
  18202. case 22:
  18203. return _context50.finish(19);
  18204. case 23:
  18205. case "end":
  18206. return _context50.stop();
  18207. }
  18208. }
  18209. }, _callee50, null, [[2, 13, 19, 23]]);
  18210. }));
  18211. }({
  18212. fn: function () {
  18213. var _s14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52() {
  18214. var l,
  18215. _len3,
  18216. u,
  18217. _key3,
  18218. d,
  18219. p,
  18220. _ref50,
  18221. f,
  18222. g,
  18223. m,
  18224. y,
  18225. _e26,
  18226. _yield,
  18227. _t18,
  18228. _n14,
  18229. _args4 = arguments;
  18230. return _regenerator.default.wrap(function _callee52$(_context52) {
  18231. while (1) {
  18232. switch (_context52.prev = _context52.next) {
  18233. case 0:
  18234. a && uni.showLoading({
  18235. title: r.title,
  18236. mask: r.mask
  18237. });
  18238. for (_len3 = _args4.length, u = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  18239. u[_key3] = _args4[_key3];
  18240. }
  18241. d = {
  18242. name: t,
  18243. type: h,
  18244. data: {
  18245. method: c,
  18246. params: u
  18247. }
  18248. };
  18249. "object" == (0, _typeof2.default)(n.secretMethods) && function (e, t) {
  18250. var n = t.data.method,
  18251. s = e.secretMethods || {},
  18252. r = s[n] || s["*"];
  18253. r && (t.secretType = r);
  18254. }(n, d);
  18255. p = !1;
  18256. _context52.prev = 5;
  18257. _context52.next = 8;
  18258. return e.callFunction(d);
  18259. case 8:
  18260. l = _context52.sent;
  18261. _context52.next = 14;
  18262. break;
  18263. case 11:
  18264. _context52.prev = 11;
  18265. _context52.t0 = _context52["catch"](5);
  18266. p = !0, l = {
  18267. result: new se(_context52.t0)
  18268. };
  18269. case 14:
  18270. _ref50 = l.result || {}, f = _ref50.errSubject, g = _ref50.errCode, m = _ref50.errMsg, y = _ref50.newToken;
  18271. if (!(a && uni.hideLoading(), y && y.token && y.tokenExpired && (oe(y), X(z, _objectSpread({}, y))), g)) {
  18272. _context52.next = 39;
  18273. break;
  18274. }
  18275. _e26 = m;
  18276. if (!(p && o)) {
  18277. _context52.next = 24;
  18278. break;
  18279. }
  18280. _context52.next = 20;
  18281. return o({
  18282. objectName: t,
  18283. methodName: c,
  18284. params: u,
  18285. errSubject: f,
  18286. errCode: g,
  18287. errMsg: m
  18288. });
  18289. case 20:
  18290. _context52.t1 = _context52.sent.errMsg;
  18291. if (_context52.t1) {
  18292. _context52.next = 23;
  18293. break;
  18294. }
  18295. _context52.t1 = m;
  18296. case 23:
  18297. _e26 = _context52.t1;
  18298. case 24:
  18299. if (!a) {
  18300. _context52.next = 37;
  18301. break;
  18302. }
  18303. if (!("toast" === i.type)) {
  18304. _context52.next = 29;
  18305. break;
  18306. }
  18307. uni.showToast({
  18308. title: _e26,
  18309. icon: "none"
  18310. });
  18311. _context52.next = 37;
  18312. break;
  18313. case 29:
  18314. if (!("modal" !== i.type)) {
  18315. _context52.next = 31;
  18316. break;
  18317. }
  18318. throw new Error("Invalid errorOptions.type: ".concat(i.type));
  18319. case 31:
  18320. _context52.next = 33;
  18321. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51() {
  18322. var _ref52,
  18323. e,
  18324. t,
  18325. n,
  18326. s,
  18327. r,
  18328. _args2 = arguments;
  18329. return _regenerator.default.wrap(function _callee51$(_context51) {
  18330. while (1) {
  18331. switch (_context51.prev = _context51.next) {
  18332. case 0:
  18333. _ref52 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, e = _ref52.title, t = _ref52.content, n = _ref52.showCancel, s = _ref52.cancelText, r = _ref52.confirmText;
  18334. return _context51.abrupt("return", new Promise(function (i, o) {
  18335. uni.showModal({
  18336. title: e,
  18337. content: t,
  18338. showCancel: n,
  18339. cancelText: s,
  18340. confirmText: r,
  18341. success: function success(e) {
  18342. i(e);
  18343. },
  18344. fail: function fail() {
  18345. i({
  18346. confirm: !1,
  18347. cancel: !0
  18348. });
  18349. }
  18350. });
  18351. }));
  18352. case 2:
  18353. case "end":
  18354. return _context51.stop();
  18355. }
  18356. }
  18357. }, _callee51);
  18358. }))({
  18359. title: "提示",
  18360. content: _e26,
  18361. showCancel: i.retry,
  18362. cancelText: "取消",
  18363. confirmText: i.retry ? "重试" : "确定"
  18364. });
  18365. case 33:
  18366. _yield = _context52.sent;
  18367. _t18 = _yield.confirm;
  18368. if (!(i.retry && _t18)) {
  18369. _context52.next = 37;
  18370. break;
  18371. }
  18372. return _context52.abrupt("return", s.apply(void 0, u));
  18373. case 37:
  18374. _n14 = new se({
  18375. subject: f,
  18376. code: g,
  18377. message: m,
  18378. requestId: l.requestId
  18379. });
  18380. throw _n14.detail = l.result, X($, {
  18381. type: G,
  18382. content: _n14
  18383. }), _n14;
  18384. case 39:
  18385. return _context52.abrupt("return", (X($, {
  18386. type: G,
  18387. content: l.result
  18388. }), l.result));
  18389. case 40:
  18390. case "end":
  18391. return _context52.stop();
  18392. }
  18393. }
  18394. }, _callee52, null, [[5, 11]]);
  18395. }));
  18396. function s() {
  18397. return _s14.apply(this, arguments);
  18398. }
  18399. return s;
  18400. }(),
  18401. interceptorName: "callObject",
  18402. getCallbackArgs: function getCallbackArgs() {
  18403. var _ref53 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18404. e = _ref53.params;
  18405. return {
  18406. objectName: t,
  18407. methodName: c,
  18408. params: e
  18409. };
  18410. }
  18411. });
  18412. }
  18413. });
  18414. };
  18415. }
  18416. function Ts(e) {
  18417. return L("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e.config.spaceId));
  18418. }
  18419. function Cs() {
  18420. return _Cs.apply(this, arguments);
  18421. }
  18422. function _Cs() {
  18423. _Cs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55() {
  18424. var _ref65,
  18425. e,
  18426. _ref65$callLoginByWei,
  18427. t,
  18428. n,
  18429. s,
  18430. r,
  18431. _args7 = arguments;
  18432. return _regenerator.default.wrap(function _callee55$(_context55) {
  18433. while (1) {
  18434. switch (_context55.prev = _context55.next) {
  18435. case 0:
  18436. _ref65 = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {}, e = _ref65.openid, _ref65$callLoginByWei = _ref65.callLoginByWeixin, t = _ref65$callLoginByWei === void 0 ? !1 : _ref65$callLoginByWei;
  18437. n = Ts(this);
  18438. if (!("mp-weixin" !== A)) {
  18439. _context55.next = 4;
  18440. break;
  18441. }
  18442. throw new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `".concat(A, "`"));
  18443. case 4:
  18444. if (!(e && t)) {
  18445. _context55.next = 6;
  18446. break;
  18447. }
  18448. throw new Error("[SecureNetwork] openid and callLoginByWeixin cannot be passed at the same time");
  18449. case 6:
  18450. if (!e) {
  18451. _context55.next = 8;
  18452. break;
  18453. }
  18454. return _context55.abrupt("return", (n.mpWeixinOpenid = e, {}));
  18455. case 8:
  18456. _context55.next = 10;
  18457. return new Promise(function (e, t) {
  18458. uni.login({
  18459. success: function success(t) {
  18460. e(t.code);
  18461. },
  18462. fail: function fail(e) {
  18463. t(new Error(e.errMsg));
  18464. }
  18465. });
  18466. });
  18467. case 10:
  18468. s = _context55.sent;
  18469. r = this.importObject("uni-id-co", {
  18470. customUI: !0
  18471. });
  18472. _context55.next = 14;
  18473. return r.secureNetworkHandshakeByWeixin({
  18474. code: s,
  18475. callLoginByWeixin: t
  18476. });
  18477. case 14:
  18478. n.mpWeixinCode = s;
  18479. return _context55.abrupt("return", {
  18480. code: s
  18481. });
  18482. case 16:
  18483. case "end":
  18484. return _context55.stop();
  18485. }
  18486. }
  18487. }, _callee55, this);
  18488. }));
  18489. return _Cs.apply(this, arguments);
  18490. }
  18491. function Ps(_x37) {
  18492. return _Ps.apply(this, arguments);
  18493. }
  18494. function _Ps() {
  18495. _Ps = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee56(e) {
  18496. var t;
  18497. return _regenerator.default.wrap(function _callee56$(_context56) {
  18498. while (1) {
  18499. switch (_context56.prev = _context56.next) {
  18500. case 0:
  18501. t = Ts(this);
  18502. return _context56.abrupt("return", (t.initPromise || (t.initPromise = Cs.call(this, e)), t.initPromise));
  18503. case 2:
  18504. case "end":
  18505. return _context56.stop();
  18506. }
  18507. }
  18508. }, _callee56, this);
  18509. }));
  18510. return _Ps.apply(this, arguments);
  18511. }
  18512. function As(e) {
  18513. return function () {
  18514. var _ref54 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18515. t = _ref54.openid,
  18516. _ref54$callLoginByWei = _ref54.callLoginByWeixin,
  18517. n = _ref54$callLoginByWei === void 0 ? !1 : _ref54$callLoginByWei;
  18518. return Ps.call(e, {
  18519. openid: t,
  18520. callLoginByWeixin: n
  18521. });
  18522. };
  18523. }
  18524. var Es = /*#__PURE__*/function (_ref55) {
  18525. (0, _inherits2.default)(Es, _ref55);
  18526. var _super12 = _createSuper(Es);
  18527. function Es() {
  18528. var _this22;
  18529. (0, _classCallCheck2.default)(this, Es);
  18530. _this22 = _super12.call(this), _this22._uniPushMessageCallback = _this22._receivePushMessage.bind((0, _assertThisInitialized2.default)(_this22)), _this22._currentMessageId = -1, _this22._payloadQueue = [];
  18531. return _this22;
  18532. }
  18533. (0, _createClass2.default)(Es, [{
  18534. key: "init",
  18535. value: function init() {
  18536. var _this23 = this;
  18537. return Promise.all([I("getSystemInfo")(), I("getPushClientId")()]).then(function () {
  18538. var _ref56 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [],
  18539. _ref57 = (0, _slicedToArray2.default)(_ref56, 2),
  18540. _ref57$ = _ref57[0];
  18541. _ref57$ = _ref57$ === void 0 ? {} : _ref57$;
  18542. var e = _ref57$.appId,
  18543. _ref57$2 = _ref57[1];
  18544. _ref57$2 = _ref57$2 === void 0 ? {} : _ref57$2;
  18545. var t = _ref57$2.cid;
  18546. if (!e) throw new Error("Invalid appId, please check the manifest.json file");
  18547. if (!t) throw new Error("Invalid push client id");
  18548. _this23._appId = e, _this23._pushClientId = t, _this23._seqId = Date.now() + "-" + Math.floor(9e5 * Math.random() + 1e5), _this23.emit("open"), _this23._initMessageListener();
  18549. }, function (e) {
  18550. throw _this23.emit("error", e), _this23.close(), e;
  18551. });
  18552. }
  18553. }, {
  18554. key: "open",
  18555. value: function () {
  18556. var _open = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53() {
  18557. return _regenerator.default.wrap(function _callee53$(_context53) {
  18558. while (1) {
  18559. switch (_context53.prev = _context53.next) {
  18560. case 0:
  18561. return _context53.abrupt("return", this.init());
  18562. case 1:
  18563. case "end":
  18564. return _context53.stop();
  18565. }
  18566. }
  18567. }, _callee53, this);
  18568. }));
  18569. function open() {
  18570. return _open.apply(this, arguments);
  18571. }
  18572. return open;
  18573. }()
  18574. }, {
  18575. key: "_isUniCloudSSE",
  18576. value: function _isUniCloudSSE(e) {
  18577. if ("receive" !== e.type) return !1;
  18578. var t = e && e.data && e.data.payload;
  18579. return !(!t || "UNI_CLOUD_SSE" !== t.channel || t.seqId !== this._seqId);
  18580. }
  18581. }, {
  18582. key: "_receivePushMessage",
  18583. value: function _receivePushMessage(e) {
  18584. if (!this._isUniCloudSSE(e)) return;
  18585. var t = e && e.data && e.data.payload,
  18586. n = t.action,
  18587. s = t.messageId,
  18588. r = t.message;
  18589. this._payloadQueue.push({
  18590. action: n,
  18591. messageId: s,
  18592. message: r
  18593. }), this._consumMessage();
  18594. }
  18595. }, {
  18596. key: "_consumMessage",
  18597. value: function _consumMessage() {
  18598. var _this24 = this;
  18599. for (;;) {
  18600. var _e27 = this._payloadQueue.find(function (e) {
  18601. return e.messageId === _this24._currentMessageId + 1;
  18602. });
  18603. if (!_e27) break;
  18604. this._currentMessageId++, this._parseMessagePayload(_e27);
  18605. }
  18606. }
  18607. }, {
  18608. key: "_parseMessagePayload",
  18609. value: function _parseMessagePayload(e) {
  18610. var t = e.action,
  18611. n = e.messageId,
  18612. s = e.message;
  18613. "end" === t ? this._end({
  18614. messageId: n,
  18615. message: s
  18616. }) : "message" === t && this._appendMessage({
  18617. messageId: n,
  18618. message: s
  18619. });
  18620. }
  18621. }, {
  18622. key: "_appendMessage",
  18623. value: function _appendMessage() {
  18624. var _ref58 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18625. e = _ref58.messageId,
  18626. t = _ref58.message;
  18627. this.emit("message", t);
  18628. }
  18629. }, {
  18630. key: "_end",
  18631. value: function _end() {
  18632. var _ref59 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18633. e = _ref59.messageId,
  18634. t = _ref59.message;
  18635. this.emit("end", t), this.close();
  18636. }
  18637. }, {
  18638. key: "_initMessageListener",
  18639. value: function _initMessageListener() {
  18640. uni.onPushMessage(this._uniPushMessageCallback);
  18641. }
  18642. }, {
  18643. key: "_destroy",
  18644. value: function _destroy() {
  18645. uni.offPushMessage(this._uniPushMessageCallback);
  18646. }
  18647. }, {
  18648. key: "toJSON",
  18649. value: function toJSON() {
  18650. return {
  18651. appId: this._appId,
  18652. pushClientId: this._pushClientId,
  18653. seqId: this._seqId
  18654. };
  18655. }
  18656. }, {
  18657. key: "close",
  18658. value: function close() {
  18659. this._destroy(), this.emit("close");
  18660. }
  18661. }]);
  18662. return Es;
  18663. }( /*#__PURE__*/function () {
  18664. function _class6() {
  18665. (0, _classCallCheck2.default)(this, _class6);
  18666. this._callback = {};
  18667. }
  18668. (0, _createClass2.default)(_class6, [{
  18669. key: "addListener",
  18670. value: function addListener(e, t) {
  18671. this._callback[e] || (this._callback[e] = []), this._callback[e].push(t);
  18672. }
  18673. }, {
  18674. key: "on",
  18675. value: function on(e, t) {
  18676. return this.addListener(e, t);
  18677. }
  18678. }, {
  18679. key: "removeListener",
  18680. value: function removeListener(e, t) {
  18681. if (!t) throw new Error('The "listener" argument must be of type function. Received undefined');
  18682. var n = this._callback[e];
  18683. if (!n) return;
  18684. var s = function (e, t) {
  18685. for (var _n15 = e.length - 1; _n15 >= 0; _n15--) {
  18686. if (e[_n15] === t) return _n15;
  18687. }
  18688. return -1;
  18689. }(n, t);
  18690. n.splice(s, 1);
  18691. }
  18692. }, {
  18693. key: "off",
  18694. value: function off(e, t) {
  18695. return this.removeListener(e, t);
  18696. }
  18697. }, {
  18698. key: "removeAllListener",
  18699. value: function removeAllListener(e) {
  18700. delete this._callback[e];
  18701. }
  18702. }, {
  18703. key: "emit",
  18704. value: function emit(e) {
  18705. var n = this._callback[e];
  18706. for (var _len4 = arguments.length, t = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
  18707. t[_key4 - 1] = arguments[_key4];
  18708. }
  18709. if (n) for (var _e28 = 0; _e28 < n.length; _e28++) {
  18710. n[_e28].apply(n, t);
  18711. }
  18712. }
  18713. }]);
  18714. return _class6;
  18715. }());
  18716. function Os(_x38, _x39) {
  18717. return _Os.apply(this, arguments);
  18718. }
  18719. function _Os() {
  18720. _Os = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57(e, t) {
  18721. var n, _e32, s;
  18722. return _regenerator.default.wrap(function _callee57$(_context57) {
  18723. while (1) {
  18724. switch (_context57.prev = _context57.next) {
  18725. case 0:
  18726. n = "http://".concat(e, ":").concat(t, "/system/ping");
  18727. _context57.prev = 1;
  18728. _context57.next = 4;
  18729. return s = {
  18730. url: n,
  18731. timeout: 500
  18732. }, new Promise(function (e, t) {
  18733. re.request(_objectSpread(_objectSpread({}, s), {}, {
  18734. success: function success(t) {
  18735. e(t);
  18736. },
  18737. fail: function fail(e) {
  18738. t(e);
  18739. }
  18740. }));
  18741. });
  18742. case 4:
  18743. _e32 = _context57.sent;
  18744. return _context57.abrupt("return", !(!_e32.data || 0 !== _e32.data.code));
  18745. case 8:
  18746. _context57.prev = 8;
  18747. _context57.t0 = _context57["catch"](1);
  18748. return _context57.abrupt("return", !1);
  18749. case 11:
  18750. case "end":
  18751. return _context57.stop();
  18752. }
  18753. }
  18754. }, _callee57, null, [[1, 8]]);
  18755. }));
  18756. return _Os.apply(this, arguments);
  18757. }
  18758. function xs(_x40) {
  18759. return _xs.apply(this, arguments);
  18760. }
  18761. function _xs() {
  18762. _xs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee59(e) {
  18763. var _ue2, _e33, _t20, t, _t$debugInfo, n, s, _yield2, r, i, o;
  18764. return _regenerator.default.wrap(function _callee59$(_context59) {
  18765. while (1) {
  18766. switch (_context59.prev = _context59.next) {
  18767. case 0:
  18768. if (k) {
  18769. _context59.next = 2;
  18770. break;
  18771. }
  18772. return _context59.abrupt("return", Promise.resolve());
  18773. case 2:
  18774. if ("app" === A) {
  18775. _ue2 = ue(), _e33 = _ue2.osName, _t20 = _ue2.osVersion;
  18776. "ios" === _e33 && function (e) {
  18777. if (!e || "string" != typeof e) return 0;
  18778. var t = e.match(/^(\d+)./);
  18779. return t && t[1] ? parseInt(t[1]) : 0;
  18780. }(_t20) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发模式生效,发行模式会连接uniCloud云端服务)");
  18781. }
  18782. t = e.__dev__;
  18783. if (t.debugInfo) {
  18784. _context59.next = 6;
  18785. break;
  18786. }
  18787. return _context59.abrupt("return");
  18788. case 6:
  18789. _t$debugInfo = t.debugInfo;
  18790. n = _t$debugInfo.address;
  18791. s = _t$debugInfo.servePort;
  18792. _context59.next = 11;
  18793. return function () {
  18794. var _ref66 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58(e, t) {
  18795. var n, _s15, _r8;
  18796. return _regenerator.default.wrap(function _callee58$(_context58) {
  18797. while (1) {
  18798. switch (_context58.prev = _context58.next) {
  18799. case 0:
  18800. _s15 = 0;
  18801. case 1:
  18802. if (!(_s15 < e.length)) {
  18803. _context58.next = 11;
  18804. break;
  18805. }
  18806. _r8 = e[_s15];
  18807. _context58.next = 5;
  18808. return Os(_r8, t);
  18809. case 5:
  18810. if (!_context58.sent) {
  18811. _context58.next = 8;
  18812. break;
  18813. }
  18814. n = _r8;
  18815. return _context58.abrupt("break", 11);
  18816. case 8:
  18817. _s15++;
  18818. _context58.next = 1;
  18819. break;
  18820. case 11:
  18821. return _context58.abrupt("return", {
  18822. address: n,
  18823. port: t
  18824. });
  18825. case 12:
  18826. case "end":
  18827. return _context58.stop();
  18828. }
  18829. }
  18830. }, _callee58);
  18831. }));
  18832. return function (_x41, _x42) {
  18833. return _ref66.apply(this, arguments);
  18834. };
  18835. }()(n, s);
  18836. case 11:
  18837. _yield2 = _context59.sent;
  18838. r = _yield2.address;
  18839. if (!r) {
  18840. _context59.next = 15;
  18841. break;
  18842. }
  18843. return _context59.abrupt("return", (t.localAddress = r, void (t.localPort = s)));
  18844. case 15:
  18845. i = console["app" === A ? "error" : "warn"];
  18846. o = "";
  18847. 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)) {
  18848. _context59.next = 19;
  18849. break;
  18850. }
  18851. throw new Error(o);
  18852. case 19:
  18853. i(o);
  18854. case 20:
  18855. case "end":
  18856. return _context59.stop();
  18857. }
  18858. }
  18859. }, _callee59);
  18860. }));
  18861. return _xs.apply(this, arguments);
  18862. }
  18863. function Rs(e) {
  18864. e._initPromiseHub || (e._initPromiseHub = new S({
  18865. createPromise: function createPromise() {
  18866. var t = Promise.resolve();
  18867. var n;
  18868. n = 1, t = new Promise(function (e) {
  18869. setTimeout(function () {
  18870. e();
  18871. }, n);
  18872. });
  18873. var s = e.auth();
  18874. return t.then(function () {
  18875. return s.getLoginState();
  18876. }).then(function (e) {
  18877. return e ? Promise.resolve() : s.signInAnonymously();
  18878. });
  18879. }
  18880. }));
  18881. }
  18882. var Us = {
  18883. tcb: It,
  18884. tencent: It,
  18885. aliyun: me,
  18886. private: kt
  18887. };
  18888. var Ls = new ( /*#__PURE__*/function () {
  18889. function _class7() {
  18890. (0, _classCallCheck2.default)(this, _class7);
  18891. }
  18892. (0, _createClass2.default)(_class7, [{
  18893. key: "init",
  18894. value: function init(e) {
  18895. var t = {};
  18896. var n = Us[e.provider];
  18897. if (!n) throw new Error("未提供正确的provider参数");
  18898. t = n.init(e), k && function (e) {
  18899. if (!k) return;
  18900. var t = {};
  18901. e.__dev__ = t, t.debugLog = k && ("web" === A && navigator.userAgent.indexOf("HBuilderX") > 0 || "app" === A);
  18902. var n = E;
  18903. n && !n.code && (t.debugInfo = n);
  18904. var s = new S({
  18905. createPromise: function createPromise() {
  18906. return xs(e);
  18907. }
  18908. });
  18909. t.initLocalNetwork = function () {
  18910. return s.exec();
  18911. };
  18912. }(t), Rs(t), Rn(t), function (e) {
  18913. var t = e.uploadFile;
  18914. e.uploadFile = function (e) {
  18915. return t.call(this, e);
  18916. };
  18917. }(t), function (e) {
  18918. e.database = function (t) {
  18919. if (t && Object.keys(t).length > 0) return e.init(t).database();
  18920. if (this._database) return this._database;
  18921. var n = $n(Wn, {
  18922. uniClient: e
  18923. });
  18924. return this._database = n, n;
  18925. }, e.databaseForJQL = function (t) {
  18926. if (t && Object.keys(t).length > 0) return e.init(t).databaseForJQL();
  18927. if (this._databaseForJQL) return this._databaseForJQL;
  18928. var n = $n(Wn, {
  18929. uniClient: e,
  18930. isJQL: !0
  18931. });
  18932. return this._databaseForJQL = n, n;
  18933. };
  18934. }(t), function (e) {
  18935. e.getCurrentUserInfo = ws, e.chooseAndUploadFile = Ss.initChooseAndUploadFile(e), Object.assign(e, {
  18936. get mixinDatacom() {
  18937. return bs(e);
  18938. }
  18939. }), e.SSEChannel = Es, e.initSecureNetworkByWeixin = As(e), e.importObject = ks(e);
  18940. }(t);
  18941. return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach(function (e) {
  18942. if (!t[e]) return;
  18943. var n = t[e];
  18944. t[e] = function () {
  18945. return n.apply(t, Array.from(arguments));
  18946. }, t[e] = function (e, t) {
  18947. return function (n) {
  18948. var _this25 = this;
  18949. var s = !1;
  18950. if ("callFunction" === t) {
  18951. var _e29 = n && n.type || u;
  18952. s = _e29 !== u;
  18953. }
  18954. var r = "callFunction" === t && !s,
  18955. i = this._initPromiseHub.exec();
  18956. n = n || {};
  18957. var _ne2 = ne(n),
  18958. o = _ne2.success,
  18959. a = _ne2.fail,
  18960. c = _ne2.complete,
  18961. h = i.then(function () {
  18962. return s ? Promise.resolve() : M(K(t, "invoke"), n);
  18963. }).then(function () {
  18964. return e.call(_this25, n);
  18965. }).then(function (e) {
  18966. return s ? Promise.resolve(e) : M(K(t, "success"), e).then(function () {
  18967. return M(K(t, "complete"), e);
  18968. }).then(function () {
  18969. return r && X($, {
  18970. type: H,
  18971. content: e
  18972. }), Promise.resolve(e);
  18973. });
  18974. }, function (e) {
  18975. return s ? Promise.reject(e) : M(K(t, "fail"), e).then(function () {
  18976. return M(K(t, "complete"), e);
  18977. }).then(function () {
  18978. return X($, {
  18979. type: H,
  18980. content: e
  18981. }), Promise.reject(e);
  18982. });
  18983. });
  18984. if (!(o || a || c)) return h;
  18985. h.then(function (e) {
  18986. o && o(e), c && c(e), r && X($, {
  18987. type: H,
  18988. content: e
  18989. });
  18990. }, function (e) {
  18991. a && a(e), c && c(e), r && X($, {
  18992. type: H,
  18993. content: e
  18994. });
  18995. });
  18996. };
  18997. }(t[e], e).bind(t);
  18998. }), t.init = this.init, t;
  18999. }
  19000. }]);
  19001. return _class7;
  19002. }())();
  19003. (function () {
  19004. var e = O;
  19005. var t = {};
  19006. if (e && 1 === e.length) t = e[0], Ls = Ls.init(t), Ls._isDefault = !0;else {
  19007. var _t19 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
  19008. var _n16;
  19009. _n16 = e && e.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : x ? "应用未关联服务空间,请在uniCloud目录右键关联服务空间" : "uni-app cli项目内使用uniCloud需要使用HBuilderX的运行菜单运行项目,且需要在uniCloud目录关联服务空间", _t19.forEach(function (e) {
  19010. Ls[e] = function () {
  19011. return console.error(_n16), Promise.reject(new se({
  19012. code: "SYS_ERR",
  19013. message: _n16
  19014. }));
  19015. };
  19016. });
  19017. }
  19018. Object.assign(Ls, {
  19019. get mixinDatacom() {
  19020. return bs(Ls);
  19021. }
  19022. }), gs(Ls), Ls.addInterceptor = F, Ls.removeInterceptor = q, Ls.interceptObject = j, k && "web" === A && (window.uniCloud = Ls);
  19023. })();
  19024. var Ns = Ls;
  19025. exports.default = Ns;
  19026. /* 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"]))
  19027. /***/ }),
  19028. /* 210 */
  19029. /*!****************************************************************!*\
  19030. !*** ./node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
  19031. \****************************************************************/
  19032. /*! no static exports found */
  19033. /***/ (function(module, exports, __webpack_require__) {
  19034. var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ 186);
  19035. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  19036. var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ 211);
  19037. var construct = __webpack_require__(/*! ./construct.js */ 15);
  19038. function _wrapNativeSuper(Class) {
  19039. var _cache = typeof Map === "function" ? new Map() : undefined;
  19040. module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
  19041. if (Class === null || !isNativeFunction(Class)) return Class;
  19042. if (typeof Class !== "function") {
  19043. throw new TypeError("Super expression must either be null or a function");
  19044. }
  19045. if (typeof _cache !== "undefined") {
  19046. if (_cache.has(Class)) return _cache.get(Class);
  19047. _cache.set(Class, Wrapper);
  19048. }
  19049. function Wrapper() {
  19050. return construct(Class, arguments, getPrototypeOf(this).constructor);
  19051. }
  19052. Wrapper.prototype = Object.create(Class.prototype, {
  19053. constructor: {
  19054. value: Wrapper,
  19055. enumerable: false,
  19056. writable: true,
  19057. configurable: true
  19058. }
  19059. });
  19060. return setPrototypeOf(Wrapper, Class);
  19061. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19062. return _wrapNativeSuper(Class);
  19063. }
  19064. module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19065. /***/ }),
  19066. /* 211 */
  19067. /*!*****************************************************************!*\
  19068. !*** ./node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
  19069. \*****************************************************************/
  19070. /*! no static exports found */
  19071. /***/ (function(module, exports) {
  19072. function _isNativeFunction(fn) {
  19073. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  19074. }
  19075. module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19076. /***/ }),
  19077. /* 212 */
  19078. /*!******************************************************************************!*\
  19079. !*** E:/work/Project_newGit/CKQ/app/pages.json?{"type":"origin-pages-json"} ***!
  19080. \******************************************************************************/
  19081. /*! no static exports found */
  19082. /***/ (function(module, exports, __webpack_require__) {
  19083. "use strict";
  19084. Object.defineProperty(exports, "__esModule", {
  19085. value: true
  19086. });
  19087. exports.default = void 0;
  19088. var _default = {
  19089. "pages": [{
  19090. "path": "pages/index/index",
  19091. "style": {
  19092. "navigationBarTitleText": "任务",
  19093. "navigationStyle": "custom"
  19094. }
  19095. }, {
  19096. "path": "pages/risk/risk",
  19097. "style": {
  19098. "navigationBarTitleText": "风险",
  19099. "navigationStyle": "custom"
  19100. }
  19101. }, {
  19102. "path": "pages/mine/mine",
  19103. "style": {
  19104. "navigationBarTitleText": "我的",
  19105. "navigationStyle": "custom"
  19106. }
  19107. }, {
  19108. "path": "pages/login/login",
  19109. "style": {
  19110. "navigationBarTitleText": "登录"
  19111. }
  19112. }, {
  19113. "path": "pages/mine/password/password",
  19114. "style": {
  19115. "navigationBarTitleText": "修改密码"
  19116. }
  19117. }, {
  19118. "path": "pages/task/task",
  19119. "style": {
  19120. "navigationBarTitleText": "预警处置"
  19121. }
  19122. }, {
  19123. "path": "pages/task/form/form",
  19124. "style": {
  19125. "navigationBarTitleText": "处置"
  19126. }
  19127. }, {
  19128. "path": "pages/risk/review/review",
  19129. "style": {
  19130. "navigationBarTitleText": "待评审",
  19131. "enablePullDownRefresh": false
  19132. }
  19133. }, {
  19134. "path": "pages/risk/review/form/form",
  19135. "style": {
  19136. "navigationBarTitleText": "评审",
  19137. "enablePullDownRefresh": false
  19138. }
  19139. }, {
  19140. "path": "pages/risk/check/check",
  19141. "style": {
  19142. "navigationBarTitleText": "待验收",
  19143. "enablePullDownRefresh": false
  19144. }
  19145. }, {
  19146. "path": "pages/risk/check/form/form",
  19147. "style": {
  19148. "navigationBarTitleText": "验收",
  19149. "enablePullDownRefresh": false
  19150. }
  19151. }, {
  19152. "path": "pages/risk/rectify/rectify",
  19153. "style": {
  19154. "navigationBarTitleText": "待整改",
  19155. "enablePullDownRefresh": false
  19156. }
  19157. }, {
  19158. "path": "pages/risk/rectify/form/form",
  19159. "style": {
  19160. "navigationBarTitleText": "整改",
  19161. "enablePullDownRefresh": false
  19162. }
  19163. }, {
  19164. "path": "pages/risk/repeal/repeal",
  19165. "style": {
  19166. "navigationBarTitleText": "已撤销",
  19167. "enablePullDownRefresh": false
  19168. }
  19169. }, {
  19170. "path": "pages/task/taskList/taskList",
  19171. "style": {
  19172. "navigationBarTitleText": "检查任务",
  19173. "enablePullDownRefresh": false
  19174. }
  19175. }, {
  19176. "path": "pages/task/submit/submit",
  19177. "style": {
  19178. "navigationBarTitleText": "登记预警",
  19179. "enablePullDownRefresh": false
  19180. }
  19181. }],
  19182. "tabBar": {
  19183. "color": "#999999",
  19184. "selectedColor": "#3384ff",
  19185. "borderStyle": "white",
  19186. "backgroundColor": "#ffffff",
  19187. "height": "50px",
  19188. "fontSize": "10px",
  19189. "iconWidth": "24px",
  19190. "spacing": "3px",
  19191. "list": [{
  19192. "pagePath": "pages/index/index",
  19193. "iconPath": "static/tabBar/Home.png",
  19194. "selectedIconPath": "static/tabBar/HomeEd.png",
  19195. "text": "任务"
  19196. }, {
  19197. "pagePath": "pages/risk/risk",
  19198. "iconPath": "static/tabBar/risk.png",
  19199. "selectedIconPath": "static/tabBar/riskEd.png",
  19200. "text": "预警"
  19201. }, {
  19202. "pagePath": "pages/mine/mine",
  19203. "iconPath": "static/tabBar/mine.png",
  19204. "selectedIconPath": "static/tabBar/mineEd.png",
  19205. "text": "我的"
  19206. }]
  19207. },
  19208. "globalStyle": {
  19209. "navigationBarTextStyle": "black",
  19210. "navigationBarTitleText": "uni-app",
  19211. "navigationBarBackgroundColor": "#F3F5FB",
  19212. "backgroundColor": "#F8F8F8",
  19213. "app-plus": {
  19214. "background": "#efeff4"
  19215. }
  19216. }
  19217. };
  19218. exports.default = _default;
  19219. /***/ }),
  19220. /* 213 */
  19221. /*!*****************************************************************!*\
  19222. !*** E:/work/Project_newGit/CKQ/app/pages.json?{"type":"stat"} ***!
  19223. \*****************************************************************/
  19224. /*! no static exports found */
  19225. /***/ (function(module, exports, __webpack_require__) {
  19226. "use strict";
  19227. Object.defineProperty(exports, "__esModule", {
  19228. value: true
  19229. });
  19230. exports.default = void 0;
  19231. var _default = {
  19232. "appid": "__UNI__ED9AEA5"
  19233. };
  19234. exports.default = _default;
  19235. /***/ }),
  19236. /* 214 */,
  19237. /* 215 */,
  19238. /* 216 */,
  19239. /* 217 */,
  19240. /* 218 */,
  19241. /* 219 */,
  19242. /* 220 */,
  19243. /* 221 */,
  19244. /* 222 */,
  19245. /* 223 */,
  19246. /* 224 */,
  19247. /* 225 */,
  19248. /* 226 */,
  19249. /* 227 */,
  19250. /* 228 */
  19251. /*!*******************************************************************************************************************!*\
  19252. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/index.js ***!
  19253. \*******************************************************************************************************************/
  19254. /*! no static exports found */
  19255. /***/ (function(module, exports, __webpack_require__) {
  19256. "use strict";
  19257. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  19258. Object.defineProperty(exports, "__esModule", {
  19259. value: true
  19260. });
  19261. exports.default = void 0;
  19262. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 229));
  19263. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 230));
  19264. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 231));
  19265. var _default = {
  19266. en: _en.default,
  19267. 'zh-Hans': _zhHans.default,
  19268. 'zh-Hant': _zhHant.default
  19269. };
  19270. exports.default = _default;
  19271. /***/ }),
  19272. /* 229 */
  19273. /*!******************************************************************************************************************!*\
  19274. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/en.json ***!
  19275. \******************************************************************************************************************/
  19276. /*! exports provided: uni-datetime-picker.selectDate, uni-datetime-picker.selectTime, uni-datetime-picker.selectDateTime, uni-datetime-picker.startDate, uni-datetime-picker.endDate, uni-datetime-picker.startTime, uni-datetime-picker.endTime, uni-datetime-picker.ok, uni-datetime-picker.clear, uni-datetime-picker.cancel, uni-datetime-picker.year, uni-datetime-picker.month, uni-calender.MON, uni-calender.TUE, uni-calender.WED, uni-calender.THU, uni-calender.FRI, uni-calender.SAT, uni-calender.SUN, uni-calender.confirm, default */
  19277. /***/ (function(module) {
  19278. module.exports = JSON.parse("{\"uni-datetime-picker.selectDate\":\"select date\",\"uni-datetime-picker.selectTime\":\"select time\",\"uni-datetime-picker.selectDateTime\":\"select datetime\",\"uni-datetime-picker.startDate\":\"start date\",\"uni-datetime-picker.endDate\":\"end date\",\"uni-datetime-picker.startTime\":\"start time\",\"uni-datetime-picker.endTime\":\"end time\",\"uni-datetime-picker.ok\":\"ok\",\"uni-datetime-picker.clear\":\"clear\",\"uni-datetime-picker.cancel\":\"cancel\",\"uni-datetime-picker.year\":\"-\",\"uni-datetime-picker.month\":\"\",\"uni-calender.MON\":\"MON\",\"uni-calender.TUE\":\"TUE\",\"uni-calender.WED\":\"WED\",\"uni-calender.THU\":\"THU\",\"uni-calender.FRI\":\"FRI\",\"uni-calender.SAT\":\"SAT\",\"uni-calender.SUN\":\"SUN\",\"uni-calender.confirm\":\"confirm\"}");
  19279. /***/ }),
  19280. /* 230 */
  19281. /*!***********************************************************************************************************************!*\
  19282. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hans.json ***!
  19283. \***********************************************************************************************************************/
  19284. /*! exports provided: uni-datetime-picker.selectDate, uni-datetime-picker.selectTime, uni-datetime-picker.selectDateTime, uni-datetime-picker.startDate, uni-datetime-picker.endDate, uni-datetime-picker.startTime, uni-datetime-picker.endTime, uni-datetime-picker.ok, uni-datetime-picker.clear, uni-datetime-picker.cancel, uni-datetime-picker.year, uni-datetime-picker.month, uni-calender.SUN, uni-calender.MON, uni-calender.TUE, uni-calender.WED, uni-calender.THU, uni-calender.FRI, uni-calender.SAT, uni-calender.confirm, default */
  19285. /***/ (function(module) {
  19286. module.exports = JSON.parse("{\"uni-datetime-picker.selectDate\":\"选择日期\",\"uni-datetime-picker.selectTime\":\"选择时间\",\"uni-datetime-picker.selectDateTime\":\"选择日期时间\",\"uni-datetime-picker.startDate\":\"开始日期\",\"uni-datetime-picker.endDate\":\"结束日期\",\"uni-datetime-picker.startTime\":\"开始时间\",\"uni-datetime-picker.endTime\":\"结束时间\",\"uni-datetime-picker.ok\":\"确定\",\"uni-datetime-picker.clear\":\"清除\",\"uni-datetime-picker.cancel\":\"取消\",\"uni-datetime-picker.year\":\"年\",\"uni-datetime-picker.month\":\"月\",\"uni-calender.SUN\":\"日\",\"uni-calender.MON\":\"一\",\"uni-calender.TUE\":\"二\",\"uni-calender.WED\":\"三\",\"uni-calender.THU\":\"四\",\"uni-calender.FRI\":\"五\",\"uni-calender.SAT\":\"六\",\"uni-calender.confirm\":\"确认\"}");
  19287. /***/ }),
  19288. /* 231 */
  19289. /*!***********************************************************************************************************************!*\
  19290. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hant.json ***!
  19291. \***********************************************************************************************************************/
  19292. /*! exports provided: uni-datetime-picker.selectDate, uni-datetime-picker.selectTime, uni-datetime-picker.selectDateTime, uni-datetime-picker.startDate, uni-datetime-picker.endDate, uni-datetime-picker.startTime, uni-datetime-picker.endTime, uni-datetime-picker.ok, uni-datetime-picker.clear, uni-datetime-picker.cancel, uni-datetime-picker.year, uni-datetime-picker.month, uni-calender.SUN, uni-calender.MON, uni-calender.TUE, uni-calender.WED, uni-calender.THU, uni-calender.FRI, uni-calender.SAT, uni-calender.confirm, default */
  19293. /***/ (function(module) {
  19294. module.exports = JSON.parse("{\"uni-datetime-picker.selectDate\":\"選擇日期\",\"uni-datetime-picker.selectTime\":\"選擇時間\",\"uni-datetime-picker.selectDateTime\":\"選擇日期時間\",\"uni-datetime-picker.startDate\":\"開始日期\",\"uni-datetime-picker.endDate\":\"結束日期\",\"uni-datetime-picker.startTime\":\"開始时间\",\"uni-datetime-picker.endTime\":\"結束时间\",\"uni-datetime-picker.ok\":\"確定\",\"uni-datetime-picker.clear\":\"清除\",\"uni-datetime-picker.cancel\":\"取消\",\"uni-datetime-picker.year\":\"年\",\"uni-datetime-picker.month\":\"月\",\"uni-calender.SUN\":\"日\",\"uni-calender.MON\":\"一\",\"uni-calender.TUE\":\"二\",\"uni-calender.WED\":\"三\",\"uni-calender.THU\":\"四\",\"uni-calender.FRI\":\"五\",\"uni-calender.SAT\":\"六\",\"uni-calender.confirm\":\"確認\"}");
  19295. /***/ }),
  19296. /* 232 */,
  19297. /* 233 */,
  19298. /* 234 */,
  19299. /* 235 */,
  19300. /* 236 */,
  19301. /* 237 */,
  19302. /* 238 */,
  19303. /* 239 */
  19304. /*!******************************************************************************************!*\
  19305. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  19306. \******************************************************************************************/
  19307. /*! no static exports found */
  19308. /***/ (function(module, exports, __webpack_require__) {
  19309. "use strict";
  19310. Object.defineProperty(exports, "__esModule", {
  19311. value: true
  19312. });
  19313. exports.default = void 0;
  19314. var _default = {
  19315. "id": "2852637",
  19316. "name": "uniui图标库",
  19317. "font_family": "uniicons",
  19318. "css_prefix_text": "uniui-",
  19319. "description": "",
  19320. "glyphs": [{
  19321. "icon_id": "25027049",
  19322. "name": "yanse",
  19323. "font_class": "color",
  19324. "unicode": "e6cf",
  19325. "unicode_decimal": 59087
  19326. }, {
  19327. "icon_id": "25027048",
  19328. "name": "wallet",
  19329. "font_class": "wallet",
  19330. "unicode": "e6b1",
  19331. "unicode_decimal": 59057
  19332. }, {
  19333. "icon_id": "25015720",
  19334. "name": "settings-filled",
  19335. "font_class": "settings-filled",
  19336. "unicode": "e6ce",
  19337. "unicode_decimal": 59086
  19338. }, {
  19339. "icon_id": "25015434",
  19340. "name": "shimingrenzheng-filled",
  19341. "font_class": "auth-filled",
  19342. "unicode": "e6cc",
  19343. "unicode_decimal": 59084
  19344. }, {
  19345. "icon_id": "24934246",
  19346. "name": "shop-filled",
  19347. "font_class": "shop-filled",
  19348. "unicode": "e6cd",
  19349. "unicode_decimal": 59085
  19350. }, {
  19351. "icon_id": "24934159",
  19352. "name": "staff-filled-01",
  19353. "font_class": "staff-filled",
  19354. "unicode": "e6cb",
  19355. "unicode_decimal": 59083
  19356. }, {
  19357. "icon_id": "24932461",
  19358. "name": "VIP-filled",
  19359. "font_class": "vip-filled",
  19360. "unicode": "e6c6",
  19361. "unicode_decimal": 59078
  19362. }, {
  19363. "icon_id": "24932462",
  19364. "name": "plus_circle_fill",
  19365. "font_class": "plus-filled",
  19366. "unicode": "e6c7",
  19367. "unicode_decimal": 59079
  19368. }, {
  19369. "icon_id": "24932463",
  19370. "name": "folder_add-filled",
  19371. "font_class": "folder-add-filled",
  19372. "unicode": "e6c8",
  19373. "unicode_decimal": 59080
  19374. }, {
  19375. "icon_id": "24932464",
  19376. "name": "yanse-filled",
  19377. "font_class": "color-filled",
  19378. "unicode": "e6c9",
  19379. "unicode_decimal": 59081
  19380. }, {
  19381. "icon_id": "24932465",
  19382. "name": "tune-filled",
  19383. "font_class": "tune-filled",
  19384. "unicode": "e6ca",
  19385. "unicode_decimal": 59082
  19386. }, {
  19387. "icon_id": "24932455",
  19388. "name": "a-rilidaka-filled",
  19389. "font_class": "calendar-filled",
  19390. "unicode": "e6c0",
  19391. "unicode_decimal": 59072
  19392. }, {
  19393. "icon_id": "24932456",
  19394. "name": "notification-filled",
  19395. "font_class": "notification-filled",
  19396. "unicode": "e6c1",
  19397. "unicode_decimal": 59073
  19398. }, {
  19399. "icon_id": "24932457",
  19400. "name": "wallet-filled",
  19401. "font_class": "wallet-filled",
  19402. "unicode": "e6c2",
  19403. "unicode_decimal": 59074
  19404. }, {
  19405. "icon_id": "24932458",
  19406. "name": "paihangbang-filled",
  19407. "font_class": "medal-filled",
  19408. "unicode": "e6c3",
  19409. "unicode_decimal": 59075
  19410. }, {
  19411. "icon_id": "24932459",
  19412. "name": "gift-filled",
  19413. "font_class": "gift-filled",
  19414. "unicode": "e6c4",
  19415. "unicode_decimal": 59076
  19416. }, {
  19417. "icon_id": "24932460",
  19418. "name": "fire-filled",
  19419. "font_class": "fire-filled",
  19420. "unicode": "e6c5",
  19421. "unicode_decimal": 59077
  19422. }, {
  19423. "icon_id": "24928001",
  19424. "name": "refreshempty",
  19425. "font_class": "refreshempty",
  19426. "unicode": "e6bf",
  19427. "unicode_decimal": 59071
  19428. }, {
  19429. "icon_id": "24926853",
  19430. "name": "location-ellipse",
  19431. "font_class": "location-filled",
  19432. "unicode": "e6af",
  19433. "unicode_decimal": 59055
  19434. }, {
  19435. "icon_id": "24926735",
  19436. "name": "person-filled",
  19437. "font_class": "person-filled",
  19438. "unicode": "e69d",
  19439. "unicode_decimal": 59037
  19440. }, {
  19441. "icon_id": "24926703",
  19442. "name": "personadd-filled",
  19443. "font_class": "personadd-filled",
  19444. "unicode": "e698",
  19445. "unicode_decimal": 59032
  19446. }, {
  19447. "icon_id": "24923351",
  19448. "name": "back",
  19449. "font_class": "back",
  19450. "unicode": "e6b9",
  19451. "unicode_decimal": 59065
  19452. }, {
  19453. "icon_id": "24923352",
  19454. "name": "forward",
  19455. "font_class": "forward",
  19456. "unicode": "e6ba",
  19457. "unicode_decimal": 59066
  19458. }, {
  19459. "icon_id": "24923353",
  19460. "name": "arrowthinright",
  19461. "font_class": "arrow-right",
  19462. "unicode": "e6bb",
  19463. "unicode_decimal": 59067
  19464. }, {
  19465. "icon_id": "24923353",
  19466. "name": "arrowthinright",
  19467. "font_class": "arrowthinright",
  19468. "unicode": "e6bb",
  19469. "unicode_decimal": 59067
  19470. }, {
  19471. "icon_id": "24923354",
  19472. "name": "arrowthinleft",
  19473. "font_class": "arrow-left",
  19474. "unicode": "e6bc",
  19475. "unicode_decimal": 59068
  19476. }, {
  19477. "icon_id": "24923354",
  19478. "name": "arrowthinleft",
  19479. "font_class": "arrowthinleft",
  19480. "unicode": "e6bc",
  19481. "unicode_decimal": 59068
  19482. }, {
  19483. "icon_id": "24923355",
  19484. "name": "arrowthinup",
  19485. "font_class": "arrow-up",
  19486. "unicode": "e6bd",
  19487. "unicode_decimal": 59069
  19488. }, {
  19489. "icon_id": "24923355",
  19490. "name": "arrowthinup",
  19491. "font_class": "arrowthinup",
  19492. "unicode": "e6bd",
  19493. "unicode_decimal": 59069
  19494. }, {
  19495. "icon_id": "24923356",
  19496. "name": "arrowthindown",
  19497. "font_class": "arrow-down",
  19498. "unicode": "e6be",
  19499. "unicode_decimal": 59070
  19500. }, {
  19501. "icon_id": "24923356",
  19502. "name": "arrowthindown",
  19503. "font_class": "arrowthindown",
  19504. "unicode": "e6be",
  19505. "unicode_decimal": 59070
  19506. }, {
  19507. "icon_id": "24923349",
  19508. "name": "arrowdown",
  19509. "font_class": "bottom",
  19510. "unicode": "e6b8",
  19511. "unicode_decimal": 59064
  19512. }, {
  19513. "icon_id": "24923349",
  19514. "name": "arrowdown",
  19515. "font_class": "arrowdown",
  19516. "unicode": "e6b8",
  19517. "unicode_decimal": 59064
  19518. }, {
  19519. "icon_id": "24923346",
  19520. "name": "arrowright",
  19521. "font_class": "right",
  19522. "unicode": "e6b5",
  19523. "unicode_decimal": 59061
  19524. }, {
  19525. "icon_id": "24923346",
  19526. "name": "arrowright",
  19527. "font_class": "arrowright",
  19528. "unicode": "e6b5",
  19529. "unicode_decimal": 59061
  19530. }, {
  19531. "icon_id": "24923347",
  19532. "name": "arrowup",
  19533. "font_class": "top",
  19534. "unicode": "e6b6",
  19535. "unicode_decimal": 59062
  19536. }, {
  19537. "icon_id": "24923347",
  19538. "name": "arrowup",
  19539. "font_class": "arrowup",
  19540. "unicode": "e6b6",
  19541. "unicode_decimal": 59062
  19542. }, {
  19543. "icon_id": "24923348",
  19544. "name": "arrowleft",
  19545. "font_class": "left",
  19546. "unicode": "e6b7",
  19547. "unicode_decimal": 59063
  19548. }, {
  19549. "icon_id": "24923348",
  19550. "name": "arrowleft",
  19551. "font_class": "arrowleft",
  19552. "unicode": "e6b7",
  19553. "unicode_decimal": 59063
  19554. }, {
  19555. "icon_id": "24923334",
  19556. "name": "eye",
  19557. "font_class": "eye",
  19558. "unicode": "e651",
  19559. "unicode_decimal": 58961
  19560. }, {
  19561. "icon_id": "24923335",
  19562. "name": "eye-filled",
  19563. "font_class": "eye-filled",
  19564. "unicode": "e66a",
  19565. "unicode_decimal": 58986
  19566. }, {
  19567. "icon_id": "24923336",
  19568. "name": "eye-slash",
  19569. "font_class": "eye-slash",
  19570. "unicode": "e6b3",
  19571. "unicode_decimal": 59059
  19572. }, {
  19573. "icon_id": "24923337",
  19574. "name": "eye-slash-filled",
  19575. "font_class": "eye-slash-filled",
  19576. "unicode": "e6b4",
  19577. "unicode_decimal": 59060
  19578. }, {
  19579. "icon_id": "24923305",
  19580. "name": "info-filled",
  19581. "font_class": "info-filled",
  19582. "unicode": "e649",
  19583. "unicode_decimal": 58953
  19584. }, {
  19585. "icon_id": "24923299",
  19586. "name": "reload-01",
  19587. "font_class": "reload",
  19588. "unicode": "e6b2",
  19589. "unicode_decimal": 59058
  19590. }, {
  19591. "icon_id": "24923195",
  19592. "name": "mic_slash_fill",
  19593. "font_class": "micoff-filled",
  19594. "unicode": "e6b0",
  19595. "unicode_decimal": 59056
  19596. }, {
  19597. "icon_id": "24923165",
  19598. "name": "map-pin-ellipse",
  19599. "font_class": "map-pin-ellipse",
  19600. "unicode": "e6ac",
  19601. "unicode_decimal": 59052
  19602. }, {
  19603. "icon_id": "24923166",
  19604. "name": "map-pin",
  19605. "font_class": "map-pin",
  19606. "unicode": "e6ad",
  19607. "unicode_decimal": 59053
  19608. }, {
  19609. "icon_id": "24923167",
  19610. "name": "location",
  19611. "font_class": "location",
  19612. "unicode": "e6ae",
  19613. "unicode_decimal": 59054
  19614. }, {
  19615. "icon_id": "24923064",
  19616. "name": "starhalf",
  19617. "font_class": "starhalf",
  19618. "unicode": "e683",
  19619. "unicode_decimal": 59011
  19620. }, {
  19621. "icon_id": "24923065",
  19622. "name": "star",
  19623. "font_class": "star",
  19624. "unicode": "e688",
  19625. "unicode_decimal": 59016
  19626. }, {
  19627. "icon_id": "24923066",
  19628. "name": "star-filled",
  19629. "font_class": "star-filled",
  19630. "unicode": "e68f",
  19631. "unicode_decimal": 59023
  19632. }, {
  19633. "icon_id": "24899646",
  19634. "name": "a-rilidaka",
  19635. "font_class": "calendar",
  19636. "unicode": "e6a0",
  19637. "unicode_decimal": 59040
  19638. }, {
  19639. "icon_id": "24899647",
  19640. "name": "fire",
  19641. "font_class": "fire",
  19642. "unicode": "e6a1",
  19643. "unicode_decimal": 59041
  19644. }, {
  19645. "icon_id": "24899648",
  19646. "name": "paihangbang",
  19647. "font_class": "medal",
  19648. "unicode": "e6a2",
  19649. "unicode_decimal": 59042
  19650. }, {
  19651. "icon_id": "24899649",
  19652. "name": "font",
  19653. "font_class": "font",
  19654. "unicode": "e6a3",
  19655. "unicode_decimal": 59043
  19656. }, {
  19657. "icon_id": "24899650",
  19658. "name": "gift",
  19659. "font_class": "gift",
  19660. "unicode": "e6a4",
  19661. "unicode_decimal": 59044
  19662. }, {
  19663. "icon_id": "24899651",
  19664. "name": "link",
  19665. "font_class": "link",
  19666. "unicode": "e6a5",
  19667. "unicode_decimal": 59045
  19668. }, {
  19669. "icon_id": "24899652",
  19670. "name": "notification",
  19671. "font_class": "notification",
  19672. "unicode": "e6a6",
  19673. "unicode_decimal": 59046
  19674. }, {
  19675. "icon_id": "24899653",
  19676. "name": "staff",
  19677. "font_class": "staff",
  19678. "unicode": "e6a7",
  19679. "unicode_decimal": 59047
  19680. }, {
  19681. "icon_id": "24899654",
  19682. "name": "VIP",
  19683. "font_class": "vip",
  19684. "unicode": "e6a8",
  19685. "unicode_decimal": 59048
  19686. }, {
  19687. "icon_id": "24899655",
  19688. "name": "folder_add",
  19689. "font_class": "folder-add",
  19690. "unicode": "e6a9",
  19691. "unicode_decimal": 59049
  19692. }, {
  19693. "icon_id": "24899656",
  19694. "name": "tune",
  19695. "font_class": "tune",
  19696. "unicode": "e6aa",
  19697. "unicode_decimal": 59050
  19698. }, {
  19699. "icon_id": "24899657",
  19700. "name": "shimingrenzheng",
  19701. "font_class": "auth",
  19702. "unicode": "e6ab",
  19703. "unicode_decimal": 59051
  19704. }, {
  19705. "icon_id": "24899565",
  19706. "name": "person",
  19707. "font_class": "person",
  19708. "unicode": "e699",
  19709. "unicode_decimal": 59033
  19710. }, {
  19711. "icon_id": "24899566",
  19712. "name": "email-filled",
  19713. "font_class": "email-filled",
  19714. "unicode": "e69a",
  19715. "unicode_decimal": 59034
  19716. }, {
  19717. "icon_id": "24899567",
  19718. "name": "phone-filled",
  19719. "font_class": "phone-filled",
  19720. "unicode": "e69b",
  19721. "unicode_decimal": 59035
  19722. }, {
  19723. "icon_id": "24899568",
  19724. "name": "phone",
  19725. "font_class": "phone",
  19726. "unicode": "e69c",
  19727. "unicode_decimal": 59036
  19728. }, {
  19729. "icon_id": "24899570",
  19730. "name": "email",
  19731. "font_class": "email",
  19732. "unicode": "e69e",
  19733. "unicode_decimal": 59038
  19734. }, {
  19735. "icon_id": "24899571",
  19736. "name": "personadd",
  19737. "font_class": "personadd",
  19738. "unicode": "e69f",
  19739. "unicode_decimal": 59039
  19740. }, {
  19741. "icon_id": "24899558",
  19742. "name": "chatboxes-filled",
  19743. "font_class": "chatboxes-filled",
  19744. "unicode": "e692",
  19745. "unicode_decimal": 59026
  19746. }, {
  19747. "icon_id": "24899559",
  19748. "name": "contact",
  19749. "font_class": "contact",
  19750. "unicode": "e693",
  19751. "unicode_decimal": 59027
  19752. }, {
  19753. "icon_id": "24899560",
  19754. "name": "chatbubble-filled",
  19755. "font_class": "chatbubble-filled",
  19756. "unicode": "e694",
  19757. "unicode_decimal": 59028
  19758. }, {
  19759. "icon_id": "24899561",
  19760. "name": "contact-filled",
  19761. "font_class": "contact-filled",
  19762. "unicode": "e695",
  19763. "unicode_decimal": 59029
  19764. }, {
  19765. "icon_id": "24899562",
  19766. "name": "chatboxes",
  19767. "font_class": "chatboxes",
  19768. "unicode": "e696",
  19769. "unicode_decimal": 59030
  19770. }, {
  19771. "icon_id": "24899563",
  19772. "name": "chatbubble",
  19773. "font_class": "chatbubble",
  19774. "unicode": "e697",
  19775. "unicode_decimal": 59031
  19776. }, {
  19777. "icon_id": "24881290",
  19778. "name": "upload-filled",
  19779. "font_class": "upload-filled",
  19780. "unicode": "e68e",
  19781. "unicode_decimal": 59022
  19782. }, {
  19783. "icon_id": "24881292",
  19784. "name": "upload",
  19785. "font_class": "upload",
  19786. "unicode": "e690",
  19787. "unicode_decimal": 59024
  19788. }, {
  19789. "icon_id": "24881293",
  19790. "name": "weixin",
  19791. "font_class": "weixin",
  19792. "unicode": "e691",
  19793. "unicode_decimal": 59025
  19794. }, {
  19795. "icon_id": "24881274",
  19796. "name": "compose",
  19797. "font_class": "compose",
  19798. "unicode": "e67f",
  19799. "unicode_decimal": 59007
  19800. }, {
  19801. "icon_id": "24881275",
  19802. "name": "qq",
  19803. "font_class": "qq",
  19804. "unicode": "e680",
  19805. "unicode_decimal": 59008
  19806. }, {
  19807. "icon_id": "24881276",
  19808. "name": "download-filled",
  19809. "font_class": "download-filled",
  19810. "unicode": "e681",
  19811. "unicode_decimal": 59009
  19812. }, {
  19813. "icon_id": "24881277",
  19814. "name": "pengyouquan",
  19815. "font_class": "pyq",
  19816. "unicode": "e682",
  19817. "unicode_decimal": 59010
  19818. }, {
  19819. "icon_id": "24881279",
  19820. "name": "sound",
  19821. "font_class": "sound",
  19822. "unicode": "e684",
  19823. "unicode_decimal": 59012
  19824. }, {
  19825. "icon_id": "24881280",
  19826. "name": "trash-filled",
  19827. "font_class": "trash-filled",
  19828. "unicode": "e685",
  19829. "unicode_decimal": 59013
  19830. }, {
  19831. "icon_id": "24881281",
  19832. "name": "sound-filled",
  19833. "font_class": "sound-filled",
  19834. "unicode": "e686",
  19835. "unicode_decimal": 59014
  19836. }, {
  19837. "icon_id": "24881282",
  19838. "name": "trash",
  19839. "font_class": "trash",
  19840. "unicode": "e687",
  19841. "unicode_decimal": 59015
  19842. }, {
  19843. "icon_id": "24881284",
  19844. "name": "videocam-filled",
  19845. "font_class": "videocam-filled",
  19846. "unicode": "e689",
  19847. "unicode_decimal": 59017
  19848. }, {
  19849. "icon_id": "24881285",
  19850. "name": "spinner-cycle",
  19851. "font_class": "spinner-cycle",
  19852. "unicode": "e68a",
  19853. "unicode_decimal": 59018
  19854. }, {
  19855. "icon_id": "24881286",
  19856. "name": "weibo",
  19857. "font_class": "weibo",
  19858. "unicode": "e68b",
  19859. "unicode_decimal": 59019
  19860. }, {
  19861. "icon_id": "24881288",
  19862. "name": "videocam",
  19863. "font_class": "videocam",
  19864. "unicode": "e68c",
  19865. "unicode_decimal": 59020
  19866. }, {
  19867. "icon_id": "24881289",
  19868. "name": "download",
  19869. "font_class": "download",
  19870. "unicode": "e68d",
  19871. "unicode_decimal": 59021
  19872. }, {
  19873. "icon_id": "24879601",
  19874. "name": "help",
  19875. "font_class": "help",
  19876. "unicode": "e679",
  19877. "unicode_decimal": 59001
  19878. }, {
  19879. "icon_id": "24879602",
  19880. "name": "navigate-filled",
  19881. "font_class": "navigate-filled",
  19882. "unicode": "e67a",
  19883. "unicode_decimal": 59002
  19884. }, {
  19885. "icon_id": "24879603",
  19886. "name": "plusempty",
  19887. "font_class": "plusempty",
  19888. "unicode": "e67b",
  19889. "unicode_decimal": 59003
  19890. }, {
  19891. "icon_id": "24879604",
  19892. "name": "smallcircle",
  19893. "font_class": "smallcircle",
  19894. "unicode": "e67c",
  19895. "unicode_decimal": 59004
  19896. }, {
  19897. "icon_id": "24879605",
  19898. "name": "minus-filled",
  19899. "font_class": "minus-filled",
  19900. "unicode": "e67d",
  19901. "unicode_decimal": 59005
  19902. }, {
  19903. "icon_id": "24879606",
  19904. "name": "micoff",
  19905. "font_class": "micoff",
  19906. "unicode": "e67e",
  19907. "unicode_decimal": 59006
  19908. }, {
  19909. "icon_id": "24879588",
  19910. "name": "closeempty",
  19911. "font_class": "closeempty",
  19912. "unicode": "e66c",
  19913. "unicode_decimal": 58988
  19914. }, {
  19915. "icon_id": "24879589",
  19916. "name": "clear",
  19917. "font_class": "clear",
  19918. "unicode": "e66d",
  19919. "unicode_decimal": 58989
  19920. }, {
  19921. "icon_id": "24879590",
  19922. "name": "navigate",
  19923. "font_class": "navigate",
  19924. "unicode": "e66e",
  19925. "unicode_decimal": 58990
  19926. }, {
  19927. "icon_id": "24879591",
  19928. "name": "minus",
  19929. "font_class": "minus",
  19930. "unicode": "e66f",
  19931. "unicode_decimal": 58991
  19932. }, {
  19933. "icon_id": "24879592",
  19934. "name": "image",
  19935. "font_class": "image",
  19936. "unicode": "e670",
  19937. "unicode_decimal": 58992
  19938. }, {
  19939. "icon_id": "24879593",
  19940. "name": "mic",
  19941. "font_class": "mic",
  19942. "unicode": "e671",
  19943. "unicode_decimal": 58993
  19944. }, {
  19945. "icon_id": "24879594",
  19946. "name": "paperplane",
  19947. "font_class": "paperplane",
  19948. "unicode": "e672",
  19949. "unicode_decimal": 58994
  19950. }, {
  19951. "icon_id": "24879595",
  19952. "name": "close",
  19953. "font_class": "close",
  19954. "unicode": "e673",
  19955. "unicode_decimal": 58995
  19956. }, {
  19957. "icon_id": "24879596",
  19958. "name": "help-filled",
  19959. "font_class": "help-filled",
  19960. "unicode": "e674",
  19961. "unicode_decimal": 58996
  19962. }, {
  19963. "icon_id": "24879597",
  19964. "name": "plus-filled",
  19965. "font_class": "paperplane-filled",
  19966. "unicode": "e675",
  19967. "unicode_decimal": 58997
  19968. }, {
  19969. "icon_id": "24879598",
  19970. "name": "plus",
  19971. "font_class": "plus",
  19972. "unicode": "e676",
  19973. "unicode_decimal": 58998
  19974. }, {
  19975. "icon_id": "24879599",
  19976. "name": "mic-filled",
  19977. "font_class": "mic-filled",
  19978. "unicode": "e677",
  19979. "unicode_decimal": 58999
  19980. }, {
  19981. "icon_id": "24879600",
  19982. "name": "image-filled",
  19983. "font_class": "image-filled",
  19984. "unicode": "e678",
  19985. "unicode_decimal": 59000
  19986. }, {
  19987. "icon_id": "24855900",
  19988. "name": "locked-filled",
  19989. "font_class": "locked-filled",
  19990. "unicode": "e668",
  19991. "unicode_decimal": 58984
  19992. }, {
  19993. "icon_id": "24855901",
  19994. "name": "info",
  19995. "font_class": "info",
  19996. "unicode": "e669",
  19997. "unicode_decimal": 58985
  19998. }, {
  19999. "icon_id": "24855903",
  20000. "name": "locked",
  20001. "font_class": "locked",
  20002. "unicode": "e66b",
  20003. "unicode_decimal": 58987
  20004. }, {
  20005. "icon_id": "24855884",
  20006. "name": "camera-filled",
  20007. "font_class": "camera-filled",
  20008. "unicode": "e658",
  20009. "unicode_decimal": 58968
  20010. }, {
  20011. "icon_id": "24855885",
  20012. "name": "chat-filled",
  20013. "font_class": "chat-filled",
  20014. "unicode": "e659",
  20015. "unicode_decimal": 58969
  20016. }, {
  20017. "icon_id": "24855886",
  20018. "name": "camera",
  20019. "font_class": "camera",
  20020. "unicode": "e65a",
  20021. "unicode_decimal": 58970
  20022. }, {
  20023. "icon_id": "24855887",
  20024. "name": "circle",
  20025. "font_class": "circle",
  20026. "unicode": "e65b",
  20027. "unicode_decimal": 58971
  20028. }, {
  20029. "icon_id": "24855888",
  20030. "name": "checkmarkempty",
  20031. "font_class": "checkmarkempty",
  20032. "unicode": "e65c",
  20033. "unicode_decimal": 58972
  20034. }, {
  20035. "icon_id": "24855889",
  20036. "name": "chat",
  20037. "font_class": "chat",
  20038. "unicode": "e65d",
  20039. "unicode_decimal": 58973
  20040. }, {
  20041. "icon_id": "24855890",
  20042. "name": "circle-filled",
  20043. "font_class": "circle-filled",
  20044. "unicode": "e65e",
  20045. "unicode_decimal": 58974
  20046. }, {
  20047. "icon_id": "24855891",
  20048. "name": "flag",
  20049. "font_class": "flag",
  20050. "unicode": "e65f",
  20051. "unicode_decimal": 58975
  20052. }, {
  20053. "icon_id": "24855892",
  20054. "name": "flag-filled",
  20055. "font_class": "flag-filled",
  20056. "unicode": "e660",
  20057. "unicode_decimal": 58976
  20058. }, {
  20059. "icon_id": "24855893",
  20060. "name": "gear-filled",
  20061. "font_class": "gear-filled",
  20062. "unicode": "e661",
  20063. "unicode_decimal": 58977
  20064. }, {
  20065. "icon_id": "24855894",
  20066. "name": "home",
  20067. "font_class": "home",
  20068. "unicode": "e662",
  20069. "unicode_decimal": 58978
  20070. }, {
  20071. "icon_id": "24855895",
  20072. "name": "home-filled",
  20073. "font_class": "home-filled",
  20074. "unicode": "e663",
  20075. "unicode_decimal": 58979
  20076. }, {
  20077. "icon_id": "24855896",
  20078. "name": "gear",
  20079. "font_class": "gear",
  20080. "unicode": "e664",
  20081. "unicode_decimal": 58980
  20082. }, {
  20083. "icon_id": "24855897",
  20084. "name": "smallcircle-filled",
  20085. "font_class": "smallcircle-filled",
  20086. "unicode": "e665",
  20087. "unicode_decimal": 58981
  20088. }, {
  20089. "icon_id": "24855898",
  20090. "name": "map-filled",
  20091. "font_class": "map-filled",
  20092. "unicode": "e666",
  20093. "unicode_decimal": 58982
  20094. }, {
  20095. "icon_id": "24855899",
  20096. "name": "map",
  20097. "font_class": "map",
  20098. "unicode": "e667",
  20099. "unicode_decimal": 58983
  20100. }, {
  20101. "icon_id": "24855825",
  20102. "name": "refresh-filled",
  20103. "font_class": "refresh-filled",
  20104. "unicode": "e656",
  20105. "unicode_decimal": 58966
  20106. }, {
  20107. "icon_id": "24855826",
  20108. "name": "refresh",
  20109. "font_class": "refresh",
  20110. "unicode": "e657",
  20111. "unicode_decimal": 58967
  20112. }, {
  20113. "icon_id": "24855808",
  20114. "name": "cloud-upload",
  20115. "font_class": "cloud-upload",
  20116. "unicode": "e645",
  20117. "unicode_decimal": 58949
  20118. }, {
  20119. "icon_id": "24855809",
  20120. "name": "cloud-download-filled",
  20121. "font_class": "cloud-download-filled",
  20122. "unicode": "e646",
  20123. "unicode_decimal": 58950
  20124. }, {
  20125. "icon_id": "24855810",
  20126. "name": "cloud-download",
  20127. "font_class": "cloud-download",
  20128. "unicode": "e647",
  20129. "unicode_decimal": 58951
  20130. }, {
  20131. "icon_id": "24855811",
  20132. "name": "cloud-upload-filled",
  20133. "font_class": "cloud-upload-filled",
  20134. "unicode": "e648",
  20135. "unicode_decimal": 58952
  20136. }, {
  20137. "icon_id": "24855813",
  20138. "name": "redo",
  20139. "font_class": "redo",
  20140. "unicode": "e64a",
  20141. "unicode_decimal": 58954
  20142. }, {
  20143. "icon_id": "24855814",
  20144. "name": "images-filled",
  20145. "font_class": "images-filled",
  20146. "unicode": "e64b",
  20147. "unicode_decimal": 58955
  20148. }, {
  20149. "icon_id": "24855815",
  20150. "name": "undo-filled",
  20151. "font_class": "undo-filled",
  20152. "unicode": "e64c",
  20153. "unicode_decimal": 58956
  20154. }, {
  20155. "icon_id": "24855816",
  20156. "name": "more",
  20157. "font_class": "more",
  20158. "unicode": "e64d",
  20159. "unicode_decimal": 58957
  20160. }, {
  20161. "icon_id": "24855817",
  20162. "name": "more-filled",
  20163. "font_class": "more-filled",
  20164. "unicode": "e64e",
  20165. "unicode_decimal": 58958
  20166. }, {
  20167. "icon_id": "24855818",
  20168. "name": "undo",
  20169. "font_class": "undo",
  20170. "unicode": "e64f",
  20171. "unicode_decimal": 58959
  20172. }, {
  20173. "icon_id": "24855819",
  20174. "name": "images",
  20175. "font_class": "images",
  20176. "unicode": "e650",
  20177. "unicode_decimal": 58960
  20178. }, {
  20179. "icon_id": "24855821",
  20180. "name": "paperclip",
  20181. "font_class": "paperclip",
  20182. "unicode": "e652",
  20183. "unicode_decimal": 58962
  20184. }, {
  20185. "icon_id": "24855822",
  20186. "name": "settings",
  20187. "font_class": "settings",
  20188. "unicode": "e653",
  20189. "unicode_decimal": 58963
  20190. }, {
  20191. "icon_id": "24855823",
  20192. "name": "search",
  20193. "font_class": "search",
  20194. "unicode": "e654",
  20195. "unicode_decimal": 58964
  20196. }, {
  20197. "icon_id": "24855824",
  20198. "name": "redo-filled",
  20199. "font_class": "redo-filled",
  20200. "unicode": "e655",
  20201. "unicode_decimal": 58965
  20202. }, {
  20203. "icon_id": "24841702",
  20204. "name": "list",
  20205. "font_class": "list",
  20206. "unicode": "e644",
  20207. "unicode_decimal": 58948
  20208. }, {
  20209. "icon_id": "24841489",
  20210. "name": "mail-open-filled",
  20211. "font_class": "mail-open-filled",
  20212. "unicode": "e63a",
  20213. "unicode_decimal": 58938
  20214. }, {
  20215. "icon_id": "24841491",
  20216. "name": "hand-thumbsdown-filled",
  20217. "font_class": "hand-down-filled",
  20218. "unicode": "e63c",
  20219. "unicode_decimal": 58940
  20220. }, {
  20221. "icon_id": "24841492",
  20222. "name": "hand-thumbsdown",
  20223. "font_class": "hand-down",
  20224. "unicode": "e63d",
  20225. "unicode_decimal": 58941
  20226. }, {
  20227. "icon_id": "24841493",
  20228. "name": "hand-thumbsup-filled",
  20229. "font_class": "hand-up-filled",
  20230. "unicode": "e63e",
  20231. "unicode_decimal": 58942
  20232. }, {
  20233. "icon_id": "24841494",
  20234. "name": "hand-thumbsup",
  20235. "font_class": "hand-up",
  20236. "unicode": "e63f",
  20237. "unicode_decimal": 58943
  20238. }, {
  20239. "icon_id": "24841496",
  20240. "name": "heart-filled",
  20241. "font_class": "heart-filled",
  20242. "unicode": "e641",
  20243. "unicode_decimal": 58945
  20244. }, {
  20245. "icon_id": "24841498",
  20246. "name": "mail-open",
  20247. "font_class": "mail-open",
  20248. "unicode": "e643",
  20249. "unicode_decimal": 58947
  20250. }, {
  20251. "icon_id": "24841488",
  20252. "name": "heart",
  20253. "font_class": "heart",
  20254. "unicode": "e639",
  20255. "unicode_decimal": 58937
  20256. }, {
  20257. "icon_id": "24839963",
  20258. "name": "loop",
  20259. "font_class": "loop",
  20260. "unicode": "e633",
  20261. "unicode_decimal": 58931
  20262. }, {
  20263. "icon_id": "24839866",
  20264. "name": "pulldown",
  20265. "font_class": "pulldown",
  20266. "unicode": "e632",
  20267. "unicode_decimal": 58930
  20268. }, {
  20269. "icon_id": "24813798",
  20270. "name": "scan",
  20271. "font_class": "scan",
  20272. "unicode": "e62a",
  20273. "unicode_decimal": 58922
  20274. }, {
  20275. "icon_id": "24813786",
  20276. "name": "bars",
  20277. "font_class": "bars",
  20278. "unicode": "e627",
  20279. "unicode_decimal": 58919
  20280. }, {
  20281. "icon_id": "24813788",
  20282. "name": "cart-filled",
  20283. "font_class": "cart-filled",
  20284. "unicode": "e629",
  20285. "unicode_decimal": 58921
  20286. }, {
  20287. "icon_id": "24813790",
  20288. "name": "checkbox",
  20289. "font_class": "checkbox",
  20290. "unicode": "e62b",
  20291. "unicode_decimal": 58923
  20292. }, {
  20293. "icon_id": "24813791",
  20294. "name": "checkbox-filled",
  20295. "font_class": "checkbox-filled",
  20296. "unicode": "e62c",
  20297. "unicode_decimal": 58924
  20298. }, {
  20299. "icon_id": "24813794",
  20300. "name": "shop",
  20301. "font_class": "shop",
  20302. "unicode": "e62f",
  20303. "unicode_decimal": 58927
  20304. }, {
  20305. "icon_id": "24813795",
  20306. "name": "headphones",
  20307. "font_class": "headphones",
  20308. "unicode": "e630",
  20309. "unicode_decimal": 58928
  20310. }, {
  20311. "icon_id": "24813796",
  20312. "name": "cart",
  20313. "font_class": "cart",
  20314. "unicode": "e631",
  20315. "unicode_decimal": 58929
  20316. }]
  20317. };
  20318. exports.default = _default;
  20319. /***/ }),
  20320. /* 240 */,
  20321. /* 241 */,
  20322. /* 242 */,
  20323. /* 243 */,
  20324. /* 244 */,
  20325. /* 245 */,
  20326. /* 246 */,
  20327. /* 247 */
  20328. /*!*******************************************************************************************************!*\
  20329. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js ***!
  20330. \*******************************************************************************************************/
  20331. /*! no static exports found */
  20332. /***/ (function(module, exports, __webpack_require__) {
  20333. "use strict";
  20334. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  20335. Object.defineProperty(exports, "__esModule", {
  20336. value: true
  20337. });
  20338. exports.default = void 0;
  20339. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 248));
  20340. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 249));
  20341. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 250));
  20342. var _default = {
  20343. en: _en.default,
  20344. 'zh-Hans': _zhHans.default,
  20345. 'zh-Hant': _zhHant.default
  20346. };
  20347. exports.default = _default;
  20348. /***/ }),
  20349. /* 248 */
  20350. /*!******************************************************************************************************!*\
  20351. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-load-more/components/uni-load-more/i18n/en.json ***!
  20352. \******************************************************************************************************/
  20353. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  20354. /***/ (function(module) {
  20355. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"Pull up to show more\",\"uni-load-more.contentrefresh\":\"loading...\",\"uni-load-more.contentnomore\":\"No more data\"}");
  20356. /***/ }),
  20357. /* 249 */
  20358. /*!***********************************************************************************************************!*\
  20359. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json ***!
  20360. \***********************************************************************************************************/
  20361. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  20362. /***/ (function(module) {
  20363. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉显示更多\",\"uni-load-more.contentrefresh\":\"正在加载...\",\"uni-load-more.contentnomore\":\"没有更多数据了\"}");
  20364. /***/ }),
  20365. /* 250 */
  20366. /*!***********************************************************************************************************!*\
  20367. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json ***!
  20368. \***********************************************************************************************************/
  20369. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  20370. /***/ (function(module) {
  20371. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉顯示更多\",\"uni-load-more.contentrefresh\":\"正在加載...\",\"uni-load-more.contentnomore\":\"沒有更多數據了\"}");
  20372. /***/ }),
  20373. /* 251 */,
  20374. /* 252 */,
  20375. /* 253 */,
  20376. /* 254 */,
  20377. /* 255 */,
  20378. /* 256 */,
  20379. /* 257 */,
  20380. /* 258 */
  20381. /*!*************************************************************************************************************!*\
  20382. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js ***!
  20383. \*************************************************************************************************************/
  20384. /*! no static exports found */
  20385. /***/ (function(module, exports, __webpack_require__) {
  20386. "use strict";
  20387. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  20388. Object.defineProperty(exports, "__esModule", {
  20389. value: true
  20390. });
  20391. exports.default = void 0;
  20392. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  20393. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  20394. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  20395. var Calendar = /*#__PURE__*/function () {
  20396. function Calendar() {
  20397. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  20398. date = _ref.date,
  20399. selected = _ref.selected,
  20400. startDate = _ref.startDate,
  20401. endDate = _ref.endDate,
  20402. range = _ref.range;
  20403. (0, _classCallCheck2.default)(this, Calendar);
  20404. // 当前日期
  20405. this.date = this.getDate(new Date()); // 当前初入日期
  20406. // 打点信息
  20407. this.selected = selected || [];
  20408. // 范围开始
  20409. this.startDate = startDate;
  20410. // 范围结束
  20411. this.endDate = endDate;
  20412. this.range = range;
  20413. // 多选状态
  20414. this.cleanMultipleStatus();
  20415. // 每周日期
  20416. this.weeks = {};
  20417. // this._getWeek(this.date.fullDate)
  20418. // this.multipleStatus = multipleStatus
  20419. this.lastHover = false;
  20420. }
  20421. /**
  20422. * 设置日期
  20423. * @param {Object} date
  20424. */
  20425. (0, _createClass2.default)(Calendar, [{
  20426. key: "setDate",
  20427. value: function setDate(date) {
  20428. this.selectDate = this.getDate(date);
  20429. this._getWeek(this.selectDate.fullDate);
  20430. }
  20431. /**
  20432. * 清理多选状态
  20433. */
  20434. }, {
  20435. key: "cleanMultipleStatus",
  20436. value: function cleanMultipleStatus() {
  20437. this.multipleStatus = {
  20438. before: '',
  20439. after: '',
  20440. data: []
  20441. };
  20442. }
  20443. /**
  20444. * 重置开始日期
  20445. */
  20446. }, {
  20447. key: "resetSatrtDate",
  20448. value: function resetSatrtDate(startDate) {
  20449. // 范围开始
  20450. this.startDate = startDate;
  20451. }
  20452. /**
  20453. * 重置结束日期
  20454. */
  20455. }, {
  20456. key: "resetEndDate",
  20457. value: function resetEndDate(endDate) {
  20458. // 范围结束
  20459. this.endDate = endDate;
  20460. }
  20461. /**
  20462. * 获取任意时间
  20463. */
  20464. }, {
  20465. key: "getDate",
  20466. value: function getDate(date) {
  20467. var AddDayCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  20468. var str = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'day';
  20469. if (!date) {
  20470. date = new Date();
  20471. }
  20472. if ((0, _typeof2.default)(date) !== 'object') {
  20473. date = date.replace(/-/g, '/');
  20474. }
  20475. var dd = new Date(date);
  20476. switch (str) {
  20477. case 'day':
  20478. dd.setDate(dd.getDate() + AddDayCount); // 获取AddDayCount天后的日期
  20479. break;
  20480. case 'month':
  20481. if (dd.getDate() === 31) {
  20482. dd.setDate(dd.getDate() + AddDayCount);
  20483. } else {
  20484. dd.setMonth(dd.getMonth() + AddDayCount); // 获取AddDayCount天后的日期
  20485. }
  20486. break;
  20487. case 'year':
  20488. dd.setFullYear(dd.getFullYear() + AddDayCount); // 获取AddDayCount天后的日期
  20489. break;
  20490. }
  20491. var y = dd.getFullYear();
  20492. var m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1; // 获取当前月份的日期,不足10补0
  20493. var d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate(); // 获取当前几号,不足10补0
  20494. return {
  20495. fullDate: y + '-' + m + '-' + d,
  20496. year: y,
  20497. month: m,
  20498. date: d,
  20499. day: dd.getDay()
  20500. };
  20501. }
  20502. /**
  20503. * 获取上月剩余天数
  20504. */
  20505. }, {
  20506. key: "_getLastMonthDays",
  20507. value: function _getLastMonthDays(firstDay, full) {
  20508. var dateArr = [];
  20509. for (var i = firstDay; i > 0; i--) {
  20510. var beforeDate = new Date(full.year, full.month - 1, -i + 1).getDate();
  20511. dateArr.push({
  20512. date: beforeDate,
  20513. month: full.month - 1,
  20514. disable: true
  20515. });
  20516. }
  20517. return dateArr;
  20518. }
  20519. /**
  20520. * 获取本月天数
  20521. */
  20522. }, {
  20523. key: "_currentMonthDys",
  20524. value: function _currentMonthDys(dateData, full) {
  20525. var _this = this;
  20526. var dateArr = [];
  20527. var fullDate = this.date.fullDate;
  20528. var _loop = function _loop(i) {
  20529. var isinfo = false;
  20530. var nowDate = full.year + '-' + (full.month < 10 ? full.month : full.month) + '-' + (i < 10 ? '0' + i : i);
  20531. // 是否今天
  20532. var isDay = fullDate === nowDate;
  20533. // 获取打点信息
  20534. var info = _this.selected && _this.selected.find(function (item) {
  20535. if (_this.dateEqual(nowDate, item.date)) {
  20536. return item;
  20537. }
  20538. });
  20539. // 日期禁用
  20540. var disableBefore = true;
  20541. var disableAfter = true;
  20542. if (_this.startDate) {
  20543. // let dateCompBefore = this.dateCompare(this.startDate, fullDate)
  20544. // disableBefore = this.dateCompare(dateCompBefore ? this.startDate : fullDate, nowDate)
  20545. disableBefore = _this.dateCompare(_this.startDate, nowDate);
  20546. }
  20547. if (_this.endDate) {
  20548. // let dateCompAfter = this.dateCompare(fullDate, this.endDate)
  20549. // disableAfter = this.dateCompare(nowDate, dateCompAfter ? this.endDate : fullDate)
  20550. disableAfter = _this.dateCompare(nowDate, _this.endDate);
  20551. }
  20552. var multiples = _this.multipleStatus.data;
  20553. var checked = false;
  20554. var multiplesStatus = -1;
  20555. if (_this.range) {
  20556. if (multiples) {
  20557. multiplesStatus = multiples.findIndex(function (item) {
  20558. return _this.dateEqual(item, nowDate);
  20559. });
  20560. }
  20561. if (multiplesStatus !== -1) {
  20562. checked = true;
  20563. }
  20564. }
  20565. var data = {
  20566. fullDate: nowDate,
  20567. year: full.year,
  20568. date: i,
  20569. multiple: _this.range ? checked : false,
  20570. beforeMultiple: _this.isLogicBefore(nowDate, _this.multipleStatus.before, _this.multipleStatus.after),
  20571. afterMultiple: _this.isLogicAfter(nowDate, _this.multipleStatus.before, _this.multipleStatus.after),
  20572. month: full.month,
  20573. disable: !(disableBefore && disableAfter),
  20574. isDay: isDay,
  20575. userChecked: false
  20576. };
  20577. if (info) {
  20578. data.extraInfo = info;
  20579. }
  20580. dateArr.push(data);
  20581. };
  20582. for (var i = 1; i <= dateData; i++) {
  20583. _loop(i);
  20584. }
  20585. return dateArr;
  20586. }
  20587. /**
  20588. * 获取下月天数
  20589. */
  20590. }, {
  20591. key: "_getNextMonthDays",
  20592. value: function _getNextMonthDays(surplus, full) {
  20593. var dateArr = [];
  20594. for (var i = 1; i < surplus + 1; i++) {
  20595. dateArr.push({
  20596. date: i,
  20597. month: Number(full.month) + 1,
  20598. disable: true
  20599. });
  20600. }
  20601. return dateArr;
  20602. }
  20603. /**
  20604. * 获取当前日期详情
  20605. * @param {Object} date
  20606. */
  20607. }, {
  20608. key: "getInfo",
  20609. value: function getInfo(date) {
  20610. var _this2 = this;
  20611. if (!date) {
  20612. date = new Date();
  20613. }
  20614. var dateInfo = this.canlender.find(function (item) {
  20615. return item.fullDate === _this2.getDate(date).fullDate;
  20616. });
  20617. return dateInfo;
  20618. }
  20619. /**
  20620. * 比较时间大小
  20621. */
  20622. }, {
  20623. key: "dateCompare",
  20624. value: function dateCompare(startDate, endDate) {
  20625. // 计算截止时间
  20626. startDate = new Date(startDate.replace('-', '/').replace('-', '/'));
  20627. // 计算详细项的截止时间
  20628. endDate = new Date(endDate.replace('-', '/').replace('-', '/'));
  20629. if (startDate <= endDate) {
  20630. return true;
  20631. } else {
  20632. return false;
  20633. }
  20634. }
  20635. /**
  20636. * 比较时间是否相等
  20637. */
  20638. }, {
  20639. key: "dateEqual",
  20640. value: function dateEqual(before, after) {
  20641. // 计算截止时间
  20642. before = new Date(before.replace('-', '/').replace('-', '/'));
  20643. // 计算详细项的截止时间
  20644. after = new Date(after.replace('-', '/').replace('-', '/'));
  20645. if (before.getTime() - after.getTime() === 0) {
  20646. return true;
  20647. } else {
  20648. return false;
  20649. }
  20650. }
  20651. /**
  20652. * 比较真实起始日期
  20653. */
  20654. }, {
  20655. key: "isLogicBefore",
  20656. value: function isLogicBefore(currentDay, before, after) {
  20657. var logicBefore = before;
  20658. if (before && after) {
  20659. logicBefore = this.dateCompare(before, after) ? before : after;
  20660. }
  20661. return this.dateEqual(logicBefore, currentDay);
  20662. }
  20663. }, {
  20664. key: "isLogicAfter",
  20665. value: function isLogicAfter(currentDay, before, after) {
  20666. var logicAfter = after;
  20667. if (before && after) {
  20668. logicAfter = this.dateCompare(before, after) ? after : before;
  20669. }
  20670. return this.dateEqual(logicAfter, currentDay);
  20671. }
  20672. /**
  20673. * 获取日期范围内所有日期
  20674. * @param {Object} begin
  20675. * @param {Object} end
  20676. */
  20677. }, {
  20678. key: "geDateAll",
  20679. value: function geDateAll(begin, end) {
  20680. var arr = [];
  20681. var ab = begin.split('-');
  20682. var ae = end.split('-');
  20683. var db = new Date();
  20684. db.setFullYear(ab[0], ab[1] - 1, ab[2]);
  20685. var de = new Date();
  20686. de.setFullYear(ae[0], ae[1] - 1, ae[2]);
  20687. var unixDb = db.getTime() - 24 * 60 * 60 * 1000;
  20688. var unixDe = de.getTime() - 24 * 60 * 60 * 1000;
  20689. for (var k = unixDb; k <= unixDe;) {
  20690. k = k + 24 * 60 * 60 * 1000;
  20691. arr.push(this.getDate(new Date(parseInt(k))).fullDate);
  20692. }
  20693. return arr;
  20694. }
  20695. /**
  20696. * 获取多选状态
  20697. */
  20698. }, {
  20699. key: "setMultiple",
  20700. value: function setMultiple(fullDate) {
  20701. var _this$multipleStatus = this.multipleStatus,
  20702. before = _this$multipleStatus.before,
  20703. after = _this$multipleStatus.after;
  20704. if (!this.range) return;
  20705. if (before && after) {
  20706. if (!this.lastHover) {
  20707. this.lastHover = true;
  20708. return;
  20709. }
  20710. this.multipleStatus.before = fullDate;
  20711. this.multipleStatus.after = '';
  20712. this.multipleStatus.data = [];
  20713. this.multipleStatus.fulldate = '';
  20714. this.lastHover = false;
  20715. } else {
  20716. if (!before) {
  20717. this.multipleStatus.before = fullDate;
  20718. this.lastHover = false;
  20719. } else {
  20720. this.multipleStatus.after = fullDate;
  20721. if (this.dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
  20722. this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
  20723. } else {
  20724. this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
  20725. }
  20726. this.lastHover = true;
  20727. }
  20728. }
  20729. this._getWeek(fullDate);
  20730. }
  20731. /**
  20732. * 鼠标 hover 更新多选状态
  20733. */
  20734. }, {
  20735. key: "setHoverMultiple",
  20736. value: function setHoverMultiple(fullDate) {
  20737. var _this$multipleStatus2 = this.multipleStatus,
  20738. before = _this$multipleStatus2.before,
  20739. after = _this$multipleStatus2.after;
  20740. if (!this.range) return;
  20741. if (this.lastHover) return;
  20742. if (!before) {
  20743. this.multipleStatus.before = fullDate;
  20744. } else {
  20745. this.multipleStatus.after = fullDate;
  20746. if (this.dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
  20747. this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
  20748. } else {
  20749. this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
  20750. }
  20751. }
  20752. this._getWeek(fullDate);
  20753. }
  20754. /**
  20755. * 更新默认值多选状态
  20756. */
  20757. }, {
  20758. key: "setDefaultMultiple",
  20759. value: function setDefaultMultiple(before, after) {
  20760. this.multipleStatus.before = before;
  20761. this.multipleStatus.after = after;
  20762. if (before && after) {
  20763. if (this.dateCompare(before, after)) {
  20764. this.multipleStatus.data = this.geDateAll(before, after);
  20765. this._getWeek(after);
  20766. } else {
  20767. this.multipleStatus.data = this.geDateAll(after, before);
  20768. this._getWeek(before);
  20769. }
  20770. }
  20771. }
  20772. /**
  20773. * 获取每周数据
  20774. * @param {Object} dateData
  20775. */
  20776. }, {
  20777. key: "_getWeek",
  20778. value: function _getWeek(dateData) {
  20779. var _this$getDate = this.getDate(dateData),
  20780. fullDate = _this$getDate.fullDate,
  20781. year = _this$getDate.year,
  20782. month = _this$getDate.month,
  20783. date = _this$getDate.date,
  20784. day = _this$getDate.day;
  20785. var firstDay = new Date(year, month - 1, 1).getDay();
  20786. var currentDay = new Date(year, month, 0).getDate();
  20787. var dates = {
  20788. lastMonthDays: this._getLastMonthDays(firstDay, this.getDate(dateData)),
  20789. // 上个月末尾几天
  20790. currentMonthDys: this._currentMonthDys(currentDay, this.getDate(dateData)),
  20791. // 本月天数
  20792. nextMonthDays: [],
  20793. // 下个月开始几天
  20794. weeks: []
  20795. };
  20796. var canlender = [];
  20797. var surplus = 42 - (dates.lastMonthDays.length + dates.currentMonthDys.length);
  20798. dates.nextMonthDays = this._getNextMonthDays(surplus, this.getDate(dateData));
  20799. canlender = canlender.concat(dates.lastMonthDays, dates.currentMonthDys, dates.nextMonthDays);
  20800. var weeks = {};
  20801. // 拼接数组 上个月开始几天 + 本月天数+ 下个月开始几天
  20802. for (var i = 0; i < canlender.length; i++) {
  20803. if (i % 7 === 0) {
  20804. weeks[parseInt(i / 7)] = new Array(7);
  20805. }
  20806. weeks[parseInt(i / 7)][i % 7] = canlender[i];
  20807. }
  20808. this.canlender = canlender;
  20809. this.weeks = weeks;
  20810. }
  20811. //静态方法
  20812. // static init(date) {
  20813. // if (!this.instance) {
  20814. // this.instance = new Calendar(date);
  20815. // }
  20816. // return this.instance;
  20817. // }
  20818. }]);
  20819. return Calendar;
  20820. }();
  20821. var _default = Calendar;
  20822. exports.default = _default;
  20823. /***/ })
  20824. ]]);
  20825. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map