vendor.js 800 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!*********************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js ***!
  5. \*********************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. Object.defineProperty(exports, "__esModule", {
  10. value: true
  11. });
  12. exports.default = void 0;
  13. var objectKeys = ['qy', 'env', 'error', 'version', 'lanDebug', 'cloud', 'serviceMarket', 'router', 'worklet', '__webpack_require_UNI_MP_PLUGIN__'];
  14. var singlePageDisableKey = ['lanDebug', 'router', 'worklet'];
  15. var target = typeof globalThis !== 'undefined' ? globalThis : function () {
  16. return this;
  17. }();
  18. var key = ['w', 'x'].join('');
  19. var oldWx = target[key];
  20. var launchOption = oldWx.getLaunchOptionsSync ? oldWx.getLaunchOptionsSync() : null;
  21. function isWxKey(key) {
  22. if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
  23. return false;
  24. }
  25. return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function';
  26. }
  27. function initWx() {
  28. var newWx = {};
  29. for (var _key in oldWx) {
  30. if (isWxKey(_key)) {
  31. // TODO wrapper function
  32. newWx[_key] = oldWx[_key];
  33. }
  34. }
  35. return newWx;
  36. }
  37. target[key] = initWx();
  38. var _default = target[key];
  39. exports.default = _default;
  40. /***/ }),
  41. /***/ 10:
  42. /*!****************************************************************!*\
  43. !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
  44. \****************************************************************/
  45. /*! no static exports found */
  46. /***/ (function(module, exports) {
  47. function _nonIterableRest() {
  48. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  49. }
  50. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  51. /***/ }),
  52. /***/ 11:
  53. /*!***************************************************************!*\
  54. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  55. \***************************************************************/
  56. /*! no static exports found */
  57. /***/ (function(module, exports, __webpack_require__) {
  58. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  59. function _defineProperty(obj, key, value) {
  60. key = toPropertyKey(key);
  61. if (key in obj) {
  62. Object.defineProperty(obj, key, {
  63. value: value,
  64. enumerable: true,
  65. configurable: true,
  66. writable: true
  67. });
  68. } else {
  69. obj[key] = value;
  70. }
  71. return obj;
  72. }
  73. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  74. /***/ }),
  75. /***/ 115:
  76. /*!**************************************************************************!*\
  77. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/checklistScore.js ***!
  78. \**************************************************************************/
  79. /*! no static exports found */
  80. /***/ (function(module, exports, __webpack_require__) {
  81. "use strict";
  82. Object.defineProperty(exports, "__esModule", {
  83. value: true
  84. });
  85. exports.batchSatisfactionChecklist = batchSatisfactionChecklist;
  86. exports.getChecklistScoreRecordByList = getChecklistScoreRecordByList;
  87. exports.getChecklistScoreRecordByPage = getChecklistScoreRecordByPage;
  88. exports.getScoreRecordView = getScoreRecordView;
  89. exports.getScoreView = getScoreView;
  90. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  91. /**
  92. * 获取评分清单视图
  93. * @param data
  94. *
  95. * @returns
  96. */
  97. function getScoreView(checklistId) {
  98. return (0, _request.request)({
  99. url: "/checklist/view/".concat(checklistId),
  100. method: 'GET'
  101. });
  102. }
  103. /**
  104. * 获取评分清单记录视图
  105. * @param data
  106. *
  107. * @returns
  108. */
  109. function getScoreRecordView(recordId, checklistId) {
  110. return (0, _request.request)({
  111. url: "/checklist/score/record/view/".concat(recordId, "/").concat(checklistId),
  112. method: 'GET'
  113. });
  114. }
  115. // 2. 一次批量提交
  116. function batchSatisfactionChecklist(data) {
  117. return (0, _request.request)({
  118. url: "/checklist/score/record/batch",
  119. method: 'POST',
  120. data: data
  121. });
  122. }
  123. /**
  124. * 获取Checklist列表
  125. * @param data
  126. * @returns
  127. */
  128. function getChecklistScoreRecordByList(data) {
  129. return (0, _request.request)({
  130. url: '/checklist/score/record',
  131. method: 'GET',
  132. data: data
  133. });
  134. }
  135. /**
  136. * 获取Checklist列表
  137. * @param data
  138. * @returns
  139. */
  140. function getChecklistScoreRecordByPage(data) {
  141. return (0, _request.request)({
  142. url: '/checklist/score/record/page',
  143. method: 'GET',
  144. data: data
  145. });
  146. }
  147. /***/ }),
  148. /***/ 12:
  149. /*!**************************************************************!*\
  150. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  151. \**************************************************************/
  152. /*! no static exports found */
  153. /***/ (function(module, exports, __webpack_require__) {
  154. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  155. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  156. function _toPropertyKey(arg) {
  157. var key = toPrimitive(arg, "string");
  158. return _typeof(key) === "symbol" ? key : String(key);
  159. }
  160. module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  161. /***/ }),
  162. /***/ 13:
  163. /*!*******************************************************!*\
  164. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  165. \*******************************************************/
  166. /*! no static exports found */
  167. /***/ (function(module, exports) {
  168. function _typeof(obj) {
  169. "@babel/helpers - typeof";
  170. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  171. return typeof obj;
  172. } : function (obj) {
  173. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  174. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
  175. }
  176. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  177. /***/ }),
  178. /***/ 130:
  179. /*!**********************************************************************!*\
  180. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/groupApi.js ***!
  181. \**********************************************************************/
  182. /*! no static exports found */
  183. /***/ (function(module, exports, __webpack_require__) {
  184. "use strict";
  185. Object.defineProperty(exports, "__esModule", {
  186. value: true
  187. });
  188. exports.createGroup = createGroup;
  189. exports.deleteGroupById = deleteGroupById;
  190. exports.getGroupById = getGroupById;
  191. exports.getGroupByList = getGroupByList;
  192. exports.getGroupView = getGroupView;
  193. exports.updateGroup = updateGroup;
  194. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  195. /**
  196. * 获取部门列表
  197. * @returns
  198. */
  199. function getGroupByList() {
  200. return (0, _request.request)({
  201. url: '/group',
  202. method: 'GET'
  203. });
  204. }
  205. /**
  206. * 根据ID获取
  207. * @returns
  208. * @param groupId
  209. */
  210. function getGroupById(groupId) {
  211. return (0, _request.request)({
  212. url: "/group/".concat(groupId),
  213. method: 'GET'
  214. });
  215. }
  216. /**
  217. * 添加部门
  218. * @param data
  219. * @returns
  220. */
  221. function createGroup(data) {
  222. return (0, _request.request)({
  223. url: "/group/add",
  224. method: 'POST',
  225. data: data
  226. });
  227. }
  228. /**
  229. * 更新部门
  230. * @param data
  231. * @returns
  232. */
  233. function updateGroup(data) {
  234. return (0, _request.request)({
  235. url: "/group/update",
  236. method: 'PUT',
  237. data: data
  238. });
  239. }
  240. /**
  241. * 删除部门
  242. * @returns
  243. * @param groupId
  244. */
  245. function deleteGroupById(groupId) {
  246. return (0, _request.request)({
  247. url: "/group/".concat(groupId),
  248. method: 'DELETE'
  249. });
  250. }
  251. /**
  252. * 获取部门列表
  253. * @returns
  254. */
  255. function getGroupView() {
  256. return (0, _request.request)({
  257. url: '/group/view',
  258. method: 'GET'
  259. });
  260. }
  261. /***/ }),
  262. /***/ 131:
  263. /*!*************************************************************!*\
  264. !*** E:/work/Project_newGit/hptwxMiniProgram/api/danger.js ***!
  265. \*************************************************************/
  266. /*! no static exports found */
  267. /***/ (function(module, exports, __webpack_require__) {
  268. "use strict";
  269. Object.defineProperty(exports, "__esModule", {
  270. value: true
  271. });
  272. exports.getDangerCatByList = getDangerCatByList;
  273. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  274. /**
  275. * 列表查询Danger Category
  276. * @returns
  277. */
  278. function getDangerCatByList() {
  279. return (0, _request.request)({
  280. url: '/danger/cat',
  281. method: 'GET'
  282. });
  283. }
  284. /***/ }),
  285. /***/ 132:
  286. /*!****************************************************************!*\
  287. !*** E:/work/Project_newGit/hptwxMiniProgram/api/riskPiont.js ***!
  288. \****************************************************************/
  289. /*! no static exports found */
  290. /***/ (function(module, exports, __webpack_require__) {
  291. "use strict";
  292. Object.defineProperty(exports, "__esModule", {
  293. value: true
  294. });
  295. exports.getRiskPointByList = getRiskPointByList;
  296. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  297. /**
  298. * 列表查询
  299. * @returns
  300. */
  301. function getRiskPointByList(data) {
  302. return (0, _request.request)({
  303. url: '/riskPoint',
  304. method: 'GET',
  305. params: data
  306. });
  307. }
  308. /***/ }),
  309. /***/ 133:
  310. /*!***********************************************************************!*\
  311. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/dangerApi.js ***!
  312. \***********************************************************************/
  313. /*! no static exports found */
  314. /***/ (function(module, exports, __webpack_require__) {
  315. "use strict";
  316. Object.defineProperty(exports, "__esModule", {
  317. value: true
  318. });
  319. exports.deleteDangerById = deleteDangerById;
  320. exports.getDangerById = getDangerById;
  321. exports.getDangerByList = getDangerByList;
  322. exports.getDangerByPage = getDangerByPage;
  323. exports.handleDanger = handleDanger;
  324. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  325. /**
  326. * 获取Danger列表
  327. * @param data
  328. * @returns
  329. */
  330. function getDangerByList(data) {
  331. return (0, _request.request)({
  332. url: '/danger',
  333. method: 'GET',
  334. params: data
  335. });
  336. }
  337. /**
  338. * 获取Danger分页
  339. * @param data
  340. * @returns
  341. */
  342. function getDangerByPage(data) {
  343. return (0, _request.request)({
  344. url: '/danger/page',
  345. method: 'GET',
  346. params: data
  347. });
  348. }
  349. /**
  350. * 根据Id获取Danger
  351. * @param dangerId
  352. * @returns
  353. */
  354. function getDangerById(dangerId) {
  355. return (0, _request.request)({
  356. url: "/danger/".concat(dangerId),
  357. method: 'GET'
  358. });
  359. }
  360. /**
  361. * 删除Danger
  362. * @param dangerId
  363. * @returns
  364. */
  365. function deleteDangerById(dangerId) {
  366. return (0, _request.request)({
  367. url: "/danger/".concat(dangerId),
  368. method: 'DELETE'
  369. });
  370. }
  371. /**
  372. * 处理Danger
  373. * @param data
  374. * @returns
  375. */
  376. function handleDanger(data) {
  377. return (0, _request.request)({
  378. url: "/danger/handle",
  379. method: 'POST',
  380. data: data
  381. });
  382. }
  383. /***/ }),
  384. /***/ 134:
  385. /*!********************************************************************!*\
  386. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/upload.js ***!
  387. \********************************************************************/
  388. /*! no static exports found */
  389. /***/ (function(module, exports, __webpack_require__) {
  390. "use strict";
  391. /* WEBPACK VAR INJECTION */(function(uni) {
  392. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  393. Object.defineProperty(exports, "__esModule", {
  394. value: true
  395. });
  396. exports.upload = void 0;
  397. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  398. var _auth = __webpack_require__(/*! @/utils/auth.js */ 49);
  399. var _index = _interopRequireDefault(__webpack_require__(/*! @/config/index.js */ 46));
  400. var baseUrl = true ? _index.default.base.dev : undefined;
  401. var upload = function upload(_ref) {
  402. var formData = _ref.formData,
  403. filePath = _ref.filePath,
  404. callback = _ref.callback;
  405. uni.showLoading({
  406. mask: true,
  407. title: "上传中"
  408. });
  409. var unionid = uni.getStorageSync('unionid');
  410. var qrcode = uni.getStorageSync('qrcode');
  411. var isAccount = uni.getStorageSync('isAccount');
  412. return new Promise(function (resolve, reject) {
  413. var _header;
  414. var uploadTask = uni.uploadFile({
  415. url: baseUrl + '/upload/file',
  416. filePath: filePath,
  417. header: (_header = {}, (0, _defineProperty2.default)(_header, _index.default.TokenKey, (0, _auth.getToken)()), (0, _defineProperty2.default)(_header, "AppID", _index.default.appID), (0, _defineProperty2.default)(_header, "AppKey", _index.default.appKey), (0, _defineProperty2.default)(_header, "AppSecret", _index.default.appSecret), (0, _defineProperty2.default)(_header, "wxCode", unionid), (0, _defineProperty2.default)(_header, "ocId", qrcode.ocId), (0, _defineProperty2.default)(_header, "AppType", 'mini'), (0, _defineProperty2.default)(_header, "isAccount", isAccount), _header),
  418. name: 'file',
  419. formData: formData,
  420. success: function success(uploadFileRes) {
  421. uni.hideLoading();
  422. resolve(uploadFileRes.data);
  423. },
  424. fail: function fail(_ref2) {
  425. var errMsg = _ref2.errMsg;
  426. uni.hideLoading({
  427. mask: true,
  428. title: "上传失败"
  429. });
  430. reject(errMsg);
  431. }
  432. });
  433. if (callback) {
  434. callback(uploadTask);
  435. }
  436. });
  437. };
  438. exports.upload = upload;
  439. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  440. /***/ }),
  441. /***/ 14:
  442. /*!************************************************************!*\
  443. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  444. \************************************************************/
  445. /*! no static exports found */
  446. /***/ (function(module, exports, __webpack_require__) {
  447. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  448. function _toPrimitive(input, hint) {
  449. if (_typeof(input) !== "object" || input === null) return input;
  450. var prim = input[Symbol.toPrimitive];
  451. if (prim !== undefined) {
  452. var res = prim.call(input, hint || "default");
  453. if (_typeof(res) !== "object") return res;
  454. throw new TypeError("@@toPrimitive must return a primitive value.");
  455. }
  456. return (hint === "string" ? String : Number)(input);
  457. }
  458. module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  459. /***/ }),
  460. /***/ 15:
  461. /*!**********************************************************!*\
  462. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  463. \**********************************************************/
  464. /*! no static exports found */
  465. /***/ (function(module, exports, __webpack_require__) {
  466. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  467. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  468. function _construct(Parent, args, Class) {
  469. if (isNativeReflectConstruct()) {
  470. module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
  471. } else {
  472. module.exports = _construct = function _construct(Parent, args, Class) {
  473. var a = [null];
  474. a.push.apply(a, args);
  475. var Constructor = Function.bind.apply(Parent, a);
  476. var instance = new Constructor();
  477. if (Class) setPrototypeOf(instance, Class.prototype);
  478. return instance;
  479. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  480. }
  481. return _construct.apply(null, arguments);
  482. }
  483. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  484. /***/ }),
  485. /***/ 16:
  486. /*!***************************************************************!*\
  487. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  488. \***************************************************************/
  489. /*! no static exports found */
  490. /***/ (function(module, exports) {
  491. function _setPrototypeOf(o, p) {
  492. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  493. o.__proto__ = p;
  494. return o;
  495. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  496. return _setPrototypeOf(o, p);
  497. }
  498. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  499. /***/ }),
  500. /***/ 17:
  501. /*!*************************************************************************!*\
  502. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  503. \*************************************************************************/
  504. /*! no static exports found */
  505. /***/ (function(module, exports) {
  506. function _isNativeReflectConstruct() {
  507. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  508. if (Reflect.construct.sham) return false;
  509. if (typeof Proxy === "function") return true;
  510. try {
  511. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  512. return true;
  513. } catch (e) {
  514. return false;
  515. }
  516. }
  517. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  518. /***/ }),
  519. /***/ 18:
  520. /*!******************************************************************!*\
  521. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  522. \******************************************************************/
  523. /*! no static exports found */
  524. /***/ (function(module, exports, __webpack_require__) {
  525. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  526. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  527. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  528. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  529. function _toConsumableArray(arr) {
  530. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  531. }
  532. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  533. /***/ }),
  534. /***/ 181:
  535. /*!************************************************************************************!*\
  536. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/checklistHazardRecordApi.js ***!
  537. \************************************************************************************/
  538. /*! no static exports found */
  539. /***/ (function(module, exports, __webpack_require__) {
  540. "use strict";
  541. Object.defineProperty(exports, "__esModule", {
  542. value: true
  543. });
  544. exports.batchUpdateChecklistHazardRecordDoing = batchUpdateChecklistHazardRecordDoing;
  545. exports.cancelChecklistDoing = cancelChecklistDoing;
  546. exports.completeChecklistDoing = completeChecklistDoing;
  547. exports.getChecklistHazardRecordViewById = getChecklistHazardRecordViewById;
  548. exports.initChecklistHazardRecord = initChecklistHazardRecord;
  549. exports.updateChecklistHazardRecordDoing = updateChecklistHazardRecordDoing;
  550. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  551. /**
  552. * 根据Id获取Checklist Score Record Data
  553. * @param recordId
  554. * @param checklistId
  555. * @returns
  556. */
  557. function getChecklistHazardRecordViewById(recordId, checklistId) {
  558. return (0, _request.request)({
  559. url: "/checklist/hazard/record/view/".concat(recordId, "/").concat(checklistId),
  560. method: 'GET'
  561. });
  562. }
  563. /**
  564. * 初始化
  565. * @returns
  566. * @param data
  567. */
  568. function initChecklistHazardRecord(data) {
  569. return (0, _request.request)({
  570. url: "/checklist/hazard/record/init",
  571. method: 'POST',
  572. data: data
  573. });
  574. }
  575. /**
  576. * 根据Id获取Checklist Score Record Data
  577. * @param recordId
  578. * @param checklistId
  579. * @returns
  580. */
  581. function completeChecklistDoing(recordId) {
  582. return (0, _request.request)({
  583. url: "/checklist/hazard/record/complete/".concat(recordId),
  584. method: 'PUT'
  585. });
  586. }
  587. /**
  588. * 根据Id获取Checklist Score Record Data
  589. * @param recordId
  590. * @returns
  591. */
  592. function cancelChecklistDoing(recordId) {
  593. return (0, _request.request)({
  594. url: "/checklist/point/record/complete/".concat(recordId),
  595. method: 'PUT'
  596. });
  597. }
  598. /**
  599. * 更新CheckTaskDoing Item
  600. * @param data
  601. * @returns
  602. */
  603. function updateChecklistHazardRecordDoing(data) {
  604. return (0, _request.request)({
  605. url: "/checklist/hazard/record/doing/update",
  606. method: 'PUT',
  607. data: data
  608. });
  609. }
  610. /**
  611. * 批量更新CheckTaskDoing Item
  612. * @returns
  613. * @param recordId
  614. * @param checkResult
  615. */
  616. function batchUpdateChecklistHazardRecordDoing(recordId, checkResult) {
  617. return (0, _request.request)({
  618. url: "/checklist/hazard/record/doing/batchUpdate/".concat(recordId, "/").concat(checkResult),
  619. method: 'PUT'
  620. });
  621. }
  622. /***/ }),
  623. /***/ 19:
  624. /*!******************************************************************!*\
  625. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  626. \******************************************************************/
  627. /*! no static exports found */
  628. /***/ (function(module, exports, __webpack_require__) {
  629. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  630. function _arrayWithoutHoles(arr) {
  631. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  632. }
  633. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  634. /***/ }),
  635. /***/ 2:
  636. /*!************************************************************!*\
  637. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  638. \************************************************************/
  639. /*! no static exports found */
  640. /***/ (function(module, exports, __webpack_require__) {
  641. "use strict";
  642. /* WEBPACK VAR INJECTION */(function(wx, global) {
  643. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  644. Object.defineProperty(exports, "__esModule", {
  645. value: true
  646. });
  647. exports.createApp = createApp;
  648. exports.createComponent = createComponent;
  649. exports.createPage = createPage;
  650. exports.createPlugin = createPlugin;
  651. exports.createSubpackageApp = createSubpackageApp;
  652. exports.default = void 0;
  653. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  654. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  655. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  656. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  657. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  658. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  659. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  660. 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; }
  661. 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; }
  662. var realAtob;
  663. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  664. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  665. if (typeof atob !== 'function') {
  666. realAtob = function realAtob(str) {
  667. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  668. if (!b64re.test(str)) {
  669. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  670. }
  671. // Adding the padding if missing, for semplicity
  672. str += '=='.slice(2 - (str.length & 3));
  673. var bitmap;
  674. var result = '';
  675. var r1;
  676. var r2;
  677. var i = 0;
  678. for (; i < str.length;) {
  679. 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++)));
  680. 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);
  681. }
  682. return result;
  683. };
  684. } else {
  685. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  686. realAtob = atob;
  687. }
  688. function b64DecodeUnicode(str) {
  689. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  690. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  691. }).join(''));
  692. }
  693. function getCurrentUserInfo() {
  694. var token = wx.getStorageSync('uni_id_token') || '';
  695. var tokenArr = token.split('.');
  696. if (!token || tokenArr.length !== 3) {
  697. return {
  698. uid: null,
  699. role: [],
  700. permission: [],
  701. tokenExpired: 0
  702. };
  703. }
  704. var userInfo;
  705. try {
  706. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  707. } catch (error) {
  708. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  709. }
  710. userInfo.tokenExpired = userInfo.exp * 1000;
  711. delete userInfo.exp;
  712. delete userInfo.iat;
  713. return userInfo;
  714. }
  715. function uniIdMixin(Vue) {
  716. Vue.prototype.uniIDHasRole = function (roleId) {
  717. var _getCurrentUserInfo = getCurrentUserInfo(),
  718. role = _getCurrentUserInfo.role;
  719. return role.indexOf(roleId) > -1;
  720. };
  721. Vue.prototype.uniIDHasPermission = function (permissionId) {
  722. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  723. permission = _getCurrentUserInfo2.permission;
  724. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  725. };
  726. Vue.prototype.uniIDTokenValid = function () {
  727. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  728. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  729. return tokenExpired > Date.now();
  730. };
  731. }
  732. var _toString = Object.prototype.toString;
  733. var hasOwnProperty = Object.prototype.hasOwnProperty;
  734. function isFn(fn) {
  735. return typeof fn === 'function';
  736. }
  737. function isStr(str) {
  738. return typeof str === 'string';
  739. }
  740. function isObject(obj) {
  741. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  742. }
  743. function isPlainObject(obj) {
  744. return _toString.call(obj) === '[object Object]';
  745. }
  746. function hasOwn(obj, key) {
  747. return hasOwnProperty.call(obj, key);
  748. }
  749. function noop() {}
  750. /**
  751. * Create a cached version of a pure function.
  752. */
  753. function cached(fn) {
  754. var cache = Object.create(null);
  755. return function cachedFn(str) {
  756. var hit = cache[str];
  757. return hit || (cache[str] = fn(str));
  758. };
  759. }
  760. /**
  761. * Camelize a hyphen-delimited string.
  762. */
  763. var camelizeRE = /-(\w)/g;
  764. var camelize = cached(function (str) {
  765. return str.replace(camelizeRE, function (_, c) {
  766. return c ? c.toUpperCase() : '';
  767. });
  768. });
  769. function sortObject(obj) {
  770. var sortObj = {};
  771. if (isPlainObject(obj)) {
  772. Object.keys(obj).sort().forEach(function (key) {
  773. sortObj[key] = obj[key];
  774. });
  775. }
  776. return !Object.keys(sortObj) ? obj : sortObj;
  777. }
  778. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  779. var globalInterceptors = {};
  780. var scopedInterceptors = {};
  781. function mergeHook(parentVal, childVal) {
  782. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  783. return res ? dedupeHooks(res) : res;
  784. }
  785. function dedupeHooks(hooks) {
  786. var res = [];
  787. for (var i = 0; i < hooks.length; i++) {
  788. if (res.indexOf(hooks[i]) === -1) {
  789. res.push(hooks[i]);
  790. }
  791. }
  792. return res;
  793. }
  794. function removeHook(hooks, hook) {
  795. var index = hooks.indexOf(hook);
  796. if (index !== -1) {
  797. hooks.splice(index, 1);
  798. }
  799. }
  800. function mergeInterceptorHook(interceptor, option) {
  801. Object.keys(option).forEach(function (hook) {
  802. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  803. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  804. }
  805. });
  806. }
  807. function removeInterceptorHook(interceptor, option) {
  808. if (!interceptor || !option) {
  809. return;
  810. }
  811. Object.keys(option).forEach(function (hook) {
  812. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  813. removeHook(interceptor[hook], option[hook]);
  814. }
  815. });
  816. }
  817. function addInterceptor(method, option) {
  818. if (typeof method === 'string' && isPlainObject(option)) {
  819. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  820. } else if (isPlainObject(method)) {
  821. mergeInterceptorHook(globalInterceptors, method);
  822. }
  823. }
  824. function removeInterceptor(method, option) {
  825. if (typeof method === 'string') {
  826. if (isPlainObject(option)) {
  827. removeInterceptorHook(scopedInterceptors[method], option);
  828. } else {
  829. delete scopedInterceptors[method];
  830. }
  831. } else if (isPlainObject(method)) {
  832. removeInterceptorHook(globalInterceptors, method);
  833. }
  834. }
  835. function wrapperHook(hook, params) {
  836. return function (data) {
  837. return hook(data, params) || data;
  838. };
  839. }
  840. function isPromise(obj) {
  841. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  842. }
  843. function queue(hooks, data, params) {
  844. var promise = false;
  845. for (var i = 0; i < hooks.length; i++) {
  846. var hook = hooks[i];
  847. if (promise) {
  848. promise = Promise.resolve(wrapperHook(hook, params));
  849. } else {
  850. var res = hook(data, params);
  851. if (isPromise(res)) {
  852. promise = Promise.resolve(res);
  853. }
  854. if (res === false) {
  855. return {
  856. then: function then() {}
  857. };
  858. }
  859. }
  860. }
  861. return promise || {
  862. then: function then(callback) {
  863. return callback(data);
  864. }
  865. };
  866. }
  867. function wrapperOptions(interceptor) {
  868. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  869. ['success', 'fail', 'complete'].forEach(function (name) {
  870. if (Array.isArray(interceptor[name])) {
  871. var oldCallback = options[name];
  872. options[name] = function callbackInterceptor(res) {
  873. queue(interceptor[name], res, options).then(function (res) {
  874. /* eslint-disable no-mixed-operators */
  875. return isFn(oldCallback) && oldCallback(res) || res;
  876. });
  877. };
  878. }
  879. });
  880. return options;
  881. }
  882. function wrapperReturnValue(method, returnValue) {
  883. var returnValueHooks = [];
  884. if (Array.isArray(globalInterceptors.returnValue)) {
  885. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  886. }
  887. var interceptor = scopedInterceptors[method];
  888. if (interceptor && Array.isArray(interceptor.returnValue)) {
  889. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  890. }
  891. returnValueHooks.forEach(function (hook) {
  892. returnValue = hook(returnValue) || returnValue;
  893. });
  894. return returnValue;
  895. }
  896. function getApiInterceptorHooks(method) {
  897. var interceptor = Object.create(null);
  898. Object.keys(globalInterceptors).forEach(function (hook) {
  899. if (hook !== 'returnValue') {
  900. interceptor[hook] = globalInterceptors[hook].slice();
  901. }
  902. });
  903. var scopedInterceptor = scopedInterceptors[method];
  904. if (scopedInterceptor) {
  905. Object.keys(scopedInterceptor).forEach(function (hook) {
  906. if (hook !== 'returnValue') {
  907. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  908. }
  909. });
  910. }
  911. return interceptor;
  912. }
  913. function invokeApi(method, api, options) {
  914. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  915. params[_key - 3] = arguments[_key];
  916. }
  917. var interceptor = getApiInterceptorHooks(method);
  918. if (interceptor && Object.keys(interceptor).length) {
  919. if (Array.isArray(interceptor.invoke)) {
  920. var res = queue(interceptor.invoke, options);
  921. return res.then(function (options) {
  922. // 重新访问 getApiInterceptorHooks, 允许 invoke 中再次调用 addInterceptor,removeInterceptor
  923. return api.apply(void 0, [wrapperOptions(getApiInterceptorHooks(method), options)].concat(params));
  924. });
  925. } else {
  926. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  927. }
  928. }
  929. return api.apply(void 0, [options].concat(params));
  930. }
  931. var promiseInterceptor = {
  932. returnValue: function returnValue(res) {
  933. if (!isPromise(res)) {
  934. return res;
  935. }
  936. return new Promise(function (resolve, reject) {
  937. res.then(function (res) {
  938. if (res[0]) {
  939. reject(res[0]);
  940. } else {
  941. resolve(res[1]);
  942. }
  943. });
  944. });
  945. }
  946. };
  947. 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/;
  948. var CONTEXT_API_RE = /^create|Manager$/;
  949. // Context例外情况
  950. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  951. // 同步例外情况
  952. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  953. var CALLBACK_API_RE = /^on|^off/;
  954. function isContextApi(name) {
  955. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  956. }
  957. function isSyncApi(name) {
  958. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  959. }
  960. function isCallbackApi(name) {
  961. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  962. }
  963. function handlePromise(promise) {
  964. return promise.then(function (data) {
  965. return [null, data];
  966. }).catch(function (err) {
  967. return [err];
  968. });
  969. }
  970. function shouldPromise(name) {
  971. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  972. return false;
  973. }
  974. return true;
  975. }
  976. /* eslint-disable no-extend-native */
  977. if (!Promise.prototype.finally) {
  978. Promise.prototype.finally = function (callback) {
  979. var promise = this.constructor;
  980. return this.then(function (value) {
  981. return promise.resolve(callback()).then(function () {
  982. return value;
  983. });
  984. }, function (reason) {
  985. return promise.resolve(callback()).then(function () {
  986. throw reason;
  987. });
  988. });
  989. };
  990. }
  991. function promisify(name, api) {
  992. if (!shouldPromise(name) || !isFn(api)) {
  993. return api;
  994. }
  995. return function promiseApi() {
  996. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  997. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  998. params[_key2 - 1] = arguments[_key2];
  999. }
  1000. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  1001. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  1002. }
  1003. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  1004. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  1005. success: resolve,
  1006. fail: reject
  1007. })].concat(params));
  1008. })));
  1009. };
  1010. }
  1011. var EPS = 1e-4;
  1012. var BASE_DEVICE_WIDTH = 750;
  1013. var isIOS = false;
  1014. var deviceWidth = 0;
  1015. var deviceDPR = 0;
  1016. function checkDeviceWidth() {
  1017. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  1018. platform = _wx$getSystemInfoSync.platform,
  1019. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  1020. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  1021. deviceWidth = windowWidth;
  1022. deviceDPR = pixelRatio;
  1023. isIOS = platform === 'ios';
  1024. }
  1025. function upx2px(number, newDeviceWidth) {
  1026. if (deviceWidth === 0) {
  1027. checkDeviceWidth();
  1028. }
  1029. number = Number(number);
  1030. if (number === 0) {
  1031. return 0;
  1032. }
  1033. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  1034. if (result < 0) {
  1035. result = -result;
  1036. }
  1037. result = Math.floor(result + EPS);
  1038. if (result === 0) {
  1039. if (deviceDPR === 1 || !isIOS) {
  1040. result = 1;
  1041. } else {
  1042. result = 0.5;
  1043. }
  1044. }
  1045. return number < 0 ? -result : result;
  1046. }
  1047. var LOCALE_ZH_HANS = 'zh-Hans';
  1048. var LOCALE_ZH_HANT = 'zh-Hant';
  1049. var LOCALE_EN = 'en';
  1050. var LOCALE_FR = 'fr';
  1051. var LOCALE_ES = 'es';
  1052. var messages = {};
  1053. var locale;
  1054. {
  1055. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1056. }
  1057. function initI18nMessages() {
  1058. if (!isEnableLocale()) {
  1059. return;
  1060. }
  1061. var localeKeys = Object.keys(__uniConfig.locales);
  1062. if (localeKeys.length) {
  1063. localeKeys.forEach(function (locale) {
  1064. var curMessages = messages[locale];
  1065. var userMessages = __uniConfig.locales[locale];
  1066. if (curMessages) {
  1067. Object.assign(curMessages, userMessages);
  1068. } else {
  1069. messages[locale] = userMessages;
  1070. }
  1071. });
  1072. }
  1073. }
  1074. initI18nMessages();
  1075. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  1076. var t = i18n.t;
  1077. var i18nMixin = i18n.mixin = {
  1078. beforeCreate: function beforeCreate() {
  1079. var _this = this;
  1080. var unwatch = i18n.i18n.watchLocale(function () {
  1081. _this.$forceUpdate();
  1082. });
  1083. this.$once('hook:beforeDestroy', function () {
  1084. unwatch();
  1085. });
  1086. },
  1087. methods: {
  1088. $$t: function $$t(key, values) {
  1089. return t(key, values);
  1090. }
  1091. }
  1092. };
  1093. var setLocale = i18n.setLocale;
  1094. var getLocale = i18n.getLocale;
  1095. function initAppLocale(Vue, appVm, locale) {
  1096. var state = Vue.observable({
  1097. locale: locale || i18n.getLocale()
  1098. });
  1099. var localeWatchers = [];
  1100. appVm.$watchLocale = function (fn) {
  1101. localeWatchers.push(fn);
  1102. };
  1103. Object.defineProperty(appVm, '$locale', {
  1104. get: function get() {
  1105. return state.locale;
  1106. },
  1107. set: function set(v) {
  1108. state.locale = v;
  1109. localeWatchers.forEach(function (watch) {
  1110. return watch(v);
  1111. });
  1112. }
  1113. });
  1114. }
  1115. function isEnableLocale() {
  1116. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  1117. }
  1118. function include(str, parts) {
  1119. return !!parts.find(function (part) {
  1120. return str.indexOf(part) !== -1;
  1121. });
  1122. }
  1123. function startsWith(str, parts) {
  1124. return parts.find(function (part) {
  1125. return str.indexOf(part) === 0;
  1126. });
  1127. }
  1128. function normalizeLocale(locale, messages) {
  1129. if (!locale) {
  1130. return;
  1131. }
  1132. locale = locale.trim().replace(/_/g, '-');
  1133. if (messages && messages[locale]) {
  1134. return locale;
  1135. }
  1136. locale = locale.toLowerCase();
  1137. if (locale === 'chinese') {
  1138. // 支付宝
  1139. return LOCALE_ZH_HANS;
  1140. }
  1141. if (locale.indexOf('zh') === 0) {
  1142. if (locale.indexOf('-hans') > -1) {
  1143. return LOCALE_ZH_HANS;
  1144. }
  1145. if (locale.indexOf('-hant') > -1) {
  1146. return LOCALE_ZH_HANT;
  1147. }
  1148. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  1149. return LOCALE_ZH_HANT;
  1150. }
  1151. return LOCALE_ZH_HANS;
  1152. }
  1153. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  1154. if (lang) {
  1155. return lang;
  1156. }
  1157. }
  1158. // export function initI18n() {
  1159. // const localeKeys = Object.keys(__uniConfig.locales || {})
  1160. // if (localeKeys.length) {
  1161. // localeKeys.forEach((locale) =>
  1162. // i18n.add(locale, __uniConfig.locales[locale])
  1163. // )
  1164. // }
  1165. // }
  1166. function getLocale$1() {
  1167. // 优先使用 $locale
  1168. if (isFn(getApp)) {
  1169. var app = getApp({
  1170. allowDefault: true
  1171. });
  1172. if (app && app.$vm) {
  1173. return app.$vm.$locale;
  1174. }
  1175. }
  1176. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1177. }
  1178. function setLocale$1(locale) {
  1179. var app = isFn(getApp) ? getApp() : false;
  1180. if (!app) {
  1181. return false;
  1182. }
  1183. var oldLocale = app.$vm.$locale;
  1184. if (oldLocale !== locale) {
  1185. app.$vm.$locale = locale;
  1186. onLocaleChangeCallbacks.forEach(function (fn) {
  1187. return fn({
  1188. locale: locale
  1189. });
  1190. });
  1191. return true;
  1192. }
  1193. return false;
  1194. }
  1195. var onLocaleChangeCallbacks = [];
  1196. function onLocaleChange(fn) {
  1197. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  1198. onLocaleChangeCallbacks.push(fn);
  1199. }
  1200. }
  1201. if (typeof global !== 'undefined') {
  1202. global.getLocale = getLocale$1;
  1203. }
  1204. var interceptors = {
  1205. promiseInterceptor: promiseInterceptor
  1206. };
  1207. var baseApi = /*#__PURE__*/Object.freeze({
  1208. __proto__: null,
  1209. upx2px: upx2px,
  1210. getLocale: getLocale$1,
  1211. setLocale: setLocale$1,
  1212. onLocaleChange: onLocaleChange,
  1213. addInterceptor: addInterceptor,
  1214. removeInterceptor: removeInterceptor,
  1215. interceptors: interceptors
  1216. });
  1217. function findExistsPageIndex(url) {
  1218. var pages = getCurrentPages();
  1219. var len = pages.length;
  1220. while (len--) {
  1221. var page = pages[len];
  1222. if (page.$page && page.$page.fullPath === url) {
  1223. return len;
  1224. }
  1225. }
  1226. return -1;
  1227. }
  1228. var redirectTo = {
  1229. name: function name(fromArgs) {
  1230. if (fromArgs.exists === 'back' && fromArgs.delta) {
  1231. return 'navigateBack';
  1232. }
  1233. return 'redirectTo';
  1234. },
  1235. args: function args(fromArgs) {
  1236. if (fromArgs.exists === 'back' && fromArgs.url) {
  1237. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  1238. if (existsPageIndex !== -1) {
  1239. var delta = getCurrentPages().length - 1 - existsPageIndex;
  1240. if (delta > 0) {
  1241. fromArgs.delta = delta;
  1242. }
  1243. }
  1244. }
  1245. }
  1246. };
  1247. var previewImage = {
  1248. args: function args(fromArgs) {
  1249. var currentIndex = parseInt(fromArgs.current);
  1250. if (isNaN(currentIndex)) {
  1251. return;
  1252. }
  1253. var urls = fromArgs.urls;
  1254. if (!Array.isArray(urls)) {
  1255. return;
  1256. }
  1257. var len = urls.length;
  1258. if (!len) {
  1259. return;
  1260. }
  1261. if (currentIndex < 0) {
  1262. currentIndex = 0;
  1263. } else if (currentIndex >= len) {
  1264. currentIndex = len - 1;
  1265. }
  1266. if (currentIndex > 0) {
  1267. fromArgs.current = urls[currentIndex];
  1268. fromArgs.urls = urls.filter(function (item, index) {
  1269. return index < currentIndex ? item !== urls[currentIndex] : true;
  1270. });
  1271. } else {
  1272. fromArgs.current = urls[0];
  1273. }
  1274. return {
  1275. indicator: false,
  1276. loop: false
  1277. };
  1278. }
  1279. };
  1280. var UUID_KEY = '__DC_STAT_UUID';
  1281. var deviceId;
  1282. function useDeviceId(result) {
  1283. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  1284. if (!deviceId) {
  1285. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  1286. wx.setStorage({
  1287. key: UUID_KEY,
  1288. data: deviceId
  1289. });
  1290. }
  1291. result.deviceId = deviceId;
  1292. }
  1293. function addSafeAreaInsets(result) {
  1294. if (result.safeArea) {
  1295. var safeArea = result.safeArea;
  1296. result.safeAreaInsets = {
  1297. top: safeArea.top,
  1298. left: safeArea.left,
  1299. right: result.windowWidth - safeArea.right,
  1300. bottom: result.screenHeight - safeArea.bottom
  1301. };
  1302. }
  1303. }
  1304. function populateParameters(result) {
  1305. var _result$brand = result.brand,
  1306. brand = _result$brand === void 0 ? '' : _result$brand,
  1307. _result$model = result.model,
  1308. model = _result$model === void 0 ? '' : _result$model,
  1309. _result$system = result.system,
  1310. system = _result$system === void 0 ? '' : _result$system,
  1311. _result$language = result.language,
  1312. language = _result$language === void 0 ? '' : _result$language,
  1313. theme = result.theme,
  1314. version = result.version,
  1315. platform = result.platform,
  1316. fontSizeSetting = result.fontSizeSetting,
  1317. SDKVersion = result.SDKVersion,
  1318. pixelRatio = result.pixelRatio,
  1319. deviceOrientation = result.deviceOrientation;
  1320. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  1321. var extraParam = {};
  1322. // osName osVersion
  1323. var osName = '';
  1324. var osVersion = '';
  1325. {
  1326. osName = system.split(' ')[0] || '';
  1327. osVersion = system.split(' ')[1] || '';
  1328. }
  1329. var hostVersion = version;
  1330. // deviceType
  1331. var deviceType = getGetDeviceType(result, model);
  1332. // deviceModel
  1333. var deviceBrand = getDeviceBrand(brand);
  1334. // hostName
  1335. var _hostName = getHostName(result);
  1336. // deviceOrientation
  1337. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  1338. // devicePixelRatio
  1339. var _devicePixelRatio = pixelRatio;
  1340. // SDKVersion
  1341. var _SDKVersion = SDKVersion;
  1342. // hostLanguage
  1343. var hostLanguage = language.replace(/_/g, '-');
  1344. // wx.getAccountInfoSync
  1345. var parameters = {
  1346. appId: "__UNI__2E20170",
  1347. appName: "hptwxMiniProgram",
  1348. appVersion: "1.0.0",
  1349. appVersionCode: "100",
  1350. appLanguage: getAppLanguage(hostLanguage),
  1351. uniCompileVersion: "3.99",
  1352. uniRuntimeVersion: "3.99",
  1353. uniPlatform: undefined || "mp-weixin",
  1354. deviceBrand: deviceBrand,
  1355. deviceModel: model,
  1356. deviceType: deviceType,
  1357. devicePixelRatio: _devicePixelRatio,
  1358. deviceOrientation: _deviceOrientation,
  1359. osName: osName.toLocaleLowerCase(),
  1360. osVersion: osVersion,
  1361. hostTheme: theme,
  1362. hostVersion: hostVersion,
  1363. hostLanguage: hostLanguage,
  1364. hostName: _hostName,
  1365. hostSDKVersion: _SDKVersion,
  1366. hostFontSizeSetting: fontSizeSetting,
  1367. windowTop: 0,
  1368. windowBottom: 0,
  1369. // TODO
  1370. osLanguage: undefined,
  1371. osTheme: undefined,
  1372. ua: undefined,
  1373. hostPackageName: undefined,
  1374. browserName: undefined,
  1375. browserVersion: undefined
  1376. };
  1377. Object.assign(result, parameters, extraParam);
  1378. }
  1379. function getGetDeviceType(result, model) {
  1380. var deviceType = result.deviceType || 'phone';
  1381. {
  1382. var deviceTypeMaps = {
  1383. ipad: 'pad',
  1384. windows: 'pc',
  1385. mac: 'pc'
  1386. };
  1387. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  1388. var _model = model.toLocaleLowerCase();
  1389. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  1390. var _m = deviceTypeMapsKeys[index];
  1391. if (_model.indexOf(_m) !== -1) {
  1392. deviceType = deviceTypeMaps[_m];
  1393. break;
  1394. }
  1395. }
  1396. }
  1397. return deviceType;
  1398. }
  1399. function getDeviceBrand(brand) {
  1400. var deviceBrand = brand;
  1401. if (deviceBrand) {
  1402. deviceBrand = brand.toLocaleLowerCase();
  1403. }
  1404. return deviceBrand;
  1405. }
  1406. function getAppLanguage(defaultLanguage) {
  1407. return getLocale$1 ? getLocale$1() : defaultLanguage;
  1408. }
  1409. function getHostName(result) {
  1410. var _platform = 'WeChat';
  1411. var _hostName = result.hostName || _platform; // mp-jd
  1412. {
  1413. if (result.environment) {
  1414. _hostName = result.environment;
  1415. } else if (result.host && result.host.env) {
  1416. _hostName = result.host.env;
  1417. }
  1418. }
  1419. return _hostName;
  1420. }
  1421. var getSystemInfo = {
  1422. returnValue: function returnValue(result) {
  1423. useDeviceId(result);
  1424. addSafeAreaInsets(result);
  1425. populateParameters(result);
  1426. }
  1427. };
  1428. var showActionSheet = {
  1429. args: function args(fromArgs) {
  1430. if ((0, _typeof2.default)(fromArgs) === 'object') {
  1431. fromArgs.alertText = fromArgs.title;
  1432. }
  1433. }
  1434. };
  1435. var getAppBaseInfo = {
  1436. returnValue: function returnValue(result) {
  1437. var _result = result,
  1438. version = _result.version,
  1439. language = _result.language,
  1440. SDKVersion = _result.SDKVersion,
  1441. theme = _result.theme;
  1442. var _hostName = getHostName(result);
  1443. var hostLanguage = language.replace('_', '-');
  1444. result = sortObject(Object.assign(result, {
  1445. appId: "__UNI__2E20170",
  1446. appName: "hptwxMiniProgram",
  1447. appVersion: "1.0.0",
  1448. appVersionCode: "100",
  1449. appLanguage: getAppLanguage(hostLanguage),
  1450. hostVersion: version,
  1451. hostLanguage: hostLanguage,
  1452. hostName: _hostName,
  1453. hostSDKVersion: SDKVersion,
  1454. hostTheme: theme
  1455. }));
  1456. }
  1457. };
  1458. var getDeviceInfo = {
  1459. returnValue: function returnValue(result) {
  1460. var _result2 = result,
  1461. brand = _result2.brand,
  1462. model = _result2.model;
  1463. var deviceType = getGetDeviceType(result, model);
  1464. var deviceBrand = getDeviceBrand(brand);
  1465. useDeviceId(result);
  1466. result = sortObject(Object.assign(result, {
  1467. deviceType: deviceType,
  1468. deviceBrand: deviceBrand,
  1469. deviceModel: model
  1470. }));
  1471. }
  1472. };
  1473. var getWindowInfo = {
  1474. returnValue: function returnValue(result) {
  1475. addSafeAreaInsets(result);
  1476. result = sortObject(Object.assign(result, {
  1477. windowTop: 0,
  1478. windowBottom: 0
  1479. }));
  1480. }
  1481. };
  1482. var getAppAuthorizeSetting = {
  1483. returnValue: function returnValue(result) {
  1484. var locationReducedAccuracy = result.locationReducedAccuracy;
  1485. result.locationAccuracy = 'unsupported';
  1486. if (locationReducedAccuracy === true) {
  1487. result.locationAccuracy = 'reduced';
  1488. } else if (locationReducedAccuracy === false) {
  1489. result.locationAccuracy = 'full';
  1490. }
  1491. }
  1492. };
  1493. // import navigateTo from 'uni-helpers/navigate-to'
  1494. var compressImage = {
  1495. args: function args(fromArgs) {
  1496. // https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
  1497. if (fromArgs.compressedHeight && !fromArgs.compressHeight) {
  1498. fromArgs.compressHeight = fromArgs.compressedHeight;
  1499. }
  1500. if (fromArgs.compressedWidth && !fromArgs.compressWidth) {
  1501. fromArgs.compressWidth = fromArgs.compressedWidth;
  1502. }
  1503. }
  1504. };
  1505. var protocols = {
  1506. redirectTo: redirectTo,
  1507. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  1508. previewImage: previewImage,
  1509. getSystemInfo: getSystemInfo,
  1510. getSystemInfoSync: getSystemInfo,
  1511. showActionSheet: showActionSheet,
  1512. getAppBaseInfo: getAppBaseInfo,
  1513. getDeviceInfo: getDeviceInfo,
  1514. getWindowInfo: getWindowInfo,
  1515. getAppAuthorizeSetting: getAppAuthorizeSetting,
  1516. compressImage: compressImage
  1517. };
  1518. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  1519. var canIUses = [];
  1520. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  1521. function processCallback(methodName, method, returnValue) {
  1522. return function (res) {
  1523. return method(processReturnValue(methodName, res, returnValue));
  1524. };
  1525. }
  1526. function processArgs(methodName, fromArgs) {
  1527. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  1528. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  1529. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  1530. if (isPlainObject(fromArgs)) {
  1531. // 一般 api 的参数解析
  1532. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  1533. if (isFn(argsOption)) {
  1534. argsOption = argsOption(fromArgs, toArgs) || {};
  1535. }
  1536. for (var key in fromArgs) {
  1537. if (hasOwn(argsOption, key)) {
  1538. var keyOption = argsOption[key];
  1539. if (isFn(keyOption)) {
  1540. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  1541. }
  1542. if (!keyOption) {
  1543. // 不支持的参数
  1544. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  1545. } else if (isStr(keyOption)) {
  1546. // 重写参数 key
  1547. toArgs[keyOption] = fromArgs[key];
  1548. } else if (isPlainObject(keyOption)) {
  1549. // {name:newName,value:value}可重新指定参数 key:value
  1550. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  1551. }
  1552. } else if (CALLBACKS.indexOf(key) !== -1) {
  1553. if (isFn(fromArgs[key])) {
  1554. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  1555. }
  1556. } else {
  1557. if (!keepFromArgs) {
  1558. toArgs[key] = fromArgs[key];
  1559. }
  1560. }
  1561. }
  1562. return toArgs;
  1563. } else if (isFn(fromArgs)) {
  1564. fromArgs = processCallback(methodName, fromArgs, returnValue);
  1565. }
  1566. return fromArgs;
  1567. }
  1568. function processReturnValue(methodName, res, returnValue) {
  1569. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  1570. if (isFn(protocols.returnValue)) {
  1571. // 处理通用 returnValue
  1572. res = protocols.returnValue(methodName, res);
  1573. }
  1574. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  1575. }
  1576. function wrapper(methodName, method) {
  1577. if (hasOwn(protocols, methodName)) {
  1578. var protocol = protocols[methodName];
  1579. if (!protocol) {
  1580. // 暂不支持的 api
  1581. return function () {
  1582. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  1583. };
  1584. }
  1585. return function (arg1, arg2) {
  1586. // 目前 api 最多两个参数
  1587. var options = protocol;
  1588. if (isFn(protocol)) {
  1589. options = protocol(arg1);
  1590. }
  1591. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  1592. var args = [arg1];
  1593. if (typeof arg2 !== 'undefined') {
  1594. args.push(arg2);
  1595. }
  1596. if (isFn(options.name)) {
  1597. methodName = options.name(arg1);
  1598. } else if (isStr(options.name)) {
  1599. methodName = options.name;
  1600. }
  1601. var returnValue = wx[methodName].apply(wx, args);
  1602. if (isSyncApi(methodName)) {
  1603. // 同步 api
  1604. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  1605. }
  1606. return returnValue;
  1607. };
  1608. }
  1609. return method;
  1610. }
  1611. var todoApis = Object.create(null);
  1612. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  1613. function createTodoApi(name) {
  1614. return function todoApi(_ref) {
  1615. var fail = _ref.fail,
  1616. complete = _ref.complete;
  1617. var res = {
  1618. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  1619. };
  1620. isFn(fail) && fail(res);
  1621. isFn(complete) && complete(res);
  1622. };
  1623. }
  1624. TODOS.forEach(function (name) {
  1625. todoApis[name] = createTodoApi(name);
  1626. });
  1627. var providers = {
  1628. oauth: ['weixin'],
  1629. share: ['weixin'],
  1630. payment: ['wxpay'],
  1631. push: ['weixin']
  1632. };
  1633. function getProvider(_ref2) {
  1634. var service = _ref2.service,
  1635. success = _ref2.success,
  1636. fail = _ref2.fail,
  1637. complete = _ref2.complete;
  1638. var res = false;
  1639. if (providers[service]) {
  1640. res = {
  1641. errMsg: 'getProvider:ok',
  1642. service: service,
  1643. provider: providers[service]
  1644. };
  1645. isFn(success) && success(res);
  1646. } else {
  1647. res = {
  1648. errMsg: 'getProvider:fail service not found'
  1649. };
  1650. isFn(fail) && fail(res);
  1651. }
  1652. isFn(complete) && complete(res);
  1653. }
  1654. var extraApi = /*#__PURE__*/Object.freeze({
  1655. __proto__: null,
  1656. getProvider: getProvider
  1657. });
  1658. var getEmitter = function () {
  1659. var Emitter;
  1660. return function getUniEmitter() {
  1661. if (!Emitter) {
  1662. Emitter = new _vue.default();
  1663. }
  1664. return Emitter;
  1665. };
  1666. }();
  1667. function apply(ctx, method, args) {
  1668. return ctx[method].apply(ctx, args);
  1669. }
  1670. function $on() {
  1671. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  1672. }
  1673. function $off() {
  1674. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  1675. }
  1676. function $once() {
  1677. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  1678. }
  1679. function $emit() {
  1680. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  1681. }
  1682. var eventApi = /*#__PURE__*/Object.freeze({
  1683. __proto__: null,
  1684. $on: $on,
  1685. $off: $off,
  1686. $once: $once,
  1687. $emit: $emit
  1688. });
  1689. /**
  1690. * 框架内 try-catch
  1691. */
  1692. /**
  1693. * 开发者 try-catch
  1694. */
  1695. function tryCatch(fn) {
  1696. return function () {
  1697. try {
  1698. return fn.apply(fn, arguments);
  1699. } catch (e) {
  1700. // TODO
  1701. console.error(e);
  1702. }
  1703. };
  1704. }
  1705. function getApiCallbacks(params) {
  1706. var apiCallbacks = {};
  1707. for (var name in params) {
  1708. var param = params[name];
  1709. if (isFn(param)) {
  1710. apiCallbacks[name] = tryCatch(param);
  1711. delete params[name];
  1712. }
  1713. }
  1714. return apiCallbacks;
  1715. }
  1716. var cid;
  1717. var cidErrMsg;
  1718. var enabled;
  1719. function normalizePushMessage(message) {
  1720. try {
  1721. return JSON.parse(message);
  1722. } catch (e) {}
  1723. return message;
  1724. }
  1725. function invokePushCallback(args) {
  1726. if (args.type === 'enabled') {
  1727. enabled = true;
  1728. } else if (args.type === 'clientId') {
  1729. cid = args.cid;
  1730. cidErrMsg = args.errMsg;
  1731. invokeGetPushCidCallbacks(cid, args.errMsg);
  1732. } else if (args.type === 'pushMsg') {
  1733. var message = {
  1734. type: 'receive',
  1735. data: normalizePushMessage(args.message)
  1736. };
  1737. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  1738. var callback = onPushMessageCallbacks[i];
  1739. callback(message);
  1740. // 该消息已被阻止
  1741. if (message.stopped) {
  1742. break;
  1743. }
  1744. }
  1745. } else if (args.type === 'click') {
  1746. onPushMessageCallbacks.forEach(function (callback) {
  1747. callback({
  1748. type: 'click',
  1749. data: normalizePushMessage(args.message)
  1750. });
  1751. });
  1752. }
  1753. }
  1754. var getPushCidCallbacks = [];
  1755. function invokeGetPushCidCallbacks(cid, errMsg) {
  1756. getPushCidCallbacks.forEach(function (callback) {
  1757. callback(cid, errMsg);
  1758. });
  1759. getPushCidCallbacks.length = 0;
  1760. }
  1761. function getPushClientId(args) {
  1762. if (!isPlainObject(args)) {
  1763. args = {};
  1764. }
  1765. var _getApiCallbacks = getApiCallbacks(args),
  1766. success = _getApiCallbacks.success,
  1767. fail = _getApiCallbacks.fail,
  1768. complete = _getApiCallbacks.complete;
  1769. var hasSuccess = isFn(success);
  1770. var hasFail = isFn(fail);
  1771. var hasComplete = isFn(complete);
  1772. Promise.resolve().then(function () {
  1773. if (typeof enabled === 'undefined') {
  1774. enabled = false;
  1775. cid = '';
  1776. cidErrMsg = 'uniPush is not enabled';
  1777. }
  1778. getPushCidCallbacks.push(function (cid, errMsg) {
  1779. var res;
  1780. if (cid) {
  1781. res = {
  1782. errMsg: 'getPushClientId:ok',
  1783. cid: cid
  1784. };
  1785. hasSuccess && success(res);
  1786. } else {
  1787. res = {
  1788. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  1789. };
  1790. hasFail && fail(res);
  1791. }
  1792. hasComplete && complete(res);
  1793. });
  1794. if (typeof cid !== 'undefined') {
  1795. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1796. }
  1797. });
  1798. }
  1799. var onPushMessageCallbacks = [];
  1800. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1801. var onPushMessage = function onPushMessage(fn) {
  1802. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1803. onPushMessageCallbacks.push(fn);
  1804. }
  1805. };
  1806. var offPushMessage = function offPushMessage(fn) {
  1807. if (!fn) {
  1808. onPushMessageCallbacks.length = 0;
  1809. } else {
  1810. var index = onPushMessageCallbacks.indexOf(fn);
  1811. if (index > -1) {
  1812. onPushMessageCallbacks.splice(index, 1);
  1813. }
  1814. }
  1815. };
  1816. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  1817. if (!baseInfo) {
  1818. baseInfo = wx.getSystemInfoSync();
  1819. }
  1820. var host = baseInfo ? baseInfo.host : null;
  1821. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  1822. var api = /*#__PURE__*/Object.freeze({
  1823. __proto__: null,
  1824. shareVideoMessage: shareVideoMessage,
  1825. getPushClientId: getPushClientId,
  1826. onPushMessage: onPushMessage,
  1827. offPushMessage: offPushMessage,
  1828. invokePushCallback: invokePushCallback
  1829. });
  1830. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1831. function findVmByVueId(vm, vuePid) {
  1832. var $children = vm.$children;
  1833. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1834. for (var i = $children.length - 1; i >= 0; i--) {
  1835. var childVm = $children[i];
  1836. if (childVm.$scope._$vueId === vuePid) {
  1837. return childVm;
  1838. }
  1839. }
  1840. // 反向递归查找
  1841. var parentVm;
  1842. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1843. parentVm = findVmByVueId($children[_i], vuePid);
  1844. if (parentVm) {
  1845. return parentVm;
  1846. }
  1847. }
  1848. }
  1849. function initBehavior(options) {
  1850. return Behavior(options);
  1851. }
  1852. function isPage() {
  1853. return !!this.route;
  1854. }
  1855. function initRelation(detail) {
  1856. this.triggerEvent('__l', detail);
  1857. }
  1858. function selectAllComponents(mpInstance, selector, $refs) {
  1859. var components = mpInstance.selectAllComponents(selector) || [];
  1860. components.forEach(function (component) {
  1861. var ref = component.dataset.ref;
  1862. $refs[ref] = component.$vm || toSkip(component);
  1863. {
  1864. if (component.dataset.vueGeneric === 'scoped') {
  1865. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1866. selectAllComponents(scopedComponent, selector, $refs);
  1867. });
  1868. }
  1869. }
  1870. });
  1871. }
  1872. function syncRefs(refs, newRefs) {
  1873. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  1874. var newKeys = Object.keys(newRefs);
  1875. newKeys.forEach(function (key) {
  1876. var oldValue = refs[key];
  1877. var newValue = newRefs[key];
  1878. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  1879. return oldValue.includes(value);
  1880. })) {
  1881. return;
  1882. }
  1883. refs[key] = newValue;
  1884. oldKeys.delete(key);
  1885. });
  1886. oldKeys.forEach(function (key) {
  1887. delete refs[key];
  1888. });
  1889. return refs;
  1890. }
  1891. function initRefs(vm) {
  1892. var mpInstance = vm.$scope;
  1893. var refs = {};
  1894. Object.defineProperty(vm, '$refs', {
  1895. get: function get() {
  1896. var $refs = {};
  1897. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1898. // TODO 暂不考虑 for 中的 scoped
  1899. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  1900. forComponents.forEach(function (component) {
  1901. var ref = component.dataset.ref;
  1902. if (!$refs[ref]) {
  1903. $refs[ref] = [];
  1904. }
  1905. $refs[ref].push(component.$vm || toSkip(component));
  1906. });
  1907. return syncRefs(refs, $refs);
  1908. }
  1909. });
  1910. }
  1911. function handleLink(event) {
  1912. var _ref3 = event.detail || event.value,
  1913. vuePid = _ref3.vuePid,
  1914. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  1915. var parentVm;
  1916. if (vuePid) {
  1917. parentVm = findVmByVueId(this.$vm, vuePid);
  1918. }
  1919. if (!parentVm) {
  1920. parentVm = this.$vm;
  1921. }
  1922. vueOptions.parent = parentVm;
  1923. }
  1924. function markMPComponent(component) {
  1925. // 在 Vue 中标记为小程序组件
  1926. var IS_MP = '__v_isMPComponent';
  1927. Object.defineProperty(component, IS_MP, {
  1928. configurable: true,
  1929. enumerable: false,
  1930. value: true
  1931. });
  1932. return component;
  1933. }
  1934. function toSkip(obj) {
  1935. var OB = '__ob__';
  1936. var SKIP = '__v_skip';
  1937. if (isObject(obj) && Object.isExtensible(obj)) {
  1938. // 避免被 @vue/composition-api 观测
  1939. Object.defineProperty(obj, OB, {
  1940. configurable: true,
  1941. enumerable: false,
  1942. value: (0, _defineProperty2.default)({}, SKIP, true)
  1943. });
  1944. }
  1945. return obj;
  1946. }
  1947. var WORKLET_RE = /_(.*)_worklet_factory_/;
  1948. function initWorkletMethods(mpMethods, vueMethods) {
  1949. if (vueMethods) {
  1950. Object.keys(vueMethods).forEach(function (name) {
  1951. var matches = name.match(WORKLET_RE);
  1952. if (matches) {
  1953. var workletName = matches[1];
  1954. mpMethods[name] = vueMethods[name];
  1955. mpMethods[workletName] = vueMethods[workletName];
  1956. }
  1957. });
  1958. }
  1959. }
  1960. var MPPage = Page;
  1961. var MPComponent = Component;
  1962. var customizeRE = /:/g;
  1963. var customize = cached(function (str) {
  1964. return camelize(str.replace(customizeRE, '-'));
  1965. });
  1966. function initTriggerEvent(mpInstance) {
  1967. var oldTriggerEvent = mpInstance.triggerEvent;
  1968. var newTriggerEvent = function newTriggerEvent(event) {
  1969. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  1970. args[_key3 - 1] = arguments[_key3];
  1971. }
  1972. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  1973. if (this.$vm || this.dataset && this.dataset.comType) {
  1974. event = customize(event);
  1975. } else {
  1976. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  1977. var newEvent = customize(event);
  1978. if (newEvent !== event) {
  1979. oldTriggerEvent.apply(this, [newEvent].concat(args));
  1980. }
  1981. }
  1982. return oldTriggerEvent.apply(this, [event].concat(args));
  1983. };
  1984. try {
  1985. // 京东小程序 triggerEvent 为只读
  1986. mpInstance.triggerEvent = newTriggerEvent;
  1987. } catch (error) {
  1988. mpInstance._triggerEvent = newTriggerEvent;
  1989. }
  1990. }
  1991. function initHook(name, options, isComponent) {
  1992. var oldHook = options[name];
  1993. options[name] = function () {
  1994. markMPComponent(this);
  1995. initTriggerEvent(this);
  1996. if (oldHook) {
  1997. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  1998. args[_key4] = arguments[_key4];
  1999. }
  2000. return oldHook.apply(this, args);
  2001. }
  2002. };
  2003. }
  2004. if (!MPPage.__$wrappered) {
  2005. MPPage.__$wrappered = true;
  2006. Page = function Page() {
  2007. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2008. initHook('onLoad', options);
  2009. return MPPage(options);
  2010. };
  2011. Page.after = MPPage.after;
  2012. Component = function Component() {
  2013. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2014. initHook('created', options);
  2015. return MPComponent(options);
  2016. };
  2017. }
  2018. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  2019. function initMocks(vm, mocks) {
  2020. var mpInstance = vm.$mp[vm.mpType];
  2021. mocks.forEach(function (mock) {
  2022. if (hasOwn(mpInstance, mock)) {
  2023. vm[mock] = mpInstance[mock];
  2024. }
  2025. });
  2026. }
  2027. function hasHook(hook, vueOptions) {
  2028. if (!vueOptions) {
  2029. return true;
  2030. }
  2031. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  2032. return true;
  2033. }
  2034. vueOptions = vueOptions.default || vueOptions;
  2035. if (isFn(vueOptions)) {
  2036. if (isFn(vueOptions.extendOptions[hook])) {
  2037. return true;
  2038. }
  2039. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  2040. return true;
  2041. }
  2042. return false;
  2043. }
  2044. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  2045. return true;
  2046. }
  2047. var mixins = vueOptions.mixins;
  2048. if (Array.isArray(mixins)) {
  2049. return !!mixins.find(function (mixin) {
  2050. return hasHook(hook, mixin);
  2051. });
  2052. }
  2053. }
  2054. function initHooks(mpOptions, hooks, vueOptions) {
  2055. hooks.forEach(function (hook) {
  2056. if (hasHook(hook, vueOptions)) {
  2057. mpOptions[hook] = function (args) {
  2058. return this.$vm && this.$vm.__call_hook(hook, args);
  2059. };
  2060. }
  2061. });
  2062. }
  2063. function initUnknownHooks(mpOptions, vueOptions) {
  2064. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2065. findHooks(vueOptions).forEach(function (hook) {
  2066. return initHook$1(mpOptions, hook, excludes);
  2067. });
  2068. }
  2069. function findHooks(vueOptions) {
  2070. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  2071. if (vueOptions) {
  2072. Object.keys(vueOptions).forEach(function (name) {
  2073. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  2074. hooks.push(name);
  2075. }
  2076. });
  2077. }
  2078. return hooks;
  2079. }
  2080. function initHook$1(mpOptions, hook, excludes) {
  2081. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  2082. mpOptions[hook] = function (args) {
  2083. return this.$vm && this.$vm.__call_hook(hook, args);
  2084. };
  2085. }
  2086. }
  2087. function initVueComponent(Vue, vueOptions) {
  2088. vueOptions = vueOptions.default || vueOptions;
  2089. var VueComponent;
  2090. if (isFn(vueOptions)) {
  2091. VueComponent = vueOptions;
  2092. } else {
  2093. VueComponent = Vue.extend(vueOptions);
  2094. }
  2095. vueOptions = VueComponent.options;
  2096. return [VueComponent, vueOptions];
  2097. }
  2098. function initSlots(vm, vueSlots) {
  2099. if (Array.isArray(vueSlots) && vueSlots.length) {
  2100. var $slots = Object.create(null);
  2101. vueSlots.forEach(function (slotName) {
  2102. $slots[slotName] = true;
  2103. });
  2104. vm.$scopedSlots = vm.$slots = $slots;
  2105. }
  2106. }
  2107. function initVueIds(vueIds, mpInstance) {
  2108. vueIds = (vueIds || '').split(',');
  2109. var len = vueIds.length;
  2110. if (len === 1) {
  2111. mpInstance._$vueId = vueIds[0];
  2112. } else if (len === 2) {
  2113. mpInstance._$vueId = vueIds[0];
  2114. mpInstance._$vuePid = vueIds[1];
  2115. }
  2116. }
  2117. function initData(vueOptions, context) {
  2118. var data = vueOptions.data || {};
  2119. var methods = vueOptions.methods || {};
  2120. if (typeof data === 'function') {
  2121. try {
  2122. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  2123. } catch (e) {
  2124. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"hptwxMiniProgram","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  2125. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  2126. }
  2127. }
  2128. } else {
  2129. try {
  2130. // 对 data 格式化
  2131. data = JSON.parse(JSON.stringify(data));
  2132. } catch (e) {}
  2133. }
  2134. if (!isPlainObject(data)) {
  2135. data = {};
  2136. }
  2137. Object.keys(methods).forEach(function (methodName) {
  2138. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  2139. data[methodName] = methods[methodName];
  2140. }
  2141. });
  2142. return data;
  2143. }
  2144. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  2145. function createObserver(name) {
  2146. return function observer(newVal, oldVal) {
  2147. if (this.$vm) {
  2148. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  2149. }
  2150. };
  2151. }
  2152. function initBehaviors(vueOptions, initBehavior) {
  2153. var vueBehaviors = vueOptions.behaviors;
  2154. var vueExtends = vueOptions.extends;
  2155. var vueMixins = vueOptions.mixins;
  2156. var vueProps = vueOptions.props;
  2157. if (!vueProps) {
  2158. vueOptions.props = vueProps = [];
  2159. }
  2160. var behaviors = [];
  2161. if (Array.isArray(vueBehaviors)) {
  2162. vueBehaviors.forEach(function (behavior) {
  2163. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  2164. if (behavior === 'uni://form-field') {
  2165. if (Array.isArray(vueProps)) {
  2166. vueProps.push('name');
  2167. vueProps.push('value');
  2168. } else {
  2169. vueProps.name = {
  2170. type: String,
  2171. default: ''
  2172. };
  2173. vueProps.value = {
  2174. type: [String, Number, Boolean, Array, Object, Date],
  2175. default: ''
  2176. };
  2177. }
  2178. }
  2179. });
  2180. }
  2181. if (isPlainObject(vueExtends) && vueExtends.props) {
  2182. behaviors.push(initBehavior({
  2183. properties: initProperties(vueExtends.props, true)
  2184. }));
  2185. }
  2186. if (Array.isArray(vueMixins)) {
  2187. vueMixins.forEach(function (vueMixin) {
  2188. if (isPlainObject(vueMixin) && vueMixin.props) {
  2189. behaviors.push(initBehavior({
  2190. properties: initProperties(vueMixin.props, true)
  2191. }));
  2192. }
  2193. });
  2194. }
  2195. return behaviors;
  2196. }
  2197. function parsePropType(key, type, defaultValue, file) {
  2198. // [String]=>String
  2199. if (Array.isArray(type) && type.length === 1) {
  2200. return type[0];
  2201. }
  2202. return type;
  2203. }
  2204. function initProperties(props) {
  2205. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  2206. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  2207. var options = arguments.length > 3 ? arguments[3] : undefined;
  2208. var properties = {};
  2209. if (!isBehavior) {
  2210. properties.vueId = {
  2211. type: String,
  2212. value: ''
  2213. };
  2214. {
  2215. if (options.virtualHost) {
  2216. properties.virtualHostStyle = {
  2217. type: null,
  2218. value: ''
  2219. };
  2220. properties.virtualHostClass = {
  2221. type: null,
  2222. value: ''
  2223. };
  2224. }
  2225. }
  2226. // scopedSlotsCompiler auto
  2227. properties.scopedSlotsCompiler = {
  2228. type: String,
  2229. value: ''
  2230. };
  2231. properties.vueSlots = {
  2232. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  2233. type: null,
  2234. value: [],
  2235. observer: function observer(newVal, oldVal) {
  2236. var $slots = Object.create(null);
  2237. newVal.forEach(function (slotName) {
  2238. $slots[slotName] = true;
  2239. });
  2240. this.setData({
  2241. $slots: $slots
  2242. });
  2243. }
  2244. };
  2245. }
  2246. if (Array.isArray(props)) {
  2247. // ['title']
  2248. props.forEach(function (key) {
  2249. properties[key] = {
  2250. type: null,
  2251. observer: createObserver(key)
  2252. };
  2253. });
  2254. } else if (isPlainObject(props)) {
  2255. // {title:{type:String,default:''},content:String}
  2256. Object.keys(props).forEach(function (key) {
  2257. var opts = props[key];
  2258. if (isPlainObject(opts)) {
  2259. // title:{type:String,default:''}
  2260. var value = opts.default;
  2261. if (isFn(value)) {
  2262. value = value();
  2263. }
  2264. opts.type = parsePropType(key, opts.type);
  2265. properties[key] = {
  2266. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  2267. value: value,
  2268. observer: createObserver(key)
  2269. };
  2270. } else {
  2271. // content:String
  2272. var type = parsePropType(key, opts);
  2273. properties[key] = {
  2274. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  2275. observer: createObserver(key)
  2276. };
  2277. }
  2278. });
  2279. }
  2280. return properties;
  2281. }
  2282. function wrapper$1(event) {
  2283. // TODO 又得兼容 mpvue 的 mp 对象
  2284. try {
  2285. event.mp = JSON.parse(JSON.stringify(event));
  2286. } catch (e) {}
  2287. event.stopPropagation = noop;
  2288. event.preventDefault = noop;
  2289. event.target = event.target || {};
  2290. if (!hasOwn(event, 'detail')) {
  2291. event.detail = {};
  2292. }
  2293. if (hasOwn(event, 'markerId')) {
  2294. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  2295. event.detail.markerId = event.markerId;
  2296. }
  2297. if (isPlainObject(event.detail)) {
  2298. event.target = Object.assign({}, event.target, event.detail);
  2299. }
  2300. return event;
  2301. }
  2302. function getExtraValue(vm, dataPathsArray) {
  2303. var context = vm;
  2304. dataPathsArray.forEach(function (dataPathArray) {
  2305. var dataPath = dataPathArray[0];
  2306. var value = dataPathArray[2];
  2307. if (dataPath || typeof value !== 'undefined') {
  2308. // ['','',index,'disable']
  2309. var propPath = dataPathArray[1];
  2310. var valuePath = dataPathArray[3];
  2311. var vFor;
  2312. if (Number.isInteger(dataPath)) {
  2313. vFor = dataPath;
  2314. } else if (!dataPath) {
  2315. vFor = context;
  2316. } else if (typeof dataPath === 'string' && dataPath) {
  2317. if (dataPath.indexOf('#s#') === 0) {
  2318. vFor = dataPath.substr(3);
  2319. } else {
  2320. vFor = vm.__get_value(dataPath, context);
  2321. }
  2322. }
  2323. if (Number.isInteger(vFor)) {
  2324. context = value;
  2325. } else if (!propPath) {
  2326. context = vFor[value];
  2327. } else {
  2328. if (Array.isArray(vFor)) {
  2329. context = vFor.find(function (vForItem) {
  2330. return vm.__get_value(propPath, vForItem) === value;
  2331. });
  2332. } else if (isPlainObject(vFor)) {
  2333. context = Object.keys(vFor).find(function (vForKey) {
  2334. return vm.__get_value(propPath, vFor[vForKey]) === value;
  2335. });
  2336. } else {
  2337. console.error('v-for 暂不支持循环数据:', vFor);
  2338. }
  2339. }
  2340. if (valuePath) {
  2341. context = vm.__get_value(valuePath, context);
  2342. }
  2343. }
  2344. });
  2345. return context;
  2346. }
  2347. function processEventExtra(vm, extra, event, __args__) {
  2348. var extraObj = {};
  2349. if (Array.isArray(extra) && extra.length) {
  2350. /**
  2351. *[
  2352. * ['data.items', 'data.id', item.data.id],
  2353. * ['metas', 'id', meta.id]
  2354. *],
  2355. *[
  2356. * ['data.items', 'data.id', item.data.id],
  2357. * ['metas', 'id', meta.id]
  2358. *],
  2359. *'test'
  2360. */
  2361. extra.forEach(function (dataPath, index) {
  2362. if (typeof dataPath === 'string') {
  2363. if (!dataPath) {
  2364. // model,prop.sync
  2365. extraObj['$' + index] = vm;
  2366. } else {
  2367. if (dataPath === '$event') {
  2368. // $event
  2369. extraObj['$' + index] = event;
  2370. } else if (dataPath === 'arguments') {
  2371. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  2372. } else if (dataPath.indexOf('$event.') === 0) {
  2373. // $event.target.value
  2374. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  2375. } else {
  2376. extraObj['$' + index] = vm.__get_value(dataPath);
  2377. }
  2378. }
  2379. } else {
  2380. extraObj['$' + index] = getExtraValue(vm, dataPath);
  2381. }
  2382. });
  2383. }
  2384. return extraObj;
  2385. }
  2386. function getObjByArray(arr) {
  2387. var obj = {};
  2388. for (var i = 1; i < arr.length; i++) {
  2389. var element = arr[i];
  2390. obj[element[0]] = element[1];
  2391. }
  2392. return obj;
  2393. }
  2394. function processEventArgs(vm, event) {
  2395. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2396. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  2397. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  2398. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  2399. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  2400. // fixed 用户直接触发 mpInstance.triggerEvent
  2401. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  2402. if (isCustom) {
  2403. // 自定义事件
  2404. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  2405. if (!args.length) {
  2406. // 无参数,直接传入 event 或 detail 数组
  2407. if (isCustomMPEvent) {
  2408. return [event];
  2409. }
  2410. return __args__;
  2411. }
  2412. }
  2413. var extraObj = processEventExtra(vm, extra, event, __args__);
  2414. var ret = [];
  2415. args.forEach(function (arg) {
  2416. if (arg === '$event') {
  2417. if (methodName === '__set_model' && !isCustom) {
  2418. // input v-model value
  2419. ret.push(event.target.value);
  2420. } else {
  2421. if (isCustom && !isCustomMPEvent) {
  2422. ret.push(__args__[0]);
  2423. } else {
  2424. // wxcomponent 组件或内置组件
  2425. ret.push(event);
  2426. }
  2427. }
  2428. } else {
  2429. if (Array.isArray(arg) && arg[0] === 'o') {
  2430. ret.push(getObjByArray(arg));
  2431. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  2432. ret.push(extraObj[arg]);
  2433. } else {
  2434. ret.push(arg);
  2435. }
  2436. }
  2437. });
  2438. return ret;
  2439. }
  2440. var ONCE = '~';
  2441. var CUSTOM = '^';
  2442. function isMatchEventType(eventType, optType) {
  2443. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  2444. }
  2445. function getContextVm(vm) {
  2446. var $parent = vm.$parent;
  2447. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  2448. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  2449. $parent = $parent.$parent;
  2450. }
  2451. return $parent && $parent.$parent;
  2452. }
  2453. function handleEvent(event) {
  2454. var _this2 = this;
  2455. event = wrapper$1(event);
  2456. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  2457. var dataset = (event.currentTarget || event.target).dataset;
  2458. if (!dataset) {
  2459. return console.warn('事件信息不存在');
  2460. }
  2461. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  2462. if (!eventOpts) {
  2463. return console.warn('事件信息不存在');
  2464. }
  2465. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  2466. var eventType = event.type;
  2467. var ret = [];
  2468. eventOpts.forEach(function (eventOpt) {
  2469. var type = eventOpt[0];
  2470. var eventsArray = eventOpt[1];
  2471. var isCustom = type.charAt(0) === CUSTOM;
  2472. type = isCustom ? type.slice(1) : type;
  2473. var isOnce = type.charAt(0) === ONCE;
  2474. type = isOnce ? type.slice(1) : type;
  2475. if (eventsArray && isMatchEventType(eventType, type)) {
  2476. eventsArray.forEach(function (eventArray) {
  2477. var methodName = eventArray[0];
  2478. if (methodName) {
  2479. var handlerCtx = _this2.$vm;
  2480. if (handlerCtx.$options.generic) {
  2481. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  2482. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  2483. }
  2484. if (methodName === '$emit') {
  2485. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  2486. return;
  2487. }
  2488. var handler = handlerCtx[methodName];
  2489. if (!isFn(handler)) {
  2490. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  2491. var path = _this2.route || _this2.is;
  2492. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  2493. }
  2494. if (isOnce) {
  2495. if (handler.once) {
  2496. return;
  2497. }
  2498. handler.once = true;
  2499. }
  2500. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  2501. params = Array.isArray(params) ? params : [];
  2502. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  2503. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  2504. // eslint-disable-next-line no-sparse-arrays
  2505. params = params.concat([,,,,,,,,,, event]);
  2506. }
  2507. ret.push(handler.apply(handlerCtx, params));
  2508. }
  2509. });
  2510. }
  2511. });
  2512. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  2513. return ret[0];
  2514. }
  2515. }
  2516. var eventChannels = {};
  2517. function getEventChannel(id) {
  2518. var eventChannel = eventChannels[id];
  2519. delete eventChannels[id];
  2520. return eventChannel;
  2521. }
  2522. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  2523. function initEventChannel() {
  2524. _vue.default.prototype.getOpenerEventChannel = function () {
  2525. // 微信小程序使用自身getOpenerEventChannel
  2526. {
  2527. return this.$scope.getOpenerEventChannel();
  2528. }
  2529. };
  2530. var callHook = _vue.default.prototype.__call_hook;
  2531. _vue.default.prototype.__call_hook = function (hook, args) {
  2532. if (hook === 'onLoad' && args && args.__id__) {
  2533. this.__eventChannel__ = getEventChannel(args.__id__);
  2534. delete args.__id__;
  2535. }
  2536. return callHook.call(this, hook, args);
  2537. };
  2538. }
  2539. function initScopedSlotsParams() {
  2540. var center = {};
  2541. var parents = {};
  2542. function currentId(fn) {
  2543. var vueIds = this.$options.propsData.vueId;
  2544. if (vueIds) {
  2545. var vueId = vueIds.split(',')[0];
  2546. fn(vueId);
  2547. }
  2548. }
  2549. _vue.default.prototype.$hasSSP = function (vueId) {
  2550. var slot = center[vueId];
  2551. if (!slot) {
  2552. parents[vueId] = this;
  2553. this.$on('hook:destroyed', function () {
  2554. delete parents[vueId];
  2555. });
  2556. }
  2557. return slot;
  2558. };
  2559. _vue.default.prototype.$getSSP = function (vueId, name, needAll) {
  2560. var slot = center[vueId];
  2561. if (slot) {
  2562. var params = slot[name] || [];
  2563. if (needAll) {
  2564. return params;
  2565. }
  2566. return params[0];
  2567. }
  2568. };
  2569. _vue.default.prototype.$setSSP = function (name, value) {
  2570. var index = 0;
  2571. currentId.call(this, function (vueId) {
  2572. var slot = center[vueId];
  2573. var params = slot[name] = slot[name] || [];
  2574. params.push(value);
  2575. index = params.length - 1;
  2576. });
  2577. return index;
  2578. };
  2579. _vue.default.prototype.$initSSP = function () {
  2580. currentId.call(this, function (vueId) {
  2581. center[vueId] = {};
  2582. });
  2583. };
  2584. _vue.default.prototype.$callSSP = function () {
  2585. currentId.call(this, function (vueId) {
  2586. if (parents[vueId]) {
  2587. parents[vueId].$forceUpdate();
  2588. }
  2589. });
  2590. };
  2591. _vue.default.mixin({
  2592. destroyed: function destroyed() {
  2593. var propsData = this.$options.propsData;
  2594. var vueId = propsData && propsData.vueId;
  2595. if (vueId) {
  2596. delete center[vueId];
  2597. delete parents[vueId];
  2598. }
  2599. }
  2600. });
  2601. }
  2602. function parseBaseApp(vm, _ref4) {
  2603. var mocks = _ref4.mocks,
  2604. initRefs = _ref4.initRefs;
  2605. initEventChannel();
  2606. {
  2607. initScopedSlotsParams();
  2608. }
  2609. if (vm.$options.store) {
  2610. _vue.default.prototype.$store = vm.$options.store;
  2611. }
  2612. uniIdMixin(_vue.default);
  2613. _vue.default.prototype.mpHost = "mp-weixin";
  2614. _vue.default.mixin({
  2615. beforeCreate: function beforeCreate() {
  2616. if (!this.$options.mpType) {
  2617. return;
  2618. }
  2619. this.mpType = this.$options.mpType;
  2620. this.$mp = (0, _defineProperty2.default)({
  2621. data: {}
  2622. }, this.mpType, this.$options.mpInstance);
  2623. this.$scope = this.$options.mpInstance;
  2624. delete this.$options.mpType;
  2625. delete this.$options.mpInstance;
  2626. if (this.mpType === 'page' && typeof getApp === 'function') {
  2627. // hack vue-i18n
  2628. var app = getApp();
  2629. if (app.$vm && app.$vm.$i18n) {
  2630. this._i18n = app.$vm.$i18n;
  2631. }
  2632. }
  2633. if (this.mpType !== 'app') {
  2634. initRefs(this);
  2635. initMocks(this, mocks);
  2636. }
  2637. }
  2638. });
  2639. var appOptions = {
  2640. onLaunch: function onLaunch(args) {
  2641. if (this.$vm) {
  2642. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  2643. return;
  2644. }
  2645. {
  2646. if (wx.canIUse && !wx.canIUse('nextTick')) {
  2647. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  2648. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  2649. }
  2650. }
  2651. this.$vm = vm;
  2652. this.$vm.$mp = {
  2653. app: this
  2654. };
  2655. this.$vm.$scope = this;
  2656. // vm 上也挂载 globalData
  2657. this.$vm.globalData = this.globalData;
  2658. this.$vm._isMounted = true;
  2659. this.$vm.__call_hook('mounted', args);
  2660. this.$vm.__call_hook('onLaunch', args);
  2661. }
  2662. };
  2663. // 兼容旧版本 globalData
  2664. appOptions.globalData = vm.$options.globalData || {};
  2665. // 将 methods 中的方法挂在 getApp() 中
  2666. var methods = vm.$options.methods;
  2667. if (methods) {
  2668. Object.keys(methods).forEach(function (name) {
  2669. appOptions[name] = methods[name];
  2670. });
  2671. }
  2672. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  2673. initHooks(appOptions, hooks);
  2674. initUnknownHooks(appOptions, vm.$options);
  2675. return appOptions;
  2676. }
  2677. function parseApp(vm) {
  2678. return parseBaseApp(vm, {
  2679. mocks: mocks,
  2680. initRefs: initRefs
  2681. });
  2682. }
  2683. function createApp(vm) {
  2684. App(parseApp(vm));
  2685. return vm;
  2686. }
  2687. var encodeReserveRE = /[!'()*]/g;
  2688. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  2689. return '%' + c.charCodeAt(0).toString(16);
  2690. };
  2691. var commaRE = /%2C/g;
  2692. // fixed encodeURIComponent which is more conformant to RFC3986:
  2693. // - escapes [!'()*]
  2694. // - preserve commas
  2695. var encode = function encode(str) {
  2696. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  2697. };
  2698. function stringifyQuery(obj) {
  2699. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  2700. var res = obj ? Object.keys(obj).map(function (key) {
  2701. var val = obj[key];
  2702. if (val === undefined) {
  2703. return '';
  2704. }
  2705. if (val === null) {
  2706. return encodeStr(key);
  2707. }
  2708. if (Array.isArray(val)) {
  2709. var result = [];
  2710. val.forEach(function (val2) {
  2711. if (val2 === undefined) {
  2712. return;
  2713. }
  2714. if (val2 === null) {
  2715. result.push(encodeStr(key));
  2716. } else {
  2717. result.push(encodeStr(key) + '=' + encodeStr(val2));
  2718. }
  2719. });
  2720. return result.join('&');
  2721. }
  2722. return encodeStr(key) + '=' + encodeStr(val);
  2723. }).filter(function (x) {
  2724. return x.length > 0;
  2725. }).join('&') : null;
  2726. return res ? "?".concat(res) : '';
  2727. }
  2728. function parseBaseComponent(vueComponentOptions) {
  2729. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  2730. isPage = _ref5.isPage,
  2731. initRelation = _ref5.initRelation;
  2732. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  2733. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  2734. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  2735. VueComponent = _initVueComponent2[0],
  2736. vueOptions = _initVueComponent2[1];
  2737. var options = _objectSpread({
  2738. multipleSlots: true,
  2739. // styleIsolation: 'apply-shared',
  2740. addGlobalClass: true
  2741. }, vueOptions.options || {});
  2742. {
  2743. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  2744. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  2745. Object.assign(options, vueOptions['mp-weixin'].options);
  2746. }
  2747. }
  2748. var componentOptions = {
  2749. options: options,
  2750. data: initData(vueOptions, _vue.default.prototype),
  2751. behaviors: initBehaviors(vueOptions, initBehavior),
  2752. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  2753. lifetimes: {
  2754. attached: function attached() {
  2755. var properties = this.properties;
  2756. var options = {
  2757. mpType: isPage.call(this) ? 'page' : 'component',
  2758. mpInstance: this,
  2759. propsData: properties
  2760. };
  2761. initVueIds(properties.vueId, this);
  2762. // 处理父子关系
  2763. initRelation.call(this, {
  2764. vuePid: this._$vuePid,
  2765. vueOptions: options
  2766. });
  2767. // 初始化 vue 实例
  2768. this.$vm = new VueComponent(options);
  2769. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  2770. initSlots(this.$vm, properties.vueSlots);
  2771. // 触发首次 setData
  2772. this.$vm.$mount();
  2773. },
  2774. ready: function ready() {
  2775. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  2776. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  2777. if (this.$vm) {
  2778. this.$vm._isMounted = true;
  2779. this.$vm.__call_hook('mounted');
  2780. this.$vm.__call_hook('onReady');
  2781. }
  2782. },
  2783. detached: function detached() {
  2784. this.$vm && this.$vm.$destroy();
  2785. }
  2786. },
  2787. pageLifetimes: {
  2788. show: function show(args) {
  2789. this.$vm && this.$vm.__call_hook('onPageShow', args);
  2790. },
  2791. hide: function hide() {
  2792. this.$vm && this.$vm.__call_hook('onPageHide');
  2793. },
  2794. resize: function resize(size) {
  2795. this.$vm && this.$vm.__call_hook('onPageResize', size);
  2796. }
  2797. },
  2798. methods: {
  2799. __l: handleLink,
  2800. __e: handleEvent
  2801. }
  2802. };
  2803. // externalClasses
  2804. if (vueOptions.externalClasses) {
  2805. componentOptions.externalClasses = vueOptions.externalClasses;
  2806. }
  2807. if (Array.isArray(vueOptions.wxsCallMethods)) {
  2808. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  2809. componentOptions.methods[callMethod] = function (args) {
  2810. return this.$vm[callMethod](args);
  2811. };
  2812. });
  2813. }
  2814. if (needVueOptions) {
  2815. return [componentOptions, vueOptions, VueComponent];
  2816. }
  2817. if (isPage) {
  2818. return componentOptions;
  2819. }
  2820. return [componentOptions, VueComponent];
  2821. }
  2822. function parseComponent(vueComponentOptions, needVueOptions) {
  2823. return parseBaseComponent(vueComponentOptions, {
  2824. isPage: isPage,
  2825. initRelation: initRelation
  2826. }, needVueOptions);
  2827. }
  2828. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  2829. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  2830. function parseBasePage(vuePageOptions) {
  2831. var _parseComponent = parseComponent(vuePageOptions, true),
  2832. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  2833. pageOptions = _parseComponent2[0],
  2834. vueOptions = _parseComponent2[1];
  2835. initHooks(pageOptions.methods, hooks$1, vueOptions);
  2836. pageOptions.methods.onLoad = function (query) {
  2837. this.options = query;
  2838. var copyQuery = Object.assign({}, query);
  2839. delete copyQuery.__id__;
  2840. this.$page = {
  2841. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  2842. };
  2843. this.$vm.$mp.query = query; // 兼容 mpvue
  2844. this.$vm.__call_hook('onLoad', query);
  2845. };
  2846. {
  2847. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  2848. }
  2849. {
  2850. initWorkletMethods(pageOptions.methods, vueOptions.methods);
  2851. }
  2852. return pageOptions;
  2853. }
  2854. function parsePage(vuePageOptions) {
  2855. return parseBasePage(vuePageOptions);
  2856. }
  2857. function createPage(vuePageOptions) {
  2858. {
  2859. return Component(parsePage(vuePageOptions));
  2860. }
  2861. }
  2862. function createComponent(vueOptions) {
  2863. {
  2864. return Component(parseComponent(vueOptions));
  2865. }
  2866. }
  2867. function createSubpackageApp(vm) {
  2868. var appOptions = parseApp(vm);
  2869. var app = getApp({
  2870. allowDefault: true
  2871. });
  2872. vm.$scope = app;
  2873. var globalData = app.globalData;
  2874. if (globalData) {
  2875. Object.keys(appOptions.globalData).forEach(function (name) {
  2876. if (!hasOwn(globalData, name)) {
  2877. globalData[name] = appOptions.globalData[name];
  2878. }
  2879. });
  2880. }
  2881. Object.keys(appOptions).forEach(function (name) {
  2882. if (!hasOwn(app, name)) {
  2883. app[name] = appOptions[name];
  2884. }
  2885. });
  2886. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2887. wx.onAppShow(function () {
  2888. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  2889. args[_key5] = arguments[_key5];
  2890. }
  2891. vm.__call_hook('onShow', args);
  2892. });
  2893. }
  2894. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2895. wx.onAppHide(function () {
  2896. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  2897. args[_key6] = arguments[_key6];
  2898. }
  2899. vm.__call_hook('onHide', args);
  2900. });
  2901. }
  2902. if (isFn(appOptions.onLaunch)) {
  2903. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2904. vm.__call_hook('onLaunch', args);
  2905. }
  2906. return vm;
  2907. }
  2908. function createPlugin(vm) {
  2909. var appOptions = parseApp(vm);
  2910. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2911. wx.onAppShow(function () {
  2912. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  2913. args[_key7] = arguments[_key7];
  2914. }
  2915. vm.__call_hook('onShow', args);
  2916. });
  2917. }
  2918. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2919. wx.onAppHide(function () {
  2920. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  2921. args[_key8] = arguments[_key8];
  2922. }
  2923. vm.__call_hook('onHide', args);
  2924. });
  2925. }
  2926. if (isFn(appOptions.onLaunch)) {
  2927. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2928. vm.__call_hook('onLaunch', args);
  2929. }
  2930. return vm;
  2931. }
  2932. todos.forEach(function (todoApi) {
  2933. protocols[todoApi] = false;
  2934. });
  2935. canIUses.forEach(function (canIUseApi) {
  2936. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  2937. if (!wx.canIUse(apiName)) {
  2938. protocols[canIUseApi] = false;
  2939. }
  2940. });
  2941. var uni = {};
  2942. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  2943. uni = new Proxy({}, {
  2944. get: function get(target, name) {
  2945. if (hasOwn(target, name)) {
  2946. return target[name];
  2947. }
  2948. if (baseApi[name]) {
  2949. return baseApi[name];
  2950. }
  2951. if (api[name]) {
  2952. return promisify(name, api[name]);
  2953. }
  2954. {
  2955. if (extraApi[name]) {
  2956. return promisify(name, extraApi[name]);
  2957. }
  2958. if (todoApis[name]) {
  2959. return promisify(name, todoApis[name]);
  2960. }
  2961. }
  2962. if (eventApi[name]) {
  2963. return eventApi[name];
  2964. }
  2965. return promisify(name, wrapper(name, wx[name]));
  2966. },
  2967. set: function set(target, name, value) {
  2968. target[name] = value;
  2969. return true;
  2970. }
  2971. });
  2972. } else {
  2973. Object.keys(baseApi).forEach(function (name) {
  2974. uni[name] = baseApi[name];
  2975. });
  2976. {
  2977. Object.keys(todoApis).forEach(function (name) {
  2978. uni[name] = promisify(name, todoApis[name]);
  2979. });
  2980. Object.keys(extraApi).forEach(function (name) {
  2981. uni[name] = promisify(name, extraApi[name]);
  2982. });
  2983. }
  2984. Object.keys(eventApi).forEach(function (name) {
  2985. uni[name] = eventApi[name];
  2986. });
  2987. Object.keys(api).forEach(function (name) {
  2988. uni[name] = promisify(name, api[name]);
  2989. });
  2990. Object.keys(wx).forEach(function (name) {
  2991. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2992. uni[name] = promisify(name, wrapper(name, wx[name]));
  2993. }
  2994. });
  2995. }
  2996. wx.createApp = createApp;
  2997. wx.createPage = createPage;
  2998. wx.createComponent = createComponent;
  2999. wx.createSubpackageApp = createSubpackageApp;
  3000. wx.createPlugin = createPlugin;
  3001. var uni$1 = uni;
  3002. var _default = uni$1;
  3003. exports.default = _default;
  3004. /* 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)))
  3005. /***/ }),
  3006. /***/ 20:
  3007. /*!****************************************************************!*\
  3008. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  3009. \****************************************************************/
  3010. /*! no static exports found */
  3011. /***/ (function(module, exports) {
  3012. function _iterableToArray(iter) {
  3013. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  3014. }
  3015. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3016. /***/ }),
  3017. /***/ 21:
  3018. /*!******************************************************************!*\
  3019. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  3020. \******************************************************************/
  3021. /*! no static exports found */
  3022. /***/ (function(module, exports) {
  3023. function _nonIterableSpread() {
  3024. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  3025. }
  3026. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3027. /***/ }),
  3028. /***/ 22:
  3029. /*!*************************************************************!*\
  3030. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  3031. \*************************************************************/
  3032. /*! no static exports found */
  3033. /***/ (function(module, exports, __webpack_require__) {
  3034. "use strict";
  3035. /* WEBPACK VAR INJECTION */(function(uni, global) {
  3036. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  3037. Object.defineProperty(exports, "__esModule", {
  3038. value: true
  3039. });
  3040. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  3041. exports.compileI18nJsonStr = compileI18nJsonStr;
  3042. exports.hasI18nJson = hasI18nJson;
  3043. exports.initVueI18n = initVueI18n;
  3044. exports.isI18nStr = isI18nStr;
  3045. exports.isString = void 0;
  3046. exports.normalizeLocale = normalizeLocale;
  3047. exports.parseI18nJson = parseI18nJson;
  3048. exports.resolveLocale = resolveLocale;
  3049. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  3050. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  3051. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  3052. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  3053. var isObject = function isObject(val) {
  3054. return val !== null && (0, _typeof2.default)(val) === 'object';
  3055. };
  3056. var defaultDelimiters = ['{', '}'];
  3057. var BaseFormatter = /*#__PURE__*/function () {
  3058. function BaseFormatter() {
  3059. (0, _classCallCheck2.default)(this, BaseFormatter);
  3060. this._caches = Object.create(null);
  3061. }
  3062. (0, _createClass2.default)(BaseFormatter, [{
  3063. key: "interpolate",
  3064. value: function interpolate(message, values) {
  3065. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  3066. if (!values) {
  3067. return [message];
  3068. }
  3069. var tokens = this._caches[message];
  3070. if (!tokens) {
  3071. tokens = parse(message, delimiters);
  3072. this._caches[message] = tokens;
  3073. }
  3074. return compile(tokens, values);
  3075. }
  3076. }]);
  3077. return BaseFormatter;
  3078. }();
  3079. exports.Formatter = BaseFormatter;
  3080. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  3081. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  3082. function parse(format, _ref) {
  3083. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  3084. startDelimiter = _ref2[0],
  3085. endDelimiter = _ref2[1];
  3086. var tokens = [];
  3087. var position = 0;
  3088. var text = '';
  3089. while (position < format.length) {
  3090. var char = format[position++];
  3091. if (char === startDelimiter) {
  3092. if (text) {
  3093. tokens.push({
  3094. type: 'text',
  3095. value: text
  3096. });
  3097. }
  3098. text = '';
  3099. var sub = '';
  3100. char = format[position++];
  3101. while (char !== undefined && char !== endDelimiter) {
  3102. sub += char;
  3103. char = format[position++];
  3104. }
  3105. var isClosed = char === endDelimiter;
  3106. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  3107. tokens.push({
  3108. value: sub,
  3109. type: type
  3110. });
  3111. }
  3112. // else if (char === '%') {
  3113. // // when found rails i18n syntax, skip text capture
  3114. // if (format[position] !== '{') {
  3115. // text += char
  3116. // }
  3117. // }
  3118. else {
  3119. text += char;
  3120. }
  3121. }
  3122. text && tokens.push({
  3123. type: 'text',
  3124. value: text
  3125. });
  3126. return tokens;
  3127. }
  3128. function compile(tokens, values) {
  3129. var compiled = [];
  3130. var index = 0;
  3131. var mode = Array.isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  3132. if (mode === 'unknown') {
  3133. return compiled;
  3134. }
  3135. while (index < tokens.length) {
  3136. var token = tokens[index];
  3137. switch (token.type) {
  3138. case 'text':
  3139. compiled.push(token.value);
  3140. break;
  3141. case 'list':
  3142. compiled.push(values[parseInt(token.value, 10)]);
  3143. break;
  3144. case 'named':
  3145. if (mode === 'named') {
  3146. compiled.push(values[token.value]);
  3147. } else {
  3148. if (true) {
  3149. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  3150. }
  3151. }
  3152. break;
  3153. case 'unknown':
  3154. if (true) {
  3155. console.warn("Detect 'unknown' type of token!");
  3156. }
  3157. break;
  3158. }
  3159. index++;
  3160. }
  3161. return compiled;
  3162. }
  3163. var LOCALE_ZH_HANS = 'zh-Hans';
  3164. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  3165. var LOCALE_ZH_HANT = 'zh-Hant';
  3166. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  3167. var LOCALE_EN = 'en';
  3168. exports.LOCALE_EN = LOCALE_EN;
  3169. var LOCALE_FR = 'fr';
  3170. exports.LOCALE_FR = LOCALE_FR;
  3171. var LOCALE_ES = 'es';
  3172. exports.LOCALE_ES = LOCALE_ES;
  3173. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3174. var hasOwn = function hasOwn(val, key) {
  3175. return hasOwnProperty.call(val, key);
  3176. };
  3177. var defaultFormatter = new BaseFormatter();
  3178. function include(str, parts) {
  3179. return !!parts.find(function (part) {
  3180. return str.indexOf(part) !== -1;
  3181. });
  3182. }
  3183. function startsWith(str, parts) {
  3184. return parts.find(function (part) {
  3185. return str.indexOf(part) === 0;
  3186. });
  3187. }
  3188. function normalizeLocale(locale, messages) {
  3189. if (!locale) {
  3190. return;
  3191. }
  3192. locale = locale.trim().replace(/_/g, '-');
  3193. if (messages && messages[locale]) {
  3194. return locale;
  3195. }
  3196. locale = locale.toLowerCase();
  3197. if (locale === 'chinese') {
  3198. // 支付宝
  3199. return LOCALE_ZH_HANS;
  3200. }
  3201. if (locale.indexOf('zh') === 0) {
  3202. if (locale.indexOf('-hans') > -1) {
  3203. return LOCALE_ZH_HANS;
  3204. }
  3205. if (locale.indexOf('-hant') > -1) {
  3206. return LOCALE_ZH_HANT;
  3207. }
  3208. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  3209. return LOCALE_ZH_HANT;
  3210. }
  3211. return LOCALE_ZH_HANS;
  3212. }
  3213. var locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
  3214. if (messages && Object.keys(messages).length > 0) {
  3215. locales = Object.keys(messages);
  3216. }
  3217. var lang = startsWith(locale, locales);
  3218. if (lang) {
  3219. return lang;
  3220. }
  3221. }
  3222. var I18n = /*#__PURE__*/function () {
  3223. function I18n(_ref3) {
  3224. var locale = _ref3.locale,
  3225. fallbackLocale = _ref3.fallbackLocale,
  3226. messages = _ref3.messages,
  3227. watcher = _ref3.watcher,
  3228. formater = _ref3.formater;
  3229. (0, _classCallCheck2.default)(this, I18n);
  3230. this.locale = LOCALE_EN;
  3231. this.fallbackLocale = LOCALE_EN;
  3232. this.message = {};
  3233. this.messages = {};
  3234. this.watchers = [];
  3235. if (fallbackLocale) {
  3236. this.fallbackLocale = fallbackLocale;
  3237. }
  3238. this.formater = formater || defaultFormatter;
  3239. this.messages = messages || {};
  3240. this.setLocale(locale || LOCALE_EN);
  3241. if (watcher) {
  3242. this.watchLocale(watcher);
  3243. }
  3244. }
  3245. (0, _createClass2.default)(I18n, [{
  3246. key: "setLocale",
  3247. value: function setLocale(locale) {
  3248. var _this = this;
  3249. var oldLocale = this.locale;
  3250. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  3251. if (!this.messages[this.locale]) {
  3252. // 可能初始化时不存在
  3253. this.messages[this.locale] = {};
  3254. }
  3255. this.message = this.messages[this.locale];
  3256. // 仅发生变化时,通知
  3257. if (oldLocale !== this.locale) {
  3258. this.watchers.forEach(function (watcher) {
  3259. watcher(_this.locale, oldLocale);
  3260. });
  3261. }
  3262. }
  3263. }, {
  3264. key: "getLocale",
  3265. value: function getLocale() {
  3266. return this.locale;
  3267. }
  3268. }, {
  3269. key: "watchLocale",
  3270. value: function watchLocale(fn) {
  3271. var _this2 = this;
  3272. var index = this.watchers.push(fn) - 1;
  3273. return function () {
  3274. _this2.watchers.splice(index, 1);
  3275. };
  3276. }
  3277. }, {
  3278. key: "add",
  3279. value: function add(locale, message) {
  3280. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3281. var curMessages = this.messages[locale];
  3282. if (curMessages) {
  3283. if (override) {
  3284. Object.assign(curMessages, message);
  3285. } else {
  3286. Object.keys(message).forEach(function (key) {
  3287. if (!hasOwn(curMessages, key)) {
  3288. curMessages[key] = message[key];
  3289. }
  3290. });
  3291. }
  3292. } else {
  3293. this.messages[locale] = message;
  3294. }
  3295. }
  3296. }, {
  3297. key: "f",
  3298. value: function f(message, values, delimiters) {
  3299. return this.formater.interpolate(message, values, delimiters).join('');
  3300. }
  3301. }, {
  3302. key: "t",
  3303. value: function t(key, locale, values) {
  3304. var message = this.message;
  3305. if (typeof locale === 'string') {
  3306. locale = normalizeLocale(locale, this.messages);
  3307. locale && (message = this.messages[locale]);
  3308. } else {
  3309. values = locale;
  3310. }
  3311. if (!hasOwn(message, key)) {
  3312. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  3313. return key;
  3314. }
  3315. return this.formater.interpolate(message[key], values).join('');
  3316. }
  3317. }]);
  3318. return I18n;
  3319. }();
  3320. exports.I18n = I18n;
  3321. function watchAppLocale(appVm, i18n) {
  3322. // 需要保证 watch 的触发在组件渲染之前
  3323. if (appVm.$watchLocale) {
  3324. // vue2
  3325. appVm.$watchLocale(function (newLocale) {
  3326. i18n.setLocale(newLocale);
  3327. });
  3328. } else {
  3329. appVm.$watch(function () {
  3330. return appVm.$locale;
  3331. }, function (newLocale) {
  3332. i18n.setLocale(newLocale);
  3333. });
  3334. }
  3335. }
  3336. function getDefaultLocale() {
  3337. if (typeof uni !== 'undefined' && uni.getLocale) {
  3338. return uni.getLocale();
  3339. }
  3340. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  3341. if (typeof global !== 'undefined' && global.getLocale) {
  3342. return global.getLocale();
  3343. }
  3344. return LOCALE_EN;
  3345. }
  3346. function initVueI18n(locale) {
  3347. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3348. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  3349. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  3350. // 兼容旧版本入参
  3351. if (typeof locale !== 'string') {
  3352. var _ref4 = [messages, locale];
  3353. locale = _ref4[0];
  3354. messages = _ref4[1];
  3355. }
  3356. if (typeof locale !== 'string') {
  3357. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  3358. locale = getDefaultLocale();
  3359. }
  3360. if (typeof fallbackLocale !== 'string') {
  3361. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  3362. }
  3363. var i18n = new I18n({
  3364. locale: locale,
  3365. fallbackLocale: fallbackLocale,
  3366. messages: messages,
  3367. watcher: watcher
  3368. });
  3369. var _t = function t(key, values) {
  3370. if (typeof getApp !== 'function') {
  3371. // app view
  3372. /* eslint-disable no-func-assign */
  3373. _t = function t(key, values) {
  3374. return i18n.t(key, values);
  3375. };
  3376. } else {
  3377. var isWatchedAppLocale = false;
  3378. _t = function t(key, values) {
  3379. var appVm = getApp().$vm;
  3380. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  3381. // options: {
  3382. // type: Array,
  3383. // default () {
  3384. // return [{
  3385. // icon: 'shop',
  3386. // text: t("uni-goods-nav.options.shop"),
  3387. // }, {
  3388. // icon: 'cart',
  3389. // text: t("uni-goods-nav.options.cart")
  3390. // }]
  3391. // }
  3392. // },
  3393. if (appVm) {
  3394. // 触发响应式
  3395. appVm.$locale;
  3396. if (!isWatchedAppLocale) {
  3397. isWatchedAppLocale = true;
  3398. watchAppLocale(appVm, i18n);
  3399. }
  3400. }
  3401. return i18n.t(key, values);
  3402. };
  3403. }
  3404. return _t(key, values);
  3405. };
  3406. return {
  3407. i18n: i18n,
  3408. f: function f(message, values, delimiters) {
  3409. return i18n.f(message, values, delimiters);
  3410. },
  3411. t: function t(key, values) {
  3412. return _t(key, values);
  3413. },
  3414. add: function add(locale, message) {
  3415. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3416. return i18n.add(locale, message, override);
  3417. },
  3418. watch: function watch(fn) {
  3419. return i18n.watchLocale(fn);
  3420. },
  3421. getLocale: function getLocale() {
  3422. return i18n.getLocale();
  3423. },
  3424. setLocale: function setLocale(newLocale) {
  3425. return i18n.setLocale(newLocale);
  3426. }
  3427. };
  3428. }
  3429. var isString = function isString(val) {
  3430. return typeof val === 'string';
  3431. };
  3432. exports.isString = isString;
  3433. var formater;
  3434. function hasI18nJson(jsonObj, delimiters) {
  3435. if (!formater) {
  3436. formater = new BaseFormatter();
  3437. }
  3438. return walkJsonObj(jsonObj, function (jsonObj, key) {
  3439. var value = jsonObj[key];
  3440. if (isString(value)) {
  3441. if (isI18nStr(value, delimiters)) {
  3442. return true;
  3443. }
  3444. } else {
  3445. return hasI18nJson(value, delimiters);
  3446. }
  3447. });
  3448. }
  3449. function parseI18nJson(jsonObj, values, delimiters) {
  3450. if (!formater) {
  3451. formater = new BaseFormatter();
  3452. }
  3453. walkJsonObj(jsonObj, function (jsonObj, key) {
  3454. var value = jsonObj[key];
  3455. if (isString(value)) {
  3456. if (isI18nStr(value, delimiters)) {
  3457. jsonObj[key] = compileStr(value, values, delimiters);
  3458. }
  3459. } else {
  3460. parseI18nJson(value, values, delimiters);
  3461. }
  3462. });
  3463. return jsonObj;
  3464. }
  3465. function compileI18nJsonStr(jsonStr, _ref5) {
  3466. var locale = _ref5.locale,
  3467. locales = _ref5.locales,
  3468. delimiters = _ref5.delimiters;
  3469. if (!isI18nStr(jsonStr, delimiters)) {
  3470. return jsonStr;
  3471. }
  3472. if (!formater) {
  3473. formater = new BaseFormatter();
  3474. }
  3475. var localeValues = [];
  3476. Object.keys(locales).forEach(function (name) {
  3477. if (name !== locale) {
  3478. localeValues.push({
  3479. locale: name,
  3480. values: locales[name]
  3481. });
  3482. }
  3483. });
  3484. localeValues.unshift({
  3485. locale: locale,
  3486. values: locales[locale]
  3487. });
  3488. try {
  3489. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  3490. } catch (e) {}
  3491. return jsonStr;
  3492. }
  3493. function isI18nStr(value, delimiters) {
  3494. return value.indexOf(delimiters[0]) > -1;
  3495. }
  3496. function compileStr(value, values, delimiters) {
  3497. return formater.interpolate(value, values, delimiters).join('');
  3498. }
  3499. function compileValue(jsonObj, key, localeValues, delimiters) {
  3500. var value = jsonObj[key];
  3501. if (isString(value)) {
  3502. // 存在国际化
  3503. if (isI18nStr(value, delimiters)) {
  3504. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  3505. if (localeValues.length > 1) {
  3506. // 格式化国际化语言
  3507. var valueLocales = jsonObj[key + 'Locales'] = {};
  3508. localeValues.forEach(function (localValue) {
  3509. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  3510. });
  3511. }
  3512. }
  3513. } else {
  3514. compileJsonObj(value, localeValues, delimiters);
  3515. }
  3516. }
  3517. function compileJsonObj(jsonObj, localeValues, delimiters) {
  3518. walkJsonObj(jsonObj, function (jsonObj, key) {
  3519. compileValue(jsonObj, key, localeValues, delimiters);
  3520. });
  3521. return jsonObj;
  3522. }
  3523. function walkJsonObj(jsonObj, walk) {
  3524. if (Array.isArray(jsonObj)) {
  3525. for (var i = 0; i < jsonObj.length; i++) {
  3526. if (walk(jsonObj, i)) {
  3527. return true;
  3528. }
  3529. }
  3530. } else if (isObject(jsonObj)) {
  3531. for (var key in jsonObj) {
  3532. if (walk(jsonObj, key)) {
  3533. return true;
  3534. }
  3535. }
  3536. }
  3537. return false;
  3538. }
  3539. function resolveLocale(locales) {
  3540. return function (locale) {
  3541. if (!locale) {
  3542. return locale;
  3543. }
  3544. locale = normalizeLocale(locale) || locale;
  3545. return resolveLocaleChain(locale).find(function (locale) {
  3546. return locales.indexOf(locale) > -1;
  3547. });
  3548. };
  3549. }
  3550. function resolveLocaleChain(locale) {
  3551. var chain = [];
  3552. var tokens = locale.split('-');
  3553. while (tokens.length) {
  3554. chain.push(tokens.join('-'));
  3555. tokens.pop();
  3556. }
  3557. return chain;
  3558. }
  3559. /* 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)))
  3560. /***/ }),
  3561. /***/ 222:
  3562. /*!**************************************************************************!*\
  3563. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/taskEventApi.js ***!
  3564. \**************************************************************************/
  3565. /*! no static exports found */
  3566. /***/ (function(module, exports, __webpack_require__) {
  3567. "use strict";
  3568. Object.defineProperty(exports, "__esModule", {
  3569. value: true
  3570. });
  3571. exports.createTaskEvent = createTaskEvent;
  3572. exports.deleteTaskEvent = deleteTaskEvent;
  3573. exports.getTaskEventByList = getTaskEventByList;
  3574. exports.getTaskEventByPage = getTaskEventByPage;
  3575. exports.getTaskEventByTaskId = getTaskEventByTaskId;
  3576. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  3577. /**
  3578. * 获取Task Event分页
  3579. * @param data
  3580. * @returns
  3581. */
  3582. function getTaskEventByPage(data) {
  3583. return (0, _request.request)({
  3584. url: '/task/event/page',
  3585. method: 'GET',
  3586. params: data
  3587. });
  3588. }
  3589. /**
  3590. * 获取Task Event列表
  3591. * @param data
  3592. * @returns
  3593. */
  3594. function getTaskEventByList(data) {
  3595. return (0, _request.request)({
  3596. url: '/task/event',
  3597. method: 'GET',
  3598. params: data
  3599. });
  3600. }
  3601. /**
  3602. * 根据Id获取Task Event
  3603. * @param data
  3604. * @returns
  3605. */
  3606. function getTaskEventByTaskId(taskId) {
  3607. return (0, _request.request)({
  3608. url: "/task/event/".concat(taskId),
  3609. method: 'GET'
  3610. });
  3611. }
  3612. /**
  3613. * 添加Task Event
  3614. * @param data
  3615. * @returns
  3616. */
  3617. function createTaskEvent(data) {
  3618. return (0, _request.request)({
  3619. url: "/task/event/add",
  3620. method: 'POST',
  3621. data: data
  3622. });
  3623. }
  3624. /**
  3625. * 删除Task Event
  3626. * @param data
  3627. * @returns
  3628. */
  3629. function deleteTaskEvent(taskId) {
  3630. return (0, _request.request)({
  3631. url: "/task/event/".concat(taskId),
  3632. method: 'DELETE'
  3633. });
  3634. }
  3635. /***/ }),
  3636. /***/ 23:
  3637. /*!***************************************************************!*\
  3638. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  3639. \***************************************************************/
  3640. /*! no static exports found */
  3641. /***/ (function(module, exports) {
  3642. function _classCallCheck(instance, Constructor) {
  3643. if (!(instance instanceof Constructor)) {
  3644. throw new TypeError("Cannot call a class as a function");
  3645. }
  3646. }
  3647. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3648. /***/ }),
  3649. /***/ 24:
  3650. /*!************************************************************!*\
  3651. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  3652. \************************************************************/
  3653. /*! no static exports found */
  3654. /***/ (function(module, exports, __webpack_require__) {
  3655. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  3656. function _defineProperties(target, props) {
  3657. for (var i = 0; i < props.length; i++) {
  3658. var descriptor = props[i];
  3659. descriptor.enumerable = descriptor.enumerable || false;
  3660. descriptor.configurable = true;
  3661. if ("value" in descriptor) descriptor.writable = true;
  3662. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  3663. }
  3664. }
  3665. function _createClass(Constructor, protoProps, staticProps) {
  3666. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  3667. if (staticProps) _defineProperties(Constructor, staticProps);
  3668. Object.defineProperty(Constructor, "prototype", {
  3669. writable: false
  3670. });
  3671. return Constructor;
  3672. }
  3673. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3674. /***/ }),
  3675. /***/ 247:
  3676. /*!*********************************************************************!*\
  3677. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/dutyApi.js ***!
  3678. \*********************************************************************/
  3679. /*! no static exports found */
  3680. /***/ (function(module, exports, __webpack_require__) {
  3681. "use strict";
  3682. Object.defineProperty(exports, "__esModule", {
  3683. value: true
  3684. });
  3685. exports.creatDuty = creatDuty;
  3686. exports.getDutyRecord = getDutyRecord;
  3687. exports.getDutyRecordItemByList = getDutyRecordItemByList;
  3688. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  3689. /**
  3690. * 获取Danger列表
  3691. * @param data
  3692. * @returns
  3693. */
  3694. function creatDuty(data) {
  3695. return (0, _request.request)({
  3696. url: '/duty/record/item/add',
  3697. method: 'POST',
  3698. data: data
  3699. });
  3700. }
  3701. /**
  3702. * 列表查询
  3703. * @param data
  3704. * @returns
  3705. */
  3706. function getDutyRecordItemByList(data) {
  3707. return (0, _request.request)({
  3708. url: '/duty/record/item',
  3709. method: 'GET',
  3710. params: data
  3711. });
  3712. }
  3713. /**
  3714. * 列表查询
  3715. * @param data
  3716. * @returns
  3717. */
  3718. function getDutyRecord(dutyDate) {
  3719. return (0, _request.request)({
  3720. url: "/duty/record/item/my/".concat(dutyDate)
  3721. });
  3722. }
  3723. /***/ }),
  3724. /***/ 25:
  3725. /*!******************************************************************************************!*\
  3726. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3727. \******************************************************************************************/
  3728. /*! exports provided: default */
  3729. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3730. "use strict";
  3731. __webpack_require__.r(__webpack_exports__);
  3732. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3733. * Vue.js v2.6.11
  3734. * (c) 2014-2023 Evan You
  3735. * Released under the MIT License.
  3736. */
  3737. /* */
  3738. var emptyObject = Object.freeze({});
  3739. // These helpers produce better VM code in JS engines due to their
  3740. // explicitness and function inlining.
  3741. function isUndef (v) {
  3742. return v === undefined || v === null
  3743. }
  3744. function isDef (v) {
  3745. return v !== undefined && v !== null
  3746. }
  3747. function isTrue (v) {
  3748. return v === true
  3749. }
  3750. function isFalse (v) {
  3751. return v === false
  3752. }
  3753. /**
  3754. * Check if value is primitive.
  3755. */
  3756. function isPrimitive (value) {
  3757. return (
  3758. typeof value === 'string' ||
  3759. typeof value === 'number' ||
  3760. // $flow-disable-line
  3761. typeof value === 'symbol' ||
  3762. typeof value === 'boolean'
  3763. )
  3764. }
  3765. /**
  3766. * Quick object check - this is primarily used to tell
  3767. * Objects from primitive values when we know the value
  3768. * is a JSON-compliant type.
  3769. */
  3770. function isObject (obj) {
  3771. return obj !== null && typeof obj === 'object'
  3772. }
  3773. /**
  3774. * Get the raw type string of a value, e.g., [object Object].
  3775. */
  3776. var _toString = Object.prototype.toString;
  3777. function toRawType (value) {
  3778. return _toString.call(value).slice(8, -1)
  3779. }
  3780. /**
  3781. * Strict object type check. Only returns true
  3782. * for plain JavaScript objects.
  3783. */
  3784. function isPlainObject (obj) {
  3785. return _toString.call(obj) === '[object Object]'
  3786. }
  3787. function isRegExp (v) {
  3788. return _toString.call(v) === '[object RegExp]'
  3789. }
  3790. /**
  3791. * Check if val is a valid array index.
  3792. */
  3793. function isValidArrayIndex (val) {
  3794. var n = parseFloat(String(val));
  3795. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3796. }
  3797. function isPromise (val) {
  3798. return (
  3799. isDef(val) &&
  3800. typeof val.then === 'function' &&
  3801. typeof val.catch === 'function'
  3802. )
  3803. }
  3804. /**
  3805. * Convert a value to a string that is actually rendered.
  3806. */
  3807. function toString (val) {
  3808. return val == null
  3809. ? ''
  3810. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3811. ? JSON.stringify(val, null, 2)
  3812. : String(val)
  3813. }
  3814. /**
  3815. * Convert an input value to a number for persistence.
  3816. * If the conversion fails, return original string.
  3817. */
  3818. function toNumber (val) {
  3819. var n = parseFloat(val);
  3820. return isNaN(n) ? val : n
  3821. }
  3822. /**
  3823. * Make a map and return a function for checking if a key
  3824. * is in that map.
  3825. */
  3826. function makeMap (
  3827. str,
  3828. expectsLowerCase
  3829. ) {
  3830. var map = Object.create(null);
  3831. var list = str.split(',');
  3832. for (var i = 0; i < list.length; i++) {
  3833. map[list[i]] = true;
  3834. }
  3835. return expectsLowerCase
  3836. ? function (val) { return map[val.toLowerCase()]; }
  3837. : function (val) { return map[val]; }
  3838. }
  3839. /**
  3840. * Check if a tag is a built-in tag.
  3841. */
  3842. var isBuiltInTag = makeMap('slot,component', true);
  3843. /**
  3844. * Check if an attribute is a reserved attribute.
  3845. */
  3846. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  3847. /**
  3848. * Remove an item from an array.
  3849. */
  3850. function remove (arr, item) {
  3851. if (arr.length) {
  3852. var index = arr.indexOf(item);
  3853. if (index > -1) {
  3854. return arr.splice(index, 1)
  3855. }
  3856. }
  3857. }
  3858. /**
  3859. * Check whether an object has the property.
  3860. */
  3861. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3862. function hasOwn (obj, key) {
  3863. return hasOwnProperty.call(obj, key)
  3864. }
  3865. /**
  3866. * Create a cached version of a pure function.
  3867. */
  3868. function cached (fn) {
  3869. var cache = Object.create(null);
  3870. return (function cachedFn (str) {
  3871. var hit = cache[str];
  3872. return hit || (cache[str] = fn(str))
  3873. })
  3874. }
  3875. /**
  3876. * Camelize a hyphen-delimited string.
  3877. */
  3878. var camelizeRE = /-(\w)/g;
  3879. var camelize = cached(function (str) {
  3880. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3881. });
  3882. /**
  3883. * Capitalize a string.
  3884. */
  3885. var capitalize = cached(function (str) {
  3886. return str.charAt(0).toUpperCase() + str.slice(1)
  3887. });
  3888. /**
  3889. * Hyphenate a camelCase string.
  3890. */
  3891. var hyphenateRE = /\B([A-Z])/g;
  3892. var hyphenate = cached(function (str) {
  3893. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3894. });
  3895. /**
  3896. * Simple bind polyfill for environments that do not support it,
  3897. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3898. * since native bind is now performant enough in most browsers.
  3899. * But removing it would mean breaking code that was able to run in
  3900. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3901. */
  3902. /* istanbul ignore next */
  3903. function polyfillBind (fn, ctx) {
  3904. function boundFn (a) {
  3905. var l = arguments.length;
  3906. return l
  3907. ? l > 1
  3908. ? fn.apply(ctx, arguments)
  3909. : fn.call(ctx, a)
  3910. : fn.call(ctx)
  3911. }
  3912. boundFn._length = fn.length;
  3913. return boundFn
  3914. }
  3915. function nativeBind (fn, ctx) {
  3916. return fn.bind(ctx)
  3917. }
  3918. var bind = Function.prototype.bind
  3919. ? nativeBind
  3920. : polyfillBind;
  3921. /**
  3922. * Convert an Array-like object to a real Array.
  3923. */
  3924. function toArray (list, start) {
  3925. start = start || 0;
  3926. var i = list.length - start;
  3927. var ret = new Array(i);
  3928. while (i--) {
  3929. ret[i] = list[i + start];
  3930. }
  3931. return ret
  3932. }
  3933. /**
  3934. * Mix properties into target object.
  3935. */
  3936. function extend (to, _from) {
  3937. for (var key in _from) {
  3938. to[key] = _from[key];
  3939. }
  3940. return to
  3941. }
  3942. /**
  3943. * Merge an Array of Objects into a single Object.
  3944. */
  3945. function toObject (arr) {
  3946. var res = {};
  3947. for (var i = 0; i < arr.length; i++) {
  3948. if (arr[i]) {
  3949. extend(res, arr[i]);
  3950. }
  3951. }
  3952. return res
  3953. }
  3954. /* eslint-disable no-unused-vars */
  3955. /**
  3956. * Perform no operation.
  3957. * Stubbing args to make Flow happy without leaving useless transpiled code
  3958. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3959. */
  3960. function noop (a, b, c) {}
  3961. /**
  3962. * Always return false.
  3963. */
  3964. var no = function (a, b, c) { return false; };
  3965. /* eslint-enable no-unused-vars */
  3966. /**
  3967. * Return the same value.
  3968. */
  3969. var identity = function (_) { return _; };
  3970. /**
  3971. * Check if two values are loosely equal - that is,
  3972. * if they are plain objects, do they have the same shape?
  3973. */
  3974. function looseEqual (a, b) {
  3975. if (a === b) { return true }
  3976. var isObjectA = isObject(a);
  3977. var isObjectB = isObject(b);
  3978. if (isObjectA && isObjectB) {
  3979. try {
  3980. var isArrayA = Array.isArray(a);
  3981. var isArrayB = Array.isArray(b);
  3982. if (isArrayA && isArrayB) {
  3983. return a.length === b.length && a.every(function (e, i) {
  3984. return looseEqual(e, b[i])
  3985. })
  3986. } else if (a instanceof Date && b instanceof Date) {
  3987. return a.getTime() === b.getTime()
  3988. } else if (!isArrayA && !isArrayB) {
  3989. var keysA = Object.keys(a);
  3990. var keysB = Object.keys(b);
  3991. return keysA.length === keysB.length && keysA.every(function (key) {
  3992. return looseEqual(a[key], b[key])
  3993. })
  3994. } else {
  3995. /* istanbul ignore next */
  3996. return false
  3997. }
  3998. } catch (e) {
  3999. /* istanbul ignore next */
  4000. return false
  4001. }
  4002. } else if (!isObjectA && !isObjectB) {
  4003. return String(a) === String(b)
  4004. } else {
  4005. return false
  4006. }
  4007. }
  4008. /**
  4009. * Return the first index at which a loosely equal value can be
  4010. * found in the array (if value is a plain object, the array must
  4011. * contain an object of the same shape), or -1 if it is not present.
  4012. */
  4013. function looseIndexOf (arr, val) {
  4014. for (var i = 0; i < arr.length; i++) {
  4015. if (looseEqual(arr[i], val)) { return i }
  4016. }
  4017. return -1
  4018. }
  4019. /**
  4020. * Ensure a function is called only once.
  4021. */
  4022. function once (fn) {
  4023. var called = false;
  4024. return function () {
  4025. if (!called) {
  4026. called = true;
  4027. fn.apply(this, arguments);
  4028. }
  4029. }
  4030. }
  4031. var ASSET_TYPES = [
  4032. 'component',
  4033. 'directive',
  4034. 'filter'
  4035. ];
  4036. var LIFECYCLE_HOOKS = [
  4037. 'beforeCreate',
  4038. 'created',
  4039. 'beforeMount',
  4040. 'mounted',
  4041. 'beforeUpdate',
  4042. 'updated',
  4043. 'beforeDestroy',
  4044. 'destroyed',
  4045. 'activated',
  4046. 'deactivated',
  4047. 'errorCaptured',
  4048. 'serverPrefetch'
  4049. ];
  4050. /* */
  4051. var config = ({
  4052. /**
  4053. * Option merge strategies (used in core/util/options)
  4054. */
  4055. // $flow-disable-line
  4056. optionMergeStrategies: Object.create(null),
  4057. /**
  4058. * Whether to suppress warnings.
  4059. */
  4060. silent: false,
  4061. /**
  4062. * Show production mode tip message on boot?
  4063. */
  4064. productionTip: "development" !== 'production',
  4065. /**
  4066. * Whether to enable devtools
  4067. */
  4068. devtools: "development" !== 'production',
  4069. /**
  4070. * Whether to record perf
  4071. */
  4072. performance: false,
  4073. /**
  4074. * Error handler for watcher errors
  4075. */
  4076. errorHandler: null,
  4077. /**
  4078. * Warn handler for watcher warns
  4079. */
  4080. warnHandler: null,
  4081. /**
  4082. * Ignore certain custom elements
  4083. */
  4084. ignoredElements: [],
  4085. /**
  4086. * Custom user key aliases for v-on
  4087. */
  4088. // $flow-disable-line
  4089. keyCodes: Object.create(null),
  4090. /**
  4091. * Check if a tag is reserved so that it cannot be registered as a
  4092. * component. This is platform-dependent and may be overwritten.
  4093. */
  4094. isReservedTag: no,
  4095. /**
  4096. * Check if an attribute is reserved so that it cannot be used as a component
  4097. * prop. This is platform-dependent and may be overwritten.
  4098. */
  4099. isReservedAttr: no,
  4100. /**
  4101. * Check if a tag is an unknown element.
  4102. * Platform-dependent.
  4103. */
  4104. isUnknownElement: no,
  4105. /**
  4106. * Get the namespace of an element
  4107. */
  4108. getTagNamespace: noop,
  4109. /**
  4110. * Parse the real tag name for the specific platform.
  4111. */
  4112. parsePlatformTagName: identity,
  4113. /**
  4114. * Check if an attribute must be bound using property, e.g. value
  4115. * Platform-dependent.
  4116. */
  4117. mustUseProp: no,
  4118. /**
  4119. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  4120. * This will significantly reduce performance if set to false.
  4121. */
  4122. async: true,
  4123. /**
  4124. * Exposed for legacy reasons
  4125. */
  4126. _lifecycleHooks: LIFECYCLE_HOOKS
  4127. });
  4128. /* */
  4129. /**
  4130. * unicode letters used for parsing html tags, component names and property paths.
  4131. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  4132. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  4133. */
  4134. 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/;
  4135. /**
  4136. * Check if a string starts with $ or _
  4137. */
  4138. function isReserved (str) {
  4139. var c = (str + '').charCodeAt(0);
  4140. return c === 0x24 || c === 0x5F
  4141. }
  4142. /**
  4143. * Define a property.
  4144. */
  4145. function def (obj, key, val, enumerable) {
  4146. Object.defineProperty(obj, key, {
  4147. value: val,
  4148. enumerable: !!enumerable,
  4149. writable: true,
  4150. configurable: true
  4151. });
  4152. }
  4153. /**
  4154. * Parse simple path.
  4155. */
  4156. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  4157. function parsePath (path) {
  4158. if (bailRE.test(path)) {
  4159. return
  4160. }
  4161. var segments = path.split('.');
  4162. return function (obj) {
  4163. for (var i = 0; i < segments.length; i++) {
  4164. if (!obj) { return }
  4165. obj = obj[segments[i]];
  4166. }
  4167. return obj
  4168. }
  4169. }
  4170. /* */
  4171. // can we use __proto__?
  4172. var hasProto = '__proto__' in {};
  4173. // Browser environment sniffing
  4174. var inBrowser = typeof window !== 'undefined';
  4175. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  4176. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  4177. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  4178. var isIE = UA && /msie|trident/.test(UA);
  4179. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  4180. var isEdge = UA && UA.indexOf('edge/') > 0;
  4181. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  4182. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  4183. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  4184. var isPhantomJS = UA && /phantomjs/.test(UA);
  4185. var isFF = UA && UA.match(/firefox\/(\d+)/);
  4186. // Firefox has a "watch" function on Object.prototype...
  4187. var nativeWatch = ({}).watch;
  4188. if (inBrowser) {
  4189. try {
  4190. var opts = {};
  4191. Object.defineProperty(opts, 'passive', ({
  4192. get: function get () {
  4193. }
  4194. })); // https://github.com/facebook/flow/issues/285
  4195. window.addEventListener('test-passive', null, opts);
  4196. } catch (e) {}
  4197. }
  4198. // this needs to be lazy-evaled because vue may be required before
  4199. // vue-server-renderer can set VUE_ENV
  4200. var _isServer;
  4201. var isServerRendering = function () {
  4202. if (_isServer === undefined) {
  4203. /* istanbul ignore if */
  4204. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  4205. // detect presence of vue-server-renderer and avoid
  4206. // Webpack shimming the process
  4207. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  4208. } else {
  4209. _isServer = false;
  4210. }
  4211. }
  4212. return _isServer
  4213. };
  4214. // detect devtools
  4215. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  4216. /* istanbul ignore next */
  4217. function isNative (Ctor) {
  4218. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  4219. }
  4220. var hasSymbol =
  4221. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  4222. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  4223. var _Set;
  4224. /* istanbul ignore if */ // $flow-disable-line
  4225. if (typeof Set !== 'undefined' && isNative(Set)) {
  4226. // use native Set when available.
  4227. _Set = Set;
  4228. } else {
  4229. // a non-standard Set polyfill that only works with primitive keys.
  4230. _Set = /*@__PURE__*/(function () {
  4231. function Set () {
  4232. this.set = Object.create(null);
  4233. }
  4234. Set.prototype.has = function has (key) {
  4235. return this.set[key] === true
  4236. };
  4237. Set.prototype.add = function add (key) {
  4238. this.set[key] = true;
  4239. };
  4240. Set.prototype.clear = function clear () {
  4241. this.set = Object.create(null);
  4242. };
  4243. return Set;
  4244. }());
  4245. }
  4246. /* */
  4247. var warn = noop;
  4248. var tip = noop;
  4249. var generateComponentTrace = (noop); // work around flow check
  4250. var formatComponentName = (noop);
  4251. if (true) {
  4252. var hasConsole = typeof console !== 'undefined';
  4253. var classifyRE = /(?:^|[-_])(\w)/g;
  4254. var classify = function (str) { return str
  4255. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  4256. .replace(/[-_]/g, ''); };
  4257. warn = function (msg, vm) {
  4258. var trace = vm ? generateComponentTrace(vm) : '';
  4259. if (config.warnHandler) {
  4260. config.warnHandler.call(null, msg, vm, trace);
  4261. } else if (hasConsole && (!config.silent)) {
  4262. console.error(("[Vue warn]: " + msg + trace));
  4263. }
  4264. };
  4265. tip = function (msg, vm) {
  4266. if (hasConsole && (!config.silent)) {
  4267. console.warn("[Vue tip]: " + msg + (
  4268. vm ? generateComponentTrace(vm) : ''
  4269. ));
  4270. }
  4271. };
  4272. formatComponentName = function (vm, includeFile) {
  4273. if (vm.$root === vm) {
  4274. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  4275. return ('') + vm.$options.__file
  4276. }
  4277. return '<Root>'
  4278. }
  4279. var options = typeof vm === 'function' && vm.cid != null
  4280. ? vm.options
  4281. : vm._isVue
  4282. ? vm.$options || vm.constructor.options
  4283. : vm;
  4284. var name = options.name || options._componentTag;
  4285. var file = options.__file;
  4286. if (!name && file) {
  4287. var match = file.match(/([^/\\]+)\.vue$/);
  4288. name = match && match[1];
  4289. }
  4290. return (
  4291. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  4292. (file && includeFile !== false ? (" at " + file) : '')
  4293. )
  4294. };
  4295. var repeat = function (str, n) {
  4296. var res = '';
  4297. while (n) {
  4298. if (n % 2 === 1) { res += str; }
  4299. if (n > 1) { str += str; }
  4300. n >>= 1;
  4301. }
  4302. return res
  4303. };
  4304. generateComponentTrace = function (vm) {
  4305. if (vm._isVue && vm.$parent) {
  4306. var tree = [];
  4307. var currentRecursiveSequence = 0;
  4308. while (vm && vm.$options.name !== 'PageBody') {
  4309. if (tree.length > 0) {
  4310. var last = tree[tree.length - 1];
  4311. if (last.constructor === vm.constructor) {
  4312. currentRecursiveSequence++;
  4313. vm = vm.$parent;
  4314. continue
  4315. } else if (currentRecursiveSequence > 0) {
  4316. tree[tree.length - 1] = [last, currentRecursiveSequence];
  4317. currentRecursiveSequence = 0;
  4318. }
  4319. }
  4320. !vm.$options.isReserved && tree.push(vm);
  4321. vm = vm.$parent;
  4322. }
  4323. return '\n\nfound in\n\n' + tree
  4324. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  4325. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  4326. : formatComponentName(vm))); })
  4327. .join('\n')
  4328. } else {
  4329. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  4330. }
  4331. };
  4332. }
  4333. /* */
  4334. var uid = 0;
  4335. /**
  4336. * A dep is an observable that can have multiple
  4337. * directives subscribing to it.
  4338. */
  4339. var Dep = function Dep () {
  4340. this.id = uid++;
  4341. this.subs = [];
  4342. };
  4343. Dep.prototype.addSub = function addSub (sub) {
  4344. this.subs.push(sub);
  4345. };
  4346. Dep.prototype.removeSub = function removeSub (sub) {
  4347. remove(this.subs, sub);
  4348. };
  4349. Dep.prototype.depend = function depend () {
  4350. if (Dep.SharedObject.target) {
  4351. Dep.SharedObject.target.addDep(this);
  4352. }
  4353. };
  4354. Dep.prototype.notify = function notify () {
  4355. // stabilize the subscriber list first
  4356. var subs = this.subs.slice();
  4357. if ( true && !config.async) {
  4358. // subs aren't sorted in scheduler if not running async
  4359. // we need to sort them now to make sure they fire in correct
  4360. // order
  4361. subs.sort(function (a, b) { return a.id - b.id; });
  4362. }
  4363. for (var i = 0, l = subs.length; i < l; i++) {
  4364. subs[i].update();
  4365. }
  4366. };
  4367. // The current target watcher being evaluated.
  4368. // This is globally unique because only one watcher
  4369. // can be evaluated at a time.
  4370. // fixed by xxxxxx (nvue shared vuex)
  4371. /* eslint-disable no-undef */
  4372. Dep.SharedObject = {};
  4373. Dep.SharedObject.target = null;
  4374. Dep.SharedObject.targetStack = [];
  4375. function pushTarget (target) {
  4376. Dep.SharedObject.targetStack.push(target);
  4377. Dep.SharedObject.target = target;
  4378. Dep.target = target;
  4379. }
  4380. function popTarget () {
  4381. Dep.SharedObject.targetStack.pop();
  4382. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  4383. Dep.target = Dep.SharedObject.target;
  4384. }
  4385. /* */
  4386. var VNode = function VNode (
  4387. tag,
  4388. data,
  4389. children,
  4390. text,
  4391. elm,
  4392. context,
  4393. componentOptions,
  4394. asyncFactory
  4395. ) {
  4396. this.tag = tag;
  4397. this.data = data;
  4398. this.children = children;
  4399. this.text = text;
  4400. this.elm = elm;
  4401. this.ns = undefined;
  4402. this.context = context;
  4403. this.fnContext = undefined;
  4404. this.fnOptions = undefined;
  4405. this.fnScopeId = undefined;
  4406. this.key = data && data.key;
  4407. this.componentOptions = componentOptions;
  4408. this.componentInstance = undefined;
  4409. this.parent = undefined;
  4410. this.raw = false;
  4411. this.isStatic = false;
  4412. this.isRootInsert = true;
  4413. this.isComment = false;
  4414. this.isCloned = false;
  4415. this.isOnce = false;
  4416. this.asyncFactory = asyncFactory;
  4417. this.asyncMeta = undefined;
  4418. this.isAsyncPlaceholder = false;
  4419. };
  4420. var prototypeAccessors = { child: { configurable: true } };
  4421. // DEPRECATED: alias for componentInstance for backwards compat.
  4422. /* istanbul ignore next */
  4423. prototypeAccessors.child.get = function () {
  4424. return this.componentInstance
  4425. };
  4426. Object.defineProperties( VNode.prototype, prototypeAccessors );
  4427. var createEmptyVNode = function (text) {
  4428. if ( text === void 0 ) text = '';
  4429. var node = new VNode();
  4430. node.text = text;
  4431. node.isComment = true;
  4432. return node
  4433. };
  4434. function createTextVNode (val) {
  4435. return new VNode(undefined, undefined, undefined, String(val))
  4436. }
  4437. // optimized shallow clone
  4438. // used for static nodes and slot nodes because they may be reused across
  4439. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4440. // on their elm reference.
  4441. function cloneVNode (vnode) {
  4442. var cloned = new VNode(
  4443. vnode.tag,
  4444. vnode.data,
  4445. // #7975
  4446. // clone children array to avoid mutating original in case of cloning
  4447. // a child.
  4448. vnode.children && vnode.children.slice(),
  4449. vnode.text,
  4450. vnode.elm,
  4451. vnode.context,
  4452. vnode.componentOptions,
  4453. vnode.asyncFactory
  4454. );
  4455. cloned.ns = vnode.ns;
  4456. cloned.isStatic = vnode.isStatic;
  4457. cloned.key = vnode.key;
  4458. cloned.isComment = vnode.isComment;
  4459. cloned.fnContext = vnode.fnContext;
  4460. cloned.fnOptions = vnode.fnOptions;
  4461. cloned.fnScopeId = vnode.fnScopeId;
  4462. cloned.asyncMeta = vnode.asyncMeta;
  4463. cloned.isCloned = true;
  4464. return cloned
  4465. }
  4466. /*
  4467. * not type checking this file because flow doesn't play well with
  4468. * dynamically accessing methods on Array prototype
  4469. */
  4470. var arrayProto = Array.prototype;
  4471. var arrayMethods = Object.create(arrayProto);
  4472. var methodsToPatch = [
  4473. 'push',
  4474. 'pop',
  4475. 'shift',
  4476. 'unshift',
  4477. 'splice',
  4478. 'sort',
  4479. 'reverse'
  4480. ];
  4481. /**
  4482. * Intercept mutating methods and emit events
  4483. */
  4484. methodsToPatch.forEach(function (method) {
  4485. // cache original method
  4486. var original = arrayProto[method];
  4487. def(arrayMethods, method, function mutator () {
  4488. var args = [], len = arguments.length;
  4489. while ( len-- ) args[ len ] = arguments[ len ];
  4490. var result = original.apply(this, args);
  4491. var ob = this.__ob__;
  4492. var inserted;
  4493. switch (method) {
  4494. case 'push':
  4495. case 'unshift':
  4496. inserted = args;
  4497. break
  4498. case 'splice':
  4499. inserted = args.slice(2);
  4500. break
  4501. }
  4502. if (inserted) { ob.observeArray(inserted); }
  4503. // notify change
  4504. ob.dep.notify();
  4505. return result
  4506. });
  4507. });
  4508. /* */
  4509. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4510. /**
  4511. * In some cases we may want to disable observation inside a component's
  4512. * update computation.
  4513. */
  4514. var shouldObserve = true;
  4515. function toggleObserving (value) {
  4516. shouldObserve = value;
  4517. }
  4518. /**
  4519. * Observer class that is attached to each observed
  4520. * object. Once attached, the observer converts the target
  4521. * object's property keys into getter/setters that
  4522. * collect dependencies and dispatch updates.
  4523. */
  4524. var Observer = function Observer (value) {
  4525. this.value = value;
  4526. this.dep = new Dep();
  4527. this.vmCount = 0;
  4528. def(value, '__ob__', this);
  4529. if (Array.isArray(value)) {
  4530. if (hasProto) {
  4531. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4532. if(value.push !== value.__proto__.push){
  4533. copyAugment(value, arrayMethods, arrayKeys);
  4534. } else {
  4535. protoAugment(value, arrayMethods);
  4536. }
  4537. }
  4538. } else {
  4539. copyAugment(value, arrayMethods, arrayKeys);
  4540. }
  4541. this.observeArray(value);
  4542. } else {
  4543. this.walk(value);
  4544. }
  4545. };
  4546. /**
  4547. * Walk through all properties and convert them into
  4548. * getter/setters. This method should only be called when
  4549. * value type is Object.
  4550. */
  4551. Observer.prototype.walk = function walk (obj) {
  4552. var keys = Object.keys(obj);
  4553. for (var i = 0; i < keys.length; i++) {
  4554. defineReactive$$1(obj, keys[i]);
  4555. }
  4556. };
  4557. /**
  4558. * Observe a list of Array items.
  4559. */
  4560. Observer.prototype.observeArray = function observeArray (items) {
  4561. for (var i = 0, l = items.length; i < l; i++) {
  4562. observe(items[i]);
  4563. }
  4564. };
  4565. // helpers
  4566. /**
  4567. * Augment a target Object or Array by intercepting
  4568. * the prototype chain using __proto__
  4569. */
  4570. function protoAugment (target, src) {
  4571. /* eslint-disable no-proto */
  4572. target.__proto__ = src;
  4573. /* eslint-enable no-proto */
  4574. }
  4575. /**
  4576. * Augment a target Object or Array by defining
  4577. * hidden properties.
  4578. */
  4579. /* istanbul ignore next */
  4580. function copyAugment (target, src, keys) {
  4581. for (var i = 0, l = keys.length; i < l; i++) {
  4582. var key = keys[i];
  4583. def(target, key, src[key]);
  4584. }
  4585. }
  4586. /**
  4587. * Attempt to create an observer instance for a value,
  4588. * returns the new observer if successfully observed,
  4589. * or the existing observer if the value already has one.
  4590. */
  4591. function observe (value, asRootData) {
  4592. if (!isObject(value) || value instanceof VNode) {
  4593. return
  4594. }
  4595. var ob;
  4596. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4597. ob = value.__ob__;
  4598. } else if (
  4599. shouldObserve &&
  4600. !isServerRendering() &&
  4601. (Array.isArray(value) || isPlainObject(value)) &&
  4602. Object.isExtensible(value) &&
  4603. !value._isVue &&
  4604. !value.__v_isMPComponent
  4605. ) {
  4606. ob = new Observer(value);
  4607. }
  4608. if (asRootData && ob) {
  4609. ob.vmCount++;
  4610. }
  4611. return ob
  4612. }
  4613. /**
  4614. * Define a reactive property on an Object.
  4615. */
  4616. function defineReactive$$1 (
  4617. obj,
  4618. key,
  4619. val,
  4620. customSetter,
  4621. shallow
  4622. ) {
  4623. var dep = new Dep();
  4624. var property = Object.getOwnPropertyDescriptor(obj, key);
  4625. if (property && property.configurable === false) {
  4626. return
  4627. }
  4628. // cater for pre-defined getter/setters
  4629. var getter = property && property.get;
  4630. var setter = property && property.set;
  4631. if ((!getter || setter) && arguments.length === 2) {
  4632. val = obj[key];
  4633. }
  4634. var childOb = !shallow && observe(val);
  4635. Object.defineProperty(obj, key, {
  4636. enumerable: true,
  4637. configurable: true,
  4638. get: function reactiveGetter () {
  4639. var value = getter ? getter.call(obj) : val;
  4640. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4641. dep.depend();
  4642. if (childOb) {
  4643. childOb.dep.depend();
  4644. if (Array.isArray(value)) {
  4645. dependArray(value);
  4646. }
  4647. }
  4648. }
  4649. return value
  4650. },
  4651. set: function reactiveSetter (newVal) {
  4652. var value = getter ? getter.call(obj) : val;
  4653. /* eslint-disable no-self-compare */
  4654. if (newVal === value || (newVal !== newVal && value !== value)) {
  4655. return
  4656. }
  4657. /* eslint-enable no-self-compare */
  4658. if ( true && customSetter) {
  4659. customSetter();
  4660. }
  4661. // #7981: for accessor properties without setter
  4662. if (getter && !setter) { return }
  4663. if (setter) {
  4664. setter.call(obj, newVal);
  4665. } else {
  4666. val = newVal;
  4667. }
  4668. childOb = !shallow && observe(newVal);
  4669. dep.notify();
  4670. }
  4671. });
  4672. }
  4673. /**
  4674. * Set a property on an object. Adds the new property and
  4675. * triggers change notification if the property doesn't
  4676. * already exist.
  4677. */
  4678. function set (target, key, val) {
  4679. if ( true &&
  4680. (isUndef(target) || isPrimitive(target))
  4681. ) {
  4682. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4683. }
  4684. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4685. target.length = Math.max(target.length, key);
  4686. target.splice(key, 1, val);
  4687. return val
  4688. }
  4689. if (key in target && !(key in Object.prototype)) {
  4690. target[key] = val;
  4691. return val
  4692. }
  4693. var ob = (target).__ob__;
  4694. if (target._isVue || (ob && ob.vmCount)) {
  4695. true && warn(
  4696. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4697. 'at runtime - declare it upfront in the data option.'
  4698. );
  4699. return val
  4700. }
  4701. if (!ob) {
  4702. target[key] = val;
  4703. return val
  4704. }
  4705. defineReactive$$1(ob.value, key, val);
  4706. ob.dep.notify();
  4707. return val
  4708. }
  4709. /**
  4710. * Delete a property and trigger change if necessary.
  4711. */
  4712. function del (target, key) {
  4713. if ( true &&
  4714. (isUndef(target) || isPrimitive(target))
  4715. ) {
  4716. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4717. }
  4718. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4719. target.splice(key, 1);
  4720. return
  4721. }
  4722. var ob = (target).__ob__;
  4723. if (target._isVue || (ob && ob.vmCount)) {
  4724. true && warn(
  4725. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4726. '- just set it to null.'
  4727. );
  4728. return
  4729. }
  4730. if (!hasOwn(target, key)) {
  4731. return
  4732. }
  4733. delete target[key];
  4734. if (!ob) {
  4735. return
  4736. }
  4737. ob.dep.notify();
  4738. }
  4739. /**
  4740. * Collect dependencies on array elements when the array is touched, since
  4741. * we cannot intercept array element access like property getters.
  4742. */
  4743. function dependArray (value) {
  4744. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4745. e = value[i];
  4746. e && e.__ob__ && e.__ob__.dep.depend();
  4747. if (Array.isArray(e)) {
  4748. dependArray(e);
  4749. }
  4750. }
  4751. }
  4752. /* */
  4753. /**
  4754. * Option overwriting strategies are functions that handle
  4755. * how to merge a parent option value and a child option
  4756. * value into the final value.
  4757. */
  4758. var strats = config.optionMergeStrategies;
  4759. /**
  4760. * Options with restrictions
  4761. */
  4762. if (true) {
  4763. strats.el = strats.propsData = function (parent, child, vm, key) {
  4764. if (!vm) {
  4765. warn(
  4766. "option \"" + key + "\" can only be used during instance " +
  4767. 'creation with the `new` keyword.'
  4768. );
  4769. }
  4770. return defaultStrat(parent, child)
  4771. };
  4772. }
  4773. /**
  4774. * Helper that recursively merges two data objects together.
  4775. */
  4776. function mergeData (to, from) {
  4777. if (!from) { return to }
  4778. var key, toVal, fromVal;
  4779. var keys = hasSymbol
  4780. ? Reflect.ownKeys(from)
  4781. : Object.keys(from);
  4782. for (var i = 0; i < keys.length; i++) {
  4783. key = keys[i];
  4784. // in case the object is already observed...
  4785. if (key === '__ob__') { continue }
  4786. toVal = to[key];
  4787. fromVal = from[key];
  4788. if (!hasOwn(to, key)) {
  4789. set(to, key, fromVal);
  4790. } else if (
  4791. toVal !== fromVal &&
  4792. isPlainObject(toVal) &&
  4793. isPlainObject(fromVal)
  4794. ) {
  4795. mergeData(toVal, fromVal);
  4796. }
  4797. }
  4798. return to
  4799. }
  4800. /**
  4801. * Data
  4802. */
  4803. function mergeDataOrFn (
  4804. parentVal,
  4805. childVal,
  4806. vm
  4807. ) {
  4808. if (!vm) {
  4809. // in a Vue.extend merge, both should be functions
  4810. if (!childVal) {
  4811. return parentVal
  4812. }
  4813. if (!parentVal) {
  4814. return childVal
  4815. }
  4816. // when parentVal & childVal are both present,
  4817. // we need to return a function that returns the
  4818. // merged result of both functions... no need to
  4819. // check if parentVal is a function here because
  4820. // it has to be a function to pass previous merges.
  4821. return function mergedDataFn () {
  4822. return mergeData(
  4823. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  4824. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  4825. )
  4826. }
  4827. } else {
  4828. return function mergedInstanceDataFn () {
  4829. // instance merge
  4830. var instanceData = typeof childVal === 'function'
  4831. ? childVal.call(vm, vm)
  4832. : childVal;
  4833. var defaultData = typeof parentVal === 'function'
  4834. ? parentVal.call(vm, vm)
  4835. : parentVal;
  4836. if (instanceData) {
  4837. return mergeData(instanceData, defaultData)
  4838. } else {
  4839. return defaultData
  4840. }
  4841. }
  4842. }
  4843. }
  4844. strats.data = function (
  4845. parentVal,
  4846. childVal,
  4847. vm
  4848. ) {
  4849. if (!vm) {
  4850. if (childVal && typeof childVal !== 'function') {
  4851. true && warn(
  4852. 'The "data" option should be a function ' +
  4853. 'that returns a per-instance value in component ' +
  4854. 'definitions.',
  4855. vm
  4856. );
  4857. return parentVal
  4858. }
  4859. return mergeDataOrFn(parentVal, childVal)
  4860. }
  4861. return mergeDataOrFn(parentVal, childVal, vm)
  4862. };
  4863. /**
  4864. * Hooks and props are merged as arrays.
  4865. */
  4866. function mergeHook (
  4867. parentVal,
  4868. childVal
  4869. ) {
  4870. var res = childVal
  4871. ? parentVal
  4872. ? parentVal.concat(childVal)
  4873. : Array.isArray(childVal)
  4874. ? childVal
  4875. : [childVal]
  4876. : parentVal;
  4877. return res
  4878. ? dedupeHooks(res)
  4879. : res
  4880. }
  4881. function dedupeHooks (hooks) {
  4882. var res = [];
  4883. for (var i = 0; i < hooks.length; i++) {
  4884. if (res.indexOf(hooks[i]) === -1) {
  4885. res.push(hooks[i]);
  4886. }
  4887. }
  4888. return res
  4889. }
  4890. LIFECYCLE_HOOKS.forEach(function (hook) {
  4891. strats[hook] = mergeHook;
  4892. });
  4893. /**
  4894. * Assets
  4895. *
  4896. * When a vm is present (instance creation), we need to do
  4897. * a three-way merge between constructor options, instance
  4898. * options and parent options.
  4899. */
  4900. function mergeAssets (
  4901. parentVal,
  4902. childVal,
  4903. vm,
  4904. key
  4905. ) {
  4906. var res = Object.create(parentVal || null);
  4907. if (childVal) {
  4908. true && assertObjectType(key, childVal, vm);
  4909. return extend(res, childVal)
  4910. } else {
  4911. return res
  4912. }
  4913. }
  4914. ASSET_TYPES.forEach(function (type) {
  4915. strats[type + 's'] = mergeAssets;
  4916. });
  4917. /**
  4918. * Watchers.
  4919. *
  4920. * Watchers hashes should not overwrite one
  4921. * another, so we merge them as arrays.
  4922. */
  4923. strats.watch = function (
  4924. parentVal,
  4925. childVal,
  4926. vm,
  4927. key
  4928. ) {
  4929. // work around Firefox's Object.prototype.watch...
  4930. if (parentVal === nativeWatch) { parentVal = undefined; }
  4931. if (childVal === nativeWatch) { childVal = undefined; }
  4932. /* istanbul ignore if */
  4933. if (!childVal) { return Object.create(parentVal || null) }
  4934. if (true) {
  4935. assertObjectType(key, childVal, vm);
  4936. }
  4937. if (!parentVal) { return childVal }
  4938. var ret = {};
  4939. extend(ret, parentVal);
  4940. for (var key$1 in childVal) {
  4941. var parent = ret[key$1];
  4942. var child = childVal[key$1];
  4943. if (parent && !Array.isArray(parent)) {
  4944. parent = [parent];
  4945. }
  4946. ret[key$1] = parent
  4947. ? parent.concat(child)
  4948. : Array.isArray(child) ? child : [child];
  4949. }
  4950. return ret
  4951. };
  4952. /**
  4953. * Other object hashes.
  4954. */
  4955. strats.props =
  4956. strats.methods =
  4957. strats.inject =
  4958. strats.computed = function (
  4959. parentVal,
  4960. childVal,
  4961. vm,
  4962. key
  4963. ) {
  4964. if (childVal && "development" !== 'production') {
  4965. assertObjectType(key, childVal, vm);
  4966. }
  4967. if (!parentVal) { return childVal }
  4968. var ret = Object.create(null);
  4969. extend(ret, parentVal);
  4970. if (childVal) { extend(ret, childVal); }
  4971. return ret
  4972. };
  4973. strats.provide = mergeDataOrFn;
  4974. /**
  4975. * Default strategy.
  4976. */
  4977. var defaultStrat = function (parentVal, childVal) {
  4978. return childVal === undefined
  4979. ? parentVal
  4980. : childVal
  4981. };
  4982. /**
  4983. * Validate component names
  4984. */
  4985. function checkComponents (options) {
  4986. for (var key in options.components) {
  4987. validateComponentName(key);
  4988. }
  4989. }
  4990. function validateComponentName (name) {
  4991. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4992. warn(
  4993. 'Invalid component name: "' + name + '". Component names ' +
  4994. 'should conform to valid custom element name in html5 specification.'
  4995. );
  4996. }
  4997. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4998. warn(
  4999. 'Do not use built-in or reserved HTML elements as component ' +
  5000. 'id: ' + name
  5001. );
  5002. }
  5003. }
  5004. /**
  5005. * Ensure all props option syntax are normalized into the
  5006. * Object-based format.
  5007. */
  5008. function normalizeProps (options, vm) {
  5009. var props = options.props;
  5010. if (!props) { return }
  5011. var res = {};
  5012. var i, val, name;
  5013. if (Array.isArray(props)) {
  5014. i = props.length;
  5015. while (i--) {
  5016. val = props[i];
  5017. if (typeof val === 'string') {
  5018. name = camelize(val);
  5019. res[name] = { type: null };
  5020. } else if (true) {
  5021. warn('props must be strings when using array syntax.');
  5022. }
  5023. }
  5024. } else if (isPlainObject(props)) {
  5025. for (var key in props) {
  5026. val = props[key];
  5027. name = camelize(key);
  5028. res[name] = isPlainObject(val)
  5029. ? val
  5030. : { type: val };
  5031. }
  5032. } else if (true) {
  5033. warn(
  5034. "Invalid value for option \"props\": expected an Array or an Object, " +
  5035. "but got " + (toRawType(props)) + ".",
  5036. vm
  5037. );
  5038. }
  5039. options.props = res;
  5040. }
  5041. /**
  5042. * Normalize all injections into Object-based format
  5043. */
  5044. function normalizeInject (options, vm) {
  5045. var inject = options.inject;
  5046. if (!inject) { return }
  5047. var normalized = options.inject = {};
  5048. if (Array.isArray(inject)) {
  5049. for (var i = 0; i < inject.length; i++) {
  5050. normalized[inject[i]] = { from: inject[i] };
  5051. }
  5052. } else if (isPlainObject(inject)) {
  5053. for (var key in inject) {
  5054. var val = inject[key];
  5055. normalized[key] = isPlainObject(val)
  5056. ? extend({ from: key }, val)
  5057. : { from: val };
  5058. }
  5059. } else if (true) {
  5060. warn(
  5061. "Invalid value for option \"inject\": expected an Array or an Object, " +
  5062. "but got " + (toRawType(inject)) + ".",
  5063. vm
  5064. );
  5065. }
  5066. }
  5067. /**
  5068. * Normalize raw function directives into object format.
  5069. */
  5070. function normalizeDirectives (options) {
  5071. var dirs = options.directives;
  5072. if (dirs) {
  5073. for (var key in dirs) {
  5074. var def$$1 = dirs[key];
  5075. if (typeof def$$1 === 'function') {
  5076. dirs[key] = { bind: def$$1, update: def$$1 };
  5077. }
  5078. }
  5079. }
  5080. }
  5081. function assertObjectType (name, value, vm) {
  5082. if (!isPlainObject(value)) {
  5083. warn(
  5084. "Invalid value for option \"" + name + "\": expected an Object, " +
  5085. "but got " + (toRawType(value)) + ".",
  5086. vm
  5087. );
  5088. }
  5089. }
  5090. /**
  5091. * Merge two option objects into a new one.
  5092. * Core utility used in both instantiation and inheritance.
  5093. */
  5094. function mergeOptions (
  5095. parent,
  5096. child,
  5097. vm
  5098. ) {
  5099. if (true) {
  5100. checkComponents(child);
  5101. }
  5102. if (typeof child === 'function') {
  5103. child = child.options;
  5104. }
  5105. normalizeProps(child, vm);
  5106. normalizeInject(child, vm);
  5107. normalizeDirectives(child);
  5108. // Apply extends and mixins on the child options,
  5109. // but only if it is a raw options object that isn't
  5110. // the result of another mergeOptions call.
  5111. // Only merged options has the _base property.
  5112. if (!child._base) {
  5113. if (child.extends) {
  5114. parent = mergeOptions(parent, child.extends, vm);
  5115. }
  5116. if (child.mixins) {
  5117. for (var i = 0, l = child.mixins.length; i < l; i++) {
  5118. parent = mergeOptions(parent, child.mixins[i], vm);
  5119. }
  5120. }
  5121. }
  5122. var options = {};
  5123. var key;
  5124. for (key in parent) {
  5125. mergeField(key);
  5126. }
  5127. for (key in child) {
  5128. if (!hasOwn(parent, key)) {
  5129. mergeField(key);
  5130. }
  5131. }
  5132. function mergeField (key) {
  5133. var strat = strats[key] || defaultStrat;
  5134. options[key] = strat(parent[key], child[key], vm, key);
  5135. }
  5136. return options
  5137. }
  5138. /**
  5139. * Resolve an asset.
  5140. * This function is used because child instances need access
  5141. * to assets defined in its ancestor chain.
  5142. */
  5143. function resolveAsset (
  5144. options,
  5145. type,
  5146. id,
  5147. warnMissing
  5148. ) {
  5149. /* istanbul ignore if */
  5150. if (typeof id !== 'string') {
  5151. return
  5152. }
  5153. var assets = options[type];
  5154. // check local registration variations first
  5155. if (hasOwn(assets, id)) { return assets[id] }
  5156. var camelizedId = camelize(id);
  5157. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  5158. var PascalCaseId = capitalize(camelizedId);
  5159. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  5160. // fallback to prototype chain
  5161. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  5162. if ( true && warnMissing && !res) {
  5163. warn(
  5164. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  5165. options
  5166. );
  5167. }
  5168. return res
  5169. }
  5170. /* */
  5171. function validateProp (
  5172. key,
  5173. propOptions,
  5174. propsData,
  5175. vm
  5176. ) {
  5177. var prop = propOptions[key];
  5178. var absent = !hasOwn(propsData, key);
  5179. var value = propsData[key];
  5180. // boolean casting
  5181. var booleanIndex = getTypeIndex(Boolean, prop.type);
  5182. if (booleanIndex > -1) {
  5183. if (absent && !hasOwn(prop, 'default')) {
  5184. value = false;
  5185. } else if (value === '' || value === hyphenate(key)) {
  5186. // only cast empty string / same name to boolean if
  5187. // boolean has higher priority
  5188. var stringIndex = getTypeIndex(String, prop.type);
  5189. if (stringIndex < 0 || booleanIndex < stringIndex) {
  5190. value = true;
  5191. }
  5192. }
  5193. }
  5194. // check default value
  5195. if (value === undefined) {
  5196. value = getPropDefaultValue(vm, prop, key);
  5197. // since the default value is a fresh copy,
  5198. // make sure to observe it.
  5199. var prevShouldObserve = shouldObserve;
  5200. toggleObserving(true);
  5201. observe(value);
  5202. toggleObserving(prevShouldObserve);
  5203. }
  5204. if (
  5205. true
  5206. ) {
  5207. assertProp(prop, key, value, vm, absent);
  5208. }
  5209. return value
  5210. }
  5211. /**
  5212. * Get the default value of a prop.
  5213. */
  5214. function getPropDefaultValue (vm, prop, key) {
  5215. // no default, return undefined
  5216. if (!hasOwn(prop, 'default')) {
  5217. return undefined
  5218. }
  5219. var def = prop.default;
  5220. // warn against non-factory defaults for Object & Array
  5221. if ( true && isObject(def)) {
  5222. warn(
  5223. 'Invalid default value for prop "' + key + '": ' +
  5224. 'Props with type Object/Array must use a factory function ' +
  5225. 'to return the default value.',
  5226. vm
  5227. );
  5228. }
  5229. // the raw prop value was also undefined from previous render,
  5230. // return previous default value to avoid unnecessary watcher trigger
  5231. if (vm && vm.$options.propsData &&
  5232. vm.$options.propsData[key] === undefined &&
  5233. vm._props[key] !== undefined
  5234. ) {
  5235. return vm._props[key]
  5236. }
  5237. // call factory function for non-Function types
  5238. // a value is Function if its prototype is function even across different execution context
  5239. return typeof def === 'function' && getType(prop.type) !== 'Function'
  5240. ? def.call(vm)
  5241. : def
  5242. }
  5243. /**
  5244. * Assert whether a prop is valid.
  5245. */
  5246. function assertProp (
  5247. prop,
  5248. name,
  5249. value,
  5250. vm,
  5251. absent
  5252. ) {
  5253. if (prop.required && absent) {
  5254. warn(
  5255. 'Missing required prop: "' + name + '"',
  5256. vm
  5257. );
  5258. return
  5259. }
  5260. if (value == null && !prop.required) {
  5261. return
  5262. }
  5263. var type = prop.type;
  5264. var valid = !type || type === true;
  5265. var expectedTypes = [];
  5266. if (type) {
  5267. if (!Array.isArray(type)) {
  5268. type = [type];
  5269. }
  5270. for (var i = 0; i < type.length && !valid; i++) {
  5271. var assertedType = assertType(value, type[i]);
  5272. expectedTypes.push(assertedType.expectedType || '');
  5273. valid = assertedType.valid;
  5274. }
  5275. }
  5276. if (!valid) {
  5277. warn(
  5278. getInvalidTypeMessage(name, value, expectedTypes),
  5279. vm
  5280. );
  5281. return
  5282. }
  5283. var validator = prop.validator;
  5284. if (validator) {
  5285. if (!validator(value)) {
  5286. warn(
  5287. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  5288. vm
  5289. );
  5290. }
  5291. }
  5292. }
  5293. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  5294. function assertType (value, type) {
  5295. var valid;
  5296. var expectedType = getType(type);
  5297. if (simpleCheckRE.test(expectedType)) {
  5298. var t = typeof value;
  5299. valid = t === expectedType.toLowerCase();
  5300. // for primitive wrapper objects
  5301. if (!valid && t === 'object') {
  5302. valid = value instanceof type;
  5303. }
  5304. } else if (expectedType === 'Object') {
  5305. valid = isPlainObject(value);
  5306. } else if (expectedType === 'Array') {
  5307. valid = Array.isArray(value);
  5308. } else {
  5309. valid = value instanceof type;
  5310. }
  5311. return {
  5312. valid: valid,
  5313. expectedType: expectedType
  5314. }
  5315. }
  5316. /**
  5317. * Use function string name to check built-in types,
  5318. * because a simple equality check will fail when running
  5319. * across different vms / iframes.
  5320. */
  5321. function getType (fn) {
  5322. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  5323. return match ? match[1] : ''
  5324. }
  5325. function isSameType (a, b) {
  5326. return getType(a) === getType(b)
  5327. }
  5328. function getTypeIndex (type, expectedTypes) {
  5329. if (!Array.isArray(expectedTypes)) {
  5330. return isSameType(expectedTypes, type) ? 0 : -1
  5331. }
  5332. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  5333. if (isSameType(expectedTypes[i], type)) {
  5334. return i
  5335. }
  5336. }
  5337. return -1
  5338. }
  5339. function getInvalidTypeMessage (name, value, expectedTypes) {
  5340. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  5341. " Expected " + (expectedTypes.map(capitalize).join(', '));
  5342. var expectedType = expectedTypes[0];
  5343. var receivedType = toRawType(value);
  5344. var expectedValue = styleValue(value, expectedType);
  5345. var receivedValue = styleValue(value, receivedType);
  5346. // check if we need to specify expected value
  5347. if (expectedTypes.length === 1 &&
  5348. isExplicable(expectedType) &&
  5349. !isBoolean(expectedType, receivedType)) {
  5350. message += " with value " + expectedValue;
  5351. }
  5352. message += ", got " + receivedType + " ";
  5353. // check if we need to specify received value
  5354. if (isExplicable(receivedType)) {
  5355. message += "with value " + receivedValue + ".";
  5356. }
  5357. return message
  5358. }
  5359. function styleValue (value, type) {
  5360. if (type === 'String') {
  5361. return ("\"" + value + "\"")
  5362. } else if (type === 'Number') {
  5363. return ("" + (Number(value)))
  5364. } else {
  5365. return ("" + value)
  5366. }
  5367. }
  5368. function isExplicable (value) {
  5369. var explicitTypes = ['string', 'number', 'boolean'];
  5370. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  5371. }
  5372. function isBoolean () {
  5373. var args = [], len = arguments.length;
  5374. while ( len-- ) args[ len ] = arguments[ len ];
  5375. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  5376. }
  5377. /* */
  5378. function handleError (err, vm, info) {
  5379. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  5380. // See: https://github.com/vuejs/vuex/issues/1505
  5381. pushTarget();
  5382. try {
  5383. if (vm) {
  5384. var cur = vm;
  5385. while ((cur = cur.$parent)) {
  5386. var hooks = cur.$options.errorCaptured;
  5387. if (hooks) {
  5388. for (var i = 0; i < hooks.length; i++) {
  5389. try {
  5390. var capture = hooks[i].call(cur, err, vm, info) === false;
  5391. if (capture) { return }
  5392. } catch (e) {
  5393. globalHandleError(e, cur, 'errorCaptured hook');
  5394. }
  5395. }
  5396. }
  5397. }
  5398. }
  5399. globalHandleError(err, vm, info);
  5400. } finally {
  5401. popTarget();
  5402. }
  5403. }
  5404. function invokeWithErrorHandling (
  5405. handler,
  5406. context,
  5407. args,
  5408. vm,
  5409. info
  5410. ) {
  5411. var res;
  5412. try {
  5413. res = args ? handler.apply(context, args) : handler.call(context);
  5414. if (res && !res._isVue && isPromise(res) && !res._handled) {
  5415. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  5416. // issue #9511
  5417. // avoid catch triggering multiple times when nested calls
  5418. res._handled = true;
  5419. }
  5420. } catch (e) {
  5421. handleError(e, vm, info);
  5422. }
  5423. return res
  5424. }
  5425. function globalHandleError (err, vm, info) {
  5426. if (config.errorHandler) {
  5427. try {
  5428. return config.errorHandler.call(null, err, vm, info)
  5429. } catch (e) {
  5430. // if the user intentionally throws the original error in the handler,
  5431. // do not log it twice
  5432. if (e !== err) {
  5433. logError(e, null, 'config.errorHandler');
  5434. }
  5435. }
  5436. }
  5437. logError(err, vm, info);
  5438. }
  5439. function logError (err, vm, info) {
  5440. if (true) {
  5441. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5442. }
  5443. /* istanbul ignore else */
  5444. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5445. console.error(err);
  5446. } else {
  5447. throw err
  5448. }
  5449. }
  5450. /* */
  5451. var callbacks = [];
  5452. var pending = false;
  5453. function flushCallbacks () {
  5454. pending = false;
  5455. var copies = callbacks.slice(0);
  5456. callbacks.length = 0;
  5457. for (var i = 0; i < copies.length; i++) {
  5458. copies[i]();
  5459. }
  5460. }
  5461. // Here we have async deferring wrappers using microtasks.
  5462. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5463. // However, it has subtle problems when state is changed right before repaint
  5464. // (e.g. #6813, out-in transitions).
  5465. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5466. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5467. // So we now use microtasks everywhere, again.
  5468. // A major drawback of this tradeoff is that there are some scenarios
  5469. // where microtasks have too high a priority and fire in between supposedly
  5470. // sequential events (e.g. #4521, #6690, which have workarounds)
  5471. // or even between bubbling of the same event (#6566).
  5472. var timerFunc;
  5473. // The nextTick behavior leverages the microtask queue, which can be accessed
  5474. // via either native Promise.then or MutationObserver.
  5475. // MutationObserver has wider support, however it is seriously bugged in
  5476. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5477. // completely stops working after triggering a few times... so, if native
  5478. // Promise is available, we will use it:
  5479. /* istanbul ignore next, $flow-disable-line */
  5480. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5481. var p = Promise.resolve();
  5482. timerFunc = function () {
  5483. p.then(flushCallbacks);
  5484. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5485. // it can get stuck in a weird state where callbacks are pushed into the
  5486. // microtask queue but the queue isn't being flushed, until the browser
  5487. // needs to do some other work, e.g. handle a timer. Therefore we can
  5488. // "force" the microtask queue to be flushed by adding an empty timer.
  5489. if (isIOS) { setTimeout(noop); }
  5490. };
  5491. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5492. isNative(MutationObserver) ||
  5493. // PhantomJS and iOS 7.x
  5494. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5495. )) {
  5496. // Use MutationObserver where native Promise is not available,
  5497. // e.g. PhantomJS, iOS7, Android 4.4
  5498. // (#6466 MutationObserver is unreliable in IE11)
  5499. var counter = 1;
  5500. var observer = new MutationObserver(flushCallbacks);
  5501. var textNode = document.createTextNode(String(counter));
  5502. observer.observe(textNode, {
  5503. characterData: true
  5504. });
  5505. timerFunc = function () {
  5506. counter = (counter + 1) % 2;
  5507. textNode.data = String(counter);
  5508. };
  5509. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5510. // Fallback to setImmediate.
  5511. // Technically it leverages the (macro) task queue,
  5512. // but it is still a better choice than setTimeout.
  5513. timerFunc = function () {
  5514. setImmediate(flushCallbacks);
  5515. };
  5516. } else {
  5517. // Fallback to setTimeout.
  5518. timerFunc = function () {
  5519. setTimeout(flushCallbacks, 0);
  5520. };
  5521. }
  5522. function nextTick (cb, ctx) {
  5523. var _resolve;
  5524. callbacks.push(function () {
  5525. if (cb) {
  5526. try {
  5527. cb.call(ctx);
  5528. } catch (e) {
  5529. handleError(e, ctx, 'nextTick');
  5530. }
  5531. } else if (_resolve) {
  5532. _resolve(ctx);
  5533. }
  5534. });
  5535. if (!pending) {
  5536. pending = true;
  5537. timerFunc();
  5538. }
  5539. // $flow-disable-line
  5540. if (!cb && typeof Promise !== 'undefined') {
  5541. return new Promise(function (resolve) {
  5542. _resolve = resolve;
  5543. })
  5544. }
  5545. }
  5546. /* */
  5547. /* not type checking this file because flow doesn't play well with Proxy */
  5548. var initProxy;
  5549. if (true) {
  5550. var allowedGlobals = makeMap(
  5551. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5552. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5553. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5554. 'require' // for Webpack/Browserify
  5555. );
  5556. var warnNonPresent = function (target, key) {
  5557. warn(
  5558. "Property or method \"" + key + "\" is not defined on the instance but " +
  5559. 'referenced during render. Make sure that this property is reactive, ' +
  5560. 'either in the data option, or for class-based components, by ' +
  5561. 'initializing the property. ' +
  5562. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5563. target
  5564. );
  5565. };
  5566. var warnReservedPrefix = function (target, key) {
  5567. warn(
  5568. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5569. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5570. 'prevent conflicts with Vue internals. ' +
  5571. 'See: https://vuejs.org/v2/api/#data',
  5572. target
  5573. );
  5574. };
  5575. var hasProxy =
  5576. typeof Proxy !== 'undefined' && isNative(Proxy);
  5577. if (hasProxy) {
  5578. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5579. config.keyCodes = new Proxy(config.keyCodes, {
  5580. set: function set (target, key, value) {
  5581. if (isBuiltInModifier(key)) {
  5582. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5583. return false
  5584. } else {
  5585. target[key] = value;
  5586. return true
  5587. }
  5588. }
  5589. });
  5590. }
  5591. var hasHandler = {
  5592. has: function has (target, key) {
  5593. var has = key in target;
  5594. var isAllowed = allowedGlobals(key) ||
  5595. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5596. if (!has && !isAllowed) {
  5597. if (key in target.$data) { warnReservedPrefix(target, key); }
  5598. else { warnNonPresent(target, key); }
  5599. }
  5600. return has || !isAllowed
  5601. }
  5602. };
  5603. var getHandler = {
  5604. get: function get (target, key) {
  5605. if (typeof key === 'string' && !(key in target)) {
  5606. if (key in target.$data) { warnReservedPrefix(target, key); }
  5607. else { warnNonPresent(target, key); }
  5608. }
  5609. return target[key]
  5610. }
  5611. };
  5612. initProxy = function initProxy (vm) {
  5613. if (hasProxy) {
  5614. // determine which proxy handler to use
  5615. var options = vm.$options;
  5616. var handlers = options.render && options.render._withStripped
  5617. ? getHandler
  5618. : hasHandler;
  5619. vm._renderProxy = new Proxy(vm, handlers);
  5620. } else {
  5621. vm._renderProxy = vm;
  5622. }
  5623. };
  5624. }
  5625. /* */
  5626. var seenObjects = new _Set();
  5627. /**
  5628. * Recursively traverse an object to evoke all converted
  5629. * getters, so that every nested property inside the object
  5630. * is collected as a "deep" dependency.
  5631. */
  5632. function traverse (val) {
  5633. _traverse(val, seenObjects);
  5634. seenObjects.clear();
  5635. }
  5636. function _traverse (val, seen) {
  5637. var i, keys;
  5638. var isA = Array.isArray(val);
  5639. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5640. return
  5641. }
  5642. if (val.__ob__) {
  5643. var depId = val.__ob__.dep.id;
  5644. if (seen.has(depId)) {
  5645. return
  5646. }
  5647. seen.add(depId);
  5648. }
  5649. if (isA) {
  5650. i = val.length;
  5651. while (i--) { _traverse(val[i], seen); }
  5652. } else {
  5653. keys = Object.keys(val);
  5654. i = keys.length;
  5655. while (i--) { _traverse(val[keys[i]], seen); }
  5656. }
  5657. }
  5658. var mark;
  5659. var measure;
  5660. if (true) {
  5661. var perf = inBrowser && window.performance;
  5662. /* istanbul ignore if */
  5663. if (
  5664. perf &&
  5665. perf.mark &&
  5666. perf.measure &&
  5667. perf.clearMarks &&
  5668. perf.clearMeasures
  5669. ) {
  5670. mark = function (tag) { return perf.mark(tag); };
  5671. measure = function (name, startTag, endTag) {
  5672. perf.measure(name, startTag, endTag);
  5673. perf.clearMarks(startTag);
  5674. perf.clearMarks(endTag);
  5675. // perf.clearMeasures(name)
  5676. };
  5677. }
  5678. }
  5679. /* */
  5680. var normalizeEvent = cached(function (name) {
  5681. var passive = name.charAt(0) === '&';
  5682. name = passive ? name.slice(1) : name;
  5683. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5684. name = once$$1 ? name.slice(1) : name;
  5685. var capture = name.charAt(0) === '!';
  5686. name = capture ? name.slice(1) : name;
  5687. return {
  5688. name: name,
  5689. once: once$$1,
  5690. capture: capture,
  5691. passive: passive
  5692. }
  5693. });
  5694. function createFnInvoker (fns, vm) {
  5695. function invoker () {
  5696. var arguments$1 = arguments;
  5697. var fns = invoker.fns;
  5698. if (Array.isArray(fns)) {
  5699. var cloned = fns.slice();
  5700. for (var i = 0; i < cloned.length; i++) {
  5701. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5702. }
  5703. } else {
  5704. // return handler return value for single handlers
  5705. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5706. }
  5707. }
  5708. invoker.fns = fns;
  5709. return invoker
  5710. }
  5711. function updateListeners (
  5712. on,
  5713. oldOn,
  5714. add,
  5715. remove$$1,
  5716. createOnceHandler,
  5717. vm
  5718. ) {
  5719. var name, def$$1, cur, old, event;
  5720. for (name in on) {
  5721. def$$1 = cur = on[name];
  5722. old = oldOn[name];
  5723. event = normalizeEvent(name);
  5724. if (isUndef(cur)) {
  5725. true && warn(
  5726. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5727. vm
  5728. );
  5729. } else if (isUndef(old)) {
  5730. if (isUndef(cur.fns)) {
  5731. cur = on[name] = createFnInvoker(cur, vm);
  5732. }
  5733. if (isTrue(event.once)) {
  5734. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5735. }
  5736. add(event.name, cur, event.capture, event.passive, event.params);
  5737. } else if (cur !== old) {
  5738. old.fns = cur;
  5739. on[name] = old;
  5740. }
  5741. }
  5742. for (name in oldOn) {
  5743. if (isUndef(on[name])) {
  5744. event = normalizeEvent(name);
  5745. remove$$1(event.name, oldOn[name], event.capture);
  5746. }
  5747. }
  5748. }
  5749. /* */
  5750. /* */
  5751. // fixed by xxxxxx (mp properties)
  5752. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5753. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5754. if (isUndef(propOptions)) {
  5755. return res
  5756. }
  5757. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5758. var attrs = data.attrs;
  5759. var props = data.props;
  5760. if (isDef(attrs) || isDef(props)) {
  5761. for (var key in propOptions) {
  5762. var altKey = hyphenate(key);
  5763. var result = checkProp(res, props, key, altKey, true) ||
  5764. checkProp(res, attrs, key, altKey, false);
  5765. // externalClass
  5766. if (
  5767. result &&
  5768. res[key] &&
  5769. externalClasses.indexOf(altKey) !== -1 &&
  5770. context[camelize(res[key])]
  5771. ) {
  5772. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5773. res[key] = context[camelize(res[key])];
  5774. }
  5775. }
  5776. }
  5777. return res
  5778. }
  5779. function extractPropsFromVNodeData (
  5780. data,
  5781. Ctor,
  5782. tag,
  5783. context// fixed by xxxxxx
  5784. ) {
  5785. // we are only extracting raw values here.
  5786. // validation and default values are handled in the child
  5787. // component itself.
  5788. var propOptions = Ctor.options.props;
  5789. if (isUndef(propOptions)) {
  5790. // fixed by xxxxxx
  5791. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5792. }
  5793. var res = {};
  5794. var attrs = data.attrs;
  5795. var props = data.props;
  5796. if (isDef(attrs) || isDef(props)) {
  5797. for (var key in propOptions) {
  5798. var altKey = hyphenate(key);
  5799. if (true) {
  5800. var keyInLowerCase = key.toLowerCase();
  5801. if (
  5802. key !== keyInLowerCase &&
  5803. attrs && hasOwn(attrs, keyInLowerCase)
  5804. ) {
  5805. tip(
  5806. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5807. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5808. " \"" + key + "\". " +
  5809. "Note that HTML attributes are case-insensitive and camelCased " +
  5810. "props need to use their kebab-case equivalents when using in-DOM " +
  5811. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5812. );
  5813. }
  5814. }
  5815. checkProp(res, props, key, altKey, true) ||
  5816. checkProp(res, attrs, key, altKey, false);
  5817. }
  5818. }
  5819. // fixed by xxxxxx
  5820. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  5821. }
  5822. function checkProp (
  5823. res,
  5824. hash,
  5825. key,
  5826. altKey,
  5827. preserve
  5828. ) {
  5829. if (isDef(hash)) {
  5830. if (hasOwn(hash, key)) {
  5831. res[key] = hash[key];
  5832. if (!preserve) {
  5833. delete hash[key];
  5834. }
  5835. return true
  5836. } else if (hasOwn(hash, altKey)) {
  5837. res[key] = hash[altKey];
  5838. if (!preserve) {
  5839. delete hash[altKey];
  5840. }
  5841. return true
  5842. }
  5843. }
  5844. return false
  5845. }
  5846. /* */
  5847. // The template compiler attempts to minimize the need for normalization by
  5848. // statically analyzing the template at compile time.
  5849. //
  5850. // For plain HTML markup, normalization can be completely skipped because the
  5851. // generated render function is guaranteed to return Array<VNode>. There are
  5852. // two cases where extra normalization is needed:
  5853. // 1. When the children contains components - because a functional component
  5854. // may return an Array instead of a single root. In this case, just a simple
  5855. // normalization is needed - if any child is an Array, we flatten the whole
  5856. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  5857. // because functional components already normalize their own children.
  5858. function simpleNormalizeChildren (children) {
  5859. for (var i = 0; i < children.length; i++) {
  5860. if (Array.isArray(children[i])) {
  5861. return Array.prototype.concat.apply([], children)
  5862. }
  5863. }
  5864. return children
  5865. }
  5866. // 2. When the children contains constructs that always generated nested Arrays,
  5867. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  5868. // with hand-written render functions / JSX. In such cases a full normalization
  5869. // is needed to cater to all possible types of children values.
  5870. function normalizeChildren (children) {
  5871. return isPrimitive(children)
  5872. ? [createTextVNode(children)]
  5873. : Array.isArray(children)
  5874. ? normalizeArrayChildren(children)
  5875. : undefined
  5876. }
  5877. function isTextNode (node) {
  5878. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  5879. }
  5880. function normalizeArrayChildren (children, nestedIndex) {
  5881. var res = [];
  5882. var i, c, lastIndex, last;
  5883. for (i = 0; i < children.length; i++) {
  5884. c = children[i];
  5885. if (isUndef(c) || typeof c === 'boolean') { continue }
  5886. lastIndex = res.length - 1;
  5887. last = res[lastIndex];
  5888. // nested
  5889. if (Array.isArray(c)) {
  5890. if (c.length > 0) {
  5891. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  5892. // merge adjacent text nodes
  5893. if (isTextNode(c[0]) && isTextNode(last)) {
  5894. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5895. c.shift();
  5896. }
  5897. res.push.apply(res, c);
  5898. }
  5899. } else if (isPrimitive(c)) {
  5900. if (isTextNode(last)) {
  5901. // merge adjacent text nodes
  5902. // this is necessary for SSR hydration because text nodes are
  5903. // essentially merged when rendered to HTML strings
  5904. res[lastIndex] = createTextVNode(last.text + c);
  5905. } else if (c !== '') {
  5906. // convert primitive to vnode
  5907. res.push(createTextVNode(c));
  5908. }
  5909. } else {
  5910. if (isTextNode(c) && isTextNode(last)) {
  5911. // merge adjacent text nodes
  5912. res[lastIndex] = createTextVNode(last.text + c.text);
  5913. } else {
  5914. // default key for nested array children (likely generated by v-for)
  5915. if (isTrue(children._isVList) &&
  5916. isDef(c.tag) &&
  5917. isUndef(c.key) &&
  5918. isDef(nestedIndex)) {
  5919. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5920. }
  5921. res.push(c);
  5922. }
  5923. }
  5924. }
  5925. return res
  5926. }
  5927. /* */
  5928. function initProvide (vm) {
  5929. var provide = vm.$options.provide;
  5930. if (provide) {
  5931. vm._provided = typeof provide === 'function'
  5932. ? provide.call(vm)
  5933. : provide;
  5934. }
  5935. }
  5936. function initInjections (vm) {
  5937. var result = resolveInject(vm.$options.inject, vm);
  5938. if (result) {
  5939. toggleObserving(false);
  5940. Object.keys(result).forEach(function (key) {
  5941. /* istanbul ignore else */
  5942. if (true) {
  5943. defineReactive$$1(vm, key, result[key], function () {
  5944. warn(
  5945. "Avoid mutating an injected value directly since the changes will be " +
  5946. "overwritten whenever the provided component re-renders. " +
  5947. "injection being mutated: \"" + key + "\"",
  5948. vm
  5949. );
  5950. });
  5951. } else {}
  5952. });
  5953. toggleObserving(true);
  5954. }
  5955. }
  5956. function resolveInject (inject, vm) {
  5957. if (inject) {
  5958. // inject is :any because flow is not smart enough to figure out cached
  5959. var result = Object.create(null);
  5960. var keys = hasSymbol
  5961. ? Reflect.ownKeys(inject)
  5962. : Object.keys(inject);
  5963. for (var i = 0; i < keys.length; i++) {
  5964. var key = keys[i];
  5965. // #6574 in case the inject object is observed...
  5966. if (key === '__ob__') { continue }
  5967. var provideKey = inject[key].from;
  5968. var source = vm;
  5969. while (source) {
  5970. if (source._provided && hasOwn(source._provided, provideKey)) {
  5971. result[key] = source._provided[provideKey];
  5972. break
  5973. }
  5974. source = source.$parent;
  5975. }
  5976. if (!source) {
  5977. if ('default' in inject[key]) {
  5978. var provideDefault = inject[key].default;
  5979. result[key] = typeof provideDefault === 'function'
  5980. ? provideDefault.call(vm)
  5981. : provideDefault;
  5982. } else if (true) {
  5983. warn(("Injection \"" + key + "\" not found"), vm);
  5984. }
  5985. }
  5986. }
  5987. return result
  5988. }
  5989. }
  5990. /* */
  5991. /**
  5992. * Runtime helper for resolving raw children VNodes into a slot object.
  5993. */
  5994. function resolveSlots (
  5995. children,
  5996. context
  5997. ) {
  5998. if (!children || !children.length) {
  5999. return {}
  6000. }
  6001. var slots = {};
  6002. for (var i = 0, l = children.length; i < l; i++) {
  6003. var child = children[i];
  6004. var data = child.data;
  6005. // remove slot attribute if the node is resolved as a Vue slot node
  6006. if (data && data.attrs && data.attrs.slot) {
  6007. delete data.attrs.slot;
  6008. }
  6009. // named slots should only be respected if the vnode was rendered in the
  6010. // same context.
  6011. if ((child.context === context || child.fnContext === context) &&
  6012. data && data.slot != null
  6013. ) {
  6014. var name = data.slot;
  6015. var slot = (slots[name] || (slots[name] = []));
  6016. if (child.tag === 'template') {
  6017. slot.push.apply(slot, child.children || []);
  6018. } else {
  6019. slot.push(child);
  6020. }
  6021. } else {
  6022. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  6023. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  6024. (slots['page'] || (slots['page'] = [])).push(child);
  6025. }else{
  6026. (slots.default || (slots.default = [])).push(child);
  6027. }
  6028. }
  6029. }
  6030. // ignore slots that contains only whitespace
  6031. for (var name$1 in slots) {
  6032. if (slots[name$1].every(isWhitespace)) {
  6033. delete slots[name$1];
  6034. }
  6035. }
  6036. return slots
  6037. }
  6038. function isWhitespace (node) {
  6039. return (node.isComment && !node.asyncFactory) || node.text === ' '
  6040. }
  6041. /* */
  6042. function normalizeScopedSlots (
  6043. slots,
  6044. normalSlots,
  6045. prevSlots
  6046. ) {
  6047. var res;
  6048. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  6049. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  6050. var key = slots && slots.$key;
  6051. if (!slots) {
  6052. res = {};
  6053. } else if (slots._normalized) {
  6054. // fast path 1: child component re-render only, parent did not change
  6055. return slots._normalized
  6056. } else if (
  6057. isStable &&
  6058. prevSlots &&
  6059. prevSlots !== emptyObject &&
  6060. key === prevSlots.$key &&
  6061. !hasNormalSlots &&
  6062. !prevSlots.$hasNormal
  6063. ) {
  6064. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  6065. // only need to normalize once
  6066. return prevSlots
  6067. } else {
  6068. res = {};
  6069. for (var key$1 in slots) {
  6070. if (slots[key$1] && key$1[0] !== '$') {
  6071. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  6072. }
  6073. }
  6074. }
  6075. // expose normal slots on scopedSlots
  6076. for (var key$2 in normalSlots) {
  6077. if (!(key$2 in res)) {
  6078. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  6079. }
  6080. }
  6081. // avoriaz seems to mock a non-extensible $scopedSlots object
  6082. // and when that is passed down this would cause an error
  6083. if (slots && Object.isExtensible(slots)) {
  6084. (slots)._normalized = res;
  6085. }
  6086. def(res, '$stable', isStable);
  6087. def(res, '$key', key);
  6088. def(res, '$hasNormal', hasNormalSlots);
  6089. return res
  6090. }
  6091. function normalizeScopedSlot(normalSlots, key, fn) {
  6092. var normalized = function () {
  6093. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  6094. res = res && typeof res === 'object' && !Array.isArray(res)
  6095. ? [res] // single vnode
  6096. : normalizeChildren(res);
  6097. return res && (
  6098. res.length === 0 ||
  6099. (res.length === 1 && res[0].isComment) // #9658
  6100. ) ? undefined
  6101. : res
  6102. };
  6103. // this is a slot using the new v-slot syntax without scope. although it is
  6104. // compiled as a scoped slot, render fn users would expect it to be present
  6105. // on this.$slots because the usage is semantically a normal slot.
  6106. if (fn.proxy) {
  6107. Object.defineProperty(normalSlots, key, {
  6108. get: normalized,
  6109. enumerable: true,
  6110. configurable: true
  6111. });
  6112. }
  6113. return normalized
  6114. }
  6115. function proxyNormalSlot(slots, key) {
  6116. return function () { return slots[key]; }
  6117. }
  6118. /* */
  6119. /**
  6120. * Runtime helper for rendering v-for lists.
  6121. */
  6122. function renderList (
  6123. val,
  6124. render
  6125. ) {
  6126. var ret, i, l, keys, key;
  6127. if (Array.isArray(val) || typeof val === 'string') {
  6128. ret = new Array(val.length);
  6129. for (i = 0, l = val.length; i < l; i++) {
  6130. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  6131. }
  6132. } else if (typeof val === 'number') {
  6133. ret = new Array(val);
  6134. for (i = 0; i < val; i++) {
  6135. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  6136. }
  6137. } else if (isObject(val)) {
  6138. if (hasSymbol && val[Symbol.iterator]) {
  6139. ret = [];
  6140. var iterator = val[Symbol.iterator]();
  6141. var result = iterator.next();
  6142. while (!result.done) {
  6143. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  6144. result = iterator.next();
  6145. }
  6146. } else {
  6147. keys = Object.keys(val);
  6148. ret = new Array(keys.length);
  6149. for (i = 0, l = keys.length; i < l; i++) {
  6150. key = keys[i];
  6151. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  6152. }
  6153. }
  6154. }
  6155. if (!isDef(ret)) {
  6156. ret = [];
  6157. }
  6158. (ret)._isVList = true;
  6159. return ret
  6160. }
  6161. /* */
  6162. /**
  6163. * Runtime helper for rendering <slot>
  6164. */
  6165. function renderSlot (
  6166. name,
  6167. fallback,
  6168. props,
  6169. bindObject
  6170. ) {
  6171. var scopedSlotFn = this.$scopedSlots[name];
  6172. var nodes;
  6173. if (scopedSlotFn) { // scoped slot
  6174. props = props || {};
  6175. if (bindObject) {
  6176. if ( true && !isObject(bindObject)) {
  6177. warn(
  6178. 'slot v-bind without argument expects an Object',
  6179. this
  6180. );
  6181. }
  6182. props = extend(extend({}, bindObject), props);
  6183. }
  6184. // fixed by xxxxxx app-plus scopedSlot
  6185. nodes = scopedSlotFn(props, this, props._i) || fallback;
  6186. } else {
  6187. nodes = this.$slots[name] || fallback;
  6188. }
  6189. var target = props && props.slot;
  6190. if (target) {
  6191. return this.$createElement('template', { slot: target }, nodes)
  6192. } else {
  6193. return nodes
  6194. }
  6195. }
  6196. /* */
  6197. /**
  6198. * Runtime helper for resolving filters
  6199. */
  6200. function resolveFilter (id) {
  6201. return resolveAsset(this.$options, 'filters', id, true) || identity
  6202. }
  6203. /* */
  6204. function isKeyNotMatch (expect, actual) {
  6205. if (Array.isArray(expect)) {
  6206. return expect.indexOf(actual) === -1
  6207. } else {
  6208. return expect !== actual
  6209. }
  6210. }
  6211. /**
  6212. * Runtime helper for checking keyCodes from config.
  6213. * exposed as Vue.prototype._k
  6214. * passing in eventKeyName as last argument separately for backwards compat
  6215. */
  6216. function checkKeyCodes (
  6217. eventKeyCode,
  6218. key,
  6219. builtInKeyCode,
  6220. eventKeyName,
  6221. builtInKeyName
  6222. ) {
  6223. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  6224. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  6225. return isKeyNotMatch(builtInKeyName, eventKeyName)
  6226. } else if (mappedKeyCode) {
  6227. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  6228. } else if (eventKeyName) {
  6229. return hyphenate(eventKeyName) !== key
  6230. }
  6231. }
  6232. /* */
  6233. /**
  6234. * Runtime helper for merging v-bind="object" into a VNode's data.
  6235. */
  6236. function bindObjectProps (
  6237. data,
  6238. tag,
  6239. value,
  6240. asProp,
  6241. isSync
  6242. ) {
  6243. if (value) {
  6244. if (!isObject(value)) {
  6245. true && warn(
  6246. 'v-bind without argument expects an Object or Array value',
  6247. this
  6248. );
  6249. } else {
  6250. if (Array.isArray(value)) {
  6251. value = toObject(value);
  6252. }
  6253. var hash;
  6254. var loop = function ( key ) {
  6255. if (
  6256. key === 'class' ||
  6257. key === 'style' ||
  6258. isReservedAttribute(key)
  6259. ) {
  6260. hash = data;
  6261. } else {
  6262. var type = data.attrs && data.attrs.type;
  6263. hash = asProp || config.mustUseProp(tag, type, key)
  6264. ? data.domProps || (data.domProps = {})
  6265. : data.attrs || (data.attrs = {});
  6266. }
  6267. var camelizedKey = camelize(key);
  6268. var hyphenatedKey = hyphenate(key);
  6269. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  6270. hash[key] = value[key];
  6271. if (isSync) {
  6272. var on = data.on || (data.on = {});
  6273. on[("update:" + key)] = function ($event) {
  6274. value[key] = $event;
  6275. };
  6276. }
  6277. }
  6278. };
  6279. for (var key in value) loop( key );
  6280. }
  6281. }
  6282. return data
  6283. }
  6284. /* */
  6285. /**
  6286. * Runtime helper for rendering static trees.
  6287. */
  6288. function renderStatic (
  6289. index,
  6290. isInFor
  6291. ) {
  6292. var cached = this._staticTrees || (this._staticTrees = []);
  6293. var tree = cached[index];
  6294. // if has already-rendered static tree and not inside v-for,
  6295. // we can reuse the same tree.
  6296. if (tree && !isInFor) {
  6297. return tree
  6298. }
  6299. // otherwise, render a fresh tree.
  6300. tree = cached[index] = this.$options.staticRenderFns[index].call(
  6301. this._renderProxy,
  6302. null,
  6303. this // for render fns generated for functional component templates
  6304. );
  6305. markStatic(tree, ("__static__" + index), false);
  6306. return tree
  6307. }
  6308. /**
  6309. * Runtime helper for v-once.
  6310. * Effectively it means marking the node as static with a unique key.
  6311. */
  6312. function markOnce (
  6313. tree,
  6314. index,
  6315. key
  6316. ) {
  6317. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  6318. return tree
  6319. }
  6320. function markStatic (
  6321. tree,
  6322. key,
  6323. isOnce
  6324. ) {
  6325. if (Array.isArray(tree)) {
  6326. for (var i = 0; i < tree.length; i++) {
  6327. if (tree[i] && typeof tree[i] !== 'string') {
  6328. markStaticNode(tree[i], (key + "_" + i), isOnce);
  6329. }
  6330. }
  6331. } else {
  6332. markStaticNode(tree, key, isOnce);
  6333. }
  6334. }
  6335. function markStaticNode (node, key, isOnce) {
  6336. node.isStatic = true;
  6337. node.key = key;
  6338. node.isOnce = isOnce;
  6339. }
  6340. /* */
  6341. function bindObjectListeners (data, value) {
  6342. if (value) {
  6343. if (!isPlainObject(value)) {
  6344. true && warn(
  6345. 'v-on without argument expects an Object value',
  6346. this
  6347. );
  6348. } else {
  6349. var on = data.on = data.on ? extend({}, data.on) : {};
  6350. for (var key in value) {
  6351. var existing = on[key];
  6352. var ours = value[key];
  6353. on[key] = existing ? [].concat(existing, ours) : ours;
  6354. }
  6355. }
  6356. }
  6357. return data
  6358. }
  6359. /* */
  6360. function resolveScopedSlots (
  6361. fns, // see flow/vnode
  6362. res,
  6363. // the following are added in 2.6
  6364. hasDynamicKeys,
  6365. contentHashKey
  6366. ) {
  6367. res = res || { $stable: !hasDynamicKeys };
  6368. for (var i = 0; i < fns.length; i++) {
  6369. var slot = fns[i];
  6370. if (Array.isArray(slot)) {
  6371. resolveScopedSlots(slot, res, hasDynamicKeys);
  6372. } else if (slot) {
  6373. // marker for reverse proxying v-slot without scope on this.$slots
  6374. if (slot.proxy) {
  6375. slot.fn.proxy = true;
  6376. }
  6377. res[slot.key] = slot.fn;
  6378. }
  6379. }
  6380. if (contentHashKey) {
  6381. (res).$key = contentHashKey;
  6382. }
  6383. return res
  6384. }
  6385. /* */
  6386. function bindDynamicKeys (baseObj, values) {
  6387. for (var i = 0; i < values.length; i += 2) {
  6388. var key = values[i];
  6389. if (typeof key === 'string' && key) {
  6390. baseObj[values[i]] = values[i + 1];
  6391. } else if ( true && key !== '' && key !== null) {
  6392. // null is a special value for explicitly removing a binding
  6393. warn(
  6394. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  6395. this
  6396. );
  6397. }
  6398. }
  6399. return baseObj
  6400. }
  6401. // helper to dynamically append modifier runtime markers to event names.
  6402. // ensure only append when value is already string, otherwise it will be cast
  6403. // to string and cause the type check to miss.
  6404. function prependModifier (value, symbol) {
  6405. return typeof value === 'string' ? symbol + value : value
  6406. }
  6407. /* */
  6408. function installRenderHelpers (target) {
  6409. target._o = markOnce;
  6410. target._n = toNumber;
  6411. target._s = toString;
  6412. target._l = renderList;
  6413. target._t = renderSlot;
  6414. target._q = looseEqual;
  6415. target._i = looseIndexOf;
  6416. target._m = renderStatic;
  6417. target._f = resolveFilter;
  6418. target._k = checkKeyCodes;
  6419. target._b = bindObjectProps;
  6420. target._v = createTextVNode;
  6421. target._e = createEmptyVNode;
  6422. target._u = resolveScopedSlots;
  6423. target._g = bindObjectListeners;
  6424. target._d = bindDynamicKeys;
  6425. target._p = prependModifier;
  6426. }
  6427. /* */
  6428. function FunctionalRenderContext (
  6429. data,
  6430. props,
  6431. children,
  6432. parent,
  6433. Ctor
  6434. ) {
  6435. var this$1 = this;
  6436. var options = Ctor.options;
  6437. // ensure the createElement function in functional components
  6438. // gets a unique context - this is necessary for correct named slot check
  6439. var contextVm;
  6440. if (hasOwn(parent, '_uid')) {
  6441. contextVm = Object.create(parent);
  6442. // $flow-disable-line
  6443. contextVm._original = parent;
  6444. } else {
  6445. // the context vm passed in is a functional context as well.
  6446. // in this case we want to make sure we are able to get a hold to the
  6447. // real context instance.
  6448. contextVm = parent;
  6449. // $flow-disable-line
  6450. parent = parent._original;
  6451. }
  6452. var isCompiled = isTrue(options._compiled);
  6453. var needNormalization = !isCompiled;
  6454. this.data = data;
  6455. this.props = props;
  6456. this.children = children;
  6457. this.parent = parent;
  6458. this.listeners = data.on || emptyObject;
  6459. this.injections = resolveInject(options.inject, parent);
  6460. this.slots = function () {
  6461. if (!this$1.$slots) {
  6462. normalizeScopedSlots(
  6463. data.scopedSlots,
  6464. this$1.$slots = resolveSlots(children, parent)
  6465. );
  6466. }
  6467. return this$1.$slots
  6468. };
  6469. Object.defineProperty(this, 'scopedSlots', ({
  6470. enumerable: true,
  6471. get: function get () {
  6472. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6473. }
  6474. }));
  6475. // support for compiled functional template
  6476. if (isCompiled) {
  6477. // exposing $options for renderStatic()
  6478. this.$options = options;
  6479. // pre-resolve slots for renderSlot()
  6480. this.$slots = this.slots();
  6481. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6482. }
  6483. if (options._scopeId) {
  6484. this._c = function (a, b, c, d) {
  6485. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6486. if (vnode && !Array.isArray(vnode)) {
  6487. vnode.fnScopeId = options._scopeId;
  6488. vnode.fnContext = parent;
  6489. }
  6490. return vnode
  6491. };
  6492. } else {
  6493. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6494. }
  6495. }
  6496. installRenderHelpers(FunctionalRenderContext.prototype);
  6497. function createFunctionalComponent (
  6498. Ctor,
  6499. propsData,
  6500. data,
  6501. contextVm,
  6502. children
  6503. ) {
  6504. var options = Ctor.options;
  6505. var props = {};
  6506. var propOptions = options.props;
  6507. if (isDef(propOptions)) {
  6508. for (var key in propOptions) {
  6509. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6510. }
  6511. } else {
  6512. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6513. if (isDef(data.props)) { mergeProps(props, data.props); }
  6514. }
  6515. var renderContext = new FunctionalRenderContext(
  6516. data,
  6517. props,
  6518. children,
  6519. contextVm,
  6520. Ctor
  6521. );
  6522. var vnode = options.render.call(null, renderContext._c, renderContext);
  6523. if (vnode instanceof VNode) {
  6524. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6525. } else if (Array.isArray(vnode)) {
  6526. var vnodes = normalizeChildren(vnode) || [];
  6527. var res = new Array(vnodes.length);
  6528. for (var i = 0; i < vnodes.length; i++) {
  6529. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6530. }
  6531. return res
  6532. }
  6533. }
  6534. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6535. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6536. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6537. // that should not be matched to match.
  6538. var clone = cloneVNode(vnode);
  6539. clone.fnContext = contextVm;
  6540. clone.fnOptions = options;
  6541. if (true) {
  6542. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6543. }
  6544. if (data.slot) {
  6545. (clone.data || (clone.data = {})).slot = data.slot;
  6546. }
  6547. return clone
  6548. }
  6549. function mergeProps (to, from) {
  6550. for (var key in from) {
  6551. to[camelize(key)] = from[key];
  6552. }
  6553. }
  6554. /* */
  6555. /* */
  6556. /* */
  6557. /* */
  6558. // inline hooks to be invoked on component VNodes during patch
  6559. var componentVNodeHooks = {
  6560. init: function init (vnode, hydrating) {
  6561. if (
  6562. vnode.componentInstance &&
  6563. !vnode.componentInstance._isDestroyed &&
  6564. vnode.data.keepAlive
  6565. ) {
  6566. // kept-alive components, treat as a patch
  6567. var mountedNode = vnode; // work around flow
  6568. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6569. } else {
  6570. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6571. vnode,
  6572. activeInstance
  6573. );
  6574. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6575. }
  6576. },
  6577. prepatch: function prepatch (oldVnode, vnode) {
  6578. var options = vnode.componentOptions;
  6579. var child = vnode.componentInstance = oldVnode.componentInstance;
  6580. updateChildComponent(
  6581. child,
  6582. options.propsData, // updated props
  6583. options.listeners, // updated listeners
  6584. vnode, // new parent vnode
  6585. options.children // new children
  6586. );
  6587. },
  6588. insert: function insert (vnode) {
  6589. var context = vnode.context;
  6590. var componentInstance = vnode.componentInstance;
  6591. if (!componentInstance._isMounted) {
  6592. callHook(componentInstance, 'onServiceCreated');
  6593. callHook(componentInstance, 'onServiceAttached');
  6594. componentInstance._isMounted = true;
  6595. callHook(componentInstance, 'mounted');
  6596. }
  6597. if (vnode.data.keepAlive) {
  6598. if (context._isMounted) {
  6599. // vue-router#1212
  6600. // During updates, a kept-alive component's child components may
  6601. // change, so directly walking the tree here may call activated hooks
  6602. // on incorrect children. Instead we push them into a queue which will
  6603. // be processed after the whole patch process ended.
  6604. queueActivatedComponent(componentInstance);
  6605. } else {
  6606. activateChildComponent(componentInstance, true /* direct */);
  6607. }
  6608. }
  6609. },
  6610. destroy: function destroy (vnode) {
  6611. var componentInstance = vnode.componentInstance;
  6612. if (!componentInstance._isDestroyed) {
  6613. if (!vnode.data.keepAlive) {
  6614. componentInstance.$destroy();
  6615. } else {
  6616. deactivateChildComponent(componentInstance, true /* direct */);
  6617. }
  6618. }
  6619. }
  6620. };
  6621. var hooksToMerge = Object.keys(componentVNodeHooks);
  6622. function createComponent (
  6623. Ctor,
  6624. data,
  6625. context,
  6626. children,
  6627. tag
  6628. ) {
  6629. if (isUndef(Ctor)) {
  6630. return
  6631. }
  6632. var baseCtor = context.$options._base;
  6633. // plain options object: turn it into a constructor
  6634. if (isObject(Ctor)) {
  6635. Ctor = baseCtor.extend(Ctor);
  6636. }
  6637. // if at this stage it's not a constructor or an async component factory,
  6638. // reject.
  6639. if (typeof Ctor !== 'function') {
  6640. if (true) {
  6641. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6642. }
  6643. return
  6644. }
  6645. // async component
  6646. var asyncFactory;
  6647. if (isUndef(Ctor.cid)) {
  6648. asyncFactory = Ctor;
  6649. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6650. if (Ctor === undefined) {
  6651. // return a placeholder node for async component, which is rendered
  6652. // as a comment node but preserves all the raw information for the node.
  6653. // the information will be used for async server-rendering and hydration.
  6654. return createAsyncPlaceholder(
  6655. asyncFactory,
  6656. data,
  6657. context,
  6658. children,
  6659. tag
  6660. )
  6661. }
  6662. }
  6663. data = data || {};
  6664. // resolve constructor options in case global mixins are applied after
  6665. // component constructor creation
  6666. resolveConstructorOptions(Ctor);
  6667. // transform component v-model data into props & events
  6668. if (isDef(data.model)) {
  6669. transformModel(Ctor.options, data);
  6670. }
  6671. // extract props
  6672. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6673. // functional component
  6674. if (isTrue(Ctor.options.functional)) {
  6675. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6676. }
  6677. // extract listeners, since these needs to be treated as
  6678. // child component listeners instead of DOM listeners
  6679. var listeners = data.on;
  6680. // replace with listeners with .native modifier
  6681. // so it gets processed during parent component patch.
  6682. data.on = data.nativeOn;
  6683. if (isTrue(Ctor.options.abstract)) {
  6684. // abstract components do not keep anything
  6685. // other than props & listeners & slot
  6686. // work around flow
  6687. var slot = data.slot;
  6688. data = {};
  6689. if (slot) {
  6690. data.slot = slot;
  6691. }
  6692. }
  6693. // install component management hooks onto the placeholder node
  6694. installComponentHooks(data);
  6695. // return a placeholder vnode
  6696. var name = Ctor.options.name || tag;
  6697. var vnode = new VNode(
  6698. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6699. data, undefined, undefined, undefined, context,
  6700. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6701. asyncFactory
  6702. );
  6703. return vnode
  6704. }
  6705. function createComponentInstanceForVnode (
  6706. vnode, // we know it's MountedComponentVNode but flow doesn't
  6707. parent // activeInstance in lifecycle state
  6708. ) {
  6709. var options = {
  6710. _isComponent: true,
  6711. _parentVnode: vnode,
  6712. parent: parent
  6713. };
  6714. // check inline-template render functions
  6715. var inlineTemplate = vnode.data.inlineTemplate;
  6716. if (isDef(inlineTemplate)) {
  6717. options.render = inlineTemplate.render;
  6718. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6719. }
  6720. return new vnode.componentOptions.Ctor(options)
  6721. }
  6722. function installComponentHooks (data) {
  6723. var hooks = data.hook || (data.hook = {});
  6724. for (var i = 0; i < hooksToMerge.length; i++) {
  6725. var key = hooksToMerge[i];
  6726. var existing = hooks[key];
  6727. var toMerge = componentVNodeHooks[key];
  6728. if (existing !== toMerge && !(existing && existing._merged)) {
  6729. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6730. }
  6731. }
  6732. }
  6733. function mergeHook$1 (f1, f2) {
  6734. var merged = function (a, b) {
  6735. // flow complains about extra args which is why we use any
  6736. f1(a, b);
  6737. f2(a, b);
  6738. };
  6739. merged._merged = true;
  6740. return merged
  6741. }
  6742. // transform component v-model info (value and callback) into
  6743. // prop and event handler respectively.
  6744. function transformModel (options, data) {
  6745. var prop = (options.model && options.model.prop) || 'value';
  6746. var event = (options.model && options.model.event) || 'input'
  6747. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6748. var on = data.on || (data.on = {});
  6749. var existing = on[event];
  6750. var callback = data.model.callback;
  6751. if (isDef(existing)) {
  6752. if (
  6753. Array.isArray(existing)
  6754. ? existing.indexOf(callback) === -1
  6755. : existing !== callback
  6756. ) {
  6757. on[event] = [callback].concat(existing);
  6758. }
  6759. } else {
  6760. on[event] = callback;
  6761. }
  6762. }
  6763. /* */
  6764. var SIMPLE_NORMALIZE = 1;
  6765. var ALWAYS_NORMALIZE = 2;
  6766. // wrapper function for providing a more flexible interface
  6767. // without getting yelled at by flow
  6768. function createElement (
  6769. context,
  6770. tag,
  6771. data,
  6772. children,
  6773. normalizationType,
  6774. alwaysNormalize
  6775. ) {
  6776. if (Array.isArray(data) || isPrimitive(data)) {
  6777. normalizationType = children;
  6778. children = data;
  6779. data = undefined;
  6780. }
  6781. if (isTrue(alwaysNormalize)) {
  6782. normalizationType = ALWAYS_NORMALIZE;
  6783. }
  6784. return _createElement(context, tag, data, children, normalizationType)
  6785. }
  6786. function _createElement (
  6787. context,
  6788. tag,
  6789. data,
  6790. children,
  6791. normalizationType
  6792. ) {
  6793. if (isDef(data) && isDef((data).__ob__)) {
  6794. true && warn(
  6795. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6796. 'Always create fresh vnode data objects in each render!',
  6797. context
  6798. );
  6799. return createEmptyVNode()
  6800. }
  6801. // object syntax in v-bind
  6802. if (isDef(data) && isDef(data.is)) {
  6803. tag = data.is;
  6804. }
  6805. if (!tag) {
  6806. // in case of component :is set to falsy value
  6807. return createEmptyVNode()
  6808. }
  6809. // warn against non-primitive key
  6810. if ( true &&
  6811. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6812. ) {
  6813. {
  6814. warn(
  6815. 'Avoid using non-primitive value as key, ' +
  6816. 'use string/number value instead.',
  6817. context
  6818. );
  6819. }
  6820. }
  6821. // support single function children as default scoped slot
  6822. if (Array.isArray(children) &&
  6823. typeof children[0] === 'function'
  6824. ) {
  6825. data = data || {};
  6826. data.scopedSlots = { default: children[0] };
  6827. children.length = 0;
  6828. }
  6829. if (normalizationType === ALWAYS_NORMALIZE) {
  6830. children = normalizeChildren(children);
  6831. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6832. children = simpleNormalizeChildren(children);
  6833. }
  6834. var vnode, ns;
  6835. if (typeof tag === 'string') {
  6836. var Ctor;
  6837. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6838. if (config.isReservedTag(tag)) {
  6839. // platform built-in elements
  6840. if ( true && isDef(data) && isDef(data.nativeOn)) {
  6841. warn(
  6842. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  6843. context
  6844. );
  6845. }
  6846. vnode = new VNode(
  6847. config.parsePlatformTagName(tag), data, children,
  6848. undefined, undefined, context
  6849. );
  6850. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6851. // component
  6852. vnode = createComponent(Ctor, data, context, children, tag);
  6853. } else {
  6854. // unknown or unlisted namespaced elements
  6855. // check at runtime because it may get assigned a namespace when its
  6856. // parent normalizes children
  6857. vnode = new VNode(
  6858. tag, data, children,
  6859. undefined, undefined, context
  6860. );
  6861. }
  6862. } else {
  6863. // direct component options / constructor
  6864. vnode = createComponent(tag, data, context, children);
  6865. }
  6866. if (Array.isArray(vnode)) {
  6867. return vnode
  6868. } else if (isDef(vnode)) {
  6869. if (isDef(ns)) { applyNS(vnode, ns); }
  6870. if (isDef(data)) { registerDeepBindings(data); }
  6871. return vnode
  6872. } else {
  6873. return createEmptyVNode()
  6874. }
  6875. }
  6876. function applyNS (vnode, ns, force) {
  6877. vnode.ns = ns;
  6878. if (vnode.tag === 'foreignObject') {
  6879. // use default namespace inside foreignObject
  6880. ns = undefined;
  6881. force = true;
  6882. }
  6883. if (isDef(vnode.children)) {
  6884. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6885. var child = vnode.children[i];
  6886. if (isDef(child.tag) && (
  6887. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6888. applyNS(child, ns, force);
  6889. }
  6890. }
  6891. }
  6892. }
  6893. // ref #5318
  6894. // necessary to ensure parent re-render when deep bindings like :style and
  6895. // :class are used on slot nodes
  6896. function registerDeepBindings (data) {
  6897. if (isObject(data.style)) {
  6898. traverse(data.style);
  6899. }
  6900. if (isObject(data.class)) {
  6901. traverse(data.class);
  6902. }
  6903. }
  6904. /* */
  6905. function initRender (vm) {
  6906. vm._vnode = null; // the root of the child tree
  6907. vm._staticTrees = null; // v-once cached trees
  6908. var options = vm.$options;
  6909. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6910. var renderContext = parentVnode && parentVnode.context;
  6911. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6912. vm.$scopedSlots = emptyObject;
  6913. // bind the createElement fn to this instance
  6914. // so that we get proper render context inside it.
  6915. // args order: tag, data, children, normalizationType, alwaysNormalize
  6916. // internal version is used by render functions compiled from templates
  6917. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6918. // normalization is always applied for the public version, used in
  6919. // user-written render functions.
  6920. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6921. // $attrs & $listeners are exposed for easier HOC creation.
  6922. // they need to be reactive so that HOCs using them are always updated
  6923. var parentData = parentVnode && parentVnode.data;
  6924. /* istanbul ignore else */
  6925. if (true) {
  6926. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6927. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6928. }, true);
  6929. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6930. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6931. }, true);
  6932. } else {}
  6933. }
  6934. var currentRenderingInstance = null;
  6935. function renderMixin (Vue) {
  6936. // install runtime convenience helpers
  6937. installRenderHelpers(Vue.prototype);
  6938. Vue.prototype.$nextTick = function (fn) {
  6939. return nextTick(fn, this)
  6940. };
  6941. Vue.prototype._render = function () {
  6942. var vm = this;
  6943. var ref = vm.$options;
  6944. var render = ref.render;
  6945. var _parentVnode = ref._parentVnode;
  6946. if (_parentVnode) {
  6947. vm.$scopedSlots = normalizeScopedSlots(
  6948. _parentVnode.data.scopedSlots,
  6949. vm.$slots,
  6950. vm.$scopedSlots
  6951. );
  6952. }
  6953. // set parent vnode. this allows render functions to have access
  6954. // to the data on the placeholder node.
  6955. vm.$vnode = _parentVnode;
  6956. // render self
  6957. var vnode;
  6958. try {
  6959. // There's no need to maintain a stack because all render fns are called
  6960. // separately from one another. Nested component's render fns are called
  6961. // when parent component is patched.
  6962. currentRenderingInstance = vm;
  6963. vnode = render.call(vm._renderProxy, vm.$createElement);
  6964. } catch (e) {
  6965. handleError(e, vm, "render");
  6966. // return error render result,
  6967. // or previous vnode to prevent render error causing blank component
  6968. /* istanbul ignore else */
  6969. if ( true && vm.$options.renderError) {
  6970. try {
  6971. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6972. } catch (e) {
  6973. handleError(e, vm, "renderError");
  6974. vnode = vm._vnode;
  6975. }
  6976. } else {
  6977. vnode = vm._vnode;
  6978. }
  6979. } finally {
  6980. currentRenderingInstance = null;
  6981. }
  6982. // if the returned array contains only a single node, allow it
  6983. if (Array.isArray(vnode) && vnode.length === 1) {
  6984. vnode = vnode[0];
  6985. }
  6986. // return empty vnode in case the render function errored out
  6987. if (!(vnode instanceof VNode)) {
  6988. if ( true && Array.isArray(vnode)) {
  6989. warn(
  6990. 'Multiple root nodes returned from render function. Render function ' +
  6991. 'should return a single root node.',
  6992. vm
  6993. );
  6994. }
  6995. vnode = createEmptyVNode();
  6996. }
  6997. // set parent
  6998. vnode.parent = _parentVnode;
  6999. return vnode
  7000. };
  7001. }
  7002. /* */
  7003. function ensureCtor (comp, base) {
  7004. if (
  7005. comp.__esModule ||
  7006. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  7007. ) {
  7008. comp = comp.default;
  7009. }
  7010. return isObject(comp)
  7011. ? base.extend(comp)
  7012. : comp
  7013. }
  7014. function createAsyncPlaceholder (
  7015. factory,
  7016. data,
  7017. context,
  7018. children,
  7019. tag
  7020. ) {
  7021. var node = createEmptyVNode();
  7022. node.asyncFactory = factory;
  7023. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  7024. return node
  7025. }
  7026. function resolveAsyncComponent (
  7027. factory,
  7028. baseCtor
  7029. ) {
  7030. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  7031. return factory.errorComp
  7032. }
  7033. if (isDef(factory.resolved)) {
  7034. return factory.resolved
  7035. }
  7036. var owner = currentRenderingInstance;
  7037. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  7038. // already pending
  7039. factory.owners.push(owner);
  7040. }
  7041. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  7042. return factory.loadingComp
  7043. }
  7044. if (owner && !isDef(factory.owners)) {
  7045. var owners = factory.owners = [owner];
  7046. var sync = true;
  7047. var timerLoading = null;
  7048. var timerTimeout = null
  7049. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  7050. var forceRender = function (renderCompleted) {
  7051. for (var i = 0, l = owners.length; i < l; i++) {
  7052. (owners[i]).$forceUpdate();
  7053. }
  7054. if (renderCompleted) {
  7055. owners.length = 0;
  7056. if (timerLoading !== null) {
  7057. clearTimeout(timerLoading);
  7058. timerLoading = null;
  7059. }
  7060. if (timerTimeout !== null) {
  7061. clearTimeout(timerTimeout);
  7062. timerTimeout = null;
  7063. }
  7064. }
  7065. };
  7066. var resolve = once(function (res) {
  7067. // cache resolved
  7068. factory.resolved = ensureCtor(res, baseCtor);
  7069. // invoke callbacks only if this is not a synchronous resolve
  7070. // (async resolves are shimmed as synchronous during SSR)
  7071. if (!sync) {
  7072. forceRender(true);
  7073. } else {
  7074. owners.length = 0;
  7075. }
  7076. });
  7077. var reject = once(function (reason) {
  7078. true && warn(
  7079. "Failed to resolve async component: " + (String(factory)) +
  7080. (reason ? ("\nReason: " + reason) : '')
  7081. );
  7082. if (isDef(factory.errorComp)) {
  7083. factory.error = true;
  7084. forceRender(true);
  7085. }
  7086. });
  7087. var res = factory(resolve, reject);
  7088. if (isObject(res)) {
  7089. if (isPromise(res)) {
  7090. // () => Promise
  7091. if (isUndef(factory.resolved)) {
  7092. res.then(resolve, reject);
  7093. }
  7094. } else if (isPromise(res.component)) {
  7095. res.component.then(resolve, reject);
  7096. if (isDef(res.error)) {
  7097. factory.errorComp = ensureCtor(res.error, baseCtor);
  7098. }
  7099. if (isDef(res.loading)) {
  7100. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  7101. if (res.delay === 0) {
  7102. factory.loading = true;
  7103. } else {
  7104. timerLoading = setTimeout(function () {
  7105. timerLoading = null;
  7106. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  7107. factory.loading = true;
  7108. forceRender(false);
  7109. }
  7110. }, res.delay || 200);
  7111. }
  7112. }
  7113. if (isDef(res.timeout)) {
  7114. timerTimeout = setTimeout(function () {
  7115. timerTimeout = null;
  7116. if (isUndef(factory.resolved)) {
  7117. reject(
  7118. true
  7119. ? ("timeout (" + (res.timeout) + "ms)")
  7120. : undefined
  7121. );
  7122. }
  7123. }, res.timeout);
  7124. }
  7125. }
  7126. }
  7127. sync = false;
  7128. // return in case resolved synchronously
  7129. return factory.loading
  7130. ? factory.loadingComp
  7131. : factory.resolved
  7132. }
  7133. }
  7134. /* */
  7135. function isAsyncPlaceholder (node) {
  7136. return node.isComment && node.asyncFactory
  7137. }
  7138. /* */
  7139. function getFirstComponentChild (children) {
  7140. if (Array.isArray(children)) {
  7141. for (var i = 0; i < children.length; i++) {
  7142. var c = children[i];
  7143. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  7144. return c
  7145. }
  7146. }
  7147. }
  7148. }
  7149. /* */
  7150. /* */
  7151. function initEvents (vm) {
  7152. vm._events = Object.create(null);
  7153. vm._hasHookEvent = false;
  7154. // init parent attached events
  7155. var listeners = vm.$options._parentListeners;
  7156. if (listeners) {
  7157. updateComponentListeners(vm, listeners);
  7158. }
  7159. }
  7160. var target;
  7161. function add (event, fn) {
  7162. target.$on(event, fn);
  7163. }
  7164. function remove$1 (event, fn) {
  7165. target.$off(event, fn);
  7166. }
  7167. function createOnceHandler (event, fn) {
  7168. var _target = target;
  7169. return function onceHandler () {
  7170. var res = fn.apply(null, arguments);
  7171. if (res !== null) {
  7172. _target.$off(event, onceHandler);
  7173. }
  7174. }
  7175. }
  7176. function updateComponentListeners (
  7177. vm,
  7178. listeners,
  7179. oldListeners
  7180. ) {
  7181. target = vm;
  7182. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  7183. target = undefined;
  7184. }
  7185. function eventsMixin (Vue) {
  7186. var hookRE = /^hook:/;
  7187. Vue.prototype.$on = function (event, fn) {
  7188. var vm = this;
  7189. if (Array.isArray(event)) {
  7190. for (var i = 0, l = event.length; i < l; i++) {
  7191. vm.$on(event[i], fn);
  7192. }
  7193. } else {
  7194. (vm._events[event] || (vm._events[event] = [])).push(fn);
  7195. // optimize hook:event cost by using a boolean flag marked at registration
  7196. // instead of a hash lookup
  7197. if (hookRE.test(event)) {
  7198. vm._hasHookEvent = true;
  7199. }
  7200. }
  7201. return vm
  7202. };
  7203. Vue.prototype.$once = function (event, fn) {
  7204. var vm = this;
  7205. function on () {
  7206. vm.$off(event, on);
  7207. fn.apply(vm, arguments);
  7208. }
  7209. on.fn = fn;
  7210. vm.$on(event, on);
  7211. return vm
  7212. };
  7213. Vue.prototype.$off = function (event, fn) {
  7214. var vm = this;
  7215. // all
  7216. if (!arguments.length) {
  7217. vm._events = Object.create(null);
  7218. return vm
  7219. }
  7220. // array of events
  7221. if (Array.isArray(event)) {
  7222. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  7223. vm.$off(event[i$1], fn);
  7224. }
  7225. return vm
  7226. }
  7227. // specific event
  7228. var cbs = vm._events[event];
  7229. if (!cbs) {
  7230. return vm
  7231. }
  7232. if (!fn) {
  7233. vm._events[event] = null;
  7234. return vm
  7235. }
  7236. // specific handler
  7237. var cb;
  7238. var i = cbs.length;
  7239. while (i--) {
  7240. cb = cbs[i];
  7241. if (cb === fn || cb.fn === fn) {
  7242. cbs.splice(i, 1);
  7243. break
  7244. }
  7245. }
  7246. return vm
  7247. };
  7248. Vue.prototype.$emit = function (event) {
  7249. var vm = this;
  7250. if (true) {
  7251. var lowerCaseEvent = event.toLowerCase();
  7252. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  7253. tip(
  7254. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  7255. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  7256. "Note that HTML attributes are case-insensitive and you cannot use " +
  7257. "v-on to listen to camelCase events when using in-DOM templates. " +
  7258. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  7259. );
  7260. }
  7261. }
  7262. var cbs = vm._events[event];
  7263. if (cbs) {
  7264. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  7265. var args = toArray(arguments, 1);
  7266. var info = "event handler for \"" + event + "\"";
  7267. for (var i = 0, l = cbs.length; i < l; i++) {
  7268. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  7269. }
  7270. }
  7271. return vm
  7272. };
  7273. }
  7274. /* */
  7275. var activeInstance = null;
  7276. var isUpdatingChildComponent = false;
  7277. function setActiveInstance(vm) {
  7278. var prevActiveInstance = activeInstance;
  7279. activeInstance = vm;
  7280. return function () {
  7281. activeInstance = prevActiveInstance;
  7282. }
  7283. }
  7284. function initLifecycle (vm) {
  7285. var options = vm.$options;
  7286. // locate first non-abstract parent
  7287. var parent = options.parent;
  7288. if (parent && !options.abstract) {
  7289. while (parent.$options.abstract && parent.$parent) {
  7290. parent = parent.$parent;
  7291. }
  7292. parent.$children.push(vm);
  7293. }
  7294. vm.$parent = parent;
  7295. vm.$root = parent ? parent.$root : vm;
  7296. vm.$children = [];
  7297. vm.$refs = {};
  7298. vm._watcher = null;
  7299. vm._inactive = null;
  7300. vm._directInactive = false;
  7301. vm._isMounted = false;
  7302. vm._isDestroyed = false;
  7303. vm._isBeingDestroyed = false;
  7304. }
  7305. function lifecycleMixin (Vue) {
  7306. Vue.prototype._update = function (vnode, hydrating) {
  7307. var vm = this;
  7308. var prevEl = vm.$el;
  7309. var prevVnode = vm._vnode;
  7310. var restoreActiveInstance = setActiveInstance(vm);
  7311. vm._vnode = vnode;
  7312. // Vue.prototype.__patch__ is injected in entry points
  7313. // based on the rendering backend used.
  7314. if (!prevVnode) {
  7315. // initial render
  7316. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  7317. } else {
  7318. // updates
  7319. vm.$el = vm.__patch__(prevVnode, vnode);
  7320. }
  7321. restoreActiveInstance();
  7322. // update __vue__ reference
  7323. if (prevEl) {
  7324. prevEl.__vue__ = null;
  7325. }
  7326. if (vm.$el) {
  7327. vm.$el.__vue__ = vm;
  7328. }
  7329. // if parent is an HOC, update its $el as well
  7330. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  7331. vm.$parent.$el = vm.$el;
  7332. }
  7333. // updated hook is called by the scheduler to ensure that children are
  7334. // updated in a parent's updated hook.
  7335. };
  7336. Vue.prototype.$forceUpdate = function () {
  7337. var vm = this;
  7338. if (vm._watcher) {
  7339. vm._watcher.update();
  7340. }
  7341. };
  7342. Vue.prototype.$destroy = function () {
  7343. var vm = this;
  7344. if (vm._isBeingDestroyed) {
  7345. return
  7346. }
  7347. callHook(vm, 'beforeDestroy');
  7348. vm._isBeingDestroyed = true;
  7349. // remove self from parent
  7350. var parent = vm.$parent;
  7351. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  7352. remove(parent.$children, vm);
  7353. }
  7354. // teardown watchers
  7355. if (vm._watcher) {
  7356. vm._watcher.teardown();
  7357. }
  7358. var i = vm._watchers.length;
  7359. while (i--) {
  7360. vm._watchers[i].teardown();
  7361. }
  7362. // remove reference from data ob
  7363. // frozen object may not have observer.
  7364. if (vm._data.__ob__) {
  7365. vm._data.__ob__.vmCount--;
  7366. }
  7367. // call the last hook...
  7368. vm._isDestroyed = true;
  7369. // invoke destroy hooks on current rendered tree
  7370. vm.__patch__(vm._vnode, null);
  7371. // fire destroyed hook
  7372. callHook(vm, 'destroyed');
  7373. // turn off all instance listeners.
  7374. vm.$off();
  7375. // remove __vue__ reference
  7376. if (vm.$el) {
  7377. vm.$el.__vue__ = null;
  7378. }
  7379. // release circular reference (#6759)
  7380. if (vm.$vnode) {
  7381. vm.$vnode.parent = null;
  7382. }
  7383. };
  7384. }
  7385. function updateChildComponent (
  7386. vm,
  7387. propsData,
  7388. listeners,
  7389. parentVnode,
  7390. renderChildren
  7391. ) {
  7392. if (true) {
  7393. isUpdatingChildComponent = true;
  7394. }
  7395. // determine whether component has slot children
  7396. // we need to do this before overwriting $options._renderChildren.
  7397. // check if there are dynamic scopedSlots (hand-written or compiled but with
  7398. // dynamic slot names). Static scoped slots compiled from template has the
  7399. // "$stable" marker.
  7400. var newScopedSlots = parentVnode.data.scopedSlots;
  7401. var oldScopedSlots = vm.$scopedSlots;
  7402. var hasDynamicScopedSlot = !!(
  7403. (newScopedSlots && !newScopedSlots.$stable) ||
  7404. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  7405. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  7406. );
  7407. // Any static slot children from the parent may have changed during parent's
  7408. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  7409. // update is necessary to ensure correctness.
  7410. var needsForceUpdate = !!(
  7411. renderChildren || // has new static slots
  7412. vm.$options._renderChildren || // has old static slots
  7413. hasDynamicScopedSlot
  7414. );
  7415. vm.$options._parentVnode = parentVnode;
  7416. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  7417. if (vm._vnode) { // update child tree's parent
  7418. vm._vnode.parent = parentVnode;
  7419. }
  7420. vm.$options._renderChildren = renderChildren;
  7421. // update $attrs and $listeners hash
  7422. // these are also reactive so they may trigger child update if the child
  7423. // used them during render
  7424. vm.$attrs = parentVnode.data.attrs || emptyObject;
  7425. vm.$listeners = listeners || emptyObject;
  7426. // update props
  7427. if (propsData && vm.$options.props) {
  7428. toggleObserving(false);
  7429. var props = vm._props;
  7430. var propKeys = vm.$options._propKeys || [];
  7431. for (var i = 0; i < propKeys.length; i++) {
  7432. var key = propKeys[i];
  7433. var propOptions = vm.$options.props; // wtf flow?
  7434. props[key] = validateProp(key, propOptions, propsData, vm);
  7435. }
  7436. toggleObserving(true);
  7437. // keep a copy of raw propsData
  7438. vm.$options.propsData = propsData;
  7439. }
  7440. // fixed by xxxxxx update properties(mp runtime)
  7441. vm._$updateProperties && vm._$updateProperties(vm);
  7442. // update listeners
  7443. listeners = listeners || emptyObject;
  7444. var oldListeners = vm.$options._parentListeners;
  7445. vm.$options._parentListeners = listeners;
  7446. updateComponentListeners(vm, listeners, oldListeners);
  7447. // resolve slots + force update if has children
  7448. if (needsForceUpdate) {
  7449. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7450. vm.$forceUpdate();
  7451. }
  7452. if (true) {
  7453. isUpdatingChildComponent = false;
  7454. }
  7455. }
  7456. function isInInactiveTree (vm) {
  7457. while (vm && (vm = vm.$parent)) {
  7458. if (vm._inactive) { return true }
  7459. }
  7460. return false
  7461. }
  7462. function activateChildComponent (vm, direct) {
  7463. if (direct) {
  7464. vm._directInactive = false;
  7465. if (isInInactiveTree(vm)) {
  7466. return
  7467. }
  7468. } else if (vm._directInactive) {
  7469. return
  7470. }
  7471. if (vm._inactive || vm._inactive === null) {
  7472. vm._inactive = false;
  7473. for (var i = 0; i < vm.$children.length; i++) {
  7474. activateChildComponent(vm.$children[i]);
  7475. }
  7476. callHook(vm, 'activated');
  7477. }
  7478. }
  7479. function deactivateChildComponent (vm, direct) {
  7480. if (direct) {
  7481. vm._directInactive = true;
  7482. if (isInInactiveTree(vm)) {
  7483. return
  7484. }
  7485. }
  7486. if (!vm._inactive) {
  7487. vm._inactive = true;
  7488. for (var i = 0; i < vm.$children.length; i++) {
  7489. deactivateChildComponent(vm.$children[i]);
  7490. }
  7491. callHook(vm, 'deactivated');
  7492. }
  7493. }
  7494. function callHook (vm, hook) {
  7495. // #7573 disable dep collection when invoking lifecycle hooks
  7496. pushTarget();
  7497. var handlers = vm.$options[hook];
  7498. var info = hook + " hook";
  7499. if (handlers) {
  7500. for (var i = 0, j = handlers.length; i < j; i++) {
  7501. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7502. }
  7503. }
  7504. if (vm._hasHookEvent) {
  7505. vm.$emit('hook:' + hook);
  7506. }
  7507. popTarget();
  7508. }
  7509. /* */
  7510. var MAX_UPDATE_COUNT = 100;
  7511. var queue = [];
  7512. var activatedChildren = [];
  7513. var has = {};
  7514. var circular = {};
  7515. var waiting = false;
  7516. var flushing = false;
  7517. var index = 0;
  7518. /**
  7519. * Reset the scheduler's state.
  7520. */
  7521. function resetSchedulerState () {
  7522. index = queue.length = activatedChildren.length = 0;
  7523. has = {};
  7524. if (true) {
  7525. circular = {};
  7526. }
  7527. waiting = flushing = false;
  7528. }
  7529. // Async edge case #6566 requires saving the timestamp when event listeners are
  7530. // attached. However, calling performance.now() has a perf overhead especially
  7531. // if the page has thousands of event listeners. Instead, we take a timestamp
  7532. // every time the scheduler flushes and use that for all event listeners
  7533. // attached during that flush.
  7534. var currentFlushTimestamp = 0;
  7535. // Async edge case fix requires storing an event listener's attach timestamp.
  7536. var getNow = Date.now;
  7537. // Determine what event timestamp the browser is using. Annoyingly, the
  7538. // timestamp can either be hi-res (relative to page load) or low-res
  7539. // (relative to UNIX epoch), so in order to compare time we have to use the
  7540. // same timestamp type when saving the flush timestamp.
  7541. // All IE versions use low-res event timestamps, and have problematic clock
  7542. // implementations (#9632)
  7543. if (inBrowser && !isIE) {
  7544. var performance = window.performance;
  7545. if (
  7546. performance &&
  7547. typeof performance.now === 'function' &&
  7548. getNow() > document.createEvent('Event').timeStamp
  7549. ) {
  7550. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7551. // smaller than it, it means the event is using a hi-res timestamp,
  7552. // and we need to use the hi-res version for event listener timestamps as
  7553. // well.
  7554. getNow = function () { return performance.now(); };
  7555. }
  7556. }
  7557. /**
  7558. * Flush both queues and run the watchers.
  7559. */
  7560. function flushSchedulerQueue () {
  7561. currentFlushTimestamp = getNow();
  7562. flushing = true;
  7563. var watcher, id;
  7564. // Sort queue before flush.
  7565. // This ensures that:
  7566. // 1. Components are updated from parent to child. (because parent is always
  7567. // created before the child)
  7568. // 2. A component's user watchers are run before its render watcher (because
  7569. // user watchers are created before the render watcher)
  7570. // 3. If a component is destroyed during a parent component's watcher run,
  7571. // its watchers can be skipped.
  7572. queue.sort(function (a, b) { return a.id - b.id; });
  7573. // do not cache length because more watchers might be pushed
  7574. // as we run existing watchers
  7575. for (index = 0; index < queue.length; index++) {
  7576. watcher = queue[index];
  7577. if (watcher.before) {
  7578. watcher.before();
  7579. }
  7580. id = watcher.id;
  7581. has[id] = null;
  7582. watcher.run();
  7583. // in dev build, check and stop circular updates.
  7584. if ( true && has[id] != null) {
  7585. circular[id] = (circular[id] || 0) + 1;
  7586. if (circular[id] > MAX_UPDATE_COUNT) {
  7587. warn(
  7588. 'You may have an infinite update loop ' + (
  7589. watcher.user
  7590. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7591. : "in a component render function."
  7592. ),
  7593. watcher.vm
  7594. );
  7595. break
  7596. }
  7597. }
  7598. }
  7599. // keep copies of post queues before resetting state
  7600. var activatedQueue = activatedChildren.slice();
  7601. var updatedQueue = queue.slice();
  7602. resetSchedulerState();
  7603. // call component updated and activated hooks
  7604. callActivatedHooks(activatedQueue);
  7605. callUpdatedHooks(updatedQueue);
  7606. // devtool hook
  7607. /* istanbul ignore if */
  7608. if (devtools && config.devtools) {
  7609. devtools.emit('flush');
  7610. }
  7611. }
  7612. function callUpdatedHooks (queue) {
  7613. var i = queue.length;
  7614. while (i--) {
  7615. var watcher = queue[i];
  7616. var vm = watcher.vm;
  7617. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7618. callHook(vm, 'updated');
  7619. }
  7620. }
  7621. }
  7622. /**
  7623. * Queue a kept-alive component that was activated during patch.
  7624. * The queue will be processed after the entire tree has been patched.
  7625. */
  7626. function queueActivatedComponent (vm) {
  7627. // setting _inactive to false here so that a render function can
  7628. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7629. vm._inactive = false;
  7630. activatedChildren.push(vm);
  7631. }
  7632. function callActivatedHooks (queue) {
  7633. for (var i = 0; i < queue.length; i++) {
  7634. queue[i]._inactive = true;
  7635. activateChildComponent(queue[i], true /* true */);
  7636. }
  7637. }
  7638. /**
  7639. * Push a watcher into the watcher queue.
  7640. * Jobs with duplicate IDs will be skipped unless it's
  7641. * pushed when the queue is being flushed.
  7642. */
  7643. function queueWatcher (watcher) {
  7644. var id = watcher.id;
  7645. if (has[id] == null) {
  7646. has[id] = true;
  7647. if (!flushing) {
  7648. queue.push(watcher);
  7649. } else {
  7650. // if already flushing, splice the watcher based on its id
  7651. // if already past its id, it will be run next immediately.
  7652. var i = queue.length - 1;
  7653. while (i > index && queue[i].id > watcher.id) {
  7654. i--;
  7655. }
  7656. queue.splice(i + 1, 0, watcher);
  7657. }
  7658. // queue the flush
  7659. if (!waiting) {
  7660. waiting = true;
  7661. if ( true && !config.async) {
  7662. flushSchedulerQueue();
  7663. return
  7664. }
  7665. nextTick(flushSchedulerQueue);
  7666. }
  7667. }
  7668. }
  7669. /* */
  7670. var uid$2 = 0;
  7671. /**
  7672. * A watcher parses an expression, collects dependencies,
  7673. * and fires callback when the expression value changes.
  7674. * This is used for both the $watch() api and directives.
  7675. */
  7676. var Watcher = function Watcher (
  7677. vm,
  7678. expOrFn,
  7679. cb,
  7680. options,
  7681. isRenderWatcher
  7682. ) {
  7683. this.vm = vm;
  7684. if (isRenderWatcher) {
  7685. vm._watcher = this;
  7686. }
  7687. vm._watchers.push(this);
  7688. // options
  7689. if (options) {
  7690. this.deep = !!options.deep;
  7691. this.user = !!options.user;
  7692. this.lazy = !!options.lazy;
  7693. this.sync = !!options.sync;
  7694. this.before = options.before;
  7695. } else {
  7696. this.deep = this.user = this.lazy = this.sync = false;
  7697. }
  7698. this.cb = cb;
  7699. this.id = ++uid$2; // uid for batching
  7700. this.active = true;
  7701. this.dirty = this.lazy; // for lazy watchers
  7702. this.deps = [];
  7703. this.newDeps = [];
  7704. this.depIds = new _Set();
  7705. this.newDepIds = new _Set();
  7706. this.expression = true
  7707. ? expOrFn.toString()
  7708. : undefined;
  7709. // parse expression for getter
  7710. if (typeof expOrFn === 'function') {
  7711. this.getter = expOrFn;
  7712. } else {
  7713. this.getter = parsePath(expOrFn);
  7714. if (!this.getter) {
  7715. this.getter = noop;
  7716. true && warn(
  7717. "Failed watching path: \"" + expOrFn + "\" " +
  7718. 'Watcher only accepts simple dot-delimited paths. ' +
  7719. 'For full control, use a function instead.',
  7720. vm
  7721. );
  7722. }
  7723. }
  7724. this.value = this.lazy
  7725. ? undefined
  7726. : this.get();
  7727. };
  7728. /**
  7729. * Evaluate the getter, and re-collect dependencies.
  7730. */
  7731. Watcher.prototype.get = function get () {
  7732. pushTarget(this);
  7733. var value;
  7734. var vm = this.vm;
  7735. try {
  7736. value = this.getter.call(vm, vm);
  7737. } catch (e) {
  7738. if (this.user) {
  7739. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7740. } else {
  7741. throw e
  7742. }
  7743. } finally {
  7744. // "touch" every property so they are all tracked as
  7745. // dependencies for deep watching
  7746. if (this.deep) {
  7747. traverse(value);
  7748. }
  7749. popTarget();
  7750. this.cleanupDeps();
  7751. }
  7752. return value
  7753. };
  7754. /**
  7755. * Add a dependency to this directive.
  7756. */
  7757. Watcher.prototype.addDep = function addDep (dep) {
  7758. var id = dep.id;
  7759. if (!this.newDepIds.has(id)) {
  7760. this.newDepIds.add(id);
  7761. this.newDeps.push(dep);
  7762. if (!this.depIds.has(id)) {
  7763. dep.addSub(this);
  7764. }
  7765. }
  7766. };
  7767. /**
  7768. * Clean up for dependency collection.
  7769. */
  7770. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7771. var i = this.deps.length;
  7772. while (i--) {
  7773. var dep = this.deps[i];
  7774. if (!this.newDepIds.has(dep.id)) {
  7775. dep.removeSub(this);
  7776. }
  7777. }
  7778. var tmp = this.depIds;
  7779. this.depIds = this.newDepIds;
  7780. this.newDepIds = tmp;
  7781. this.newDepIds.clear();
  7782. tmp = this.deps;
  7783. this.deps = this.newDeps;
  7784. this.newDeps = tmp;
  7785. this.newDeps.length = 0;
  7786. };
  7787. /**
  7788. * Subscriber interface.
  7789. * Will be called when a dependency changes.
  7790. */
  7791. Watcher.prototype.update = function update () {
  7792. /* istanbul ignore else */
  7793. if (this.lazy) {
  7794. this.dirty = true;
  7795. } else if (this.sync) {
  7796. this.run();
  7797. } else {
  7798. queueWatcher(this);
  7799. }
  7800. };
  7801. /**
  7802. * Scheduler job interface.
  7803. * Will be called by the scheduler.
  7804. */
  7805. Watcher.prototype.run = function run () {
  7806. if (this.active) {
  7807. var value = this.get();
  7808. if (
  7809. value !== this.value ||
  7810. // Deep watchers and watchers on Object/Arrays should fire even
  7811. // when the value is the same, because the value may
  7812. // have mutated.
  7813. isObject(value) ||
  7814. this.deep
  7815. ) {
  7816. // set new value
  7817. var oldValue = this.value;
  7818. this.value = value;
  7819. if (this.user) {
  7820. try {
  7821. this.cb.call(this.vm, value, oldValue);
  7822. } catch (e) {
  7823. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  7824. }
  7825. } else {
  7826. this.cb.call(this.vm, value, oldValue);
  7827. }
  7828. }
  7829. }
  7830. };
  7831. /**
  7832. * Evaluate the value of the watcher.
  7833. * This only gets called for lazy watchers.
  7834. */
  7835. Watcher.prototype.evaluate = function evaluate () {
  7836. this.value = this.get();
  7837. this.dirty = false;
  7838. };
  7839. /**
  7840. * Depend on all deps collected by this watcher.
  7841. */
  7842. Watcher.prototype.depend = function depend () {
  7843. var i = this.deps.length;
  7844. while (i--) {
  7845. this.deps[i].depend();
  7846. }
  7847. };
  7848. /**
  7849. * Remove self from all dependencies' subscriber list.
  7850. */
  7851. Watcher.prototype.teardown = function teardown () {
  7852. if (this.active) {
  7853. // remove self from vm's watcher list
  7854. // this is a somewhat expensive operation so we skip it
  7855. // if the vm is being destroyed.
  7856. if (!this.vm._isBeingDestroyed) {
  7857. remove(this.vm._watchers, this);
  7858. }
  7859. var i = this.deps.length;
  7860. while (i--) {
  7861. this.deps[i].removeSub(this);
  7862. }
  7863. this.active = false;
  7864. }
  7865. };
  7866. /* */
  7867. var sharedPropertyDefinition = {
  7868. enumerable: true,
  7869. configurable: true,
  7870. get: noop,
  7871. set: noop
  7872. };
  7873. function proxy (target, sourceKey, key) {
  7874. sharedPropertyDefinition.get = function proxyGetter () {
  7875. return this[sourceKey][key]
  7876. };
  7877. sharedPropertyDefinition.set = function proxySetter (val) {
  7878. this[sourceKey][key] = val;
  7879. };
  7880. Object.defineProperty(target, key, sharedPropertyDefinition);
  7881. }
  7882. function initState (vm) {
  7883. vm._watchers = [];
  7884. var opts = vm.$options;
  7885. if (opts.props) { initProps(vm, opts.props); }
  7886. if (opts.methods) { initMethods(vm, opts.methods); }
  7887. if (opts.data) {
  7888. initData(vm);
  7889. } else {
  7890. observe(vm._data = {}, true /* asRootData */);
  7891. }
  7892. if (opts.computed) { initComputed(vm, opts.computed); }
  7893. if (opts.watch && opts.watch !== nativeWatch) {
  7894. initWatch(vm, opts.watch);
  7895. }
  7896. }
  7897. function initProps (vm, propsOptions) {
  7898. var propsData = vm.$options.propsData || {};
  7899. var props = vm._props = {};
  7900. // cache prop keys so that future props updates can iterate using Array
  7901. // instead of dynamic object key enumeration.
  7902. var keys = vm.$options._propKeys = [];
  7903. var isRoot = !vm.$parent;
  7904. // root instance props should be converted
  7905. if (!isRoot) {
  7906. toggleObserving(false);
  7907. }
  7908. var loop = function ( key ) {
  7909. keys.push(key);
  7910. var value = validateProp(key, propsOptions, propsData, vm);
  7911. /* istanbul ignore else */
  7912. if (true) {
  7913. var hyphenatedKey = hyphenate(key);
  7914. if (isReservedAttribute(hyphenatedKey) ||
  7915. config.isReservedAttr(hyphenatedKey)) {
  7916. warn(
  7917. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7918. vm
  7919. );
  7920. }
  7921. defineReactive$$1(props, key, value, function () {
  7922. if (!isRoot && !isUpdatingChildComponent) {
  7923. {
  7924. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  7925. return
  7926. }
  7927. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7928. if(
  7929. key === 'value' &&
  7930. Array.isArray(vm.$options.behaviors) &&
  7931. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7932. ){
  7933. return
  7934. }
  7935. if(vm._getFormData){
  7936. return
  7937. }
  7938. var $parent = vm.$parent;
  7939. while($parent){
  7940. if($parent.__next_tick_pending){
  7941. return
  7942. }
  7943. $parent = $parent.$parent;
  7944. }
  7945. }
  7946. warn(
  7947. "Avoid mutating a prop directly since the value will be " +
  7948. "overwritten whenever the parent component re-renders. " +
  7949. "Instead, use a data or computed property based on the prop's " +
  7950. "value. Prop being mutated: \"" + key + "\"",
  7951. vm
  7952. );
  7953. }
  7954. });
  7955. } else {}
  7956. // static props are already proxied on the component's prototype
  7957. // during Vue.extend(). We only need to proxy props defined at
  7958. // instantiation here.
  7959. if (!(key in vm)) {
  7960. proxy(vm, "_props", key);
  7961. }
  7962. };
  7963. for (var key in propsOptions) loop( key );
  7964. toggleObserving(true);
  7965. }
  7966. function initData (vm) {
  7967. var data = vm.$options.data;
  7968. data = vm._data = typeof data === 'function'
  7969. ? getData(data, vm)
  7970. : data || {};
  7971. if (!isPlainObject(data)) {
  7972. data = {};
  7973. true && warn(
  7974. 'data functions should return an object:\n' +
  7975. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7976. vm
  7977. );
  7978. }
  7979. // proxy data on instance
  7980. var keys = Object.keys(data);
  7981. var props = vm.$options.props;
  7982. var methods = vm.$options.methods;
  7983. var i = keys.length;
  7984. while (i--) {
  7985. var key = keys[i];
  7986. if (true) {
  7987. if (methods && hasOwn(methods, key)) {
  7988. warn(
  7989. ("Method \"" + key + "\" has already been defined as a data property."),
  7990. vm
  7991. );
  7992. }
  7993. }
  7994. if (props && hasOwn(props, key)) {
  7995. true && warn(
  7996. "The data property \"" + key + "\" is already declared as a prop. " +
  7997. "Use prop default value instead.",
  7998. vm
  7999. );
  8000. } else if (!isReserved(key)) {
  8001. proxy(vm, "_data", key);
  8002. }
  8003. }
  8004. // observe data
  8005. observe(data, true /* asRootData */);
  8006. }
  8007. function getData (data, vm) {
  8008. // #7573 disable dep collection when invoking data getters
  8009. pushTarget();
  8010. try {
  8011. return data.call(vm, vm)
  8012. } catch (e) {
  8013. handleError(e, vm, "data()");
  8014. return {}
  8015. } finally {
  8016. popTarget();
  8017. }
  8018. }
  8019. var computedWatcherOptions = { lazy: true };
  8020. function initComputed (vm, computed) {
  8021. // $flow-disable-line
  8022. var watchers = vm._computedWatchers = Object.create(null);
  8023. // computed properties are just getters during SSR
  8024. var isSSR = isServerRendering();
  8025. for (var key in computed) {
  8026. var userDef = computed[key];
  8027. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  8028. if ( true && getter == null) {
  8029. warn(
  8030. ("Getter is missing for computed property \"" + key + "\"."),
  8031. vm
  8032. );
  8033. }
  8034. if (!isSSR) {
  8035. // create internal watcher for the computed property.
  8036. watchers[key] = new Watcher(
  8037. vm,
  8038. getter || noop,
  8039. noop,
  8040. computedWatcherOptions
  8041. );
  8042. }
  8043. // component-defined computed properties are already defined on the
  8044. // component prototype. We only need to define computed properties defined
  8045. // at instantiation here.
  8046. if (!(key in vm)) {
  8047. defineComputed(vm, key, userDef);
  8048. } else if (true) {
  8049. if (key in vm.$data) {
  8050. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  8051. } else if (vm.$options.props && key in vm.$options.props) {
  8052. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  8053. }
  8054. }
  8055. }
  8056. }
  8057. function defineComputed (
  8058. target,
  8059. key,
  8060. userDef
  8061. ) {
  8062. var shouldCache = !isServerRendering();
  8063. if (typeof userDef === 'function') {
  8064. sharedPropertyDefinition.get = shouldCache
  8065. ? createComputedGetter(key)
  8066. : createGetterInvoker(userDef);
  8067. sharedPropertyDefinition.set = noop;
  8068. } else {
  8069. sharedPropertyDefinition.get = userDef.get
  8070. ? shouldCache && userDef.cache !== false
  8071. ? createComputedGetter(key)
  8072. : createGetterInvoker(userDef.get)
  8073. : noop;
  8074. sharedPropertyDefinition.set = userDef.set || noop;
  8075. }
  8076. if ( true &&
  8077. sharedPropertyDefinition.set === noop) {
  8078. sharedPropertyDefinition.set = function () {
  8079. warn(
  8080. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  8081. this
  8082. );
  8083. };
  8084. }
  8085. Object.defineProperty(target, key, sharedPropertyDefinition);
  8086. }
  8087. function createComputedGetter (key) {
  8088. return function computedGetter () {
  8089. var watcher = this._computedWatchers && this._computedWatchers[key];
  8090. if (watcher) {
  8091. if (watcher.dirty) {
  8092. watcher.evaluate();
  8093. }
  8094. if (Dep.SharedObject.target) {// fixed by xxxxxx
  8095. watcher.depend();
  8096. }
  8097. return watcher.value
  8098. }
  8099. }
  8100. }
  8101. function createGetterInvoker(fn) {
  8102. return function computedGetter () {
  8103. return fn.call(this, this)
  8104. }
  8105. }
  8106. function initMethods (vm, methods) {
  8107. var props = vm.$options.props;
  8108. for (var key in methods) {
  8109. if (true) {
  8110. if (typeof methods[key] !== 'function') {
  8111. warn(
  8112. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  8113. "Did you reference the function correctly?",
  8114. vm
  8115. );
  8116. }
  8117. if (props && hasOwn(props, key)) {
  8118. warn(
  8119. ("Method \"" + key + "\" has already been defined as a prop."),
  8120. vm
  8121. );
  8122. }
  8123. if ((key in vm) && isReserved(key)) {
  8124. warn(
  8125. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  8126. "Avoid defining component methods that start with _ or $."
  8127. );
  8128. }
  8129. }
  8130. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  8131. }
  8132. }
  8133. function initWatch (vm, watch) {
  8134. for (var key in watch) {
  8135. var handler = watch[key];
  8136. if (Array.isArray(handler)) {
  8137. for (var i = 0; i < handler.length; i++) {
  8138. createWatcher(vm, key, handler[i]);
  8139. }
  8140. } else {
  8141. createWatcher(vm, key, handler);
  8142. }
  8143. }
  8144. }
  8145. function createWatcher (
  8146. vm,
  8147. expOrFn,
  8148. handler,
  8149. options
  8150. ) {
  8151. if (isPlainObject(handler)) {
  8152. options = handler;
  8153. handler = handler.handler;
  8154. }
  8155. if (typeof handler === 'string') {
  8156. handler = vm[handler];
  8157. }
  8158. return vm.$watch(expOrFn, handler, options)
  8159. }
  8160. function stateMixin (Vue) {
  8161. // flow somehow has problems with directly declared definition object
  8162. // when using Object.defineProperty, so we have to procedurally build up
  8163. // the object here.
  8164. var dataDef = {};
  8165. dataDef.get = function () { return this._data };
  8166. var propsDef = {};
  8167. propsDef.get = function () { return this._props };
  8168. if (true) {
  8169. dataDef.set = function () {
  8170. warn(
  8171. 'Avoid replacing instance root $data. ' +
  8172. 'Use nested data properties instead.',
  8173. this
  8174. );
  8175. };
  8176. propsDef.set = function () {
  8177. warn("$props is readonly.", this);
  8178. };
  8179. }
  8180. Object.defineProperty(Vue.prototype, '$data', dataDef);
  8181. Object.defineProperty(Vue.prototype, '$props', propsDef);
  8182. Vue.prototype.$set = set;
  8183. Vue.prototype.$delete = del;
  8184. Vue.prototype.$watch = function (
  8185. expOrFn,
  8186. cb,
  8187. options
  8188. ) {
  8189. var vm = this;
  8190. if (isPlainObject(cb)) {
  8191. return createWatcher(vm, expOrFn, cb, options)
  8192. }
  8193. options = options || {};
  8194. options.user = true;
  8195. var watcher = new Watcher(vm, expOrFn, cb, options);
  8196. if (options.immediate) {
  8197. try {
  8198. cb.call(vm, watcher.value);
  8199. } catch (error) {
  8200. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  8201. }
  8202. }
  8203. return function unwatchFn () {
  8204. watcher.teardown();
  8205. }
  8206. };
  8207. }
  8208. /* */
  8209. var uid$3 = 0;
  8210. function initMixin (Vue) {
  8211. Vue.prototype._init = function (options) {
  8212. var vm = this;
  8213. // a uid
  8214. vm._uid = uid$3++;
  8215. var startTag, endTag;
  8216. /* istanbul ignore if */
  8217. if ( true && config.performance && mark) {
  8218. startTag = "vue-perf-start:" + (vm._uid);
  8219. endTag = "vue-perf-end:" + (vm._uid);
  8220. mark(startTag);
  8221. }
  8222. // a flag to avoid this being observed
  8223. vm._isVue = true;
  8224. // merge options
  8225. if (options && options._isComponent) {
  8226. // optimize internal component instantiation
  8227. // since dynamic options merging is pretty slow, and none of the
  8228. // internal component options needs special treatment.
  8229. initInternalComponent(vm, options);
  8230. } else {
  8231. vm.$options = mergeOptions(
  8232. resolveConstructorOptions(vm.constructor),
  8233. options || {},
  8234. vm
  8235. );
  8236. }
  8237. /* istanbul ignore else */
  8238. if (true) {
  8239. initProxy(vm);
  8240. } else {}
  8241. // expose real self
  8242. vm._self = vm;
  8243. initLifecycle(vm);
  8244. initEvents(vm);
  8245. initRender(vm);
  8246. callHook(vm, 'beforeCreate');
  8247. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  8248. initState(vm);
  8249. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  8250. !vm._$fallback && callHook(vm, 'created');
  8251. /* istanbul ignore if */
  8252. if ( true && config.performance && mark) {
  8253. vm._name = formatComponentName(vm, false);
  8254. mark(endTag);
  8255. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  8256. }
  8257. if (vm.$options.el) {
  8258. vm.$mount(vm.$options.el);
  8259. }
  8260. };
  8261. }
  8262. function initInternalComponent (vm, options) {
  8263. var opts = vm.$options = Object.create(vm.constructor.options);
  8264. // doing this because it's faster than dynamic enumeration.
  8265. var parentVnode = options._parentVnode;
  8266. opts.parent = options.parent;
  8267. opts._parentVnode = parentVnode;
  8268. var vnodeComponentOptions = parentVnode.componentOptions;
  8269. opts.propsData = vnodeComponentOptions.propsData;
  8270. opts._parentListeners = vnodeComponentOptions.listeners;
  8271. opts._renderChildren = vnodeComponentOptions.children;
  8272. opts._componentTag = vnodeComponentOptions.tag;
  8273. if (options.render) {
  8274. opts.render = options.render;
  8275. opts.staticRenderFns = options.staticRenderFns;
  8276. }
  8277. }
  8278. function resolveConstructorOptions (Ctor) {
  8279. var options = Ctor.options;
  8280. if (Ctor.super) {
  8281. var superOptions = resolveConstructorOptions(Ctor.super);
  8282. var cachedSuperOptions = Ctor.superOptions;
  8283. if (superOptions !== cachedSuperOptions) {
  8284. // super option changed,
  8285. // need to resolve new options.
  8286. Ctor.superOptions = superOptions;
  8287. // check if there are any late-modified/attached options (#4976)
  8288. var modifiedOptions = resolveModifiedOptions(Ctor);
  8289. // update base extend options
  8290. if (modifiedOptions) {
  8291. extend(Ctor.extendOptions, modifiedOptions);
  8292. }
  8293. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  8294. if (options.name) {
  8295. options.components[options.name] = Ctor;
  8296. }
  8297. }
  8298. }
  8299. return options
  8300. }
  8301. function resolveModifiedOptions (Ctor) {
  8302. var modified;
  8303. var latest = Ctor.options;
  8304. var sealed = Ctor.sealedOptions;
  8305. for (var key in latest) {
  8306. if (latest[key] !== sealed[key]) {
  8307. if (!modified) { modified = {}; }
  8308. modified[key] = latest[key];
  8309. }
  8310. }
  8311. return modified
  8312. }
  8313. function Vue (options) {
  8314. if ( true &&
  8315. !(this instanceof Vue)
  8316. ) {
  8317. warn('Vue is a constructor and should be called with the `new` keyword');
  8318. }
  8319. this._init(options);
  8320. }
  8321. initMixin(Vue);
  8322. stateMixin(Vue);
  8323. eventsMixin(Vue);
  8324. lifecycleMixin(Vue);
  8325. renderMixin(Vue);
  8326. /* */
  8327. function initUse (Vue) {
  8328. Vue.use = function (plugin) {
  8329. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  8330. if (installedPlugins.indexOf(plugin) > -1) {
  8331. return this
  8332. }
  8333. // additional parameters
  8334. var args = toArray(arguments, 1);
  8335. args.unshift(this);
  8336. if (typeof plugin.install === 'function') {
  8337. plugin.install.apply(plugin, args);
  8338. } else if (typeof plugin === 'function') {
  8339. plugin.apply(null, args);
  8340. }
  8341. installedPlugins.push(plugin);
  8342. return this
  8343. };
  8344. }
  8345. /* */
  8346. function initMixin$1 (Vue) {
  8347. Vue.mixin = function (mixin) {
  8348. this.options = mergeOptions(this.options, mixin);
  8349. return this
  8350. };
  8351. }
  8352. /* */
  8353. function initExtend (Vue) {
  8354. /**
  8355. * Each instance constructor, including Vue, has a unique
  8356. * cid. This enables us to create wrapped "child
  8357. * constructors" for prototypal inheritance and cache them.
  8358. */
  8359. Vue.cid = 0;
  8360. var cid = 1;
  8361. /**
  8362. * Class inheritance
  8363. */
  8364. Vue.extend = function (extendOptions) {
  8365. extendOptions = extendOptions || {};
  8366. var Super = this;
  8367. var SuperId = Super.cid;
  8368. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  8369. if (cachedCtors[SuperId]) {
  8370. return cachedCtors[SuperId]
  8371. }
  8372. var name = extendOptions.name || Super.options.name;
  8373. if ( true && name) {
  8374. validateComponentName(name);
  8375. }
  8376. var Sub = function VueComponent (options) {
  8377. this._init(options);
  8378. };
  8379. Sub.prototype = Object.create(Super.prototype);
  8380. Sub.prototype.constructor = Sub;
  8381. Sub.cid = cid++;
  8382. Sub.options = mergeOptions(
  8383. Super.options,
  8384. extendOptions
  8385. );
  8386. Sub['super'] = Super;
  8387. // For props and computed properties, we define the proxy getters on
  8388. // the Vue instances at extension time, on the extended prototype. This
  8389. // avoids Object.defineProperty calls for each instance created.
  8390. if (Sub.options.props) {
  8391. initProps$1(Sub);
  8392. }
  8393. if (Sub.options.computed) {
  8394. initComputed$1(Sub);
  8395. }
  8396. // allow further extension/mixin/plugin usage
  8397. Sub.extend = Super.extend;
  8398. Sub.mixin = Super.mixin;
  8399. Sub.use = Super.use;
  8400. // create asset registers, so extended classes
  8401. // can have their private assets too.
  8402. ASSET_TYPES.forEach(function (type) {
  8403. Sub[type] = Super[type];
  8404. });
  8405. // enable recursive self-lookup
  8406. if (name) {
  8407. Sub.options.components[name] = Sub;
  8408. }
  8409. // keep a reference to the super options at extension time.
  8410. // later at instantiation we can check if Super's options have
  8411. // been updated.
  8412. Sub.superOptions = Super.options;
  8413. Sub.extendOptions = extendOptions;
  8414. Sub.sealedOptions = extend({}, Sub.options);
  8415. // cache constructor
  8416. cachedCtors[SuperId] = Sub;
  8417. return Sub
  8418. };
  8419. }
  8420. function initProps$1 (Comp) {
  8421. var props = Comp.options.props;
  8422. for (var key in props) {
  8423. proxy(Comp.prototype, "_props", key);
  8424. }
  8425. }
  8426. function initComputed$1 (Comp) {
  8427. var computed = Comp.options.computed;
  8428. for (var key in computed) {
  8429. defineComputed(Comp.prototype, key, computed[key]);
  8430. }
  8431. }
  8432. /* */
  8433. function initAssetRegisters (Vue) {
  8434. /**
  8435. * Create asset registration methods.
  8436. */
  8437. ASSET_TYPES.forEach(function (type) {
  8438. Vue[type] = function (
  8439. id,
  8440. definition
  8441. ) {
  8442. if (!definition) {
  8443. return this.options[type + 's'][id]
  8444. } else {
  8445. /* istanbul ignore if */
  8446. if ( true && type === 'component') {
  8447. validateComponentName(id);
  8448. }
  8449. if (type === 'component' && isPlainObject(definition)) {
  8450. definition.name = definition.name || id;
  8451. definition = this.options._base.extend(definition);
  8452. }
  8453. if (type === 'directive' && typeof definition === 'function') {
  8454. definition = { bind: definition, update: definition };
  8455. }
  8456. this.options[type + 's'][id] = definition;
  8457. return definition
  8458. }
  8459. };
  8460. });
  8461. }
  8462. /* */
  8463. function getComponentName (opts) {
  8464. return opts && (opts.Ctor.options.name || opts.tag)
  8465. }
  8466. function matches (pattern, name) {
  8467. if (Array.isArray(pattern)) {
  8468. return pattern.indexOf(name) > -1
  8469. } else if (typeof pattern === 'string') {
  8470. return pattern.split(',').indexOf(name) > -1
  8471. } else if (isRegExp(pattern)) {
  8472. return pattern.test(name)
  8473. }
  8474. /* istanbul ignore next */
  8475. return false
  8476. }
  8477. function pruneCache (keepAliveInstance, filter) {
  8478. var cache = keepAliveInstance.cache;
  8479. var keys = keepAliveInstance.keys;
  8480. var _vnode = keepAliveInstance._vnode;
  8481. for (var key in cache) {
  8482. var cachedNode = cache[key];
  8483. if (cachedNode) {
  8484. var name = getComponentName(cachedNode.componentOptions);
  8485. if (name && !filter(name)) {
  8486. pruneCacheEntry(cache, key, keys, _vnode);
  8487. }
  8488. }
  8489. }
  8490. }
  8491. function pruneCacheEntry (
  8492. cache,
  8493. key,
  8494. keys,
  8495. current
  8496. ) {
  8497. var cached$$1 = cache[key];
  8498. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8499. cached$$1.componentInstance.$destroy();
  8500. }
  8501. cache[key] = null;
  8502. remove(keys, key);
  8503. }
  8504. var patternTypes = [String, RegExp, Array];
  8505. var KeepAlive = {
  8506. name: 'keep-alive',
  8507. abstract: true,
  8508. props: {
  8509. include: patternTypes,
  8510. exclude: patternTypes,
  8511. max: [String, Number]
  8512. },
  8513. created: function created () {
  8514. this.cache = Object.create(null);
  8515. this.keys = [];
  8516. },
  8517. destroyed: function destroyed () {
  8518. for (var key in this.cache) {
  8519. pruneCacheEntry(this.cache, key, this.keys);
  8520. }
  8521. },
  8522. mounted: function mounted () {
  8523. var this$1 = this;
  8524. this.$watch('include', function (val) {
  8525. pruneCache(this$1, function (name) { return matches(val, name); });
  8526. });
  8527. this.$watch('exclude', function (val) {
  8528. pruneCache(this$1, function (name) { return !matches(val, name); });
  8529. });
  8530. },
  8531. render: function render () {
  8532. var slot = this.$slots.default;
  8533. var vnode = getFirstComponentChild(slot);
  8534. var componentOptions = vnode && vnode.componentOptions;
  8535. if (componentOptions) {
  8536. // check pattern
  8537. var name = getComponentName(componentOptions);
  8538. var ref = this;
  8539. var include = ref.include;
  8540. var exclude = ref.exclude;
  8541. if (
  8542. // not included
  8543. (include && (!name || !matches(include, name))) ||
  8544. // excluded
  8545. (exclude && name && matches(exclude, name))
  8546. ) {
  8547. return vnode
  8548. }
  8549. var ref$1 = this;
  8550. var cache = ref$1.cache;
  8551. var keys = ref$1.keys;
  8552. var key = vnode.key == null
  8553. // same constructor may get registered as different local components
  8554. // so cid alone is not enough (#3269)
  8555. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8556. : vnode.key;
  8557. if (cache[key]) {
  8558. vnode.componentInstance = cache[key].componentInstance;
  8559. // make current key freshest
  8560. remove(keys, key);
  8561. keys.push(key);
  8562. } else {
  8563. cache[key] = vnode;
  8564. keys.push(key);
  8565. // prune oldest entry
  8566. if (this.max && keys.length > parseInt(this.max)) {
  8567. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8568. }
  8569. }
  8570. vnode.data.keepAlive = true;
  8571. }
  8572. return vnode || (slot && slot[0])
  8573. }
  8574. };
  8575. var builtInComponents = {
  8576. KeepAlive: KeepAlive
  8577. };
  8578. /* */
  8579. function initGlobalAPI (Vue) {
  8580. // config
  8581. var configDef = {};
  8582. configDef.get = function () { return config; };
  8583. if (true) {
  8584. configDef.set = function () {
  8585. warn(
  8586. 'Do not replace the Vue.config object, set individual fields instead.'
  8587. );
  8588. };
  8589. }
  8590. Object.defineProperty(Vue, 'config', configDef);
  8591. // exposed util methods.
  8592. // NOTE: these are not considered part of the public API - avoid relying on
  8593. // them unless you are aware of the risk.
  8594. Vue.util = {
  8595. warn: warn,
  8596. extend: extend,
  8597. mergeOptions: mergeOptions,
  8598. defineReactive: defineReactive$$1
  8599. };
  8600. Vue.set = set;
  8601. Vue.delete = del;
  8602. Vue.nextTick = nextTick;
  8603. // 2.6 explicit observable API
  8604. Vue.observable = function (obj) {
  8605. observe(obj);
  8606. return obj
  8607. };
  8608. Vue.options = Object.create(null);
  8609. ASSET_TYPES.forEach(function (type) {
  8610. Vue.options[type + 's'] = Object.create(null);
  8611. });
  8612. // this is used to identify the "base" constructor to extend all plain-object
  8613. // components with in Weex's multi-instance scenarios.
  8614. Vue.options._base = Vue;
  8615. extend(Vue.options.components, builtInComponents);
  8616. initUse(Vue);
  8617. initMixin$1(Vue);
  8618. initExtend(Vue);
  8619. initAssetRegisters(Vue);
  8620. }
  8621. initGlobalAPI(Vue);
  8622. Object.defineProperty(Vue.prototype, '$isServer', {
  8623. get: isServerRendering
  8624. });
  8625. Object.defineProperty(Vue.prototype, '$ssrContext', {
  8626. get: function get () {
  8627. /* istanbul ignore next */
  8628. return this.$vnode && this.$vnode.ssrContext
  8629. }
  8630. });
  8631. // expose FunctionalRenderContext for ssr runtime helper installation
  8632. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8633. value: FunctionalRenderContext
  8634. });
  8635. Vue.version = '2.6.11';
  8636. /**
  8637. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8638. */
  8639. var ARRAYTYPE = '[object Array]';
  8640. var OBJECTTYPE = '[object Object]';
  8641. var NULLTYPE = '[object Null]';
  8642. var UNDEFINEDTYPE = '[object Undefined]';
  8643. // const FUNCTIONTYPE = '[object Function]'
  8644. function diff(current, pre) {
  8645. var result = {};
  8646. syncKeys(current, pre);
  8647. _diff(current, pre, '', result);
  8648. return result
  8649. }
  8650. function syncKeys(current, pre) {
  8651. if (current === pre) { return }
  8652. var rootCurrentType = type(current);
  8653. var rootPreType = type(pre);
  8654. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8655. if(Object.keys(current).length >= Object.keys(pre).length){
  8656. for (var key in pre) {
  8657. var currentValue = current[key];
  8658. if (currentValue === undefined) {
  8659. current[key] = null;
  8660. } else {
  8661. syncKeys(currentValue, pre[key]);
  8662. }
  8663. }
  8664. }
  8665. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8666. if (current.length >= pre.length) {
  8667. pre.forEach(function (item, index) {
  8668. syncKeys(current[index], item);
  8669. });
  8670. }
  8671. }
  8672. }
  8673. function nullOrUndefined(currentType, preType) {
  8674. if(
  8675. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  8676. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  8677. ) {
  8678. return false
  8679. }
  8680. return true
  8681. }
  8682. function _diff(current, pre, path, result) {
  8683. if (current === pre) { return }
  8684. var rootCurrentType = type(current);
  8685. var rootPreType = type(pre);
  8686. if (rootCurrentType == OBJECTTYPE) {
  8687. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8688. setResult(result, path, current);
  8689. } else {
  8690. var loop = function ( key ) {
  8691. var currentValue = current[key];
  8692. var preValue = pre[key];
  8693. var currentType = type(currentValue);
  8694. var preType = type(preValue);
  8695. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8696. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  8697. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8698. }
  8699. } else if (currentType == ARRAYTYPE) {
  8700. if (preType != ARRAYTYPE) {
  8701. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8702. } else {
  8703. if (currentValue.length < preValue.length) {
  8704. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8705. } else {
  8706. currentValue.forEach(function (item, index) {
  8707. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8708. });
  8709. }
  8710. }
  8711. } else if (currentType == OBJECTTYPE) {
  8712. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8713. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8714. } else {
  8715. for (var subKey in currentValue) {
  8716. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8717. }
  8718. }
  8719. }
  8720. };
  8721. for (var key in current) loop( key );
  8722. }
  8723. } else if (rootCurrentType == ARRAYTYPE) {
  8724. if (rootPreType != ARRAYTYPE) {
  8725. setResult(result, path, current);
  8726. } else {
  8727. if (current.length < pre.length) {
  8728. setResult(result, path, current);
  8729. } else {
  8730. current.forEach(function (item, index) {
  8731. _diff(item, pre[index], path + '[' + index + ']', result);
  8732. });
  8733. }
  8734. }
  8735. } else {
  8736. setResult(result, path, current);
  8737. }
  8738. }
  8739. function setResult(result, k, v) {
  8740. // if (type(v) != FUNCTIONTYPE) {
  8741. result[k] = v;
  8742. // }
  8743. }
  8744. function type(obj) {
  8745. return Object.prototype.toString.call(obj)
  8746. }
  8747. /* */
  8748. function flushCallbacks$1(vm) {
  8749. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8750. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"hptwxMiniProgram","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8751. var mpInstance = vm.$scope;
  8752. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8753. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8754. }
  8755. var copies = vm.__next_tick_callbacks.slice(0);
  8756. vm.__next_tick_callbacks.length = 0;
  8757. for (var i = 0; i < copies.length; i++) {
  8758. copies[i]();
  8759. }
  8760. }
  8761. }
  8762. function hasRenderWatcher(vm) {
  8763. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8764. }
  8765. function nextTick$1(vm, cb) {
  8766. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8767. //2.nextTick 之前存在 render watcher
  8768. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8769. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"hptwxMiniProgram","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8770. var mpInstance = vm.$scope;
  8771. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8772. ']:nextVueTick');
  8773. }
  8774. return nextTick(cb, vm)
  8775. }else{
  8776. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"hptwxMiniProgram","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8777. var mpInstance$1 = vm.$scope;
  8778. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8779. ']:nextMPTick');
  8780. }
  8781. }
  8782. var _resolve;
  8783. if (!vm.__next_tick_callbacks) {
  8784. vm.__next_tick_callbacks = [];
  8785. }
  8786. vm.__next_tick_callbacks.push(function () {
  8787. if (cb) {
  8788. try {
  8789. cb.call(vm);
  8790. } catch (e) {
  8791. handleError(e, vm, 'nextTick');
  8792. }
  8793. } else if (_resolve) {
  8794. _resolve(vm);
  8795. }
  8796. });
  8797. // $flow-disable-line
  8798. if (!cb && typeof Promise !== 'undefined') {
  8799. return new Promise(function (resolve) {
  8800. _resolve = resolve;
  8801. })
  8802. }
  8803. }
  8804. /* */
  8805. function clearInstance(key, value) {
  8806. // 简易去除 Vue 和小程序组件实例
  8807. if (value) {
  8808. if (value._isVue || value.__v_isMPComponent) {
  8809. return {}
  8810. }
  8811. }
  8812. return value
  8813. }
  8814. function cloneWithData(vm) {
  8815. // 确保当前 vm 所有数据被同步
  8816. var ret = Object.create(null);
  8817. var dataKeys = [].concat(
  8818. Object.keys(vm._data || {}),
  8819. Object.keys(vm._computedWatchers || {}));
  8820. dataKeys.reduce(function(ret, key) {
  8821. ret[key] = vm[key];
  8822. return ret
  8823. }, ret);
  8824. // vue-composition-api
  8825. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  8826. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  8827. if (rawBindings) {
  8828. Object.keys(rawBindings).forEach(function (key) {
  8829. ret[key] = vm[key];
  8830. });
  8831. }
  8832. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8833. Object.assign(ret, vm.$mp.data || {});
  8834. if (
  8835. Array.isArray(vm.$options.behaviors) &&
  8836. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8837. ) { //form-field
  8838. ret['name'] = vm.name;
  8839. ret['value'] = vm.value;
  8840. }
  8841. return JSON.parse(JSON.stringify(ret, clearInstance))
  8842. }
  8843. var patch = function(oldVnode, vnode) {
  8844. var this$1 = this;
  8845. if (vnode === null) { //destroy
  8846. return
  8847. }
  8848. if (this.mpType === 'page' || this.mpType === 'component') {
  8849. var mpInstance = this.$scope;
  8850. var data = Object.create(null);
  8851. try {
  8852. data = cloneWithData(this);
  8853. } catch (err) {
  8854. console.error(err);
  8855. }
  8856. data.__webviewId__ = mpInstance.data.__webviewId__;
  8857. var mpData = Object.create(null);
  8858. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  8859. mpData[key] = mpInstance.data[key];
  8860. });
  8861. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  8862. if (Object.keys(diffData).length) {
  8863. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"hptwxMiniProgram","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8864. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  8865. ']差量更新',
  8866. JSON.stringify(diffData));
  8867. }
  8868. this.__next_tick_pending = true;
  8869. mpInstance.setData(diffData, function () {
  8870. this$1.__next_tick_pending = false;
  8871. flushCallbacks$1(this$1);
  8872. });
  8873. } else {
  8874. flushCallbacks$1(this);
  8875. }
  8876. }
  8877. };
  8878. /* */
  8879. function createEmptyRender() {
  8880. }
  8881. function mountComponent$1(
  8882. vm,
  8883. el,
  8884. hydrating
  8885. ) {
  8886. if (!vm.mpType) {//main.js 中的 new Vue
  8887. return vm
  8888. }
  8889. if (vm.mpType === 'app') {
  8890. vm.$options.render = createEmptyRender;
  8891. }
  8892. if (!vm.$options.render) {
  8893. vm.$options.render = createEmptyRender;
  8894. if (true) {
  8895. /* istanbul ignore if */
  8896. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  8897. vm.$options.el || el) {
  8898. warn(
  8899. 'You are using the runtime-only build of Vue where the template ' +
  8900. 'compiler is not available. Either pre-compile the templates into ' +
  8901. 'render functions, or use the compiler-included build.',
  8902. vm
  8903. );
  8904. } else {
  8905. warn(
  8906. 'Failed to mount component: template or render function not defined.',
  8907. vm
  8908. );
  8909. }
  8910. }
  8911. }
  8912. !vm._$fallback && callHook(vm, 'beforeMount');
  8913. var updateComponent = function () {
  8914. vm._update(vm._render(), hydrating);
  8915. };
  8916. // we set this to vm._watcher inside the watcher's constructor
  8917. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8918. // component's mounted hook), which relies on vm._watcher being already defined
  8919. new Watcher(vm, updateComponent, noop, {
  8920. before: function before() {
  8921. if (vm._isMounted && !vm._isDestroyed) {
  8922. callHook(vm, 'beforeUpdate');
  8923. }
  8924. }
  8925. }, true /* isRenderWatcher */);
  8926. hydrating = false;
  8927. return vm
  8928. }
  8929. /* */
  8930. function renderClass (
  8931. staticClass,
  8932. dynamicClass
  8933. ) {
  8934. if (isDef(staticClass) || isDef(dynamicClass)) {
  8935. return concat(staticClass, stringifyClass(dynamicClass))
  8936. }
  8937. /* istanbul ignore next */
  8938. return ''
  8939. }
  8940. function concat (a, b) {
  8941. return a ? b ? (a + ' ' + b) : a : (b || '')
  8942. }
  8943. function stringifyClass (value) {
  8944. if (Array.isArray(value)) {
  8945. return stringifyArray(value)
  8946. }
  8947. if (isObject(value)) {
  8948. return stringifyObject(value)
  8949. }
  8950. if (typeof value === 'string') {
  8951. return value
  8952. }
  8953. /* istanbul ignore next */
  8954. return ''
  8955. }
  8956. function stringifyArray (value) {
  8957. var res = '';
  8958. var stringified;
  8959. for (var i = 0, l = value.length; i < l; i++) {
  8960. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8961. if (res) { res += ' '; }
  8962. res += stringified;
  8963. }
  8964. }
  8965. return res
  8966. }
  8967. function stringifyObject (value) {
  8968. var res = '';
  8969. for (var key in value) {
  8970. if (value[key]) {
  8971. if (res) { res += ' '; }
  8972. res += key;
  8973. }
  8974. }
  8975. return res
  8976. }
  8977. /* */
  8978. var parseStyleText = cached(function (cssText) {
  8979. var res = {};
  8980. var listDelimiter = /;(?![^(]*\))/g;
  8981. var propertyDelimiter = /:(.+)/;
  8982. cssText.split(listDelimiter).forEach(function (item) {
  8983. if (item) {
  8984. var tmp = item.split(propertyDelimiter);
  8985. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8986. }
  8987. });
  8988. return res
  8989. });
  8990. // normalize possible array / string values into Object
  8991. function normalizeStyleBinding (bindingStyle) {
  8992. if (Array.isArray(bindingStyle)) {
  8993. return toObject(bindingStyle)
  8994. }
  8995. if (typeof bindingStyle === 'string') {
  8996. return parseStyleText(bindingStyle)
  8997. }
  8998. return bindingStyle
  8999. }
  9000. /* */
  9001. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  9002. function getTarget(obj, path) {
  9003. var parts = path.split('.');
  9004. var key = parts[0];
  9005. if (key.indexOf('__$n') === 0) { //number index
  9006. key = parseInt(key.replace('__$n', ''));
  9007. }
  9008. if (parts.length === 1) {
  9009. return obj[key]
  9010. }
  9011. return getTarget(obj[key], parts.slice(1).join('.'))
  9012. }
  9013. function internalMixin(Vue) {
  9014. Vue.config.errorHandler = function(err, vm, info) {
  9015. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  9016. console.error(err);
  9017. /* eslint-disable no-undef */
  9018. var app = typeof getApp === 'function' && getApp();
  9019. if (app && app.onError) {
  9020. app.onError(err);
  9021. }
  9022. };
  9023. var oldEmit = Vue.prototype.$emit;
  9024. Vue.prototype.$emit = function(event) {
  9025. if (this.$scope && event) {
  9026. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  9027. if (triggerEvent) {
  9028. try {
  9029. triggerEvent.call(this.$scope, event, {
  9030. __args__: toArray(arguments, 1)
  9031. });
  9032. } catch (error) {
  9033. }
  9034. }
  9035. }
  9036. return oldEmit.apply(this, arguments)
  9037. };
  9038. Vue.prototype.$nextTick = function(fn) {
  9039. return nextTick$1(this, fn)
  9040. };
  9041. MP_METHODS.forEach(function (method) {
  9042. Vue.prototype[method] = function(args) {
  9043. if (this.$scope && this.$scope[method]) {
  9044. return this.$scope[method](args)
  9045. }
  9046. // mp-alipay
  9047. if (typeof my === 'undefined') {
  9048. return
  9049. }
  9050. if (method === 'createSelectorQuery') {
  9051. /* eslint-disable no-undef */
  9052. return my.createSelectorQuery(args)
  9053. } else if (method === 'createIntersectionObserver') {
  9054. /* eslint-disable no-undef */
  9055. return my.createIntersectionObserver(args)
  9056. }
  9057. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  9058. };
  9059. });
  9060. Vue.prototype.__init_provide = initProvide;
  9061. Vue.prototype.__init_injections = initInjections;
  9062. Vue.prototype.__call_hook = function(hook, args) {
  9063. var vm = this;
  9064. // #7573 disable dep collection when invoking lifecycle hooks
  9065. pushTarget();
  9066. var handlers = vm.$options[hook];
  9067. var info = hook + " hook";
  9068. var ret;
  9069. if (handlers) {
  9070. for (var i = 0, j = handlers.length; i < j; i++) {
  9071. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  9072. }
  9073. }
  9074. if (vm._hasHookEvent) {
  9075. vm.$emit('hook:' + hook, args);
  9076. }
  9077. popTarget();
  9078. return ret
  9079. };
  9080. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  9081. if (Array.isArray(modifiers)) {
  9082. if (modifiers.indexOf('trim') !== -1) {
  9083. value = value.trim();
  9084. }
  9085. if (modifiers.indexOf('number') !== -1) {
  9086. value = this._n(value);
  9087. }
  9088. }
  9089. if (!target) {
  9090. target = this;
  9091. }
  9092. // 解决动态属性添加
  9093. Vue.set(target, key, value);
  9094. };
  9095. Vue.prototype.__set_sync = function(target, key, value) {
  9096. if (!target) {
  9097. target = this;
  9098. }
  9099. // 解决动态属性添加
  9100. Vue.set(target, key, value);
  9101. };
  9102. Vue.prototype.__get_orig = function(item) {
  9103. if (isPlainObject(item)) {
  9104. return item['$orig'] || item
  9105. }
  9106. return item
  9107. };
  9108. Vue.prototype.__get_value = function(dataPath, target) {
  9109. return getTarget(target || this, dataPath)
  9110. };
  9111. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  9112. return renderClass(staticClass, dynamicClass)
  9113. };
  9114. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  9115. if (!dynamicStyle && !staticStyle) {
  9116. return ''
  9117. }
  9118. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  9119. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  9120. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  9121. };
  9122. Vue.prototype.__map = function(val, iteratee) {
  9123. //TODO 暂不考虑 string
  9124. var ret, i, l, keys, key;
  9125. if (Array.isArray(val)) {
  9126. ret = new Array(val.length);
  9127. for (i = 0, l = val.length; i < l; i++) {
  9128. ret[i] = iteratee(val[i], i);
  9129. }
  9130. return ret
  9131. } else if (isObject(val)) {
  9132. keys = Object.keys(val);
  9133. ret = Object.create(null);
  9134. for (i = 0, l = keys.length; i < l; i++) {
  9135. key = keys[i];
  9136. ret[key] = iteratee(val[key], key, i);
  9137. }
  9138. return ret
  9139. } else if (typeof val === 'number') {
  9140. ret = new Array(val);
  9141. for (i = 0, l = val; i < l; i++) {
  9142. // 第一个参数暂时仍和小程序一致
  9143. ret[i] = iteratee(i, i);
  9144. }
  9145. return ret
  9146. }
  9147. return []
  9148. };
  9149. }
  9150. /* */
  9151. var LIFECYCLE_HOOKS$1 = [
  9152. //App
  9153. 'onLaunch',
  9154. 'onShow',
  9155. 'onHide',
  9156. 'onUniNViewMessage',
  9157. 'onPageNotFound',
  9158. 'onThemeChange',
  9159. 'onError',
  9160. 'onUnhandledRejection',
  9161. //Page
  9162. 'onInit',
  9163. 'onLoad',
  9164. // 'onShow',
  9165. 'onReady',
  9166. // 'onHide',
  9167. 'onUnload',
  9168. 'onPullDownRefresh',
  9169. 'onReachBottom',
  9170. 'onTabItemTap',
  9171. 'onAddToFavorites',
  9172. 'onShareTimeline',
  9173. 'onShareAppMessage',
  9174. 'onResize',
  9175. 'onPageScroll',
  9176. 'onNavigationBarButtonTap',
  9177. 'onBackPress',
  9178. 'onNavigationBarSearchInputChanged',
  9179. 'onNavigationBarSearchInputConfirmed',
  9180. 'onNavigationBarSearchInputClicked',
  9181. 'onUploadDouyinVideo',
  9182. 'onNFCReadMessage',
  9183. //Component
  9184. // 'onReady', // 兼容旧版本,应该移除该事件
  9185. 'onPageShow',
  9186. 'onPageHide',
  9187. 'onPageResize'
  9188. ];
  9189. function lifecycleMixin$1(Vue) {
  9190. //fixed vue-class-component
  9191. var oldExtend = Vue.extend;
  9192. Vue.extend = function(extendOptions) {
  9193. extendOptions = extendOptions || {};
  9194. var methods = extendOptions.methods;
  9195. if (methods) {
  9196. Object.keys(methods).forEach(function (methodName) {
  9197. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  9198. extendOptions[methodName] = methods[methodName];
  9199. delete methods[methodName];
  9200. }
  9201. });
  9202. }
  9203. return oldExtend.call(this, extendOptions)
  9204. };
  9205. var strategies = Vue.config.optionMergeStrategies;
  9206. var mergeHook = strategies.created;
  9207. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  9208. strategies[hook] = mergeHook;
  9209. });
  9210. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  9211. }
  9212. /* */
  9213. // install platform patch function
  9214. Vue.prototype.__patch__ = patch;
  9215. // public mount method
  9216. Vue.prototype.$mount = function(
  9217. el ,
  9218. hydrating
  9219. ) {
  9220. return mountComponent$1(this, el, hydrating)
  9221. };
  9222. lifecycleMixin$1(Vue);
  9223. internalMixin(Vue);
  9224. /* */
  9225. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  9226. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  9227. /***/ }),
  9228. /***/ 256:
  9229. /*!********************************************************************!*\
  9230. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/alertApi.js ***!
  9231. \********************************************************************/
  9232. /*! no static exports found */
  9233. /***/ (function(module, exports, __webpack_require__) {
  9234. "use strict";
  9235. Object.defineProperty(exports, "__esModule", {
  9236. value: true
  9237. });
  9238. exports.cancelAlert = cancelAlert;
  9239. exports.completeAlert = completeAlert;
  9240. exports.counterByStatus = counterByStatus;
  9241. exports.deleteAlertById = deleteAlertById;
  9242. exports.getAlertById = getAlertById;
  9243. exports.getAlertByList = getAlertByList;
  9244. exports.getAlertByPage = getAlertByPage;
  9245. exports.getAlertCounter = getAlertCounter;
  9246. exports.getAlertWaitingByList = getAlertWaitingByList;
  9247. exports.transferAlert = transferAlert;
  9248. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  9249. /**
  9250. * 分页查询
  9251. */
  9252. function getAlertByPage(data) {
  9253. return (0, _request.request)({
  9254. url: '/alert/page',
  9255. method: 'GET',
  9256. data: data
  9257. });
  9258. }
  9259. /**
  9260. * 列表查询
  9261. */
  9262. function getAlertByList(data) {
  9263. return (0, _request.request)({
  9264. url: '/alert',
  9265. method: 'GET',
  9266. data: data
  9267. });
  9268. }
  9269. /**
  9270. * 列表查询待处理告警
  9271. */
  9272. function getAlertWaitingByList(data) {
  9273. return (0, _request.request)({
  9274. url: '/alert/waiting',
  9275. method: 'GET',
  9276. data: data
  9277. });
  9278. }
  9279. /**
  9280. * 基于ID查询Alert
  9281. */
  9282. function getAlertById(alertId) {
  9283. return (0, _request.request)({
  9284. url: "/alert/".concat(alertId),
  9285. method: 'GET'
  9286. });
  9287. }
  9288. /**
  9289. * 完成处理
  9290. * @param data
  9291. * @returns
  9292. */
  9293. function completeAlert(data) {
  9294. return (0, _request.request)({
  9295. url: "/alert/complete",
  9296. method: 'POST',
  9297. data: data
  9298. });
  9299. }
  9300. /**
  9301. * 转交他人
  9302. * @param alertId
  9303. * @param data
  9304. * @returns
  9305. */
  9306. function transferAlert(alertId, data) {
  9307. return (0, _request.request)({
  9308. url: "/alert/transfer/".concat(alertId),
  9309. method: 'POST',
  9310. data: data
  9311. });
  9312. }
  9313. /**
  9314. * 撤消
  9315. * @param alertId
  9316. * @returns
  9317. */
  9318. function cancelAlert(alertId) {
  9319. return (0, _request.request)({
  9320. url: "/alert/cancel/".concat(alertId),
  9321. method: 'GET'
  9322. });
  9323. }
  9324. /**
  9325. * 删除
  9326. */
  9327. function deleteAlertById(alertId) {
  9328. return (0, _request.request)({
  9329. url: "/alert/".concat(alertId),
  9330. method: 'DELETE'
  9331. });
  9332. }
  9333. /**
  9334. * 查询统计结果
  9335. */
  9336. function counterByStatus(data) {
  9337. return (0, _request.request)({
  9338. url: '/alert/statis/counterByStatus',
  9339. method: 'GET',
  9340. data: data
  9341. });
  9342. }
  9343. /**
  9344. * 查询统计结果
  9345. */
  9346. function getAlertCounter() {
  9347. return (0, _request.request)({
  9348. url: '/alert/statis/getCounter',
  9349. method: 'GET'
  9350. });
  9351. }
  9352. /***/ }),
  9353. /***/ 257:
  9354. /*!*******************************************************************!*\
  9355. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/taskApi.js ***!
  9356. \*******************************************************************/
  9357. /*! no static exports found */
  9358. /***/ (function(module, exports, __webpack_require__) {
  9359. "use strict";
  9360. Object.defineProperty(exports, "__esModule", {
  9361. value: true
  9362. });
  9363. exports.cancelTask = cancelTask;
  9364. exports.createTask = createTask;
  9365. exports.deleteTaskById = deleteTaskById;
  9366. exports.getMyWaitingTaskTop = getMyWaitingTaskTop;
  9367. exports.getRecentTaskByList = getRecentTaskByList;
  9368. exports.getTaskById = getTaskById;
  9369. exports.getTaskByList = getTaskByList;
  9370. exports.getTaskByPage = getTaskByPage;
  9371. exports.getWaitingTaskByList = getWaitingTaskByList;
  9372. exports.handleTask = handleTask;
  9373. exports.transferTask = transferTask;
  9374. exports.updateTask = updateTask;
  9375. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  9376. /**
  9377. * 分页查询Task
  9378. * @param data
  9379. * @returns
  9380. */
  9381. function getTaskByPage(data) {
  9382. return (0, _request.request)({
  9383. url: '/task/page',
  9384. method: 'GET',
  9385. data: data
  9386. });
  9387. }
  9388. /**
  9389. * 列表查询Task
  9390. * @param data
  9391. * @returns
  9392. */
  9393. function getTaskByList(data) {
  9394. return (0, _request.request)({
  9395. url: '/task',
  9396. method: 'GET',
  9397. data: data
  9398. });
  9399. }
  9400. /**
  9401. * 列表查询未执行Task
  9402. * @param data
  9403. * @returns
  9404. */
  9405. function getWaitingTaskByList(data) {
  9406. return (0, _request.request)({
  9407. url: '/task/waiting',
  9408. method: 'GET',
  9409. data: data
  9410. });
  9411. }
  9412. /**
  9413. * 列表查询Task: 50笔
  9414. * @param data
  9415. * @returns
  9416. */
  9417. function getRecentTaskByList(data) {
  9418. return (0, _request.request)({
  9419. url: '/task/recent',
  9420. method: 'GET',
  9421. data: data
  9422. });
  9423. }
  9424. /**
  9425. * @param taskId
  9426. * @returns
  9427. */
  9428. function getTaskById(taskId) {
  9429. return (0, _request.request)({
  9430. url: "/task/".concat(taskId),
  9431. method: 'GET'
  9432. });
  9433. }
  9434. /**
  9435. * 添加Task
  9436. * @param data
  9437. * @returns
  9438. */
  9439. function createTask(data) {
  9440. return (0, _request.request)({
  9441. url: "/task/add",
  9442. method: 'POST',
  9443. data: data
  9444. });
  9445. }
  9446. /**
  9447. * 更新Task
  9448. * @param data
  9449. * @returns
  9450. */
  9451. function updateTask(data) {
  9452. return (0, _request.request)({
  9453. url: "/task/update",
  9454. method: 'PUT',
  9455. data: data
  9456. });
  9457. }
  9458. /**
  9459. * 删除Task
  9460. * @param taskId
  9461. * @returns
  9462. */
  9463. function deleteTaskById(taskId) {
  9464. return (0, _request.request)({
  9465. url: "/task/".concat(taskId),
  9466. method: 'DELETE'
  9467. });
  9468. }
  9469. /**
  9470. * Handle Task
  9471. * @param taskId
  9472. * @returns
  9473. */
  9474. function handleTask(taskId) {
  9475. return (0, _request.request)({
  9476. url: "/task/handle/".concat(taskId),
  9477. method: 'PUT'
  9478. });
  9479. }
  9480. /**
  9481. * Transfer Task
  9482. * @param data
  9483. * @returns
  9484. */
  9485. function transferTask(data) {
  9486. return (0, _request.request)({
  9487. url: "/task/transfer",
  9488. method: 'PUT',
  9489. data: data
  9490. });
  9491. }
  9492. /**
  9493. * Cancel Task
  9494. * @param taskId
  9495. * @returns
  9496. */
  9497. function cancelTask(taskId) {
  9498. return (0, _request.request)({
  9499. url: "/task/cancel/".concat(taskId),
  9500. method: 'PUT'
  9501. });
  9502. }
  9503. /**
  9504. * 列表查询我的待办Task:
  9505. * @param limit待办数目
  9506. * @returns
  9507. */
  9508. function getMyWaitingTaskTop(limit) {
  9509. return (0, _request.request)({
  9510. url: "/task/myWaiting/top/".concat(limit),
  9511. method: 'GET'
  9512. });
  9513. }
  9514. /***/ }),
  9515. /***/ 258:
  9516. /*!*******************************************************************!*\
  9517. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/warning.js ***!
  9518. \*******************************************************************/
  9519. /*! no static exports found */
  9520. /***/ (function(module, exports, __webpack_require__) {
  9521. "use strict";
  9522. Object.defineProperty(exports, "__esModule", {
  9523. value: true
  9524. });
  9525. exports.getMyWarningWaitingTop = getMyWarningWaitingTop;
  9526. exports.getWarningByPage = getWarningByPage;
  9527. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  9528. /**
  9529. * 我的待处理告警TOP
  9530. */
  9531. function getMyWarningWaitingTop(limit) {
  9532. return (0, _request.request)({
  9533. url: "/warning/myWaiting/top/".concat(limit),
  9534. method: 'GET'
  9535. });
  9536. }
  9537. /**
  9538. * 分页查询告警
  9539. */
  9540. function getWarningByPage(data) {
  9541. return (0, _request.request)({
  9542. url: '/warning/page',
  9543. method: 'GET',
  9544. data: data
  9545. });
  9546. }
  9547. /***/ }),
  9548. /***/ 259:
  9549. /*!************************************************************************!*\
  9550. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/checkTaskApi.js ***!
  9551. \************************************************************************/
  9552. /*! no static exports found */
  9553. /***/ (function(module, exports, __webpack_require__) {
  9554. "use strict";
  9555. Object.defineProperty(exports, "__esModule", {
  9556. value: true
  9557. });
  9558. exports.cancelCheckTask = cancelCheckTask;
  9559. exports.completeCheckTask = completeCheckTask;
  9560. exports.createCheckTask = createCheckTask;
  9561. exports.deleteCheckTaskById = deleteCheckTaskById;
  9562. exports.getCheckTaskById = getCheckTaskById;
  9563. exports.getCheckTaskByList = getCheckTaskByList;
  9564. exports.getCheckTaskByPage = getCheckTaskByPage;
  9565. exports.getCheckTaskViewById = getCheckTaskViewById;
  9566. exports.handleCheckTask = handleCheckTask;
  9567. exports.transferCheckTask = transferCheckTask;
  9568. exports.updateCheckTask = updateCheckTask;
  9569. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  9570. /**
  9571. * 分页查询CheckTask
  9572. * @param data
  9573. */
  9574. function getCheckTaskByPage(data) {
  9575. return (0, _request.request)({
  9576. url: '/check/task/page',
  9577. method: 'GET',
  9578. data: data
  9579. });
  9580. }
  9581. /**
  9582. * 列表查询CheckTask
  9583. * @param data
  9584. */
  9585. function getCheckTaskByList(data) {
  9586. return (0, _request.request)({
  9587. url: '/check/task',
  9588. method: 'GET',
  9589. data: data
  9590. });
  9591. }
  9592. /**
  9593. * @param checkTaskId
  9594. */
  9595. function getCheckTaskById(checkTaskId) {
  9596. return (0, _request.request)({
  9597. url: "/check/task/".concat(checkTaskId),
  9598. method: 'GET'
  9599. });
  9600. }
  9601. /**
  9602. * 获取任务视图
  9603. * @param taskId
  9604. */
  9605. function getCheckTaskViewById(taskId) {
  9606. return (0, _request.request)({
  9607. url: "/check/task/view/".concat(taskId),
  9608. method: 'GET'
  9609. });
  9610. }
  9611. /**
  9612. * 添加一次性临时CheckTask
  9613. * @param data
  9614. */
  9615. function createCheckTask(data) {
  9616. return (0, _request.request)({
  9617. url: "/check/task/once/add",
  9618. method: 'POST',
  9619. data: data
  9620. });
  9621. }
  9622. /**
  9623. * 更新CheckTask
  9624. * @param data
  9625. */
  9626. function updateCheckTask(data) {
  9627. return (0, _request.request)({
  9628. url: "/check/task/update",
  9629. method: 'PUT',
  9630. data: data
  9631. });
  9632. }
  9633. /**
  9634. * 删除CheckTask
  9635. * @param taskId
  9636. */
  9637. function deleteCheckTaskById(taskId) {
  9638. return (0, _request.request)({
  9639. url: "/check/task/".concat(taskId),
  9640. method: 'DELETE'
  9641. });
  9642. }
  9643. /**
  9644. * Handle CheckTask
  9645. * @param taskId
  9646. */
  9647. function handleCheckTask(taskId) {
  9648. return (0, _request.request)({
  9649. url: "/check/task/handle/".concat(taskId),
  9650. method: 'PUT'
  9651. });
  9652. }
  9653. /**
  9654. * Transfer CheckTask
  9655. * @param data
  9656. */
  9657. function transferCheckTask(data) {
  9658. return (0, _request.request)({
  9659. url: "/check/task/transfer",
  9660. method: 'PUT',
  9661. data: data
  9662. });
  9663. }
  9664. /**
  9665. * Cancel CheckTask
  9666. * @param taskId
  9667. */
  9668. function cancelCheckTask(taskId) {
  9669. return (0, _request.request)({
  9670. url: "/check/task/cancel/".concat(taskId),
  9671. method: 'PUT'
  9672. });
  9673. }
  9674. /**
  9675. * Complete CheckTask
  9676. * @param taskId
  9677. */
  9678. function completeCheckTask(taskId) {
  9679. return (0, _request.request)({
  9680. url: "/check/task/complete/".concat(taskId),
  9681. method: 'PUT'
  9682. });
  9683. }
  9684. /***/ }),
  9685. /***/ 26:
  9686. /*!**********************************************************!*\
  9687. !*** E:/work/Project_newGit/hptwxMiniProgram/pages.json ***!
  9688. \**********************************************************/
  9689. /*! no static exports found */
  9690. /***/ (function(module, exports) {
  9691. /***/ }),
  9692. /***/ 260:
  9693. /*!*************************************************************!*\
  9694. !*** E:/work/Project_newGit/hptwxMiniProgram/utils/enum.js ***!
  9695. \*************************************************************/
  9696. /*! no static exports found */
  9697. /***/ (function(module, exports, __webpack_require__) {
  9698. "use strict";
  9699. Object.defineProperty(exports, "__esModule", {
  9700. value: true
  9701. });
  9702. exports.alertLevel = alertLevel;
  9703. exports.alertStatus = alertStatus;
  9704. exports.checkResult = checkResult;
  9705. exports.dangerLevel = dangerLevel;
  9706. exports.dangerRectifyCat = dangerRectifyCat;
  9707. exports.dangerSource = dangerSource;
  9708. exports.dangerStatus = dangerStatus;
  9709. exports.rectifyCat = rectifyCat;
  9710. exports.riskLevel = riskLevel;
  9711. exports.riskPointLevel = riskPointLevel;
  9712. exports.riskPointStatus = riskPointStatus;
  9713. exports.riskType = riskType;
  9714. exports.taskPriority = taskPriority;
  9715. exports.taskStatus = taskStatus;
  9716. exports.taskType = taskType;
  9717. exports.warningLevel = warningLevel;
  9718. exports.warningStatus = warningStatus;
  9719. exports.wfInsStatus = wfInsStatus;
  9720. exports.wfTaskInsStatus = wfTaskInsStatus;
  9721. // 风险类型
  9722. function riskType(val) {
  9723. var strs = ['默认', '人', '物', '管'];
  9724. return strs[val];
  9725. }
  9726. // 风险等级
  9727. function riskLevel(val) {
  9728. var strs = ['默认', '重大', '较大', '一般', '较小'];
  9729. return strs[val];
  9730. }
  9731. // 风险等级
  9732. function riskPointStatus(val) {
  9733. var strs = ['未知', '安全受控', '失控'];
  9734. return strs[val];
  9735. }
  9736. // 风险点等级
  9737. function riskPointLevel(val) {
  9738. var strs = ['默认', '重大', '较大', '一般', '较小'];
  9739. return strs[val];
  9740. }
  9741. function taskPriority(i) {
  9742. var strs = ['未知', '较低', '普通', '紧急', '非常紧急'];
  9743. return strs[i];
  9744. }
  9745. function taskType(i) {
  9746. var strs = ['未知', '常规', '审批任务', '巡检任务'];
  9747. return strs[i];
  9748. }
  9749. function taskStatus(i) {
  9750. var strs = ['待处理', '已完成'];
  9751. if (i === -1) {
  9752. return '已撤消';
  9753. } else {
  9754. return strs[i];
  9755. }
  9756. }
  9757. function checkResult(i) {
  9758. var strs = ['没执行', '通过', '没通过', '有隐患', '已完成'];
  9759. return strs[i];
  9760. }
  9761. function dangerStatus(i) {
  9762. if (i >= 0) {
  9763. var strs = ['待提交', '待评审', '待整改', '待验收', '已整改'];
  9764. return strs[i];
  9765. } else {
  9766. return '已撤销';
  9767. }
  9768. }
  9769. function dangerLevel(i) {
  9770. var strs = ['未知', '重大', '较大', '严重', '一般'];
  9771. return strs[i];
  9772. }
  9773. function dangerSource(i) {
  9774. var strs = ['自查', '内部反馈', '上级抽查', '政府执法'];
  9775. return strs[i];
  9776. }
  9777. function rectifyCat(i) {
  9778. var strs = ['自行整改', '外协整改'];
  9779. return strs[i];
  9780. }
  9781. function wfInsStatus(i) {
  9782. if (i >= 0) {
  9783. var strs = ['未开始', '执行中', '已完成'];
  9784. return strs[i];
  9785. } else {
  9786. return '已撤销';
  9787. }
  9788. }
  9789. function wfTaskInsStatus(i) {
  9790. var strs = ['未开始', '已完成'];
  9791. return strs[i];
  9792. }
  9793. function dangerRectifyCat(i) {
  9794. var strs = ['自行整改', '外协整改'];
  9795. return strs[i];
  9796. }
  9797. function alertLevel(i) {
  9798. var strs = ['未知', '1级', '2级', '3级', '4级', '5级', '6级'];
  9799. return strs[i];
  9800. }
  9801. function alertStatus(i) {
  9802. if (i >= 0) {
  9803. var strs = ['活动', '已解除'];
  9804. return strs[i];
  9805. } else {
  9806. return '已撤销';
  9807. }
  9808. }
  9809. function warningLevel(val) {
  9810. var enums = {
  9811. 1: 'Ⅰ级',
  9812. 2: 'Ⅱ级',
  9813. 3: 'Ⅲ级',
  9814. 4: 'Ⅳ级'
  9815. };
  9816. return enums[val];
  9817. }
  9818. function warningStatus(i) {
  9819. if (i >= 0) {
  9820. var strs = ['待处理', '已处理'];
  9821. return strs[i];
  9822. } else {
  9823. return '已撤销';
  9824. }
  9825. }
  9826. /***/ }),
  9827. /***/ 277:
  9828. /*!************************************************************************!*\
  9829. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/riskPointApi.js ***!
  9830. \************************************************************************/
  9831. /*! no static exports found */
  9832. /***/ (function(module, exports, __webpack_require__) {
  9833. "use strict";
  9834. Object.defineProperty(exports, "__esModule", {
  9835. value: true
  9836. });
  9837. exports.batchUpdateRiskPoint = batchUpdateRiskPoint;
  9838. exports.createRiskPoint = createRiskPoint;
  9839. exports.deleteRiskPointById = deleteRiskPointById;
  9840. exports.getRiskPointById = getRiskPointById;
  9841. exports.getRiskPointByList = getRiskPointByList;
  9842. exports.getRiskPointByPage = getRiskPointByPage;
  9843. exports.getRiskPointCounterByLevel = getRiskPointCounterByLevel;
  9844. exports.updateRiskPoint = updateRiskPoint;
  9845. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  9846. /**
  9847. * 列表查询
  9848. * @returns
  9849. */
  9850. function getRiskPointByList(data) {
  9851. return (0, _request.request)({
  9852. url: '/riskPoint',
  9853. method: 'GET',
  9854. data: data
  9855. });
  9856. }
  9857. /**
  9858. * 分页查询
  9859. * @returns
  9860. */
  9861. function getRiskPointByPage(data) {
  9862. return (0, _request.request)({
  9863. url: '/riskPoint/page',
  9864. method: 'GET',
  9865. data: data
  9866. });
  9867. }
  9868. /**
  9869. * 基于ID查询
  9870. * @returns
  9871. */
  9872. function getRiskPointById(riskPointId) {
  9873. return (0, _request.request)({
  9874. url: "/riskPoint/".concat(riskPointId),
  9875. method: 'GET'
  9876. });
  9877. }
  9878. /**
  9879. * 添加风险单元
  9880. * @param data
  9881. * @returns
  9882. */
  9883. function createRiskPoint(data) {
  9884. return (0, _request.request)({
  9885. url: "/riskPoint/add",
  9886. method: 'POST',
  9887. data: data
  9888. });
  9889. }
  9890. /**
  9891. * 修改风险单元
  9892. * @param data
  9893. * @returns
  9894. */
  9895. function updateRiskPoint(data) {
  9896. return (0, _request.request)({
  9897. url: "/riskPoint/update",
  9898. method: 'PUT',
  9899. data: data
  9900. });
  9901. }
  9902. /**
  9903. * 删除风险单元
  9904. * @returns
  9905. * @param riskPointId
  9906. */
  9907. function deleteRiskPointById(riskPointId) {
  9908. return (0, _request.request)({
  9909. url: "/riskPoint/".concat(riskPointId),
  9910. method: 'DELETE'
  9911. });
  9912. }
  9913. /**
  9914. * 批量操作激活或未激活风险单元
  9915. * @param data
  9916. * @returns
  9917. */
  9918. function batchUpdateRiskPoint(data) {
  9919. return (0, _request.request)({
  9920. url: "/riskPoint/batchUpdate",
  9921. method: 'post',
  9922. data: data
  9923. });
  9924. }
  9925. /**
  9926. * 基于等级统计
  9927. * @returns
  9928. */
  9929. function getRiskPointCounterByLevel(data) {
  9930. return (0, _request.request)({
  9931. url: '/riskPoint/statis/getCounterByLevel',
  9932. method: 'GET',
  9933. data: data
  9934. });
  9935. }
  9936. /***/ }),
  9937. /***/ 278:
  9938. /*!************************************************************************!*\
  9939. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/dangerCatApi.js ***!
  9940. \************************************************************************/
  9941. /*! no static exports found */
  9942. /***/ (function(module, exports, __webpack_require__) {
  9943. "use strict";
  9944. Object.defineProperty(exports, "__esModule", {
  9945. value: true
  9946. });
  9947. exports.createDangerCat = createDangerCat;
  9948. exports.deleteDangerCat = deleteDangerCat;
  9949. exports.getDangerCatById = getDangerCatById;
  9950. exports.getDangerCatByList = getDangerCatByList;
  9951. exports.getDangerCatByPage = getDangerCatByPage;
  9952. exports.updateDangerCat = updateDangerCat;
  9953. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  9954. /**
  9955. * 分页查询Danger Category
  9956. * @param data
  9957. * @returns
  9958. */
  9959. function getDangerCatByPage(data) {
  9960. return (0, _request.request)({
  9961. url: '/danger/cat/page',
  9962. method: 'GET',
  9963. data: data
  9964. });
  9965. }
  9966. /**
  9967. * 列表查询Danger Category
  9968. * @returns
  9969. */
  9970. function getDangerCatByList() {
  9971. return (0, _request.request)({
  9972. url: '/danger/cat',
  9973. method: 'GET'
  9974. });
  9975. }
  9976. /**
  9977. * 基于Id查询Danger Category
  9978. * @param dangerCatId
  9979. * @returns
  9980. */
  9981. function getDangerCatById(dangerCatId) {
  9982. return (0, _request.request)({
  9983. url: "/danger/cat/".concat(dangerCatId),
  9984. method: 'GET'
  9985. });
  9986. }
  9987. /**
  9988. * 添加Danger Category
  9989. * @param data
  9990. * @returns
  9991. */
  9992. function createDangerCat(data) {
  9993. return (0, _request.request)({
  9994. url: "/danger/cat/add",
  9995. method: 'POST',
  9996. data: data
  9997. });
  9998. }
  9999. /**
  10000. * 更新Danger Category
  10001. * @param data
  10002. * @returns
  10003. */
  10004. function updateDangerCat(data) {
  10005. return (0, _request.request)({
  10006. url: "/danger/cat/update",
  10007. method: 'PUT',
  10008. data: data
  10009. });
  10010. }
  10011. /**
  10012. * 删除Danger Category
  10013. * @param dangerCatId
  10014. * @returns
  10015. */
  10016. function deleteDangerCat(dangerCatId) {
  10017. return (0, _request.request)({
  10018. url: "/danger/cat/".concat(dangerCatId),
  10019. method: 'DELETE'
  10020. });
  10021. }
  10022. /***/ }),
  10023. /***/ 3:
  10024. /*!***********************************!*\
  10025. !*** (webpack)/buildin/global.js ***!
  10026. \***********************************/
  10027. /*! no static exports found */
  10028. /***/ (function(module, exports) {
  10029. var g;
  10030. // This works in non-strict mode
  10031. g = (function() {
  10032. return this;
  10033. })();
  10034. try {
  10035. // This works if eval is allowed (see CSP)
  10036. g = g || new Function("return this")();
  10037. } catch (e) {
  10038. // This works if the window reference is available
  10039. if (typeof window === "object") g = window;
  10040. }
  10041. // g can still be undefined, but nothing to do about it...
  10042. // We return undefined, instead of nothing here, so it's
  10043. // easier to handle this case. if(!global) { ...}
  10044. module.exports = g;
  10045. /***/ }),
  10046. /***/ 309:
  10047. /*!**********************************************************************!*\
  10048. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/warningApi.js ***!
  10049. \**********************************************************************/
  10050. /*! no static exports found */
  10051. /***/ (function(module, exports, __webpack_require__) {
  10052. "use strict";
  10053. Object.defineProperty(exports, "__esModule", {
  10054. value: true
  10055. });
  10056. exports.cancelWarning = cancelWarning;
  10057. exports.completeWarning = completeWarning;
  10058. exports.deleteWarningById = deleteWarningById;
  10059. exports.getMyWarningWaitingTop = getMyWarningWaitingTop;
  10060. exports.getWarningById = getWarningById;
  10061. exports.getWarningByList = getWarningByList;
  10062. exports.getWarningByPage = getWarningByPage;
  10063. exports.getWarningWaitingByList = getWarningWaitingByList;
  10064. exports.transferWarning = transferWarning;
  10065. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  10066. /**
  10067. * 分页查询告警
  10068. */
  10069. function getWarningByPage(data) {
  10070. return (0, _request.request)({
  10071. url: '/warning/page',
  10072. method: 'GET',
  10073. data: data
  10074. });
  10075. }
  10076. /**
  10077. * 列表查询告警
  10078. */
  10079. function getWarningByList(data) {
  10080. return (0, _request.request)({
  10081. url: '/warning',
  10082. method: 'GET',
  10083. data: data
  10084. });
  10085. }
  10086. /**
  10087. * 列表查询待处理告警
  10088. */
  10089. function getWarningWaitingByList(data) {
  10090. return (0, _request.request)({
  10091. url: '/warning/waiting',
  10092. method: 'GET',
  10093. data: data
  10094. });
  10095. }
  10096. /**
  10097. * 我的待处理告警TOP
  10098. */
  10099. function getMyWarningWaitingTop(limit) {
  10100. return (0, _request.request)({
  10101. url: "/warning/myWaiting/top/".concat(limit),
  10102. method: 'GET'
  10103. });
  10104. }
  10105. /**
  10106. * 基于ID查询告警
  10107. */
  10108. function getWarningById(warnId) {
  10109. return (0, _request.request)({
  10110. url: "/warning/".concat(warnId),
  10111. method: 'GET'
  10112. });
  10113. }
  10114. /**
  10115. * 完成处理
  10116. * @param data
  10117. * @returns
  10118. */
  10119. function completeWarning(data) {
  10120. return (0, _request.request)({
  10121. url: "/warning/complete",
  10122. method: 'POST',
  10123. data: data
  10124. });
  10125. }
  10126. /**
  10127. * 转交他人
  10128. * @param warnId
  10129. * @param data
  10130. * @returns
  10131. */
  10132. function transferWarning(warnId, data) {
  10133. return (0, _request.request)({
  10134. url: "/warning/transfer/".concat(warnId),
  10135. method: 'POST',
  10136. data: data
  10137. });
  10138. }
  10139. /**
  10140. * 撤消
  10141. * @param warnId
  10142. * @returns
  10143. */
  10144. function cancelWarning(warnId) {
  10145. return (0, _request.request)({
  10146. url: "/warning/cancel/".concat(warnId),
  10147. method: 'GET'
  10148. });
  10149. }
  10150. /**
  10151. * 删除
  10152. */
  10153. function deleteWarningById(warnId) {
  10154. return (0, _request.request)({
  10155. url: "/warning/".concat(warnId),
  10156. method: 'DELETE'
  10157. });
  10158. }
  10159. /***/ }),
  10160. /***/ 32:
  10161. /*!**********************************************************************************************************!*\
  10162. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  10163. \**********************************************************************************************************/
  10164. /*! exports provided: default */
  10165. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10166. "use strict";
  10167. __webpack_require__.r(__webpack_exports__);
  10168. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  10169. /* globals __VUE_SSR_CONTEXT__ */
  10170. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  10171. // This module is a runtime utility for cleaner component module output and will
  10172. // be included in the final webpack user bundle.
  10173. function normalizeComponent (
  10174. scriptExports,
  10175. render,
  10176. staticRenderFns,
  10177. functionalTemplate,
  10178. injectStyles,
  10179. scopeId,
  10180. moduleIdentifier, /* server only */
  10181. shadowMode, /* vue-cli only */
  10182. components, // fixed by xxxxxx auto components
  10183. renderjs // fixed by xxxxxx renderjs
  10184. ) {
  10185. // Vue.extend constructor export interop
  10186. var options = typeof scriptExports === 'function'
  10187. ? scriptExports.options
  10188. : scriptExports
  10189. // fixed by xxxxxx auto components
  10190. if (components) {
  10191. if (!options.components) {
  10192. options.components = {}
  10193. }
  10194. var hasOwn = Object.prototype.hasOwnProperty
  10195. for (var name in components) {
  10196. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  10197. options.components[name] = components[name]
  10198. }
  10199. }
  10200. }
  10201. // fixed by xxxxxx renderjs
  10202. if (renderjs) {
  10203. if(typeof renderjs.beforeCreate === 'function'){
  10204. renderjs.beforeCreate = [renderjs.beforeCreate]
  10205. }
  10206. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  10207. this[renderjs.__module] = this
  10208. });
  10209. (options.mixins || (options.mixins = [])).push(renderjs)
  10210. }
  10211. // render functions
  10212. if (render) {
  10213. options.render = render
  10214. options.staticRenderFns = staticRenderFns
  10215. options._compiled = true
  10216. }
  10217. // functional template
  10218. if (functionalTemplate) {
  10219. options.functional = true
  10220. }
  10221. // scopedId
  10222. if (scopeId) {
  10223. options._scopeId = 'data-v-' + scopeId
  10224. }
  10225. var hook
  10226. if (moduleIdentifier) { // server build
  10227. hook = function (context) {
  10228. // 2.3 injection
  10229. context =
  10230. context || // cached call
  10231. (this.$vnode && this.$vnode.ssrContext) || // stateful
  10232. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  10233. // 2.2 with runInNewContext: true
  10234. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  10235. context = __VUE_SSR_CONTEXT__
  10236. }
  10237. // inject component styles
  10238. if (injectStyles) {
  10239. injectStyles.call(this, context)
  10240. }
  10241. // register component module identifier for async chunk inferrence
  10242. if (context && context._registeredComponents) {
  10243. context._registeredComponents.add(moduleIdentifier)
  10244. }
  10245. }
  10246. // used by ssr in case component is cached and beforeCreate
  10247. // never gets called
  10248. options._ssrRegister = hook
  10249. } else if (injectStyles) {
  10250. hook = shadowMode
  10251. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  10252. : injectStyles
  10253. }
  10254. if (hook) {
  10255. if (options.functional) {
  10256. // for template-only hot-reload because in that case the render fn doesn't
  10257. // go through the normalizer
  10258. options._injectStyles = hook
  10259. // register for functioal component in vue file
  10260. var originalRender = options.render
  10261. options.render = function renderWithStyleInjection (h, context) {
  10262. hook.call(context)
  10263. return originalRender(h, context)
  10264. }
  10265. } else {
  10266. // inject component registration as beforeCreate hook
  10267. var existing = options.beforeCreate
  10268. options.beforeCreate = existing
  10269. ? [].concat(existing, hook)
  10270. : [hook]
  10271. }
  10272. }
  10273. return {
  10274. exports: scriptExports,
  10275. options: options
  10276. }
  10277. }
  10278. /***/ }),
  10279. /***/ 326:
  10280. /*!************************************************************************************!*\
  10281. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/checklistRecordHazardApi.js ***!
  10282. \************************************************************************************/
  10283. /*! no static exports found */
  10284. /***/ (function(module, exports, __webpack_require__) {
  10285. "use strict";
  10286. Object.defineProperty(exports, "__esModule", {
  10287. value: true
  10288. });
  10289. exports.getChecklistHazardRecordView = getChecklistHazardRecordView;
  10290. exports.initChecklistHazardRecordView = initChecklistHazardRecordView;
  10291. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  10292. function getChecklistHazardRecordView(recordId) {
  10293. return (0, _request.request)({
  10294. url: "/checklist/hazard/record/view/".concat(recordId),
  10295. method: 'GET'
  10296. });
  10297. }
  10298. function initChecklistHazardRecordView(data) {
  10299. return (0, _request.request)({
  10300. url: '/checklist/hazard/record/init',
  10301. method: 'POST',
  10302. data: data
  10303. });
  10304. }
  10305. /***/ }),
  10306. /***/ 33:
  10307. /*!************************************************************************!*\
  10308. !*** E:/work/Project_newGit/hptwxMiniProgram/uni.promisify.adaptor.js ***!
  10309. \************************************************************************/
  10310. /*! no static exports found */
  10311. /***/ (function(module, exports, __webpack_require__) {
  10312. /* WEBPACK VAR INJECTION */(function(uni) {var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  10313. uni.addInterceptor({
  10314. returnValue: function returnValue(res) {
  10315. if (!(!!res && (_typeof(res) === "object" || typeof res === "function") && typeof res.then === "function")) {
  10316. return res;
  10317. }
  10318. return new Promise(function (resolve, reject) {
  10319. res.then(function (res) {
  10320. return res[0] ? reject(res[0]) : resolve(res[1]);
  10321. });
  10322. });
  10323. }
  10324. });
  10325. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  10326. /***/ }),
  10327. /***/ 384:
  10328. /*!******************************************************************************************************!*\
  10329. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-forms/components/uni-forms/validate.js ***!
  10330. \******************************************************************************************************/
  10331. /*! no static exports found */
  10332. /***/ (function(module, exports, __webpack_require__) {
  10333. "use strict";
  10334. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10335. Object.defineProperty(exports, "__esModule", {
  10336. value: true
  10337. });
  10338. exports.default = void 0;
  10339. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 40));
  10340. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 385));
  10341. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 386));
  10342. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 388));
  10343. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 42));
  10344. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  10345. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  10346. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  10347. 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); }; }
  10348. 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; } }
  10349. var pattern = {
  10350. email: /^\S+?@\S+?\.\S+?$/,
  10351. 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]$/,
  10352. 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')
  10353. };
  10354. var FORMAT_MAPPING = {
  10355. "int": 'integer',
  10356. "bool": 'boolean',
  10357. "double": 'number',
  10358. "long": 'number',
  10359. "password": 'string'
  10360. // "fileurls": 'array'
  10361. };
  10362. function formatMessage(args) {
  10363. var resources = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  10364. var defaultMessage = ['label'];
  10365. defaultMessage.forEach(function (item) {
  10366. if (args[item] === undefined) {
  10367. args[item] = '';
  10368. }
  10369. });
  10370. var str = resources;
  10371. for (var key in args) {
  10372. var reg = new RegExp('{' + key + '}');
  10373. str = str.replace(reg, args[key]);
  10374. }
  10375. return str;
  10376. }
  10377. function isEmptyValue(value, type) {
  10378. if (value === undefined || value === null) {
  10379. return true;
  10380. }
  10381. if (typeof value === 'string' && !value) {
  10382. return true;
  10383. }
  10384. if (Array.isArray(value) && !value.length) {
  10385. return true;
  10386. }
  10387. if (type === 'object' && !Object.keys(value).length) {
  10388. return true;
  10389. }
  10390. return false;
  10391. }
  10392. var types = {
  10393. integer: function integer(value) {
  10394. return types.number(value) && parseInt(value, 10) === value;
  10395. },
  10396. string: function string(value) {
  10397. return typeof value === 'string';
  10398. },
  10399. number: function number(value) {
  10400. if (isNaN(value)) {
  10401. return false;
  10402. }
  10403. return typeof value === 'number';
  10404. },
  10405. "boolean": function boolean(value) {
  10406. return typeof value === 'boolean';
  10407. },
  10408. "float": function float(value) {
  10409. return types.number(value) && !types.integer(value);
  10410. },
  10411. array: function array(value) {
  10412. return Array.isArray(value);
  10413. },
  10414. object: function object(value) {
  10415. return (0, _typeof2.default)(value) === 'object' && !types.array(value);
  10416. },
  10417. date: function date(value) {
  10418. return value instanceof Date;
  10419. },
  10420. timestamp: function timestamp(value) {
  10421. if (!this.integer(value) || Math.abs(value).toString().length > 16) {
  10422. return false;
  10423. }
  10424. return true;
  10425. },
  10426. file: function file(value) {
  10427. return typeof value.url === 'string';
  10428. },
  10429. email: function email(value) {
  10430. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  10431. },
  10432. url: function url(value) {
  10433. return typeof value === 'string' && !!value.match(pattern.url);
  10434. },
  10435. pattern: function pattern(reg, value) {
  10436. try {
  10437. return new RegExp(reg).test(value);
  10438. } catch (e) {
  10439. return false;
  10440. }
  10441. },
  10442. method: function method(value) {
  10443. return typeof value === 'function';
  10444. },
  10445. idcard: function idcard(value) {
  10446. return typeof value === 'string' && !!value.match(pattern.idcard);
  10447. },
  10448. 'url-https': function urlHttps(value) {
  10449. return this.url(value) && value.startsWith('https://');
  10450. },
  10451. 'url-scheme': function urlScheme(value) {
  10452. return value.startsWith('://');
  10453. },
  10454. 'url-web': function urlWeb(value) {
  10455. return false;
  10456. }
  10457. };
  10458. var RuleValidator = /*#__PURE__*/function () {
  10459. function RuleValidator(message) {
  10460. (0, _classCallCheck2.default)(this, RuleValidator);
  10461. this._message = message;
  10462. }
  10463. (0, _createClass2.default)(RuleValidator, [{
  10464. key: "validateRule",
  10465. value: function () {
  10466. var _validateRule = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(fieldKey, fieldValue, value, data, allData) {
  10467. var result, rules, hasRequired, message, i, rule, vt, now, resultExpr;
  10468. return _regenerator.default.wrap(function _callee$(_context) {
  10469. while (1) {
  10470. switch (_context.prev = _context.next) {
  10471. case 0:
  10472. result = null;
  10473. rules = fieldValue.rules;
  10474. hasRequired = rules.findIndex(function (item) {
  10475. return item.required;
  10476. });
  10477. if (!(hasRequired < 0)) {
  10478. _context.next = 8;
  10479. break;
  10480. }
  10481. if (!(value === null || value === undefined)) {
  10482. _context.next = 6;
  10483. break;
  10484. }
  10485. return _context.abrupt("return", result);
  10486. case 6:
  10487. if (!(typeof value === 'string' && !value.length)) {
  10488. _context.next = 8;
  10489. break;
  10490. }
  10491. return _context.abrupt("return", result);
  10492. case 8:
  10493. message = this._message;
  10494. if (!(rules === undefined)) {
  10495. _context.next = 11;
  10496. break;
  10497. }
  10498. return _context.abrupt("return", message['default']);
  10499. case 11:
  10500. i = 0;
  10501. case 12:
  10502. if (!(i < rules.length)) {
  10503. _context.next = 35;
  10504. break;
  10505. }
  10506. rule = rules[i];
  10507. vt = this._getValidateType(rule);
  10508. Object.assign(rule, {
  10509. label: fieldValue.label || "[\"".concat(fieldKey, "\"]")
  10510. });
  10511. if (!RuleValidatorHelper[vt]) {
  10512. _context.next = 20;
  10513. break;
  10514. }
  10515. result = RuleValidatorHelper[vt](rule, value, message);
  10516. if (!(result != null)) {
  10517. _context.next = 20;
  10518. break;
  10519. }
  10520. return _context.abrupt("break", 35);
  10521. case 20:
  10522. if (!rule.validateExpr) {
  10523. _context.next = 26;
  10524. break;
  10525. }
  10526. now = Date.now();
  10527. resultExpr = rule.validateExpr(value, allData, now);
  10528. if (!(resultExpr === false)) {
  10529. _context.next = 26;
  10530. break;
  10531. }
  10532. result = this._getMessage(rule, rule.errorMessage || this._message['default']);
  10533. return _context.abrupt("break", 35);
  10534. case 26:
  10535. if (!rule.validateFunction) {
  10536. _context.next = 32;
  10537. break;
  10538. }
  10539. _context.next = 29;
  10540. return this.validateFunction(rule, value, data, allData, vt);
  10541. case 29:
  10542. result = _context.sent;
  10543. if (!(result !== null)) {
  10544. _context.next = 32;
  10545. break;
  10546. }
  10547. return _context.abrupt("break", 35);
  10548. case 32:
  10549. i++;
  10550. _context.next = 12;
  10551. break;
  10552. case 35:
  10553. if (result !== null) {
  10554. result = message.TAG + result;
  10555. }
  10556. return _context.abrupt("return", result);
  10557. case 37:
  10558. case "end":
  10559. return _context.stop();
  10560. }
  10561. }
  10562. }, _callee, this);
  10563. }));
  10564. function validateRule(_x, _x2, _x3, _x4, _x5) {
  10565. return _validateRule.apply(this, arguments);
  10566. }
  10567. return validateRule;
  10568. }()
  10569. }, {
  10570. key: "validateFunction",
  10571. value: function () {
  10572. var _validateFunction = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(rule, value, data, allData, vt) {
  10573. var result, callbackMessage, res;
  10574. return _regenerator.default.wrap(function _callee2$(_context2) {
  10575. while (1) {
  10576. switch (_context2.prev = _context2.next) {
  10577. case 0:
  10578. result = null;
  10579. _context2.prev = 1;
  10580. callbackMessage = null;
  10581. _context2.next = 5;
  10582. return rule.validateFunction(rule, value, allData || data, function (message) {
  10583. callbackMessage = message;
  10584. });
  10585. case 5:
  10586. res = _context2.sent;
  10587. if (callbackMessage || typeof res === 'string' && res || res === false) {
  10588. result = this._getMessage(rule, callbackMessage || res, vt);
  10589. }
  10590. _context2.next = 12;
  10591. break;
  10592. case 9:
  10593. _context2.prev = 9;
  10594. _context2.t0 = _context2["catch"](1);
  10595. result = this._getMessage(rule, _context2.t0.message, vt);
  10596. case 12:
  10597. return _context2.abrupt("return", result);
  10598. case 13:
  10599. case "end":
  10600. return _context2.stop();
  10601. }
  10602. }
  10603. }, _callee2, this, [[1, 9]]);
  10604. }));
  10605. function validateFunction(_x6, _x7, _x8, _x9, _x10) {
  10606. return _validateFunction.apply(this, arguments);
  10607. }
  10608. return validateFunction;
  10609. }()
  10610. }, {
  10611. key: "_getMessage",
  10612. value: function _getMessage(rule, message, vt) {
  10613. return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default']);
  10614. }
  10615. }, {
  10616. key: "_getValidateType",
  10617. value: function _getValidateType(rule) {
  10618. var result = '';
  10619. if (rule.required) {
  10620. result = 'required';
  10621. } else if (rule.format) {
  10622. result = 'format';
  10623. } else if (rule.arrayType) {
  10624. result = 'arrayTypeFormat';
  10625. } else if (rule.range) {
  10626. result = 'range';
  10627. } else if (rule.maximum !== undefined || rule.minimum !== undefined) {
  10628. result = 'rangeNumber';
  10629. } else if (rule.maxLength !== undefined || rule.minLength !== undefined) {
  10630. result = 'rangeLength';
  10631. } else if (rule.pattern) {
  10632. result = 'pattern';
  10633. } else if (rule.validateFunction) {
  10634. result = 'validateFunction';
  10635. }
  10636. return result;
  10637. }
  10638. }]);
  10639. return RuleValidator;
  10640. }();
  10641. var RuleValidatorHelper = {
  10642. required: function required(rule, value, message) {
  10643. if (rule.required && isEmptyValue(value, rule.format || (0, _typeof2.default)(value))) {
  10644. return formatMessage(rule, rule.errorMessage || message.required);
  10645. }
  10646. return null;
  10647. },
  10648. range: function range(rule, value, message) {
  10649. var range = rule.range,
  10650. errorMessage = rule.errorMessage;
  10651. var list = new Array(range.length);
  10652. for (var i = 0; i < range.length; i++) {
  10653. var item = range[i];
  10654. if (types.object(item) && item.value !== undefined) {
  10655. list[i] = item.value;
  10656. } else {
  10657. list[i] = item;
  10658. }
  10659. }
  10660. var result = false;
  10661. if (Array.isArray(value)) {
  10662. result = new Set(value.concat(list)).size === list.length;
  10663. } else {
  10664. if (list.indexOf(value) > -1) {
  10665. result = true;
  10666. }
  10667. }
  10668. if (!result) {
  10669. return formatMessage(rule, errorMessage || message['enum']);
  10670. }
  10671. return null;
  10672. },
  10673. rangeNumber: function rangeNumber(rule, value, message) {
  10674. if (!types.number(value)) {
  10675. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  10676. }
  10677. var minimum = rule.minimum,
  10678. maximum = rule.maximum,
  10679. exclusiveMinimum = rule.exclusiveMinimum,
  10680. exclusiveMaximum = rule.exclusiveMaximum;
  10681. var min = exclusiveMinimum ? value <= minimum : value < minimum;
  10682. var max = exclusiveMaximum ? value >= maximum : value > maximum;
  10683. if (minimum !== undefined && min) {
  10684. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMinimum ? 'exclusiveMinimum' : 'minimum']);
  10685. } else if (maximum !== undefined && max) {
  10686. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMaximum ? 'exclusiveMaximum' : 'maximum']);
  10687. } else if (minimum !== undefined && maximum !== undefined && (min || max)) {
  10688. return formatMessage(rule, rule.errorMessage || message['number'].range);
  10689. }
  10690. return null;
  10691. },
  10692. rangeLength: function rangeLength(rule, value, message) {
  10693. if (!types.string(value) && !types.array(value)) {
  10694. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  10695. }
  10696. var min = rule.minLength;
  10697. var max = rule.maxLength;
  10698. var val = value.length;
  10699. if (min !== undefined && val < min) {
  10700. return formatMessage(rule, rule.errorMessage || message['length'].minLength);
  10701. } else if (max !== undefined && val > max) {
  10702. return formatMessage(rule, rule.errorMessage || message['length'].maxLength);
  10703. } else if (min !== undefined && max !== undefined && (val < min || val > max)) {
  10704. return formatMessage(rule, rule.errorMessage || message['length'].range);
  10705. }
  10706. return null;
  10707. },
  10708. pattern: function pattern(rule, value, message) {
  10709. if (!types['pattern'](rule.pattern, value)) {
  10710. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  10711. }
  10712. return null;
  10713. },
  10714. format: function format(rule, value, message) {
  10715. var customTypes = Object.keys(types);
  10716. var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format || rule.arrayType;
  10717. if (customTypes.indexOf(format) > -1) {
  10718. if (!types[format](value)) {
  10719. return formatMessage(rule, rule.errorMessage || message.typeError);
  10720. }
  10721. }
  10722. return null;
  10723. },
  10724. arrayTypeFormat: function arrayTypeFormat(rule, value, message) {
  10725. if (!Array.isArray(value)) {
  10726. return formatMessage(rule, rule.errorMessage || message.typeError);
  10727. }
  10728. for (var i = 0; i < value.length; i++) {
  10729. var element = value[i];
  10730. var formatResult = this.format(rule, element, message);
  10731. if (formatResult !== null) {
  10732. return formatResult;
  10733. }
  10734. }
  10735. return null;
  10736. }
  10737. };
  10738. var SchemaValidator = /*#__PURE__*/function (_RuleValidator) {
  10739. (0, _inherits2.default)(SchemaValidator, _RuleValidator);
  10740. var _super = _createSuper(SchemaValidator);
  10741. function SchemaValidator(schema, options) {
  10742. var _this;
  10743. (0, _classCallCheck2.default)(this, SchemaValidator);
  10744. _this = _super.call(this, SchemaValidator.message);
  10745. _this._schema = schema;
  10746. _this._options = options || null;
  10747. return _this;
  10748. }
  10749. (0, _createClass2.default)(SchemaValidator, [{
  10750. key: "updateSchema",
  10751. value: function updateSchema(schema) {
  10752. this._schema = schema;
  10753. }
  10754. }, {
  10755. key: "validate",
  10756. value: function () {
  10757. var _validate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(data, allData) {
  10758. var result;
  10759. return _regenerator.default.wrap(function _callee3$(_context3) {
  10760. while (1) {
  10761. switch (_context3.prev = _context3.next) {
  10762. case 0:
  10763. result = this._checkFieldInSchema(data);
  10764. if (result) {
  10765. _context3.next = 5;
  10766. break;
  10767. }
  10768. _context3.next = 4;
  10769. return this.invokeValidate(data, false, allData);
  10770. case 4:
  10771. result = _context3.sent;
  10772. case 5:
  10773. return _context3.abrupt("return", result.length ? result[0] : null);
  10774. case 6:
  10775. case "end":
  10776. return _context3.stop();
  10777. }
  10778. }
  10779. }, _callee3, this);
  10780. }));
  10781. function validate(_x11, _x12) {
  10782. return _validate.apply(this, arguments);
  10783. }
  10784. return validate;
  10785. }()
  10786. }, {
  10787. key: "validateAll",
  10788. value: function () {
  10789. var _validateAll = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(data, allData) {
  10790. var result;
  10791. return _regenerator.default.wrap(function _callee4$(_context4) {
  10792. while (1) {
  10793. switch (_context4.prev = _context4.next) {
  10794. case 0:
  10795. result = this._checkFieldInSchema(data);
  10796. if (result) {
  10797. _context4.next = 5;
  10798. break;
  10799. }
  10800. _context4.next = 4;
  10801. return this.invokeValidate(data, true, allData);
  10802. case 4:
  10803. result = _context4.sent;
  10804. case 5:
  10805. return _context4.abrupt("return", result);
  10806. case 6:
  10807. case "end":
  10808. return _context4.stop();
  10809. }
  10810. }
  10811. }, _callee4, this);
  10812. }));
  10813. function validateAll(_x13, _x14) {
  10814. return _validateAll.apply(this, arguments);
  10815. }
  10816. return validateAll;
  10817. }()
  10818. }, {
  10819. key: "validateUpdate",
  10820. value: function () {
  10821. var _validateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(data, allData) {
  10822. var result;
  10823. return _regenerator.default.wrap(function _callee5$(_context5) {
  10824. while (1) {
  10825. switch (_context5.prev = _context5.next) {
  10826. case 0:
  10827. result = this._checkFieldInSchema(data);
  10828. if (result) {
  10829. _context5.next = 5;
  10830. break;
  10831. }
  10832. _context5.next = 4;
  10833. return this.invokeValidateUpdate(data, false, allData);
  10834. case 4:
  10835. result = _context5.sent;
  10836. case 5:
  10837. return _context5.abrupt("return", result.length ? result[0] : null);
  10838. case 6:
  10839. case "end":
  10840. return _context5.stop();
  10841. }
  10842. }
  10843. }, _callee5, this);
  10844. }));
  10845. function validateUpdate(_x15, _x16) {
  10846. return _validateUpdate.apply(this, arguments);
  10847. }
  10848. return validateUpdate;
  10849. }()
  10850. }, {
  10851. key: "invokeValidate",
  10852. value: function () {
  10853. var _invokeValidate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(data, all, allData) {
  10854. var result, schema, key, value, errorMessage;
  10855. return _regenerator.default.wrap(function _callee6$(_context6) {
  10856. while (1) {
  10857. switch (_context6.prev = _context6.next) {
  10858. case 0:
  10859. result = [];
  10860. schema = this._schema;
  10861. _context6.t0 = _regenerator.default.keys(schema);
  10862. case 3:
  10863. if ((_context6.t1 = _context6.t0()).done) {
  10864. _context6.next = 15;
  10865. break;
  10866. }
  10867. key = _context6.t1.value;
  10868. value = schema[key];
  10869. _context6.next = 8;
  10870. return this.validateRule(key, value, data[key], data, allData);
  10871. case 8:
  10872. errorMessage = _context6.sent;
  10873. if (!(errorMessage != null)) {
  10874. _context6.next = 13;
  10875. break;
  10876. }
  10877. result.push({
  10878. key: key,
  10879. errorMessage: errorMessage
  10880. });
  10881. if (all) {
  10882. _context6.next = 13;
  10883. break;
  10884. }
  10885. return _context6.abrupt("break", 15);
  10886. case 13:
  10887. _context6.next = 3;
  10888. break;
  10889. case 15:
  10890. return _context6.abrupt("return", result);
  10891. case 16:
  10892. case "end":
  10893. return _context6.stop();
  10894. }
  10895. }
  10896. }, _callee6, this);
  10897. }));
  10898. function invokeValidate(_x17, _x18, _x19) {
  10899. return _invokeValidate.apply(this, arguments);
  10900. }
  10901. return invokeValidate;
  10902. }()
  10903. }, {
  10904. key: "invokeValidateUpdate",
  10905. value: function () {
  10906. var _invokeValidateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(data, all, allData) {
  10907. var result, key, errorMessage;
  10908. return _regenerator.default.wrap(function _callee7$(_context7) {
  10909. while (1) {
  10910. switch (_context7.prev = _context7.next) {
  10911. case 0:
  10912. result = [];
  10913. _context7.t0 = _regenerator.default.keys(data);
  10914. case 2:
  10915. if ((_context7.t1 = _context7.t0()).done) {
  10916. _context7.next = 13;
  10917. break;
  10918. }
  10919. key = _context7.t1.value;
  10920. _context7.next = 6;
  10921. return this.validateRule(key, this._schema[key], data[key], data, allData);
  10922. case 6:
  10923. errorMessage = _context7.sent;
  10924. if (!(errorMessage != null)) {
  10925. _context7.next = 11;
  10926. break;
  10927. }
  10928. result.push({
  10929. key: key,
  10930. errorMessage: errorMessage
  10931. });
  10932. if (all) {
  10933. _context7.next = 11;
  10934. break;
  10935. }
  10936. return _context7.abrupt("break", 13);
  10937. case 11:
  10938. _context7.next = 2;
  10939. break;
  10940. case 13:
  10941. return _context7.abrupt("return", result);
  10942. case 14:
  10943. case "end":
  10944. return _context7.stop();
  10945. }
  10946. }
  10947. }, _callee7, this);
  10948. }));
  10949. function invokeValidateUpdate(_x20, _x21, _x22) {
  10950. return _invokeValidateUpdate.apply(this, arguments);
  10951. }
  10952. return invokeValidateUpdate;
  10953. }()
  10954. }, {
  10955. key: "_checkFieldInSchema",
  10956. value: function _checkFieldInSchema(data) {
  10957. var keys = Object.keys(data);
  10958. var keys2 = Object.keys(this._schema);
  10959. if (new Set(keys.concat(keys2)).size === keys2.length) {
  10960. return '';
  10961. }
  10962. var noExistFields = keys.filter(function (key) {
  10963. return keys2.indexOf(key) < 0;
  10964. });
  10965. var errorMessage = formatMessage({
  10966. field: JSON.stringify(noExistFields)
  10967. }, SchemaValidator.message.TAG + SchemaValidator.message['defaultInvalid']);
  10968. return [{
  10969. key: 'invalid',
  10970. errorMessage: errorMessage
  10971. }];
  10972. }
  10973. }]);
  10974. return SchemaValidator;
  10975. }(RuleValidator);
  10976. function Message() {
  10977. return {
  10978. TAG: "",
  10979. default: '验证错误',
  10980. defaultInvalid: '提交的字段{field}在数据库中并不存在',
  10981. validateFunction: '验证无效',
  10982. required: '{label}必填',
  10983. 'enum': '{label}超出范围',
  10984. timestamp: '{label}格式无效',
  10985. whitespace: '{label}不能为空',
  10986. typeError: '{label}类型无效',
  10987. date: {
  10988. format: '{label}日期{value}格式无效',
  10989. parse: '{label}日期无法解析,{value}无效',
  10990. invalid: '{label}日期{value}无效'
  10991. },
  10992. length: {
  10993. minLength: '{label}长度不能少于{minLength}',
  10994. maxLength: '{label}长度不能超过{maxLength}',
  10995. range: '{label}必须介于{minLength}和{maxLength}之间'
  10996. },
  10997. number: {
  10998. minimum: '{label}不能小于{minimum}',
  10999. maximum: '{label}不能大于{maximum}',
  11000. exclusiveMinimum: '{label}不能小于等于{minimum}',
  11001. exclusiveMaximum: '{label}不能大于等于{maximum}',
  11002. range: '{label}必须介于{minimum}and{maximum}之间'
  11003. },
  11004. pattern: {
  11005. mismatch: '{label}格式不匹配'
  11006. }
  11007. };
  11008. }
  11009. SchemaValidator.message = new Message();
  11010. var _default = SchemaValidator;
  11011. exports.default = _default;
  11012. /***/ }),
  11013. /***/ 385:
  11014. /*!*********************************************************!*\
  11015. !*** ./node_modules/@babel/runtime/helpers/inherits.js ***!
  11016. \*********************************************************/
  11017. /*! no static exports found */
  11018. /***/ (function(module, exports, __webpack_require__) {
  11019. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  11020. function _inherits(subClass, superClass) {
  11021. if (typeof superClass !== "function" && superClass !== null) {
  11022. throw new TypeError("Super expression must either be null or a function");
  11023. }
  11024. subClass.prototype = Object.create(superClass && superClass.prototype, {
  11025. constructor: {
  11026. value: subClass,
  11027. writable: true,
  11028. configurable: true
  11029. }
  11030. });
  11031. Object.defineProperty(subClass, "prototype", {
  11032. writable: false
  11033. });
  11034. if (superClass) setPrototypeOf(subClass, superClass);
  11035. }
  11036. module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11037. /***/ }),
  11038. /***/ 386:
  11039. /*!**************************************************************************!*\
  11040. !*** ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
  11041. \**************************************************************************/
  11042. /*! no static exports found */
  11043. /***/ (function(module, exports, __webpack_require__) {
  11044. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  11045. var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ 387);
  11046. function _possibleConstructorReturn(self, call) {
  11047. if (call && (_typeof(call) === "object" || typeof call === "function")) {
  11048. return call;
  11049. } else if (call !== void 0) {
  11050. throw new TypeError("Derived constructors may only return object or undefined");
  11051. }
  11052. return assertThisInitialized(self);
  11053. }
  11054. module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11055. /***/ }),
  11056. /***/ 387:
  11057. /*!**********************************************************************!*\
  11058. !*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
  11059. \**********************************************************************/
  11060. /*! no static exports found */
  11061. /***/ (function(module, exports) {
  11062. function _assertThisInitialized(self) {
  11063. if (self === void 0) {
  11064. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  11065. }
  11066. return self;
  11067. }
  11068. module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11069. /***/ }),
  11070. /***/ 388:
  11071. /*!***************************************************************!*\
  11072. !*** ./node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
  11073. \***************************************************************/
  11074. /*! no static exports found */
  11075. /***/ (function(module, exports) {
  11076. function _getPrototypeOf(o) {
  11077. module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
  11078. return o.__proto__ || Object.getPrototypeOf(o);
  11079. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11080. return _getPrototypeOf(o);
  11081. }
  11082. module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11083. /***/ }),
  11084. /***/ 389:
  11085. /*!***************************************************************************************************!*\
  11086. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-forms/components/uni-forms/utils.js ***!
  11087. \***************************************************************************************************/
  11088. /*! no static exports found */
  11089. /***/ (function(module, exports, __webpack_require__) {
  11090. "use strict";
  11091. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11092. Object.defineProperty(exports, "__esModule", {
  11093. value: true
  11094. });
  11095. 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;
  11096. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  11097. /**
  11098. * 简单处理对象拷贝
  11099. * @param {Obejct} 被拷贝对象
  11100. * @@return {Object} 拷贝对象
  11101. */
  11102. var deepCopy = function deepCopy(val) {
  11103. return JSON.parse(JSON.stringify(val));
  11104. };
  11105. /**
  11106. * 过滤数字类型
  11107. * @param {String} format 数字类型
  11108. * @@return {Boolean} 返回是否为数字类型
  11109. */
  11110. exports.deepCopy = deepCopy;
  11111. var typeFilter = function typeFilter(format) {
  11112. return format === 'int' || format === 'double' || format === 'number' || format === 'timestamp';
  11113. };
  11114. /**
  11115. * 把 value 转换成指定的类型,用于处理初始值,原因是初始值需要入库不能为 undefined
  11116. * @param {String} key 字段名
  11117. * @param {any} value 字段值
  11118. * @param {Object} rules 表单校验规则
  11119. */
  11120. exports.typeFilter = typeFilter;
  11121. var getValue = function getValue(key, value, rules) {
  11122. var isRuleNumType = rules.find(function (val) {
  11123. return val.format && typeFilter(val.format);
  11124. });
  11125. var isRuleBoolType = rules.find(function (val) {
  11126. return val.format && val.format === 'boolean' || val.format === 'bool';
  11127. });
  11128. // 输入类型为 number
  11129. if (!!isRuleNumType) {
  11130. if (!value && value !== 0) {
  11131. value = null;
  11132. } else {
  11133. value = isNumber(Number(value)) ? Number(value) : value;
  11134. }
  11135. }
  11136. // 输入类型为 boolean
  11137. if (!!isRuleBoolType) {
  11138. value = isBoolean(value) ? value : false;
  11139. }
  11140. return value;
  11141. };
  11142. /**
  11143. * 获取表单数据
  11144. * @param {String|Array} name 真实名称,需要使用 realName 获取
  11145. * @param {Object} data 原始数据
  11146. * @param {any} value 需要设置的值
  11147. */
  11148. exports.getValue = getValue;
  11149. var setDataValue = function setDataValue(field, formdata, value) {
  11150. formdata[field] = value;
  11151. return value || '';
  11152. };
  11153. /**
  11154. * 获取表单数据
  11155. * @param {String|Array} field 真实名称,需要使用 realName 获取
  11156. * @param {Object} data 原始数据
  11157. */
  11158. exports.setDataValue = setDataValue;
  11159. var getDataValue = function getDataValue(field, data) {
  11160. return objGet(data, field);
  11161. };
  11162. /**
  11163. * 获取表单类型
  11164. * @param {String|Array} field 真实名称,需要使用 realName 获取
  11165. */
  11166. exports.getDataValue = getDataValue;
  11167. var getDataValueType = function getDataValueType(field, data) {
  11168. var value = getDataValue(field, data);
  11169. return {
  11170. type: type(value),
  11171. value: value
  11172. };
  11173. };
  11174. /**
  11175. * 获取表单可用的真实name
  11176. * @param {String|Array} name 表单name
  11177. * @@return {String} 表单可用的真实name
  11178. */
  11179. exports.getDataValueType = getDataValueType;
  11180. var realName = function realName(name) {
  11181. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11182. var base_name = _basePath(name);
  11183. if ((0, _typeof2.default)(base_name) === 'object' && Array.isArray(base_name) && base_name.length > 1) {
  11184. var realname = base_name.reduce(function (a, b) {
  11185. return a += "#".concat(b);
  11186. }, '_formdata_');
  11187. return realname;
  11188. }
  11189. return base_name[0] || name;
  11190. };
  11191. /**
  11192. * 判断是否表单可用的真实name
  11193. * @param {String|Array} name 表单name
  11194. * @@return {String} 表单可用的真实name
  11195. */
  11196. exports.realName = realName;
  11197. var isRealName = function isRealName(name) {
  11198. var reg = /^_formdata_#*/;
  11199. return reg.test(name);
  11200. };
  11201. /**
  11202. * 获取表单数据的原始格式
  11203. * @@return {Object|Array} object 需要解析的数据
  11204. */
  11205. exports.isRealName = isRealName;
  11206. var rawData = function rawData() {
  11207. var object = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11208. var name = arguments.length > 1 ? arguments[1] : undefined;
  11209. var newData = JSON.parse(JSON.stringify(object));
  11210. var formData = {};
  11211. for (var i in newData) {
  11212. var path = name2arr(i);
  11213. objSet(formData, path, newData[i]);
  11214. }
  11215. return formData;
  11216. };
  11217. /**
  11218. * 真实name还原为 array
  11219. * @param {*} name
  11220. */
  11221. exports.rawData = rawData;
  11222. var name2arr = function name2arr(name) {
  11223. var field = name.replace('_formdata_#', '');
  11224. field = field.split('#').map(function (v) {
  11225. return isNumber(v) ? Number(v) : v;
  11226. });
  11227. return field;
  11228. };
  11229. /**
  11230. * 对象中设置值
  11231. * @param {Object|Array} object 源数据
  11232. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  11233. * @param {String} value 需要设置的值
  11234. */
  11235. exports.name2arr = name2arr;
  11236. var objSet = function objSet(object, path, value) {
  11237. if ((0, _typeof2.default)(object) !== 'object') return object;
  11238. _basePath(path).reduce(function (o, k, i, _) {
  11239. if (i === _.length - 1) {
  11240. // 若遍历结束直接赋值
  11241. o[k] = value;
  11242. return null;
  11243. } else if (k in o) {
  11244. // 若存在对应路径,则返回找到的对象,进行下一次遍历
  11245. return o[k];
  11246. } else {
  11247. // 若不存在对应路径,则创建对应对象,若下一路径是数字,新对象赋值为空数组,否则赋值为空对象
  11248. o[k] = /^[0-9]{1,}$/.test(_[i + 1]) ? [] : {};
  11249. return o[k];
  11250. }
  11251. }, object);
  11252. // 返回object
  11253. return object;
  11254. };
  11255. // 处理 path, path有三种形式:'a[0].b.c'、'a.0.b.c' 和 ['a','0','b','c'],需要统一处理成数组,便于后续使用
  11256. exports.objSet = objSet;
  11257. function _basePath(path) {
  11258. // 若是数组,则直接返回
  11259. if (Array.isArray(path)) return path;
  11260. // 若有 '[',']',则替换成将 '[' 替换成 '.',去掉 ']'
  11261. return path.replace(/\[/g, '.').replace(/\]/g, '').split('.');
  11262. }
  11263. /**
  11264. * 从对象中获取值
  11265. * @param {Object|Array} object 源数据
  11266. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  11267. * @param {String} defaultVal 如果无法从调用链中获取值的默认值
  11268. */
  11269. var objGet = function objGet(object, path) {
  11270. var defaultVal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'undefined';
  11271. // 先将path处理成统一格式
  11272. var newPath = _basePath(path);
  11273. // 递归处理,返回最后结果
  11274. var val = newPath.reduce(function (o, k) {
  11275. return (o || {})[k];
  11276. }, object);
  11277. return !val || val !== undefined ? val : defaultVal;
  11278. };
  11279. /**
  11280. * 是否为 number 类型
  11281. * @param {any} num 需要判断的值
  11282. * @return {Boolean} 是否为 number
  11283. */
  11284. exports.objGet = objGet;
  11285. var isNumber = function isNumber(num) {
  11286. return !isNaN(Number(num));
  11287. };
  11288. /**
  11289. * 是否为 boolean 类型
  11290. * @param {any} bool 需要判断的值
  11291. * @return {Boolean} 是否为 boolean
  11292. */
  11293. exports.isNumber = isNumber;
  11294. var isBoolean = function isBoolean(bool) {
  11295. return typeof bool === 'boolean';
  11296. };
  11297. /**
  11298. * 是否有必填字段
  11299. * @param {Object} rules 规则
  11300. * @return {Boolean} 是否有必填字段
  11301. */
  11302. exports.isBoolean = isBoolean;
  11303. var isRequiredField = function isRequiredField(rules) {
  11304. var isNoField = false;
  11305. for (var i = 0; i < rules.length; i++) {
  11306. var ruleData = rules[i];
  11307. if (ruleData.required) {
  11308. isNoField = true;
  11309. break;
  11310. }
  11311. }
  11312. return isNoField;
  11313. };
  11314. /**
  11315. * 获取数据类型
  11316. * @param {Any} obj 需要获取数据类型的值
  11317. */
  11318. exports.isRequiredField = isRequiredField;
  11319. var type = function type(obj) {
  11320. var class2type = {};
  11321. // 生成class2type映射
  11322. "Boolean Number String Function Array Date RegExp Object Error".split(" ").map(function (item, index) {
  11323. class2type["[object " + item + "]"] = item.toLowerCase();
  11324. });
  11325. if (obj == null) {
  11326. return obj + "";
  11327. }
  11328. return (0, _typeof2.default)(obj) === "object" || typeof obj === "function" ? class2type[Object.prototype.toString.call(obj)] || "object" : (0, _typeof2.default)(obj);
  11329. };
  11330. /**
  11331. * 判断两个值是否相等
  11332. * @param {any} a 值
  11333. * @param {any} b 值
  11334. * @return {Boolean} 是否相等
  11335. */
  11336. exports.type = type;
  11337. var isEqual = function isEqual(a, b) {
  11338. //如果a和b本来就全等
  11339. if (a === b) {
  11340. //判断是否为0和-0
  11341. return a !== 0 || 1 / a === 1 / b;
  11342. }
  11343. //判断是否为null和undefined
  11344. if (a == null || b == null) {
  11345. return a === b;
  11346. }
  11347. //接下来判断a和b的数据类型
  11348. var classNameA = toString.call(a),
  11349. classNameB = toString.call(b);
  11350. //如果数据类型不相等,则返回false
  11351. if (classNameA !== classNameB) {
  11352. return false;
  11353. }
  11354. //如果数据类型相等,再根据不同数据类型分别判断
  11355. switch (classNameA) {
  11356. case '[object RegExp]':
  11357. case '[object String]':
  11358. //进行字符串转换比较
  11359. return '' + a === '' + b;
  11360. case '[object Number]':
  11361. //进行数字转换比较,判断是否为NaN
  11362. if (+a !== +a) {
  11363. return +b !== +b;
  11364. }
  11365. //判断是否为0或-0
  11366. return +a === 0 ? 1 / +a === 1 / b : +a === +b;
  11367. case '[object Date]':
  11368. case '[object Boolean]':
  11369. return +a === +b;
  11370. }
  11371. //如果是对象类型
  11372. if (classNameA == '[object Object]') {
  11373. //获取a和b的属性长度
  11374. var propsA = Object.getOwnPropertyNames(a),
  11375. propsB = Object.getOwnPropertyNames(b);
  11376. if (propsA.length != propsB.length) {
  11377. return false;
  11378. }
  11379. for (var i = 0; i < propsA.length; i++) {
  11380. var propName = propsA[i];
  11381. //如果对应属性对应值不相等,则返回false
  11382. if (a[propName] !== b[propName]) {
  11383. return false;
  11384. }
  11385. }
  11386. return true;
  11387. }
  11388. //如果是数组类型
  11389. if (classNameA == '[object Array]') {
  11390. if (a.toString() == b.toString()) {
  11391. return true;
  11392. }
  11393. return false;
  11394. }
  11395. };
  11396. exports.isEqual = isEqual;
  11397. /***/ }),
  11398. /***/ 4:
  11399. /*!**********************************************************************!*\
  11400. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  11401. \**********************************************************************/
  11402. /*! no static exports found */
  11403. /***/ (function(module, exports) {
  11404. function _interopRequireDefault(obj) {
  11405. return obj && obj.__esModule ? obj : {
  11406. "default": obj
  11407. };
  11408. }
  11409. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11410. /***/ }),
  11411. /***/ 40:
  11412. /*!************************************************************************************************!*\
  11413. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  11414. \************************************************************************************************/
  11415. /*! no static exports found */
  11416. /***/ (function(module, exports, __webpack_require__) {
  11417. // TODO(Babel 8): Remove this file.
  11418. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 41)();
  11419. module.exports = runtime;
  11420. /***/ }),
  11421. /***/ 404:
  11422. /*!************************************************************************************!*\
  11423. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js ***!
  11424. \************************************************************************************/
  11425. /*! no static exports found */
  11426. /***/ (function(module, exports, __webpack_require__) {
  11427. "use strict";
  11428. /* WEBPACK VAR INJECTION */(function(global, uni, wx) {
  11429. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11430. Object.defineProperty(exports, "__esModule", {
  11431. value: true
  11432. });
  11433. exports.default = void 0;
  11434. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 40));
  11435. var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ 387));
  11436. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  11437. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  11438. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  11439. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 42));
  11440. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  11441. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 385));
  11442. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 386));
  11443. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 388));
  11444. var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ 405));
  11445. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  11446. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  11447. var _pages = _interopRequireDefault(__webpack_require__(/*! @/pages.json */ 407));
  11448. 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; } } }; }
  11449. 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); }
  11450. 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; }
  11451. 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; }
  11452. 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; }
  11453. 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); }; }
  11454. 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; } }
  11455. "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self;
  11456. function t(e) {
  11457. return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
  11458. }
  11459. function n(e, t, n) {
  11460. return e(n = {
  11461. path: t,
  11462. exports: {},
  11463. require: function require(e, t) {
  11464. return function () {
  11465. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  11466. }(null == t && n.path);
  11467. }
  11468. }, n.exports), n.exports;
  11469. }
  11470. var s = n(function (e, t) {
  11471. var n;
  11472. e.exports = (n = n || function (e, t) {
  11473. var n = Object.create || function () {
  11474. function e() {}
  11475. return function (t) {
  11476. var n;
  11477. return e.prototype = t, n = new e(), e.prototype = null, n;
  11478. };
  11479. }(),
  11480. s = {},
  11481. r = s.lib = {},
  11482. i = r.Base = {
  11483. extend: function extend(e) {
  11484. var t = n(this);
  11485. return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () {
  11486. t.$super.init.apply(this, arguments);
  11487. }), t.init.prototype = t, t.$super = this, t;
  11488. },
  11489. create: function create() {
  11490. var e = this.extend();
  11491. return e.init.apply(e, arguments), e;
  11492. },
  11493. init: function init() {},
  11494. mixIn: function mixIn(e) {
  11495. for (var t in e) {
  11496. e.hasOwnProperty(t) && (this[t] = e[t]);
  11497. }
  11498. e.hasOwnProperty("toString") && (this.toString = e.toString);
  11499. },
  11500. clone: function clone() {
  11501. return this.init.prototype.extend(this);
  11502. }
  11503. },
  11504. o = r.WordArray = i.extend({
  11505. init: function init(e, n) {
  11506. e = this.words = e || [], this.sigBytes = n != t ? n : 4 * e.length;
  11507. },
  11508. toString: function toString(e) {
  11509. return (e || c).stringify(this);
  11510. },
  11511. concat: function concat(e) {
  11512. var t = this.words,
  11513. n = e.words,
  11514. s = this.sigBytes,
  11515. r = e.sigBytes;
  11516. if (this.clamp(), s % 4) for (var i = 0; i < r; i++) {
  11517. var o = n[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  11518. t[s + i >>> 2] |= o << 24 - (s + i) % 4 * 8;
  11519. } else for (i = 0; i < r; i += 4) {
  11520. t[s + i >>> 2] = n[i >>> 2];
  11521. }
  11522. return this.sigBytes += r, this;
  11523. },
  11524. clamp: function clamp() {
  11525. var t = this.words,
  11526. n = this.sigBytes;
  11527. t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4);
  11528. },
  11529. clone: function clone() {
  11530. var e = i.clone.call(this);
  11531. return e.words = this.words.slice(0), e;
  11532. },
  11533. random: function random(t) {
  11534. for (var n, s = [], r = function r(t) {
  11535. t = t;
  11536. var n = 987654321,
  11537. s = 4294967295;
  11538. return function () {
  11539. var r = ((n = 36969 * (65535 & n) + (n >> 16) & s) << 16) + (t = 18e3 * (65535 & t) + (t >> 16) & s) & s;
  11540. return r /= 4294967296, (r += .5) * (e.random() > .5 ? 1 : -1);
  11541. };
  11542. }, i = 0; i < t; i += 4) {
  11543. var a = r(4294967296 * (n || e.random()));
  11544. n = 987654071 * a(), s.push(4294967296 * a() | 0);
  11545. }
  11546. return new o.init(s, t);
  11547. }
  11548. }),
  11549. a = s.enc = {},
  11550. c = a.Hex = {
  11551. stringify: function stringify(e) {
  11552. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  11553. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  11554. s.push((i >>> 4).toString(16)), s.push((15 & i).toString(16));
  11555. }
  11556. return s.join("");
  11557. },
  11558. parse: function parse(e) {
  11559. for (var t = e.length, n = [], s = 0; s < t; s += 2) {
  11560. n[s >>> 3] |= parseInt(e.substr(s, 2), 16) << 24 - s % 8 * 4;
  11561. }
  11562. return new o.init(n, t / 2);
  11563. }
  11564. },
  11565. u = a.Latin1 = {
  11566. stringify: function stringify(e) {
  11567. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  11568. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  11569. s.push(String.fromCharCode(i));
  11570. }
  11571. return s.join("");
  11572. },
  11573. parse: function parse(e) {
  11574. for (var t = e.length, n = [], s = 0; s < t; s++) {
  11575. n[s >>> 2] |= (255 & e.charCodeAt(s)) << 24 - s % 4 * 8;
  11576. }
  11577. return new o.init(n, t);
  11578. }
  11579. },
  11580. h = a.Utf8 = {
  11581. stringify: function stringify(e) {
  11582. try {
  11583. return decodeURIComponent(escape(u.stringify(e)));
  11584. } catch (e) {
  11585. throw new Error("Malformed UTF-8 data");
  11586. }
  11587. },
  11588. parse: function parse(e) {
  11589. return u.parse(unescape(encodeURIComponent(e)));
  11590. }
  11591. },
  11592. l = r.BufferedBlockAlgorithm = i.extend({
  11593. reset: function reset() {
  11594. this._data = new o.init(), this._nDataBytes = 0;
  11595. },
  11596. _append: function _append(e) {
  11597. "string" == typeof e && (e = h.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
  11598. },
  11599. _process: function _process(t) {
  11600. var n = this._data,
  11601. s = n.words,
  11602. r = n.sigBytes,
  11603. i = this.blockSize,
  11604. a = r / (4 * i),
  11605. c = (a = t ? e.ceil(a) : e.max((0 | a) - this._minBufferSize, 0)) * i,
  11606. u = e.min(4 * c, r);
  11607. if (c) {
  11608. for (var h = 0; h < c; h += i) {
  11609. this._doProcessBlock(s, h);
  11610. }
  11611. var l = s.splice(0, c);
  11612. n.sigBytes -= u;
  11613. }
  11614. return new o.init(l, u);
  11615. },
  11616. clone: function clone() {
  11617. var e = i.clone.call(this);
  11618. return e._data = this._data.clone(), e;
  11619. },
  11620. _minBufferSize: 0
  11621. });
  11622. r.Hasher = l.extend({
  11623. cfg: i.extend(),
  11624. init: function init(e) {
  11625. this.cfg = this.cfg.extend(e), this.reset();
  11626. },
  11627. reset: function reset() {
  11628. l.reset.call(this), this._doReset();
  11629. },
  11630. update: function update(e) {
  11631. return this._append(e), this._process(), this;
  11632. },
  11633. finalize: function finalize(e) {
  11634. return e && this._append(e), this._doFinalize();
  11635. },
  11636. blockSize: 16,
  11637. _createHelper: function _createHelper(e) {
  11638. return function (t, n) {
  11639. return new e.init(n).finalize(t);
  11640. };
  11641. },
  11642. _createHmacHelper: function _createHmacHelper(e) {
  11643. return function (t, n) {
  11644. return new d.HMAC.init(e, n).finalize(t);
  11645. };
  11646. }
  11647. });
  11648. var d = s.algo = {};
  11649. return s;
  11650. }(Math), n);
  11651. }),
  11652. r = s,
  11653. i = (n(function (e, t) {
  11654. var n;
  11655. e.exports = (n = r, function (e) {
  11656. var t = n,
  11657. s = t.lib,
  11658. r = s.WordArray,
  11659. i = s.Hasher,
  11660. o = t.algo,
  11661. a = [];
  11662. !function () {
  11663. for (var t = 0; t < 64; t++) {
  11664. a[t] = 4294967296 * e.abs(e.sin(t + 1)) | 0;
  11665. }
  11666. }();
  11667. var c = o.MD5 = i.extend({
  11668. _doReset: function _doReset() {
  11669. this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878]);
  11670. },
  11671. _doProcessBlock: function _doProcessBlock(e, t) {
  11672. for (var n = 0; n < 16; n++) {
  11673. var s = t + n,
  11674. r = e[s];
  11675. e[s] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8);
  11676. }
  11677. var i = this._hash.words,
  11678. o = e[t + 0],
  11679. c = e[t + 1],
  11680. p = e[t + 2],
  11681. f = e[t + 3],
  11682. g = e[t + 4],
  11683. m = e[t + 5],
  11684. y = e[t + 6],
  11685. _ = e[t + 7],
  11686. w = e[t + 8],
  11687. v = e[t + 9],
  11688. I = e[t + 10],
  11689. S = e[t + 11],
  11690. b = e[t + 12],
  11691. k = e[t + 13],
  11692. A = e[t + 14],
  11693. P = e[t + 15],
  11694. T = i[0],
  11695. C = i[1],
  11696. x = i[2],
  11697. O = i[3];
  11698. T = u(T, C, x, O, o, 7, a[0]), O = u(O, T, C, x, c, 12, a[1]), x = u(x, O, T, C, p, 17, a[2]), C = u(C, x, O, T, f, 22, a[3]), T = u(T, C, x, O, g, 7, a[4]), O = u(O, T, C, x, m, 12, a[5]), x = u(x, O, T, C, y, 17, a[6]), C = u(C, x, O, T, _, 22, a[7]), T = u(T, C, x, O, w, 7, a[8]), O = u(O, T, C, x, v, 12, a[9]), x = u(x, O, T, C, I, 17, a[10]), C = u(C, x, O, T, S, 22, a[11]), T = u(T, C, x, O, b, 7, a[12]), O = u(O, T, C, x, k, 12, a[13]), x = u(x, O, T, C, A, 17, a[14]), T = h(T, C = u(C, x, O, T, P, 22, a[15]), x, O, c, 5, a[16]), O = h(O, T, C, x, y, 9, a[17]), x = h(x, O, T, C, S, 14, a[18]), C = h(C, x, O, T, o, 20, a[19]), T = h(T, C, x, O, m, 5, a[20]), O = h(O, T, C, x, I, 9, a[21]), x = h(x, O, T, C, P, 14, a[22]), C = h(C, x, O, T, g, 20, a[23]), T = h(T, C, x, O, v, 5, a[24]), O = h(O, T, C, x, A, 9, a[25]), x = h(x, O, T, C, f, 14, a[26]), C = h(C, x, O, T, w, 20, a[27]), T = h(T, C, x, O, k, 5, a[28]), O = h(O, T, C, x, p, 9, a[29]), x = h(x, O, T, C, _, 14, a[30]), T = l(T, C = h(C, x, O, T, b, 20, a[31]), x, O, m, 4, a[32]), O = l(O, T, C, x, w, 11, a[33]), x = l(x, O, T, C, S, 16, a[34]), C = l(C, x, O, T, A, 23, a[35]), T = l(T, C, x, O, c, 4, a[36]), O = l(O, T, C, x, g, 11, a[37]), x = l(x, O, T, C, _, 16, a[38]), C = l(C, x, O, T, I, 23, a[39]), T = l(T, C, x, O, k, 4, a[40]), O = l(O, T, C, x, o, 11, a[41]), x = l(x, O, T, C, f, 16, a[42]), C = l(C, x, O, T, y, 23, a[43]), T = l(T, C, x, O, v, 4, a[44]), O = l(O, T, C, x, b, 11, a[45]), x = l(x, O, T, C, P, 16, a[46]), T = d(T, C = l(C, x, O, T, p, 23, a[47]), x, O, o, 6, a[48]), O = d(O, T, C, x, _, 10, a[49]), x = d(x, O, T, C, A, 15, a[50]), C = d(C, x, O, T, m, 21, a[51]), T = d(T, C, x, O, b, 6, a[52]), O = d(O, T, C, x, f, 10, a[53]), x = d(x, O, T, C, I, 15, a[54]), C = d(C, x, O, T, c, 21, a[55]), T = d(T, C, x, O, w, 6, a[56]), O = d(O, T, C, x, P, 10, a[57]), x = d(x, O, T, C, y, 15, a[58]), C = d(C, x, O, T, k, 21, a[59]), T = d(T, C, x, O, g, 6, a[60]), O = d(O, T, C, x, S, 10, a[61]), x = d(x, O, T, C, p, 15, a[62]), C = d(C, x, O, T, v, 21, a[63]), i[0] = i[0] + T | 0, i[1] = i[1] + C | 0, i[2] = i[2] + x | 0, i[3] = i[3] + O | 0;
  11699. },
  11700. _doFinalize: function _doFinalize() {
  11701. var t = this._data,
  11702. n = t.words,
  11703. s = 8 * this._nDataBytes,
  11704. r = 8 * t.sigBytes;
  11705. n[r >>> 5] |= 128 << 24 - r % 32;
  11706. var i = e.floor(s / 4294967296),
  11707. o = s;
  11708. 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();
  11709. for (var a = this._hash, c = a.words, u = 0; u < 4; u++) {
  11710. var h = c[u];
  11711. c[u] = 16711935 & (h << 8 | h >>> 24) | 4278255360 & (h << 24 | h >>> 8);
  11712. }
  11713. return a;
  11714. },
  11715. clone: function clone() {
  11716. var e = i.clone.call(this);
  11717. return e._hash = this._hash.clone(), e;
  11718. }
  11719. });
  11720. function u(e, t, n, s, r, i, o) {
  11721. var a = e + (t & n | ~t & s) + r + o;
  11722. return (a << i | a >>> 32 - i) + t;
  11723. }
  11724. function h(e, t, n, s, r, i, o) {
  11725. var a = e + (t & s | n & ~s) + r + o;
  11726. return (a << i | a >>> 32 - i) + t;
  11727. }
  11728. function l(e, t, n, s, r, i, o) {
  11729. var a = e + (t ^ n ^ s) + r + o;
  11730. return (a << i | a >>> 32 - i) + t;
  11731. }
  11732. function d(e, t, n, s, r, i, o) {
  11733. var a = e + (n ^ (t | ~s)) + r + o;
  11734. return (a << i | a >>> 32 - i) + t;
  11735. }
  11736. t.MD5 = i._createHelper(c), t.HmacMD5 = i._createHmacHelper(c);
  11737. }(Math), n.MD5);
  11738. }), n(function (e, t) {
  11739. var n;
  11740. e.exports = (n = r, void function () {
  11741. var e = n,
  11742. t = e.lib.Base,
  11743. s = e.enc.Utf8;
  11744. e.algo.HMAC = t.extend({
  11745. init: function init(e, t) {
  11746. e = this._hasher = new e.init(), "string" == typeof t && (t = s.parse(t));
  11747. var n = e.blockSize,
  11748. r = 4 * n;
  11749. t.sigBytes > r && (t = e.finalize(t)), t.clamp();
  11750. for (var i = this._oKey = t.clone(), o = this._iKey = t.clone(), a = i.words, c = o.words, u = 0; u < n; u++) {
  11751. a[u] ^= 1549556828, c[u] ^= 909522486;
  11752. }
  11753. i.sigBytes = o.sigBytes = r, this.reset();
  11754. },
  11755. reset: function reset() {
  11756. var e = this._hasher;
  11757. e.reset(), e.update(this._iKey);
  11758. },
  11759. update: function update(e) {
  11760. return this._hasher.update(e), this;
  11761. },
  11762. finalize: function finalize(e) {
  11763. var t = this._hasher,
  11764. n = t.finalize(e);
  11765. return t.reset(), t.finalize(this._oKey.clone().concat(n));
  11766. }
  11767. });
  11768. }());
  11769. }), n(function (e, t) {
  11770. e.exports = r.HmacMD5;
  11771. })),
  11772. o = n(function (e, t) {
  11773. e.exports = r.enc.Utf8;
  11774. }),
  11775. a = n(function (e, t) {
  11776. var n;
  11777. e.exports = (n = r, function () {
  11778. var e = n,
  11779. t = e.lib.WordArray;
  11780. function s(e, n, s) {
  11781. for (var r = [], i = 0, o = 0; o < n; o++) {
  11782. if (o % 4) {
  11783. var a = s[e.charCodeAt(o - 1)] << o % 4 * 2,
  11784. c = s[e.charCodeAt(o)] >>> 6 - o % 4 * 2;
  11785. r[i >>> 2] |= (a | c) << 24 - i % 4 * 8, i++;
  11786. }
  11787. }
  11788. return t.create(r, i);
  11789. }
  11790. e.enc.Base64 = {
  11791. stringify: function stringify(e) {
  11792. var t = e.words,
  11793. n = e.sigBytes,
  11794. s = this._map;
  11795. e.clamp();
  11796. for (var r = [], i = 0; i < n; i += 3) {
  11797. 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++) {
  11798. r.push(s.charAt(o >>> 6 * (3 - a) & 63));
  11799. }
  11800. }
  11801. var c = s.charAt(64);
  11802. if (c) for (; r.length % 4;) {
  11803. r.push(c);
  11804. }
  11805. return r.join("");
  11806. },
  11807. parse: function parse(e) {
  11808. var t = e.length,
  11809. n = this._map,
  11810. r = this._reverseMap;
  11811. if (!r) {
  11812. r = this._reverseMap = [];
  11813. for (var i = 0; i < n.length; i++) {
  11814. r[n.charCodeAt(i)] = i;
  11815. }
  11816. }
  11817. var o = n.charAt(64);
  11818. if (o) {
  11819. var a = e.indexOf(o);
  11820. -1 !== a && (t = a);
  11821. }
  11822. return s(e, t, r);
  11823. },
  11824. _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
  11825. };
  11826. }(), n.enc.Base64);
  11827. });
  11828. var c = "FUNCTION",
  11829. u = "OBJECT",
  11830. h = "CLIENT_DB",
  11831. l = "pending",
  11832. d = "fulfilled",
  11833. p = "rejected";
  11834. function f(e) {
  11835. return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();
  11836. }
  11837. function g(e) {
  11838. return "object" === f(e);
  11839. }
  11840. function m(e) {
  11841. return "function" == typeof e;
  11842. }
  11843. function y(e) {
  11844. return function () {
  11845. try {
  11846. return e.apply(e, arguments);
  11847. } catch (e) {
  11848. console.error(e);
  11849. }
  11850. };
  11851. }
  11852. var _ = "REJECTED",
  11853. w = "NOT_PENDING";
  11854. var v = /*#__PURE__*/function () {
  11855. function v() {
  11856. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  11857. e = _ref.createPromise,
  11858. _ref$retryRule = _ref.retryRule,
  11859. t = _ref$retryRule === void 0 ? _ : _ref$retryRule;
  11860. (0, _classCallCheck2.default)(this, v);
  11861. this.createPromise = e, this.status = null, this.promise = null, this.retryRule = t;
  11862. }
  11863. (0, _createClass2.default)(v, [{
  11864. key: "needRetry",
  11865. get: function get() {
  11866. if (!this.status) return !0;
  11867. switch (this.retryRule) {
  11868. case _:
  11869. return this.status === p;
  11870. case w:
  11871. return this.status !== l;
  11872. }
  11873. }
  11874. }, {
  11875. key: "exec",
  11876. value: function exec() {
  11877. var _this = this;
  11878. return this.needRetry ? (this.status = l, this.promise = this.createPromise().then(function (e) {
  11879. return _this.status = d, Promise.resolve(e);
  11880. }, function (e) {
  11881. return _this.status = p, Promise.reject(e);
  11882. }), this.promise) : this.promise;
  11883. }
  11884. }]);
  11885. return v;
  11886. }();
  11887. function I(e) {
  11888. return e && "string" == typeof e ? JSON.parse(e) : e;
  11889. }
  11890. var S = "development" === "development",
  11891. b = "mp-weixin",
  11892. k = "true" === undefined || !0 === undefined,
  11893. A = I([]),
  11894. P = "h5" === b ? "web" : "app-plus" === b ? "app" : b,
  11895. T = I(undefined),
  11896. C = I([]) || [],
  11897. x = true;
  11898. var O = "";
  11899. try {
  11900. O = (__webpack_require__(/*! uni-stat-config */ 408).default || __webpack_require__(/*! uni-stat-config */ 408)).appid;
  11901. } catch (e) {}
  11902. var E = {};
  11903. function L(e) {
  11904. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11905. var n, s;
  11906. return n = E, s = e, Object.prototype.hasOwnProperty.call(n, s) || (E[e] = t), E[e];
  11907. }
  11908. "app" === P && (E = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {});
  11909. var R = ["invoke", "success", "fail", "complete"],
  11910. U = L("_globalUniCloudInterceptor");
  11911. function N(e, t) {
  11912. U[e] || (U[e] = {}), g(t) && Object.keys(t).forEach(function (n) {
  11913. R.indexOf(n) > -1 && function (e, t, n) {
  11914. var s = U[e][t];
  11915. s || (s = U[e][t] = []), -1 === s.indexOf(n) && m(n) && s.push(n);
  11916. }(e, n, t[n]);
  11917. });
  11918. }
  11919. function D(e, t) {
  11920. U[e] || (U[e] = {}), g(t) ? Object.keys(t).forEach(function (n) {
  11921. R.indexOf(n) > -1 && function (e, t, n) {
  11922. var s = U[e][t];
  11923. if (!s) return;
  11924. var r = s.indexOf(n);
  11925. r > -1 && s.splice(r, 1);
  11926. }(e, n, t[n]);
  11927. }) : delete U[e];
  11928. }
  11929. function M(e, t) {
  11930. return e && 0 !== e.length ? e.reduce(function (e, n) {
  11931. return e.then(function () {
  11932. return n(t);
  11933. });
  11934. }, Promise.resolve()) : Promise.resolve();
  11935. }
  11936. function q(e, t) {
  11937. return U[e] && U[e][t] || [];
  11938. }
  11939. function F(e) {
  11940. N("callObject", e);
  11941. }
  11942. var K = L("_globalUniCloudListener"),
  11943. j = "response",
  11944. $ = "needLogin",
  11945. B = "refreshToken",
  11946. W = "clientdb",
  11947. H = "cloudfunction",
  11948. z = "cloudobject";
  11949. function J(e) {
  11950. return K[e] || (K[e] = []), K[e];
  11951. }
  11952. function G(e, t) {
  11953. var n = J(e);
  11954. n.includes(t) || n.push(t);
  11955. }
  11956. function V(e, t) {
  11957. var n = J(e),
  11958. s = n.indexOf(t);
  11959. -1 !== s && n.splice(s, 1);
  11960. }
  11961. function Y(e, t) {
  11962. var n = J(e);
  11963. for (var _e2 = 0; _e2 < n.length; _e2++) {
  11964. (0, n[_e2])(t);
  11965. }
  11966. }
  11967. var Q,
  11968. X = !1;
  11969. function Z() {
  11970. return Q || (Q = new Promise(function (e) {
  11971. X && e(), function t() {
  11972. if ("function" == typeof getCurrentPages) {
  11973. var _t2 = getCurrentPages();
  11974. _t2 && _t2[0] && (X = !0, e());
  11975. }
  11976. X || setTimeout(function () {
  11977. t();
  11978. }, 30);
  11979. }();
  11980. }), Q);
  11981. }
  11982. function ee(e) {
  11983. var t = {};
  11984. for (var _n2 in e) {
  11985. var _s2 = e[_n2];
  11986. m(_s2) && (t[_n2] = y(_s2));
  11987. }
  11988. return t;
  11989. }
  11990. var te = /*#__PURE__*/function (_Error) {
  11991. (0, _inherits2.default)(te, _Error);
  11992. var _super = _createSuper(te);
  11993. function te(e) {
  11994. var _this2;
  11995. (0, _classCallCheck2.default)(this, te);
  11996. _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;
  11997. return _this2;
  11998. }
  11999. (0, _createClass2.default)(te, [{
  12000. key: "toJson",
  12001. value: function toJson() {
  12002. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  12003. if (!(e >= 10)) return e++, {
  12004. errCode: this.errCode,
  12005. errMsg: this.errMsg,
  12006. errSubject: this.errSubject,
  12007. cause: this.cause && this.cause.toJson ? this.cause.toJson(e) : this.cause
  12008. };
  12009. }
  12010. }]);
  12011. return te;
  12012. }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
  12013. var ne = {
  12014. request: function request(e) {
  12015. return uni.request(e);
  12016. },
  12017. uploadFile: function uploadFile(e) {
  12018. return uni.uploadFile(e);
  12019. },
  12020. setStorageSync: function setStorageSync(e, t) {
  12021. return uni.setStorageSync(e, t);
  12022. },
  12023. getStorageSync: function getStorageSync(e) {
  12024. return uni.getStorageSync(e);
  12025. },
  12026. removeStorageSync: function removeStorageSync(e) {
  12027. return uni.removeStorageSync(e);
  12028. },
  12029. clearStorageSync: function clearStorageSync() {
  12030. return uni.clearStorageSync();
  12031. }
  12032. };
  12033. function se() {
  12034. return {
  12035. token: ne.getStorageSync("uni_id_token") || ne.getStorageSync("uniIdToken"),
  12036. tokenExpired: ne.getStorageSync("uni_id_token_expired")
  12037. };
  12038. }
  12039. function re() {
  12040. var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  12041. e = _ref2.token,
  12042. t = _ref2.tokenExpired;
  12043. e && ne.setStorageSync("uni_id_token", e), t && ne.setStorageSync("uni_id_token_expired", t);
  12044. }
  12045. var ie, oe;
  12046. function ae() {
  12047. return ie || (ie = uni.getSystemInfoSync()), ie;
  12048. }
  12049. function ce() {
  12050. var e, t;
  12051. try {
  12052. if (uni.getLaunchOptionsSync) {
  12053. if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1) return;
  12054. var _uni$getLaunchOptions = uni.getLaunchOptionsSync(),
  12055. _n3 = _uni$getLaunchOptions.scene,
  12056. _s3 = _uni$getLaunchOptions.channel;
  12057. e = _s3, t = _n3;
  12058. }
  12059. } catch (e) {}
  12060. return {
  12061. channel: e,
  12062. scene: t
  12063. };
  12064. }
  12065. function ue() {
  12066. var e = uni.getLocale && uni.getLocale() || "en";
  12067. if (oe) return _objectSpread(_objectSpread({}, oe), {}, {
  12068. locale: e,
  12069. LOCALE: e
  12070. });
  12071. var t = ae(),
  12072. n = t.deviceId,
  12073. s = t.osName,
  12074. r = t.uniPlatform,
  12075. i = t.appId,
  12076. o = ["pixelRatio", "brand", "model", "system", "language", "version", "platform", "host", "SDKVersion", "swanNativeVersion", "app", "AppPlatform", "fontSizeSetting"];
  12077. for (var _e3 = 0; _e3 < o.length; _e3++) {
  12078. delete t[o[_e3]];
  12079. }
  12080. return oe = _objectSpread(_objectSpread({
  12081. PLATFORM: r,
  12082. OS: s,
  12083. APPID: i,
  12084. DEVICEID: n
  12085. }, ce()), t), _objectSpread(_objectSpread({}, oe), {}, {
  12086. locale: e,
  12087. LOCALE: e
  12088. });
  12089. }
  12090. var he = {
  12091. sign: function sign(e, t) {
  12092. var n = "";
  12093. return Object.keys(e).sort().forEach(function (t) {
  12094. e[t] && (n = n + "&" + t + "=" + e[t]);
  12095. }), n = n.slice(1), i(n, t).toString();
  12096. },
  12097. wrappedRequest: function wrappedRequest(e, t) {
  12098. return new Promise(function (n, s) {
  12099. t(Object.assign(e, {
  12100. complete: function complete(e) {
  12101. e || (e = {}), S && "web" === P && e.errMsg && 0 === e.errMsg.indexOf("request:fail") && console.warn("发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5");
  12102. var t = e.data && e.data.header && e.data.header["x-serverless-request-id"] || e.header && e.header["request-id"];
  12103. if (!e.statusCode || e.statusCode >= 400) return s(new te({
  12104. code: "SYS_ERR",
  12105. message: e.errMsg || "request:fail",
  12106. requestId: t
  12107. }));
  12108. var r = e.data;
  12109. if (r.error) return s(new te({
  12110. code: r.error.code,
  12111. message: r.error.message,
  12112. requestId: t
  12113. }));
  12114. r.result = r.data, r.requestId = t, delete r.data, n(r);
  12115. }
  12116. }));
  12117. });
  12118. },
  12119. toBase64: function toBase64(e) {
  12120. return a.stringify(o.parse(e));
  12121. }
  12122. };
  12123. var le = /*#__PURE__*/function () {
  12124. function le(e) {
  12125. var _this3 = this;
  12126. (0, _classCallCheck2.default)(this, le);
  12127. ["spaceId", "clientSecret"].forEach(function (t) {
  12128. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error("".concat(t, " required"));
  12129. }), this.config = Object.assign({}, {
  12130. endpoint: 0 === e.spaceId.indexOf("mp-") ? "https://api.next.bspapp.com" : "https://api.bspapp.com"
  12131. }, e), this.config.provider = "aliyun", this.config.requestUrl = this.config.endpoint + "/client", this.config.envType = this.config.envType || "public", this.config.accessTokenKey = "access_token_" + this.config.spaceId, this.adapter = ne, this._getAccessTokenPromiseHub = new v({
  12132. createPromise: function createPromise() {
  12133. return _this3.requestAuth(_this3.setupRequest({
  12134. method: "serverless.auth.user.anonymousAuthorize",
  12135. params: "{}"
  12136. }, "auth")).then(function (e) {
  12137. if (!e.result || !e.result.accessToken) throw new te({
  12138. code: "AUTH_FAILED",
  12139. message: "获取accessToken失败"
  12140. });
  12141. _this3.setAccessToken(e.result.accessToken);
  12142. });
  12143. },
  12144. retryRule: w
  12145. });
  12146. }
  12147. (0, _createClass2.default)(le, [{
  12148. key: "hasAccessToken",
  12149. get: function get() {
  12150. return !!this.accessToken;
  12151. }
  12152. }, {
  12153. key: "setAccessToken",
  12154. value: function setAccessToken(e) {
  12155. this.accessToken = e;
  12156. }
  12157. }, {
  12158. key: "requestWrapped",
  12159. value: function requestWrapped(e) {
  12160. return he.wrappedRequest(e, this.adapter.request);
  12161. }
  12162. }, {
  12163. key: "requestAuth",
  12164. value: function requestAuth(e) {
  12165. return this.requestWrapped(e);
  12166. }
  12167. }, {
  12168. key: "request",
  12169. value: function request(e, t) {
  12170. var _this4 = this;
  12171. return Promise.resolve().then(function () {
  12172. return _this4.hasAccessToken ? t ? _this4.requestWrapped(e) : _this4.requestWrapped(e).catch(function (t) {
  12173. return new Promise(function (e, n) {
  12174. !t || "GATEWAY_INVALID_TOKEN" !== t.code && "InvalidParameter.InvalidToken" !== t.code ? n(t) : e();
  12175. }).then(function () {
  12176. return _this4.getAccessToken();
  12177. }).then(function () {
  12178. var t = _this4.rebuildRequest(e);
  12179. return _this4.request(t, !0);
  12180. });
  12181. }) : _this4.getAccessToken().then(function () {
  12182. var t = _this4.rebuildRequest(e);
  12183. return _this4.request(t, !0);
  12184. });
  12185. });
  12186. }
  12187. }, {
  12188. key: "rebuildRequest",
  12189. value: function rebuildRequest(e) {
  12190. var t = Object.assign({}, e);
  12191. return t.data.token = this.accessToken, t.header["x-basement-token"] = this.accessToken, t.header["x-serverless-sign"] = he.sign(t.data, this.config.clientSecret), t;
  12192. }
  12193. }, {
  12194. key: "setupRequest",
  12195. value: function setupRequest(e, t) {
  12196. var n = Object.assign({}, e, {
  12197. spaceId: this.config.spaceId,
  12198. timestamp: Date.now()
  12199. }),
  12200. s = {
  12201. "Content-Type": "application/json"
  12202. };
  12203. return "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = he.sign(n, this.config.clientSecret), {
  12204. url: this.config.requestUrl,
  12205. method: "POST",
  12206. data: n,
  12207. dataType: "json",
  12208. header: s
  12209. };
  12210. }
  12211. }, {
  12212. key: "getAccessToken",
  12213. value: function getAccessToken() {
  12214. return this._getAccessTokenPromiseHub.exec();
  12215. }
  12216. }, {
  12217. key: "authorize",
  12218. value: function () {
  12219. var _authorize = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  12220. return _regenerator.default.wrap(function _callee$(_context) {
  12221. while (1) {
  12222. switch (_context.prev = _context.next) {
  12223. case 0:
  12224. _context.next = 2;
  12225. return this.getAccessToken();
  12226. case 2:
  12227. case "end":
  12228. return _context.stop();
  12229. }
  12230. }
  12231. }, _callee, this);
  12232. }));
  12233. function authorize() {
  12234. return _authorize.apply(this, arguments);
  12235. }
  12236. return authorize;
  12237. }()
  12238. }, {
  12239. key: "callFunction",
  12240. value: function callFunction(e) {
  12241. var t = {
  12242. method: "serverless.function.runtime.invoke",
  12243. params: JSON.stringify({
  12244. functionTarget: e.name,
  12245. functionArgs: e.data || {}
  12246. })
  12247. };
  12248. return this.request(this.setupRequest(t));
  12249. }
  12250. }, {
  12251. key: "getOSSUploadOptionsFromPath",
  12252. value: function getOSSUploadOptionsFromPath(e) {
  12253. var t = {
  12254. method: "serverless.file.resource.generateProximalSign",
  12255. params: JSON.stringify(e)
  12256. };
  12257. return this.request(this.setupRequest(t));
  12258. }
  12259. }, {
  12260. key: "uploadFileToOSS",
  12261. value: function uploadFileToOSS(_ref3) {
  12262. var _this5 = this;
  12263. var e = _ref3.url,
  12264. t = _ref3.formData,
  12265. n = _ref3.name,
  12266. s = _ref3.filePath,
  12267. r = _ref3.fileType,
  12268. i = _ref3.onUploadProgress;
  12269. return new Promise(function (o, a) {
  12270. var c = _this5.adapter.uploadFile({
  12271. url: e,
  12272. formData: t,
  12273. name: n,
  12274. filePath: s,
  12275. fileType: r,
  12276. header: {
  12277. "X-OSS-server-side-encrpytion": "AES256"
  12278. },
  12279. success: function success(e) {
  12280. e && e.statusCode < 400 ? o(e) : a(new te({
  12281. code: "UPLOAD_FAILED",
  12282. message: "文件上传失败"
  12283. }));
  12284. },
  12285. fail: function fail(e) {
  12286. a(new te({
  12287. code: e.code || "UPLOAD_FAILED",
  12288. message: e.message || e.errMsg || "文件上传失败"
  12289. }));
  12290. }
  12291. });
  12292. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  12293. i({
  12294. loaded: e.totalBytesSent,
  12295. total: e.totalBytesExpectedToSend
  12296. });
  12297. });
  12298. });
  12299. }
  12300. }, {
  12301. key: "reportOSSUpload",
  12302. value: function reportOSSUpload(e) {
  12303. var t = {
  12304. method: "serverless.file.resource.report",
  12305. params: JSON.stringify(e)
  12306. };
  12307. return this.request(this.setupRequest(t));
  12308. }
  12309. }, {
  12310. key: "uploadFile",
  12311. value: function () {
  12312. var _uploadFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref4) {
  12313. var e, t, _ref4$fileType, n, _ref4$cloudPathAsReal, s, r, i, o, a, c, u, h, l, d, p, g, m, y, _, _e4, w;
  12314. return _regenerator.default.wrap(function _callee2$(_context2) {
  12315. while (1) {
  12316. switch (_context2.prev = _context2.next) {
  12317. case 0:
  12318. e = _ref4.filePath, t = _ref4.cloudPath, _ref4$fileType = _ref4.fileType, n = _ref4$fileType === void 0 ? "image" : _ref4$fileType, _ref4$cloudPathAsReal = _ref4.cloudPathAsRealPath, s = _ref4$cloudPathAsReal === void 0 ? !1 : _ref4$cloudPathAsReal, r = _ref4.onUploadProgress, i = _ref4.config;
  12319. if (!("string" !== f(t))) {
  12320. _context2.next = 3;
  12321. break;
  12322. }
  12323. throw new te({
  12324. code: "INVALID_PARAM",
  12325. message: "cloudPath必须为字符串类型"
  12326. });
  12327. case 3:
  12328. if (t = t.trim()) {
  12329. _context2.next = 5;
  12330. break;
  12331. }
  12332. throw new te({
  12333. code: "INVALID_PARAM",
  12334. message: "cloudPath不可为空"
  12335. });
  12336. case 5:
  12337. if (!/:\/\//.test(t)) {
  12338. _context2.next = 7;
  12339. break;
  12340. }
  12341. throw new te({
  12342. code: "INVALID_PARAM",
  12343. message: "cloudPath不合法"
  12344. });
  12345. case 7:
  12346. o = i && i.envType || this.config.envType;
  12347. if (!(s && ("/" !== t[0] && (t = "/" + t), t.indexOf("\\") > -1))) {
  12348. _context2.next = 10;
  12349. break;
  12350. }
  12351. throw new te({
  12352. code: "INVALID_PARAM",
  12353. message: "使用cloudPath作为路径时,cloudPath不可包含“\\”"
  12354. });
  12355. case 10:
  12356. _context2.next = 12;
  12357. return this.getOSSUploadOptionsFromPath({
  12358. env: o,
  12359. filename: s ? t.split("/").pop() : t,
  12360. fileId: s ? t : void 0
  12361. });
  12362. case 12:
  12363. a = _context2.sent.result;
  12364. c = "https://" + a.cdnDomain + "/" + a.ossPath;
  12365. u = a.securityToken;
  12366. h = a.accessKeyId;
  12367. l = a.signature;
  12368. d = a.host;
  12369. p = a.ossPath;
  12370. g = a.id;
  12371. m = a.policy;
  12372. y = a.ossCallbackUrl;
  12373. _ = {
  12374. "Cache-Control": "max-age=2592000",
  12375. "Content-Disposition": "attachment",
  12376. OSSAccessKeyId: h,
  12377. Signature: l,
  12378. host: d,
  12379. id: g,
  12380. key: p,
  12381. policy: m,
  12382. success_action_status: 200
  12383. };
  12384. if (u && (_["x-oss-security-token"] = u), y) {
  12385. _e4 = JSON.stringify({
  12386. callbackUrl: y,
  12387. callbackBody: JSON.stringify({
  12388. fileId: g,
  12389. spaceId: this.config.spaceId
  12390. }),
  12391. callbackBodyType: "application/json"
  12392. });
  12393. _.callback = he.toBase64(_e4);
  12394. }
  12395. w = {
  12396. url: "https://" + a.host,
  12397. formData: _,
  12398. fileName: "file",
  12399. name: "file",
  12400. filePath: e,
  12401. fileType: n
  12402. };
  12403. _context2.next = 27;
  12404. return this.uploadFileToOSS(Object.assign({}, w, {
  12405. onUploadProgress: r
  12406. }));
  12407. case 27:
  12408. if (!y) {
  12409. _context2.next = 29;
  12410. break;
  12411. }
  12412. return _context2.abrupt("return", {
  12413. success: !0,
  12414. filePath: e,
  12415. fileID: c
  12416. });
  12417. case 29:
  12418. _context2.next = 31;
  12419. return this.reportOSSUpload({
  12420. id: g
  12421. });
  12422. case 31:
  12423. if (!_context2.sent.success) {
  12424. _context2.next = 33;
  12425. break;
  12426. }
  12427. return _context2.abrupt("return", {
  12428. success: !0,
  12429. filePath: e,
  12430. fileID: c
  12431. });
  12432. case 33:
  12433. throw new te({
  12434. code: "UPLOAD_FAILED",
  12435. message: "文件上传失败"
  12436. });
  12437. case 34:
  12438. case "end":
  12439. return _context2.stop();
  12440. }
  12441. }
  12442. }, _callee2, this);
  12443. }));
  12444. function uploadFile(_x) {
  12445. return _uploadFile.apply(this, arguments);
  12446. }
  12447. return uploadFile;
  12448. }()
  12449. }, {
  12450. key: "getTempFileURL",
  12451. value: function getTempFileURL() {
  12452. var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  12453. e = _ref5.fileList;
  12454. return new Promise(function (t, n) {
  12455. Array.isArray(e) && 0 !== e.length || n(new te({
  12456. code: "INVALID_PARAM",
  12457. message: "fileList的元素必须是非空的字符串"
  12458. })), t({
  12459. fileList: e.map(function (e) {
  12460. return {
  12461. fileID: e,
  12462. tempFileURL: e
  12463. };
  12464. })
  12465. });
  12466. });
  12467. }
  12468. }, {
  12469. key: "getFileInfo",
  12470. value: function () {
  12471. var _getFileInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
  12472. var _ref6,
  12473. e,
  12474. t,
  12475. _args3 = arguments;
  12476. return _regenerator.default.wrap(function _callee3$(_context3) {
  12477. while (1) {
  12478. switch (_context3.prev = _context3.next) {
  12479. case 0:
  12480. _ref6 = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, e = _ref6.fileList;
  12481. if (!(!Array.isArray(e) || 0 === e.length)) {
  12482. _context3.next = 3;
  12483. break;
  12484. }
  12485. throw new te({
  12486. code: "INVALID_PARAM",
  12487. message: "fileList的元素必须是非空的字符串"
  12488. });
  12489. case 3:
  12490. t = {
  12491. method: "serverless.file.resource.info",
  12492. params: JSON.stringify({
  12493. id: e.map(function (e) {
  12494. return e.split("?")[0];
  12495. }).join(",")
  12496. })
  12497. };
  12498. _context3.next = 6;
  12499. return this.request(this.setupRequest(t));
  12500. case 6:
  12501. _context3.t0 = _context3.sent.result;
  12502. return _context3.abrupt("return", {
  12503. fileList: _context3.t0
  12504. });
  12505. case 8:
  12506. case "end":
  12507. return _context3.stop();
  12508. }
  12509. }
  12510. }, _callee3, this);
  12511. }));
  12512. function getFileInfo() {
  12513. return _getFileInfo.apply(this, arguments);
  12514. }
  12515. return getFileInfo;
  12516. }()
  12517. }]);
  12518. return le;
  12519. }();
  12520. var de = {
  12521. init: function init(e) {
  12522. var t = new le(e),
  12523. n = {
  12524. signInAnonymously: function signInAnonymously() {
  12525. return t.authorize();
  12526. },
  12527. getLoginState: function getLoginState() {
  12528. return Promise.resolve(!1);
  12529. }
  12530. };
  12531. return t.auth = function () {
  12532. return n;
  12533. }, t.customAuth = t.auth, t;
  12534. }
  12535. };
  12536. var pe = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
  12537. var fe;
  12538. !function (e) {
  12539. e.local = "local", e.none = "none", e.session = "session";
  12540. }(fe || (fe = {}));
  12541. var ge = function ge() {},
  12542. me = n(function (e, t) {
  12543. var n;
  12544. e.exports = (n = r, function (e) {
  12545. var t = n,
  12546. s = t.lib,
  12547. r = s.WordArray,
  12548. i = s.Hasher,
  12549. o = t.algo,
  12550. a = [],
  12551. c = [];
  12552. !function () {
  12553. function t(t) {
  12554. for (var n = e.sqrt(t), s = 2; s <= n; s++) {
  12555. if (!(t % s)) return !1;
  12556. }
  12557. return !0;
  12558. }
  12559. function n(e) {
  12560. return 4294967296 * (e - (0 | e)) | 0;
  12561. }
  12562. for (var s = 2, r = 0; r < 64;) {
  12563. t(s) && (r < 8 && (a[r] = n(e.pow(s, .5))), c[r] = n(e.pow(s, 1 / 3)), r++), s++;
  12564. }
  12565. }();
  12566. var u = [],
  12567. h = o.SHA256 = i.extend({
  12568. _doReset: function _doReset() {
  12569. this._hash = new r.init(a.slice(0));
  12570. },
  12571. _doProcessBlock: function _doProcessBlock(e, t) {
  12572. for (var n = this._hash.words, s = n[0], r = n[1], i = n[2], o = n[3], a = n[4], h = n[5], l = n[6], d = n[7], p = 0; p < 64; p++) {
  12573. if (p < 16) u[p] = 0 | e[t + p];else {
  12574. var f = u[p - 15],
  12575. g = (f << 25 | f >>> 7) ^ (f << 14 | f >>> 18) ^ f >>> 3,
  12576. m = u[p - 2],
  12577. y = (m << 15 | m >>> 17) ^ (m << 13 | m >>> 19) ^ m >>> 10;
  12578. u[p] = g + u[p - 7] + y + u[p - 16];
  12579. }
  12580. var _ = s & r ^ s & i ^ r & i,
  12581. w = (s << 30 | s >>> 2) ^ (s << 19 | s >>> 13) ^ (s << 10 | s >>> 22),
  12582. v = d + ((a << 26 | a >>> 6) ^ (a << 21 | a >>> 11) ^ (a << 7 | a >>> 25)) + (a & h ^ ~a & l) + c[p] + u[p];
  12583. d = l, l = h, h = a, a = o + v | 0, o = i, i = r, r = s, s = v + (w + _) | 0;
  12584. }
  12585. n[0] = n[0] + s | 0, n[1] = n[1] + r | 0, n[2] = n[2] + i | 0, n[3] = n[3] + o | 0, n[4] = n[4] + a | 0, n[5] = n[5] + h | 0, n[6] = n[6] + l | 0, n[7] = n[7] + d | 0;
  12586. },
  12587. _doFinalize: function _doFinalize() {
  12588. var t = this._data,
  12589. n = t.words,
  12590. s = 8 * this._nDataBytes,
  12591. r = 8 * t.sigBytes;
  12592. return n[r >>> 5] |= 128 << 24 - r % 32, n[14 + (r + 64 >>> 9 << 4)] = e.floor(s / 4294967296), n[15 + (r + 64 >>> 9 << 4)] = s, t.sigBytes = 4 * n.length, this._process(), this._hash;
  12593. },
  12594. clone: function clone() {
  12595. var e = i.clone.call(this);
  12596. return e._hash = this._hash.clone(), e;
  12597. }
  12598. });
  12599. t.SHA256 = i._createHelper(h), t.HmacSHA256 = i._createHmacHelper(h);
  12600. }(Math), n.SHA256);
  12601. }),
  12602. ye = me,
  12603. _e = n(function (e, t) {
  12604. e.exports = r.HmacSHA256;
  12605. });
  12606. var we = function we() {
  12607. var e;
  12608. if (!Promise) {
  12609. e = function e() {}, e.promise = {};
  12610. var _t3 = function _t3() {
  12611. throw new te({
  12612. message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'
  12613. });
  12614. };
  12615. return Object.defineProperty(e.promise, "then", {
  12616. get: _t3
  12617. }), Object.defineProperty(e.promise, "catch", {
  12618. get: _t3
  12619. }), e;
  12620. }
  12621. var t = new Promise(function (t, n) {
  12622. e = function e(_e5, s) {
  12623. return _e5 ? n(_e5) : t(s);
  12624. };
  12625. });
  12626. return e.promise = t, e;
  12627. };
  12628. function ve(e) {
  12629. return void 0 === e;
  12630. }
  12631. function Ie(e) {
  12632. return "[object Null]" === Object.prototype.toString.call(e);
  12633. }
  12634. var Se;
  12635. function be(e) {
  12636. var t = (n = e, "[object Array]" === Object.prototype.toString.call(n) ? e : [e]);
  12637. var n;
  12638. var _iterator = _createForOfIteratorHelper(t),
  12639. _step;
  12640. try {
  12641. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  12642. var _e6 = _step.value;
  12643. var _t4 = _e6.isMatch,
  12644. _n4 = _e6.genAdapter,
  12645. _s4 = _e6.runtime;
  12646. if (_t4()) return {
  12647. adapter: _n4(),
  12648. runtime: _s4
  12649. };
  12650. }
  12651. } catch (err) {
  12652. _iterator.e(err);
  12653. } finally {
  12654. _iterator.f();
  12655. }
  12656. }
  12657. !function (e) {
  12658. e.WEB = "web", e.WX_MP = "wx_mp";
  12659. }(Se || (Se = {}));
  12660. var ke = {
  12661. adapter: null,
  12662. runtime: void 0
  12663. },
  12664. Ae = ["anonymousUuidKey"];
  12665. var Pe = /*#__PURE__*/function (_ge) {
  12666. (0, _inherits2.default)(Pe, _ge);
  12667. var _super2 = _createSuper(Pe);
  12668. function Pe() {
  12669. var _this6;
  12670. (0, _classCallCheck2.default)(this, Pe);
  12671. _this6 = _super2.call(this), ke.adapter.root.tcbObject || (ke.adapter.root.tcbObject = {});
  12672. return _this6;
  12673. }
  12674. (0, _createClass2.default)(Pe, [{
  12675. key: "setItem",
  12676. value: function setItem(e, t) {
  12677. ke.adapter.root.tcbObject[e] = t;
  12678. }
  12679. }, {
  12680. key: "getItem",
  12681. value: function getItem(e) {
  12682. return ke.adapter.root.tcbObject[e];
  12683. }
  12684. }, {
  12685. key: "removeItem",
  12686. value: function removeItem(e) {
  12687. delete ke.adapter.root.tcbObject[e];
  12688. }
  12689. }, {
  12690. key: "clear",
  12691. value: function clear() {
  12692. delete ke.adapter.root.tcbObject;
  12693. }
  12694. }]);
  12695. return Pe;
  12696. }(ge);
  12697. function Te(e, t) {
  12698. switch (e) {
  12699. case "local":
  12700. return t.localStorage || new Pe();
  12701. case "none":
  12702. return new Pe();
  12703. default:
  12704. return t.sessionStorage || new Pe();
  12705. }
  12706. }
  12707. var Ce = /*#__PURE__*/function () {
  12708. function Ce(e) {
  12709. (0, _classCallCheck2.default)(this, Ce);
  12710. if (!this._storage) {
  12711. this._persistence = ke.adapter.primaryStorage || e.persistence, this._storage = Te(this._persistence, ke.adapter);
  12712. var _t5 = "access_token_".concat(e.env),
  12713. _n5 = "access_token_expire_".concat(e.env),
  12714. _s5 = "refresh_token_".concat(e.env),
  12715. _r = "anonymous_uuid_".concat(e.env),
  12716. _i = "login_type_".concat(e.env),
  12717. _o = "user_info_".concat(e.env);
  12718. this.keys = {
  12719. accessTokenKey: _t5,
  12720. accessTokenExpireKey: _n5,
  12721. refreshTokenKey: _s5,
  12722. anonymousUuidKey: _r,
  12723. loginTypeKey: _i,
  12724. userInfoKey: _o
  12725. };
  12726. }
  12727. }
  12728. (0, _createClass2.default)(Ce, [{
  12729. key: "updatePersistence",
  12730. value: function updatePersistence(e) {
  12731. if (e === this._persistence) return;
  12732. var t = "local" === this._persistence;
  12733. this._persistence = e;
  12734. var n = Te(e, ke.adapter);
  12735. for (var _e7 in this.keys) {
  12736. var _s6 = this.keys[_e7];
  12737. if (t && Ae.includes(_e7)) continue;
  12738. var _r2 = this._storage.getItem(_s6);
  12739. ve(_r2) || Ie(_r2) || (n.setItem(_s6, _r2), this._storage.removeItem(_s6));
  12740. }
  12741. this._storage = n;
  12742. }
  12743. }, {
  12744. key: "setStore",
  12745. value: function setStore(e, t, n) {
  12746. if (!this._storage) return;
  12747. var s = {
  12748. version: n || "localCachev1",
  12749. content: t
  12750. },
  12751. r = JSON.stringify(s);
  12752. try {
  12753. this._storage.setItem(e, r);
  12754. } catch (e) {
  12755. throw e;
  12756. }
  12757. }
  12758. }, {
  12759. key: "getStore",
  12760. value: function getStore(e, t) {
  12761. try {
  12762. if (!this._storage) return;
  12763. } catch (e) {
  12764. return "";
  12765. }
  12766. t = t || "localCachev1";
  12767. var n = this._storage.getItem(e);
  12768. if (!n) return "";
  12769. if (n.indexOf(t) >= 0) {
  12770. return JSON.parse(n).content;
  12771. }
  12772. return "";
  12773. }
  12774. }, {
  12775. key: "removeStore",
  12776. value: function removeStore(e) {
  12777. this._storage.removeItem(e);
  12778. }
  12779. }]);
  12780. return Ce;
  12781. }();
  12782. var xe = {},
  12783. Oe = {};
  12784. function Ee(e) {
  12785. return xe[e];
  12786. }
  12787. var Le = /*#__PURE__*/(0, _createClass2.default)(function Le(e, t) {
  12788. (0, _classCallCheck2.default)(this, Le);
  12789. this.data = t || null, this.name = e;
  12790. });
  12791. var Re = /*#__PURE__*/function (_Le) {
  12792. (0, _inherits2.default)(Re, _Le);
  12793. var _super3 = _createSuper(Re);
  12794. function Re(e, t) {
  12795. var _this7;
  12796. (0, _classCallCheck2.default)(this, Re);
  12797. _this7 = _super3.call(this, "error", {
  12798. error: e,
  12799. data: t
  12800. }), _this7.error = e;
  12801. return _this7;
  12802. }
  12803. return (0, _createClass2.default)(Re);
  12804. }(Le);
  12805. var Ue = new ( /*#__PURE__*/function () {
  12806. function _class() {
  12807. (0, _classCallCheck2.default)(this, _class);
  12808. this._listeners = {};
  12809. }
  12810. (0, _createClass2.default)(_class, [{
  12811. key: "on",
  12812. value: function on(e, t) {
  12813. return function (e, t, n) {
  12814. n[e] = n[e] || [], n[e].push(t);
  12815. }(e, t, this._listeners), this;
  12816. }
  12817. }, {
  12818. key: "off",
  12819. value: function off(e, t) {
  12820. return function (e, t, n) {
  12821. if (n && n[e]) {
  12822. var _s7 = n[e].indexOf(t);
  12823. -1 !== _s7 && n[e].splice(_s7, 1);
  12824. }
  12825. }(e, t, this._listeners), this;
  12826. }
  12827. }, {
  12828. key: "fire",
  12829. value: function fire(e, t) {
  12830. if (e instanceof Re) return console.error(e.error), this;
  12831. var n = "string" == typeof e ? new Le(e, t || {}) : e;
  12832. var s = n.name;
  12833. if (this._listens(s)) {
  12834. n.target = this;
  12835. var _e8 = this._listeners[s] ? (0, _toConsumableArray2.default)(this._listeners[s]) : [];
  12836. var _iterator2 = _createForOfIteratorHelper(_e8),
  12837. _step2;
  12838. try {
  12839. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  12840. var _t6 = _step2.value;
  12841. _t6.call(this, n);
  12842. }
  12843. } catch (err) {
  12844. _iterator2.e(err);
  12845. } finally {
  12846. _iterator2.f();
  12847. }
  12848. }
  12849. return this;
  12850. }
  12851. }, {
  12852. key: "_listens",
  12853. value: function _listens(e) {
  12854. return this._listeners[e] && this._listeners[e].length > 0;
  12855. }
  12856. }]);
  12857. return _class;
  12858. }())();
  12859. function Ne(e, t) {
  12860. Ue.on(e, t);
  12861. }
  12862. function De(e) {
  12863. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  12864. Ue.fire(e, t);
  12865. }
  12866. function Me(e, t) {
  12867. Ue.off(e, t);
  12868. }
  12869. var qe = "loginStateChanged",
  12870. Fe = "loginStateExpire",
  12871. Ke = "loginTypeChanged",
  12872. je = "anonymousConverted",
  12873. $e = "refreshAccessToken";
  12874. var Be;
  12875. !function (e) {
  12876. 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";
  12877. }(Be || (Be = {}));
  12878. var We = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"],
  12879. He = {
  12880. "X-SDK-Version": "1.3.5"
  12881. };
  12882. function ze(e, t, n) {
  12883. var s = e[t];
  12884. e[t] = function (t) {
  12885. var r = {},
  12886. i = {};
  12887. n.forEach(function (n) {
  12888. var _n$call = n.call(e, t),
  12889. s = _n$call.data,
  12890. o = _n$call.headers;
  12891. Object.assign(r, s), Object.assign(i, o);
  12892. });
  12893. var o = t.data;
  12894. return o && function () {
  12895. var e;
  12896. if (e = o, "[object FormData]" !== Object.prototype.toString.call(e)) t.data = _objectSpread(_objectSpread({}, o), r);else for (var _e9 in r) {
  12897. o.append(_e9, r[_e9]);
  12898. }
  12899. }(), t.headers = _objectSpread(_objectSpread({}, t.headers || {}), i), s.call(e, t);
  12900. };
  12901. }
  12902. function Je() {
  12903. var e = Math.random().toString(16).slice(2);
  12904. return {
  12905. data: {
  12906. seqId: e
  12907. },
  12908. headers: _objectSpread(_objectSpread({}, He), {}, {
  12909. "x-seqid": e
  12910. })
  12911. };
  12912. }
  12913. var Ge = /*#__PURE__*/function () {
  12914. function Ge() {
  12915. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  12916. (0, _classCallCheck2.default)(this, Ge);
  12917. var t;
  12918. this.config = e, this._reqClass = new ke.adapter.reqClass({
  12919. timeout: this.config.timeout,
  12920. timeoutMsg: "\u8BF7\u6C42\u5728".concat(this.config.timeout / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD"),
  12921. restrictedMethods: ["post"]
  12922. }), this._cache = Ee(this.config.env), this._localCache = (t = this.config.env, Oe[t]), ze(this._reqClass, "post", [Je]), ze(this._reqClass, "upload", [Je]), ze(this._reqClass, "download", [Je]);
  12923. }
  12924. (0, _createClass2.default)(Ge, [{
  12925. key: "post",
  12926. value: function () {
  12927. var _post = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(e) {
  12928. return _regenerator.default.wrap(function _callee4$(_context4) {
  12929. while (1) {
  12930. switch (_context4.prev = _context4.next) {
  12931. case 0:
  12932. _context4.next = 2;
  12933. return this._reqClass.post(e);
  12934. case 2:
  12935. return _context4.abrupt("return", _context4.sent);
  12936. case 3:
  12937. case "end":
  12938. return _context4.stop();
  12939. }
  12940. }
  12941. }, _callee4, this);
  12942. }));
  12943. function post(_x2) {
  12944. return _post.apply(this, arguments);
  12945. }
  12946. return post;
  12947. }()
  12948. }, {
  12949. key: "upload",
  12950. value: function () {
  12951. var _upload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(e) {
  12952. return _regenerator.default.wrap(function _callee5$(_context5) {
  12953. while (1) {
  12954. switch (_context5.prev = _context5.next) {
  12955. case 0:
  12956. _context5.next = 2;
  12957. return this._reqClass.upload(e);
  12958. case 2:
  12959. return _context5.abrupt("return", _context5.sent);
  12960. case 3:
  12961. case "end":
  12962. return _context5.stop();
  12963. }
  12964. }
  12965. }, _callee5, this);
  12966. }));
  12967. function upload(_x3) {
  12968. return _upload.apply(this, arguments);
  12969. }
  12970. return upload;
  12971. }()
  12972. }, {
  12973. key: "download",
  12974. value: function () {
  12975. var _download = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(e) {
  12976. return _regenerator.default.wrap(function _callee6$(_context6) {
  12977. while (1) {
  12978. switch (_context6.prev = _context6.next) {
  12979. case 0:
  12980. _context6.next = 2;
  12981. return this._reqClass.download(e);
  12982. case 2:
  12983. return _context6.abrupt("return", _context6.sent);
  12984. case 3:
  12985. case "end":
  12986. return _context6.stop();
  12987. }
  12988. }
  12989. }, _callee6, this);
  12990. }));
  12991. function download(_x4) {
  12992. return _download.apply(this, arguments);
  12993. }
  12994. return download;
  12995. }()
  12996. }, {
  12997. key: "refreshAccessToken",
  12998. value: function () {
  12999. var _refreshAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
  13000. var e, t;
  13001. return _regenerator.default.wrap(function _callee7$(_context7) {
  13002. while (1) {
  13003. switch (_context7.prev = _context7.next) {
  13004. case 0:
  13005. this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
  13006. _context7.prev = 1;
  13007. _context7.next = 4;
  13008. return this._refreshAccessTokenPromise;
  13009. case 4:
  13010. e = _context7.sent;
  13011. _context7.next = 10;
  13012. break;
  13013. case 7:
  13014. _context7.prev = 7;
  13015. _context7.t0 = _context7["catch"](1);
  13016. t = _context7.t0;
  13017. case 10:
  13018. if (!(this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t)) {
  13019. _context7.next = 12;
  13020. break;
  13021. }
  13022. throw t;
  13023. case 12:
  13024. return _context7.abrupt("return", e);
  13025. case 13:
  13026. case "end":
  13027. return _context7.stop();
  13028. }
  13029. }
  13030. }, _callee7, this, [[1, 7]]);
  13031. }));
  13032. function refreshAccessToken() {
  13033. return _refreshAccessToken2.apply(this, arguments);
  13034. }
  13035. return refreshAccessToken;
  13036. }()
  13037. }, {
  13038. key: "_refreshAccessToken",
  13039. value: function () {
  13040. var _refreshAccessToken3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
  13041. var _this$_cache$keys, e, t, n, s, r, i, o, a, _e10, _e11, _t7, _s8;
  13042. return _regenerator.default.wrap(function _callee8$(_context8) {
  13043. while (1) {
  13044. switch (_context8.prev = _context8.next) {
  13045. case 0:
  13046. _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;
  13047. this._cache.removeStore(e), this._cache.removeStore(t);
  13048. i = this._cache.getStore(n);
  13049. if (i) {
  13050. _context8.next = 5;
  13051. break;
  13052. }
  13053. throw new te({
  13054. message: "未登录CloudBase"
  13055. });
  13056. case 5:
  13057. o = {
  13058. refresh_token: i
  13059. };
  13060. _context8.next = 8;
  13061. return this.request("auth.fetchAccessTokenWithRefreshToken", o);
  13062. case 8:
  13063. a = _context8.sent;
  13064. if (!a.data.code) {
  13065. _context8.next = 21;
  13066. break;
  13067. }
  13068. _e10 = a.data.code;
  13069. if (!("SIGN_PARAM_INVALID" === _e10 || "REFRESH_TOKEN_EXPIRED" === _e10 || "INVALID_REFRESH_TOKEN" === _e10)) {
  13070. _context8.next = 20;
  13071. break;
  13072. }
  13073. if (!(this._cache.getStore(s) === Be.ANONYMOUS && "INVALID_REFRESH_TOKEN" === _e10)) {
  13074. _context8.next = 19;
  13075. break;
  13076. }
  13077. _e11 = this._cache.getStore(r);
  13078. _t7 = this._cache.getStore(n);
  13079. _context8.next = 17;
  13080. return this.send("auth.signInAnonymously", {
  13081. anonymous_uuid: _e11,
  13082. refresh_token: _t7
  13083. });
  13084. case 17:
  13085. _s8 = _context8.sent;
  13086. return _context8.abrupt("return", (this.setRefreshToken(_s8.refresh_token), this._refreshAccessToken()));
  13087. case 19:
  13088. De(Fe), this._cache.removeStore(n);
  13089. case 20:
  13090. throw new te({
  13091. code: a.data.code,
  13092. message: "\u5237\u65B0access token\u5931\u8D25\uFF1A".concat(a.data.code)
  13093. });
  13094. case 21:
  13095. if (!a.data.access_token) {
  13096. _context8.next = 23;
  13097. break;
  13098. }
  13099. return _context8.abrupt("return", (De($e), this._cache.setStore(e, a.data.access_token), this._cache.setStore(t, a.data.access_token_expire + Date.now()), {
  13100. accessToken: a.data.access_token,
  13101. accessTokenExpire: a.data.access_token_expire
  13102. }));
  13103. case 23:
  13104. a.data.refresh_token && (this._cache.removeStore(n), this._cache.setStore(n, a.data.refresh_token), this._refreshAccessToken());
  13105. case 24:
  13106. case "end":
  13107. return _context8.stop();
  13108. }
  13109. }
  13110. }, _callee8, this);
  13111. }));
  13112. function _refreshAccessToken() {
  13113. return _refreshAccessToken3.apply(this, arguments);
  13114. }
  13115. return _refreshAccessToken;
  13116. }()
  13117. }, {
  13118. key: "getAccessToken",
  13119. value: function () {
  13120. var _getAccessToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
  13121. var _this$_cache$keys2, e, t, n, s, r, i;
  13122. return _regenerator.default.wrap(function _callee9$(_context9) {
  13123. while (1) {
  13124. switch (_context9.prev = _context9.next) {
  13125. case 0:
  13126. _this$_cache$keys2 = this._cache.keys, e = _this$_cache$keys2.accessTokenKey, t = _this$_cache$keys2.accessTokenExpireKey, n = _this$_cache$keys2.refreshTokenKey;
  13127. if (this._cache.getStore(n)) {
  13128. _context9.next = 3;
  13129. break;
  13130. }
  13131. throw new te({
  13132. message: "refresh token不存在,登录状态异常"
  13133. });
  13134. case 3:
  13135. s = this._cache.getStore(e), r = this._cache.getStore(t), i = !0;
  13136. _context9.t0 = this._shouldRefreshAccessTokenHook;
  13137. if (!_context9.t0) {
  13138. _context9.next = 9;
  13139. break;
  13140. }
  13141. _context9.next = 8;
  13142. return this._shouldRefreshAccessTokenHook(s, r);
  13143. case 8:
  13144. _context9.t0 = !_context9.sent;
  13145. case 9:
  13146. _context9.t1 = _context9.t0;
  13147. if (!_context9.t1) {
  13148. _context9.next = 12;
  13149. break;
  13150. }
  13151. i = !1;
  13152. case 12:
  13153. return _context9.abrupt("return", (!s || !r || r < Date.now()) && i ? this.refreshAccessToken() : {
  13154. accessToken: s,
  13155. accessTokenExpire: r
  13156. });
  13157. case 13:
  13158. case "end":
  13159. return _context9.stop();
  13160. }
  13161. }
  13162. }, _callee9, this);
  13163. }));
  13164. function getAccessToken() {
  13165. return _getAccessToken.apply(this, arguments);
  13166. }
  13167. return getAccessToken;
  13168. }()
  13169. }, {
  13170. key: "request",
  13171. value: function () {
  13172. var _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(e, t, n) {
  13173. var s, r, i, _e12, o, _e13, _e14, a, c, u, h, l, d, p, f, g;
  13174. return _regenerator.default.wrap(function _callee10$(_context10) {
  13175. while (1) {
  13176. switch (_context10.prev = _context10.next) {
  13177. case 0:
  13178. s = "x-tcb-trace_".concat(this.config.env);
  13179. r = "application/x-www-form-urlencoded";
  13180. i = _objectSpread({
  13181. action: e,
  13182. env: this.config.env,
  13183. dataVersion: "2019-08-16"
  13184. }, t);
  13185. if (!(-1 === We.indexOf(e))) {
  13186. _context10.next = 10;
  13187. break;
  13188. }
  13189. _e12 = this._cache.keys.refreshTokenKey;
  13190. _context10.t0 = this._cache.getStore(_e12);
  13191. if (!_context10.t0) {
  13192. _context10.next = 10;
  13193. break;
  13194. }
  13195. _context10.next = 9;
  13196. return this.getAccessToken();
  13197. case 9:
  13198. i.access_token = _context10.sent.accessToken;
  13199. case 10:
  13200. if ("storage.uploadFile" === e) {
  13201. o = new FormData();
  13202. for (_e13 in o) {
  13203. o.hasOwnProperty(_e13) && void 0 !== o[_e13] && o.append(_e13, i[_e13]);
  13204. }
  13205. r = "multipart/form-data";
  13206. } else {
  13207. r = "application/json", o = {};
  13208. for (_e14 in i) {
  13209. void 0 !== i[_e14] && (o[_e14] = i[_e14]);
  13210. }
  13211. }
  13212. a = {
  13213. headers: {
  13214. "content-type": r
  13215. }
  13216. };
  13217. n && n.onUploadProgress && (a.onUploadProgress = n.onUploadProgress);
  13218. c = this._localCache.getStore(s);
  13219. c && (a.headers["X-TCB-Trace"] = c);
  13220. u = t.parse, h = t.inQuery, l = t.search;
  13221. d = {
  13222. env: this.config.env
  13223. };
  13224. u && (d.parse = !0), h && (d = _objectSpread(_objectSpread({}, h), d));
  13225. p = function (e, t) {
  13226. var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  13227. var s = /\?/.test(t);
  13228. var r = "";
  13229. for (var _e15 in n) {
  13230. "" === r ? !s && (t += "?") : r += "&", r += "".concat(_e15, "=").concat(encodeURIComponent(n[_e15]));
  13231. }
  13232. return /^http(s)?\:\/\//.test(t += r) ? t : "".concat(e).concat(t);
  13233. }(pe, "//tcb-api.tencentcloudapi.com/web", d);
  13234. l && (p += l);
  13235. _context10.next = 22;
  13236. return this.post(_objectSpread({
  13237. url: p,
  13238. data: o
  13239. }, a));
  13240. case 22:
  13241. f = _context10.sent;
  13242. g = f.header && f.header["x-tcb-trace"];
  13243. if (!(g && this._localCache.setStore(s, g), 200 !== Number(f.status) && 200 !== Number(f.statusCode) || !f.data)) {
  13244. _context10.next = 26;
  13245. break;
  13246. }
  13247. throw new te({
  13248. code: "NETWORK_ERROR",
  13249. message: "network request error"
  13250. });
  13251. case 26:
  13252. return _context10.abrupt("return", f);
  13253. case 27:
  13254. case "end":
  13255. return _context10.stop();
  13256. }
  13257. }
  13258. }, _callee10, this);
  13259. }));
  13260. function request(_x5, _x6, _x7) {
  13261. return _request.apply(this, arguments);
  13262. }
  13263. return request;
  13264. }()
  13265. }, {
  13266. key: "send",
  13267. value: function () {
  13268. var _send = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(e) {
  13269. var t,
  13270. n,
  13271. _n6,
  13272. _args11 = arguments;
  13273. return _regenerator.default.wrap(function _callee11$(_context11) {
  13274. while (1) {
  13275. switch (_context11.prev = _context11.next) {
  13276. case 0:
  13277. t = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : {};
  13278. _context11.next = 3;
  13279. return this.request(e, t, {
  13280. onUploadProgress: t.onUploadProgress
  13281. });
  13282. case 3:
  13283. n = _context11.sent;
  13284. if (!("ACCESS_TOKEN_EXPIRED" === n.data.code && -1 === We.indexOf(e))) {
  13285. _context11.next = 13;
  13286. break;
  13287. }
  13288. _context11.next = 7;
  13289. return this.refreshAccessToken();
  13290. case 7:
  13291. _context11.next = 9;
  13292. return this.request(e, t, {
  13293. onUploadProgress: t.onUploadProgress
  13294. });
  13295. case 9:
  13296. _n6 = _context11.sent;
  13297. if (!_n6.data.code) {
  13298. _context11.next = 12;
  13299. break;
  13300. }
  13301. throw new te({
  13302. code: _n6.data.code,
  13303. message: _n6.data.message
  13304. });
  13305. case 12:
  13306. return _context11.abrupt("return", _n6.data);
  13307. case 13:
  13308. if (!n.data.code) {
  13309. _context11.next = 15;
  13310. break;
  13311. }
  13312. throw new te({
  13313. code: n.data.code,
  13314. message: n.data.message
  13315. });
  13316. case 15:
  13317. return _context11.abrupt("return", n.data);
  13318. case 16:
  13319. case "end":
  13320. return _context11.stop();
  13321. }
  13322. }
  13323. }, _callee11, this);
  13324. }));
  13325. function send(_x8) {
  13326. return _send.apply(this, arguments);
  13327. }
  13328. return send;
  13329. }()
  13330. }, {
  13331. key: "setRefreshToken",
  13332. value: function setRefreshToken(e) {
  13333. var _this$_cache$keys3 = this._cache.keys,
  13334. t = _this$_cache$keys3.accessTokenKey,
  13335. n = _this$_cache$keys3.accessTokenExpireKey,
  13336. s = _this$_cache$keys3.refreshTokenKey;
  13337. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  13338. }
  13339. }]);
  13340. return Ge;
  13341. }();
  13342. var Ve = {};
  13343. function Ye(e) {
  13344. return Ve[e];
  13345. }
  13346. var Qe = /*#__PURE__*/function () {
  13347. function Qe(e) {
  13348. (0, _classCallCheck2.default)(this, Qe);
  13349. this.config = e, this._cache = Ee(e.env), this._request = Ye(e.env);
  13350. }
  13351. (0, _createClass2.default)(Qe, [{
  13352. key: "setRefreshToken",
  13353. value: function setRefreshToken(e) {
  13354. var _this$_cache$keys4 = this._cache.keys,
  13355. t = _this$_cache$keys4.accessTokenKey,
  13356. n = _this$_cache$keys4.accessTokenExpireKey,
  13357. s = _this$_cache$keys4.refreshTokenKey;
  13358. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  13359. }
  13360. }, {
  13361. key: "setAccessToken",
  13362. value: function setAccessToken(e, t) {
  13363. var _this$_cache$keys5 = this._cache.keys,
  13364. n = _this$_cache$keys5.accessTokenKey,
  13365. s = _this$_cache$keys5.accessTokenExpireKey;
  13366. this._cache.setStore(n, e), this._cache.setStore(s, t);
  13367. }
  13368. }, {
  13369. key: "refreshUserInfo",
  13370. value: function () {
  13371. var _refreshUserInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
  13372. var _yield$this$_request$, e;
  13373. return _regenerator.default.wrap(function _callee12$(_context12) {
  13374. while (1) {
  13375. switch (_context12.prev = _context12.next) {
  13376. case 0:
  13377. _context12.next = 2;
  13378. return this._request.send("auth.getUserInfo", {});
  13379. case 2:
  13380. _yield$this$_request$ = _context12.sent;
  13381. e = _yield$this$_request$.data;
  13382. return _context12.abrupt("return", (this.setLocalUserInfo(e), e));
  13383. case 5:
  13384. case "end":
  13385. return _context12.stop();
  13386. }
  13387. }
  13388. }, _callee12, this);
  13389. }));
  13390. function refreshUserInfo() {
  13391. return _refreshUserInfo.apply(this, arguments);
  13392. }
  13393. return refreshUserInfo;
  13394. }()
  13395. }, {
  13396. key: "setLocalUserInfo",
  13397. value: function setLocalUserInfo(e) {
  13398. var t = this._cache.keys.userInfoKey;
  13399. this._cache.setStore(t, e);
  13400. }
  13401. }]);
  13402. return Qe;
  13403. }();
  13404. var Xe = /*#__PURE__*/function () {
  13405. function Xe(e) {
  13406. (0, _classCallCheck2.default)(this, Xe);
  13407. if (!e) throw new te({
  13408. code: "PARAM_ERROR",
  13409. message: "envId is not defined"
  13410. });
  13411. this._envId = e, this._cache = Ee(this._envId), this._request = Ye(this._envId), this.setUserInfo();
  13412. }
  13413. (0, _createClass2.default)(Xe, [{
  13414. key: "linkWithTicket",
  13415. value: function linkWithTicket(e) {
  13416. if ("string" != typeof e) throw new te({
  13417. code: "PARAM_ERROR",
  13418. message: "ticket must be string"
  13419. });
  13420. return this._request.send("auth.linkWithTicket", {
  13421. ticket: e
  13422. });
  13423. }
  13424. }, {
  13425. key: "linkWithRedirect",
  13426. value: function linkWithRedirect(e) {
  13427. e.signInWithRedirect();
  13428. }
  13429. }, {
  13430. key: "updatePassword",
  13431. value: function updatePassword(e, t) {
  13432. return this._request.send("auth.updatePassword", {
  13433. oldPassword: t,
  13434. newPassword: e
  13435. });
  13436. }
  13437. }, {
  13438. key: "updateEmail",
  13439. value: function updateEmail(e) {
  13440. return this._request.send("auth.updateEmail", {
  13441. newEmail: e
  13442. });
  13443. }
  13444. }, {
  13445. key: "updateUsername",
  13446. value: function updateUsername(e) {
  13447. if ("string" != typeof e) throw new te({
  13448. code: "PARAM_ERROR",
  13449. message: "username must be a string"
  13450. });
  13451. return this._request.send("auth.updateUsername", {
  13452. username: e
  13453. });
  13454. }
  13455. }, {
  13456. key: "getLinkedUidList",
  13457. value: function () {
  13458. var _getLinkedUidList = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
  13459. var _yield$this$_request$2, e, t, n;
  13460. return _regenerator.default.wrap(function _callee13$(_context13) {
  13461. while (1) {
  13462. switch (_context13.prev = _context13.next) {
  13463. case 0:
  13464. _context13.next = 2;
  13465. return this._request.send("auth.getLinkedUidList", {});
  13466. case 2:
  13467. _yield$this$_request$2 = _context13.sent;
  13468. e = _yield$this$_request$2.data;
  13469. t = !1;
  13470. n = e.users;
  13471. return _context13.abrupt("return", (n.forEach(function (e) {
  13472. e.wxOpenId && e.wxPublicId && (t = !0);
  13473. }), {
  13474. users: n,
  13475. hasPrimaryUid: t
  13476. }));
  13477. case 7:
  13478. case "end":
  13479. return _context13.stop();
  13480. }
  13481. }
  13482. }, _callee13, this);
  13483. }));
  13484. function getLinkedUidList() {
  13485. return _getLinkedUidList.apply(this, arguments);
  13486. }
  13487. return getLinkedUidList;
  13488. }()
  13489. }, {
  13490. key: "setPrimaryUid",
  13491. value: function setPrimaryUid(e) {
  13492. return this._request.send("auth.setPrimaryUid", {
  13493. uid: e
  13494. });
  13495. }
  13496. }, {
  13497. key: "unlink",
  13498. value: function unlink(e) {
  13499. return this._request.send("auth.unlink", {
  13500. platform: e
  13501. });
  13502. }
  13503. }, {
  13504. key: "update",
  13505. value: function () {
  13506. var _update = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(e) {
  13507. var t, n, s, r, i, o, _yield$this$_request$3, a;
  13508. return _regenerator.default.wrap(function _callee14$(_context14) {
  13509. while (1) {
  13510. switch (_context14.prev = _context14.next) {
  13511. case 0:
  13512. t = e.nickName;
  13513. n = e.gender;
  13514. s = e.avatarUrl;
  13515. r = e.province;
  13516. i = e.country;
  13517. o = e.city;
  13518. _context14.next = 8;
  13519. return this._request.send("auth.updateUserInfo", {
  13520. nickName: t,
  13521. gender: n,
  13522. avatarUrl: s,
  13523. province: r,
  13524. country: i,
  13525. city: o
  13526. });
  13527. case 8:
  13528. _yield$this$_request$3 = _context14.sent;
  13529. a = _yield$this$_request$3.data;
  13530. this.setLocalUserInfo(a);
  13531. case 11:
  13532. case "end":
  13533. return _context14.stop();
  13534. }
  13535. }
  13536. }, _callee14, this);
  13537. }));
  13538. function update(_x9) {
  13539. return _update.apply(this, arguments);
  13540. }
  13541. return update;
  13542. }()
  13543. }, {
  13544. key: "refresh",
  13545. value: function () {
  13546. var _refresh = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
  13547. var _yield$this$_request$4, e;
  13548. return _regenerator.default.wrap(function _callee15$(_context15) {
  13549. while (1) {
  13550. switch (_context15.prev = _context15.next) {
  13551. case 0:
  13552. _context15.next = 2;
  13553. return this._request.send("auth.getUserInfo", {});
  13554. case 2:
  13555. _yield$this$_request$4 = _context15.sent;
  13556. e = _yield$this$_request$4.data;
  13557. return _context15.abrupt("return", (this.setLocalUserInfo(e), e));
  13558. case 5:
  13559. case "end":
  13560. return _context15.stop();
  13561. }
  13562. }
  13563. }, _callee15, this);
  13564. }));
  13565. function refresh() {
  13566. return _refresh.apply(this, arguments);
  13567. }
  13568. return refresh;
  13569. }()
  13570. }, {
  13571. key: "setUserInfo",
  13572. value: function setUserInfo() {
  13573. var _this8 = this;
  13574. var e = this._cache.keys.userInfoKey,
  13575. t = this._cache.getStore(e);
  13576. ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach(function (e) {
  13577. _this8[e] = t[e];
  13578. }), this.location = {
  13579. country: t.country,
  13580. province: t.province,
  13581. city: t.city
  13582. };
  13583. }
  13584. }, {
  13585. key: "setLocalUserInfo",
  13586. value: function setLocalUserInfo(e) {
  13587. var t = this._cache.keys.userInfoKey;
  13588. this._cache.setStore(t, e), this.setUserInfo();
  13589. }
  13590. }]);
  13591. return Xe;
  13592. }();
  13593. var Ze = /*#__PURE__*/function () {
  13594. function Ze(e) {
  13595. (0, _classCallCheck2.default)(this, Ze);
  13596. if (!e) throw new te({
  13597. code: "PARAM_ERROR",
  13598. message: "envId is not defined"
  13599. });
  13600. this._cache = Ee(e);
  13601. var _this$_cache$keys6 = this._cache.keys,
  13602. t = _this$_cache$keys6.refreshTokenKey,
  13603. n = _this$_cache$keys6.accessTokenKey,
  13604. s = _this$_cache$keys6.accessTokenExpireKey,
  13605. r = this._cache.getStore(t),
  13606. i = this._cache.getStore(n),
  13607. o = this._cache.getStore(s);
  13608. this.credential = {
  13609. refreshToken: r,
  13610. accessToken: i,
  13611. accessTokenExpire: o
  13612. }, this.user = new Xe(e);
  13613. }
  13614. (0, _createClass2.default)(Ze, [{
  13615. key: "isAnonymousAuth",
  13616. get: function get() {
  13617. return this.loginType === Be.ANONYMOUS;
  13618. }
  13619. }, {
  13620. key: "isCustomAuth",
  13621. get: function get() {
  13622. return this.loginType === Be.CUSTOM;
  13623. }
  13624. }, {
  13625. key: "isWeixinAuth",
  13626. get: function get() {
  13627. return this.loginType === Be.WECHAT || this.loginType === Be.WECHAT_OPEN || this.loginType === Be.WECHAT_PUBLIC;
  13628. }
  13629. }, {
  13630. key: "loginType",
  13631. get: function get() {
  13632. return this._cache.getStore(this._cache.keys.loginTypeKey);
  13633. }
  13634. }]);
  13635. return Ze;
  13636. }();
  13637. var et = /*#__PURE__*/function (_Qe) {
  13638. (0, _inherits2.default)(et, _Qe);
  13639. var _super4 = _createSuper(et);
  13640. function et() {
  13641. (0, _classCallCheck2.default)(this, et);
  13642. return _super4.apply(this, arguments);
  13643. }
  13644. (0, _createClass2.default)(et, [{
  13645. key: "signIn",
  13646. value: function () {
  13647. var _signIn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
  13648. var _this$_cache$keys7, e, t, n, s, r, _e16;
  13649. return _regenerator.default.wrap(function _callee16$(_context16) {
  13650. while (1) {
  13651. switch (_context16.prev = _context16.next) {
  13652. case 0:
  13653. this._cache.updatePersistence("local");
  13654. _this$_cache$keys7 = this._cache.keys;
  13655. e = _this$_cache$keys7.anonymousUuidKey;
  13656. t = _this$_cache$keys7.refreshTokenKey;
  13657. n = this._cache.getStore(e) || void 0;
  13658. s = this._cache.getStore(t) || void 0;
  13659. _context16.next = 8;
  13660. return this._request.send("auth.signInAnonymously", {
  13661. anonymous_uuid: n,
  13662. refresh_token: s
  13663. });
  13664. case 8:
  13665. r = _context16.sent;
  13666. if (!(r.uuid && r.refresh_token)) {
  13667. _context16.next = 20;
  13668. break;
  13669. }
  13670. this._setAnonymousUUID(r.uuid);
  13671. this.setRefreshToken(r.refresh_token);
  13672. _context16.next = 14;
  13673. return this._request.refreshAccessToken();
  13674. case 14:
  13675. De(qe);
  13676. De(Ke, {
  13677. env: this.config.env,
  13678. loginType: Be.ANONYMOUS,
  13679. persistence: "local"
  13680. });
  13681. _e16 = new Ze(this.config.env);
  13682. _context16.next = 19;
  13683. return _e16.user.refresh();
  13684. case 19:
  13685. return _context16.abrupt("return", _e16);
  13686. case 20:
  13687. throw new te({
  13688. message: "匿名登录失败"
  13689. });
  13690. case 21:
  13691. case "end":
  13692. return _context16.stop();
  13693. }
  13694. }
  13695. }, _callee16, this);
  13696. }));
  13697. function signIn() {
  13698. return _signIn.apply(this, arguments);
  13699. }
  13700. return signIn;
  13701. }()
  13702. }, {
  13703. key: "linkAndRetrieveDataWithTicket",
  13704. value: function () {
  13705. var _linkAndRetrieveDataWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(e) {
  13706. var _this$_cache$keys8, t, n, s, r, i;
  13707. return _regenerator.default.wrap(function _callee17$(_context17) {
  13708. while (1) {
  13709. switch (_context17.prev = _context17.next) {
  13710. case 0:
  13711. _this$_cache$keys8 = this._cache.keys;
  13712. t = _this$_cache$keys8.anonymousUuidKey;
  13713. n = _this$_cache$keys8.refreshTokenKey;
  13714. s = this._cache.getStore(t);
  13715. r = this._cache.getStore(n);
  13716. _context17.next = 7;
  13717. return this._request.send("auth.linkAndRetrieveDataWithTicket", {
  13718. anonymous_uuid: s,
  13719. refresh_token: r,
  13720. ticket: e
  13721. });
  13722. case 7:
  13723. i = _context17.sent;
  13724. if (!i.refresh_token) {
  13725. _context17.next = 16;
  13726. break;
  13727. }
  13728. this._clearAnonymousUUID();
  13729. this.setRefreshToken(i.refresh_token);
  13730. _context17.next = 13;
  13731. return this._request.refreshAccessToken();
  13732. case 13:
  13733. De(je, {
  13734. env: this.config.env
  13735. });
  13736. De(Ke, {
  13737. loginType: Be.CUSTOM,
  13738. persistence: "local"
  13739. });
  13740. return _context17.abrupt("return", {
  13741. credential: {
  13742. refreshToken: i.refresh_token
  13743. }
  13744. });
  13745. case 16:
  13746. throw new te({
  13747. message: "匿名转化失败"
  13748. });
  13749. case 17:
  13750. case "end":
  13751. return _context17.stop();
  13752. }
  13753. }
  13754. }, _callee17, this);
  13755. }));
  13756. function linkAndRetrieveDataWithTicket(_x10) {
  13757. return _linkAndRetrieveDataWithTicket.apply(this, arguments);
  13758. }
  13759. return linkAndRetrieveDataWithTicket;
  13760. }()
  13761. }, {
  13762. key: "_setAnonymousUUID",
  13763. value: function _setAnonymousUUID(e) {
  13764. var _this$_cache$keys9 = this._cache.keys,
  13765. t = _this$_cache$keys9.anonymousUuidKey,
  13766. n = _this$_cache$keys9.loginTypeKey;
  13767. this._cache.removeStore(t), this._cache.setStore(t, e), this._cache.setStore(n, Be.ANONYMOUS);
  13768. }
  13769. }, {
  13770. key: "_clearAnonymousUUID",
  13771. value: function _clearAnonymousUUID() {
  13772. this._cache.removeStore(this._cache.keys.anonymousUuidKey);
  13773. }
  13774. }]);
  13775. return et;
  13776. }(Qe);
  13777. var tt = /*#__PURE__*/function (_Qe2) {
  13778. (0, _inherits2.default)(tt, _Qe2);
  13779. var _super5 = _createSuper(tt);
  13780. function tt() {
  13781. (0, _classCallCheck2.default)(this, tt);
  13782. return _super5.apply(this, arguments);
  13783. }
  13784. (0, _createClass2.default)(tt, [{
  13785. key: "signIn",
  13786. value: function () {
  13787. var _signIn2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(e) {
  13788. var t, n;
  13789. return _regenerator.default.wrap(function _callee18$(_context18) {
  13790. while (1) {
  13791. switch (_context18.prev = _context18.next) {
  13792. case 0:
  13793. if (!("string" != typeof e)) {
  13794. _context18.next = 2;
  13795. break;
  13796. }
  13797. throw new te({
  13798. code: "PARAM_ERROR",
  13799. message: "ticket must be a string"
  13800. });
  13801. case 2:
  13802. t = this._cache.keys.refreshTokenKey;
  13803. _context18.next = 5;
  13804. return this._request.send("auth.signInWithTicket", {
  13805. ticket: e,
  13806. refresh_token: this._cache.getStore(t) || ""
  13807. });
  13808. case 5:
  13809. n = _context18.sent;
  13810. if (!n.refresh_token) {
  13811. _context18.next = 15;
  13812. break;
  13813. }
  13814. this.setRefreshToken(n.refresh_token);
  13815. _context18.next = 10;
  13816. return this._request.refreshAccessToken();
  13817. case 10:
  13818. De(qe);
  13819. De(Ke, {
  13820. env: this.config.env,
  13821. loginType: Be.CUSTOM,
  13822. persistence: this.config.persistence
  13823. });
  13824. _context18.next = 14;
  13825. return this.refreshUserInfo();
  13826. case 14:
  13827. return _context18.abrupt("return", new Ze(this.config.env));
  13828. case 15:
  13829. throw new te({
  13830. message: "自定义登录失败"
  13831. });
  13832. case 16:
  13833. case "end":
  13834. return _context18.stop();
  13835. }
  13836. }
  13837. }, _callee18, this);
  13838. }));
  13839. function signIn(_x11) {
  13840. return _signIn2.apply(this, arguments);
  13841. }
  13842. return signIn;
  13843. }()
  13844. }]);
  13845. return tt;
  13846. }(Qe);
  13847. var nt = /*#__PURE__*/function (_Qe3) {
  13848. (0, _inherits2.default)(nt, _Qe3);
  13849. var _super6 = _createSuper(nt);
  13850. function nt() {
  13851. (0, _classCallCheck2.default)(this, nt);
  13852. return _super6.apply(this, arguments);
  13853. }
  13854. (0, _createClass2.default)(nt, [{
  13855. key: "signIn",
  13856. value: function () {
  13857. var _signIn3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(e, t) {
  13858. var n, s, r, i, o;
  13859. return _regenerator.default.wrap(function _callee19$(_context19) {
  13860. while (1) {
  13861. switch (_context19.prev = _context19.next) {
  13862. case 0:
  13863. if (!("string" != typeof e)) {
  13864. _context19.next = 2;
  13865. break;
  13866. }
  13867. throw new te({
  13868. code: "PARAM_ERROR",
  13869. message: "email must be a string"
  13870. });
  13871. case 2:
  13872. n = this._cache.keys.refreshTokenKey;
  13873. _context19.next = 5;
  13874. return this._request.send("auth.signIn", {
  13875. loginType: "EMAIL",
  13876. email: e,
  13877. password: t,
  13878. refresh_token: this._cache.getStore(n) || ""
  13879. });
  13880. case 5:
  13881. s = _context19.sent;
  13882. r = s.refresh_token;
  13883. i = s.access_token;
  13884. o = s.access_token_expire;
  13885. if (!r) {
  13886. _context19.next = 22;
  13887. break;
  13888. }
  13889. this.setRefreshToken(r);
  13890. if (!(i && o)) {
  13891. _context19.next = 15;
  13892. break;
  13893. }
  13894. this.setAccessToken(i, o);
  13895. _context19.next = 17;
  13896. break;
  13897. case 15:
  13898. _context19.next = 17;
  13899. return this._request.refreshAccessToken();
  13900. case 17:
  13901. _context19.next = 19;
  13902. return this.refreshUserInfo();
  13903. case 19:
  13904. De(qe);
  13905. De(Ke, {
  13906. env: this.config.env,
  13907. loginType: Be.EMAIL,
  13908. persistence: this.config.persistence
  13909. });
  13910. return _context19.abrupt("return", new Ze(this.config.env));
  13911. case 22:
  13912. throw s.code ? new te({
  13913. code: s.code,
  13914. message: "\u90AE\u7BB1\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  13915. }) : new te({
  13916. message: "邮箱登录失败"
  13917. });
  13918. case 23:
  13919. case "end":
  13920. return _context19.stop();
  13921. }
  13922. }
  13923. }, _callee19, this);
  13924. }));
  13925. function signIn(_x12, _x13) {
  13926. return _signIn3.apply(this, arguments);
  13927. }
  13928. return signIn;
  13929. }()
  13930. }, {
  13931. key: "activate",
  13932. value: function () {
  13933. var _activate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(e) {
  13934. return _regenerator.default.wrap(function _callee20$(_context20) {
  13935. while (1) {
  13936. switch (_context20.prev = _context20.next) {
  13937. case 0:
  13938. return _context20.abrupt("return", this._request.send("auth.activateEndUserMail", {
  13939. token: e
  13940. }));
  13941. case 1:
  13942. case "end":
  13943. return _context20.stop();
  13944. }
  13945. }
  13946. }, _callee20, this);
  13947. }));
  13948. function activate(_x14) {
  13949. return _activate.apply(this, arguments);
  13950. }
  13951. return activate;
  13952. }()
  13953. }, {
  13954. key: "resetPasswordWithToken",
  13955. value: function () {
  13956. var _resetPasswordWithToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(e, t) {
  13957. return _regenerator.default.wrap(function _callee21$(_context21) {
  13958. while (1) {
  13959. switch (_context21.prev = _context21.next) {
  13960. case 0:
  13961. return _context21.abrupt("return", this._request.send("auth.resetPasswordWithToken", {
  13962. token: e,
  13963. newPassword: t
  13964. }));
  13965. case 1:
  13966. case "end":
  13967. return _context21.stop();
  13968. }
  13969. }
  13970. }, _callee21, this);
  13971. }));
  13972. function resetPasswordWithToken(_x15, _x16) {
  13973. return _resetPasswordWithToken.apply(this, arguments);
  13974. }
  13975. return resetPasswordWithToken;
  13976. }()
  13977. }]);
  13978. return nt;
  13979. }(Qe);
  13980. var st = /*#__PURE__*/function (_Qe4) {
  13981. (0, _inherits2.default)(st, _Qe4);
  13982. var _super7 = _createSuper(st);
  13983. function st() {
  13984. (0, _classCallCheck2.default)(this, st);
  13985. return _super7.apply(this, arguments);
  13986. }
  13987. (0, _createClass2.default)(st, [{
  13988. key: "signIn",
  13989. value: function () {
  13990. var _signIn4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22(e, t) {
  13991. var n, s, r, i, o;
  13992. return _regenerator.default.wrap(function _callee22$(_context22) {
  13993. while (1) {
  13994. switch (_context22.prev = _context22.next) {
  13995. case 0:
  13996. if (!("string" != typeof e)) {
  13997. _context22.next = 2;
  13998. break;
  13999. }
  14000. throw new te({
  14001. code: "PARAM_ERROR",
  14002. message: "username must be a string"
  14003. });
  14004. case 2:
  14005. "string" != typeof t && (t = "", console.warn("password is empty"));
  14006. n = this._cache.keys.refreshTokenKey;
  14007. _context22.next = 6;
  14008. return this._request.send("auth.signIn", {
  14009. loginType: Be.USERNAME,
  14010. username: e,
  14011. password: t,
  14012. refresh_token: this._cache.getStore(n) || ""
  14013. });
  14014. case 6:
  14015. s = _context22.sent;
  14016. r = s.refresh_token;
  14017. i = s.access_token_expire;
  14018. o = s.access_token;
  14019. if (!r) {
  14020. _context22.next = 23;
  14021. break;
  14022. }
  14023. this.setRefreshToken(r);
  14024. if (!(o && i)) {
  14025. _context22.next = 16;
  14026. break;
  14027. }
  14028. this.setAccessToken(o, i);
  14029. _context22.next = 18;
  14030. break;
  14031. case 16:
  14032. _context22.next = 18;
  14033. return this._request.refreshAccessToken();
  14034. case 18:
  14035. _context22.next = 20;
  14036. return this.refreshUserInfo();
  14037. case 20:
  14038. De(qe);
  14039. De(Ke, {
  14040. env: this.config.env,
  14041. loginType: Be.USERNAME,
  14042. persistence: this.config.persistence
  14043. });
  14044. return _context22.abrupt("return", new Ze(this.config.env));
  14045. case 23:
  14046. throw s.code ? new te({
  14047. code: s.code,
  14048. message: "\u7528\u6237\u540D\u5BC6\u7801\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  14049. }) : new te({
  14050. message: "用户名密码登录失败"
  14051. });
  14052. case 24:
  14053. case "end":
  14054. return _context22.stop();
  14055. }
  14056. }
  14057. }, _callee22, this);
  14058. }));
  14059. function signIn(_x17, _x18) {
  14060. return _signIn4.apply(this, arguments);
  14061. }
  14062. return signIn;
  14063. }()
  14064. }]);
  14065. return st;
  14066. }(Qe);
  14067. var rt = /*#__PURE__*/function () {
  14068. function rt(e) {
  14069. (0, _classCallCheck2.default)(this, rt);
  14070. this.config = e, this._cache = Ee(e.env), this._request = Ye(e.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), Ne(Ke, this._onLoginTypeChanged);
  14071. }
  14072. (0, _createClass2.default)(rt, [{
  14073. key: "currentUser",
  14074. get: function get() {
  14075. var e = this.hasLoginState();
  14076. return e && e.user || null;
  14077. }
  14078. }, {
  14079. key: "loginType",
  14080. get: function get() {
  14081. return this._cache.getStore(this._cache.keys.loginTypeKey);
  14082. }
  14083. }, {
  14084. key: "anonymousAuthProvider",
  14085. value: function anonymousAuthProvider() {
  14086. return new et(this.config);
  14087. }
  14088. }, {
  14089. key: "customAuthProvider",
  14090. value: function customAuthProvider() {
  14091. return new tt(this.config);
  14092. }
  14093. }, {
  14094. key: "emailAuthProvider",
  14095. value: function emailAuthProvider() {
  14096. return new nt(this.config);
  14097. }
  14098. }, {
  14099. key: "usernameAuthProvider",
  14100. value: function usernameAuthProvider() {
  14101. return new st(this.config);
  14102. }
  14103. }, {
  14104. key: "signInAnonymously",
  14105. value: function () {
  14106. var _signInAnonymously = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
  14107. return _regenerator.default.wrap(function _callee23$(_context23) {
  14108. while (1) {
  14109. switch (_context23.prev = _context23.next) {
  14110. case 0:
  14111. return _context23.abrupt("return", new et(this.config).signIn());
  14112. case 1:
  14113. case "end":
  14114. return _context23.stop();
  14115. }
  14116. }
  14117. }, _callee23, this);
  14118. }));
  14119. function signInAnonymously() {
  14120. return _signInAnonymously.apply(this, arguments);
  14121. }
  14122. return signInAnonymously;
  14123. }()
  14124. }, {
  14125. key: "signInWithEmailAndPassword",
  14126. value: function () {
  14127. var _signInWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(e, t) {
  14128. return _regenerator.default.wrap(function _callee24$(_context24) {
  14129. while (1) {
  14130. switch (_context24.prev = _context24.next) {
  14131. case 0:
  14132. return _context24.abrupt("return", new nt(this.config).signIn(e, t));
  14133. case 1:
  14134. case "end":
  14135. return _context24.stop();
  14136. }
  14137. }
  14138. }, _callee24, this);
  14139. }));
  14140. function signInWithEmailAndPassword(_x19, _x20) {
  14141. return _signInWithEmailAndPassword.apply(this, arguments);
  14142. }
  14143. return signInWithEmailAndPassword;
  14144. }()
  14145. }, {
  14146. key: "signInWithUsernameAndPassword",
  14147. value: function signInWithUsernameAndPassword(e, t) {
  14148. return new st(this.config).signIn(e, t);
  14149. }
  14150. }, {
  14151. key: "linkAndRetrieveDataWithTicket",
  14152. value: function () {
  14153. var _linkAndRetrieveDataWithTicket2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25(e) {
  14154. return _regenerator.default.wrap(function _callee25$(_context25) {
  14155. while (1) {
  14156. switch (_context25.prev = _context25.next) {
  14157. case 0:
  14158. this._anonymousAuthProvider || (this._anonymousAuthProvider = new et(this.config)), Ne(je, this._onAnonymousConverted);
  14159. _context25.next = 3;
  14160. return this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e);
  14161. case 3:
  14162. return _context25.abrupt("return", _context25.sent);
  14163. case 4:
  14164. case "end":
  14165. return _context25.stop();
  14166. }
  14167. }
  14168. }, _callee25, this);
  14169. }));
  14170. function linkAndRetrieveDataWithTicket(_x21) {
  14171. return _linkAndRetrieveDataWithTicket2.apply(this, arguments);
  14172. }
  14173. return linkAndRetrieveDataWithTicket;
  14174. }()
  14175. }, {
  14176. key: "signOut",
  14177. value: function () {
  14178. var _signOut = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
  14179. var _this$_cache$keys10, e, t, n, s, r;
  14180. return _regenerator.default.wrap(function _callee26$(_context26) {
  14181. while (1) {
  14182. switch (_context26.prev = _context26.next) {
  14183. case 0:
  14184. if (!(this.loginType === Be.ANONYMOUS)) {
  14185. _context26.next = 2;
  14186. break;
  14187. }
  14188. throw new te({
  14189. message: "匿名用户不支持登出操作"
  14190. });
  14191. case 2:
  14192. _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);
  14193. if (s) {
  14194. _context26.next = 5;
  14195. break;
  14196. }
  14197. return _context26.abrupt("return");
  14198. case 5:
  14199. _context26.next = 7;
  14200. return this._request.send("auth.logout", {
  14201. refresh_token: s
  14202. });
  14203. case 7:
  14204. r = _context26.sent;
  14205. return _context26.abrupt("return", (this._cache.removeStore(e), this._cache.removeStore(t), this._cache.removeStore(n), De(qe), De(Ke, {
  14206. env: this.config.env,
  14207. loginType: Be.NULL,
  14208. persistence: this.config.persistence
  14209. }), r));
  14210. case 9:
  14211. case "end":
  14212. return _context26.stop();
  14213. }
  14214. }
  14215. }, _callee26, this);
  14216. }));
  14217. function signOut() {
  14218. return _signOut.apply(this, arguments);
  14219. }
  14220. return signOut;
  14221. }()
  14222. }, {
  14223. key: "signUpWithEmailAndPassword",
  14224. value: function () {
  14225. var _signUpWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27(e, t) {
  14226. return _regenerator.default.wrap(function _callee27$(_context27) {
  14227. while (1) {
  14228. switch (_context27.prev = _context27.next) {
  14229. case 0:
  14230. return _context27.abrupt("return", this._request.send("auth.signUpWithEmailAndPassword", {
  14231. email: e,
  14232. password: t
  14233. }));
  14234. case 1:
  14235. case "end":
  14236. return _context27.stop();
  14237. }
  14238. }
  14239. }, _callee27, this);
  14240. }));
  14241. function signUpWithEmailAndPassword(_x22, _x23) {
  14242. return _signUpWithEmailAndPassword.apply(this, arguments);
  14243. }
  14244. return signUpWithEmailAndPassword;
  14245. }()
  14246. }, {
  14247. key: "sendPasswordResetEmail",
  14248. value: function () {
  14249. var _sendPasswordResetEmail = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28(e) {
  14250. return _regenerator.default.wrap(function _callee28$(_context28) {
  14251. while (1) {
  14252. switch (_context28.prev = _context28.next) {
  14253. case 0:
  14254. return _context28.abrupt("return", this._request.send("auth.sendPasswordResetEmail", {
  14255. email: e
  14256. }));
  14257. case 1:
  14258. case "end":
  14259. return _context28.stop();
  14260. }
  14261. }
  14262. }, _callee28, this);
  14263. }));
  14264. function sendPasswordResetEmail(_x24) {
  14265. return _sendPasswordResetEmail.apply(this, arguments);
  14266. }
  14267. return sendPasswordResetEmail;
  14268. }()
  14269. }, {
  14270. key: "onLoginStateChanged",
  14271. value: function onLoginStateChanged(e) {
  14272. var _this9 = this;
  14273. Ne(qe, function () {
  14274. var t = _this9.hasLoginState();
  14275. e.call(_this9, t);
  14276. });
  14277. var t = this.hasLoginState();
  14278. e.call(this, t);
  14279. }
  14280. }, {
  14281. key: "onLoginStateExpired",
  14282. value: function onLoginStateExpired(e) {
  14283. Ne(Fe, e.bind(this));
  14284. }
  14285. }, {
  14286. key: "onAccessTokenRefreshed",
  14287. value: function onAccessTokenRefreshed(e) {
  14288. Ne($e, e.bind(this));
  14289. }
  14290. }, {
  14291. key: "onAnonymousConverted",
  14292. value: function onAnonymousConverted(e) {
  14293. Ne(je, e.bind(this));
  14294. }
  14295. }, {
  14296. key: "onLoginTypeChanged",
  14297. value: function onLoginTypeChanged(e) {
  14298. var _this10 = this;
  14299. Ne(Ke, function () {
  14300. var t = _this10.hasLoginState();
  14301. e.call(_this10, t);
  14302. });
  14303. }
  14304. }, {
  14305. key: "getAccessToken",
  14306. value: function () {
  14307. var _getAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
  14308. return _regenerator.default.wrap(function _callee29$(_context29) {
  14309. while (1) {
  14310. switch (_context29.prev = _context29.next) {
  14311. case 0:
  14312. _context29.next = 2;
  14313. return this._request.getAccessToken();
  14314. case 2:
  14315. _context29.t0 = _context29.sent.accessToken;
  14316. _context29.t1 = this.config.env;
  14317. return _context29.abrupt("return", {
  14318. accessToken: _context29.t0,
  14319. env: _context29.t1
  14320. });
  14321. case 5:
  14322. case "end":
  14323. return _context29.stop();
  14324. }
  14325. }
  14326. }, _callee29, this);
  14327. }));
  14328. function getAccessToken() {
  14329. return _getAccessToken2.apply(this, arguments);
  14330. }
  14331. return getAccessToken;
  14332. }()
  14333. }, {
  14334. key: "hasLoginState",
  14335. value: function hasLoginState() {
  14336. var e = this._cache.keys.refreshTokenKey;
  14337. return this._cache.getStore(e) ? new Ze(this.config.env) : null;
  14338. }
  14339. }, {
  14340. key: "isUsernameRegistered",
  14341. value: function () {
  14342. var _isUsernameRegistered = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(e) {
  14343. var _yield$this$_request$5, t;
  14344. return _regenerator.default.wrap(function _callee30$(_context30) {
  14345. while (1) {
  14346. switch (_context30.prev = _context30.next) {
  14347. case 0:
  14348. if (!("string" != typeof e)) {
  14349. _context30.next = 2;
  14350. break;
  14351. }
  14352. throw new te({
  14353. code: "PARAM_ERROR",
  14354. message: "username must be a string"
  14355. });
  14356. case 2:
  14357. _context30.next = 4;
  14358. return this._request.send("auth.isUsernameRegistered", {
  14359. username: e
  14360. });
  14361. case 4:
  14362. _yield$this$_request$5 = _context30.sent;
  14363. t = _yield$this$_request$5.data;
  14364. return _context30.abrupt("return", t && t.isRegistered);
  14365. case 7:
  14366. case "end":
  14367. return _context30.stop();
  14368. }
  14369. }
  14370. }, _callee30, this);
  14371. }));
  14372. function isUsernameRegistered(_x25) {
  14373. return _isUsernameRegistered.apply(this, arguments);
  14374. }
  14375. return isUsernameRegistered;
  14376. }()
  14377. }, {
  14378. key: "getLoginState",
  14379. value: function getLoginState() {
  14380. return Promise.resolve(this.hasLoginState());
  14381. }
  14382. }, {
  14383. key: "signInWithTicket",
  14384. value: function () {
  14385. var _signInWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(e) {
  14386. return _regenerator.default.wrap(function _callee31$(_context31) {
  14387. while (1) {
  14388. switch (_context31.prev = _context31.next) {
  14389. case 0:
  14390. return _context31.abrupt("return", new tt(this.config).signIn(e));
  14391. case 1:
  14392. case "end":
  14393. return _context31.stop();
  14394. }
  14395. }
  14396. }, _callee31, this);
  14397. }));
  14398. function signInWithTicket(_x26) {
  14399. return _signInWithTicket.apply(this, arguments);
  14400. }
  14401. return signInWithTicket;
  14402. }()
  14403. }, {
  14404. key: "shouldRefreshAccessToken",
  14405. value: function shouldRefreshAccessToken(e) {
  14406. this._request._shouldRefreshAccessTokenHook = e.bind(this);
  14407. }
  14408. }, {
  14409. key: "getUserInfo",
  14410. value: function getUserInfo() {
  14411. return this._request.send("auth.getUserInfo", {}).then(function (e) {
  14412. return e.code ? e : _objectSpread(_objectSpread({}, e.data), {}, {
  14413. requestId: e.seqId
  14414. });
  14415. });
  14416. }
  14417. }, {
  14418. key: "getAuthHeader",
  14419. value: function getAuthHeader() {
  14420. var _this$_cache$keys11 = this._cache.keys,
  14421. e = _this$_cache$keys11.refreshTokenKey,
  14422. t = _this$_cache$keys11.accessTokenKey,
  14423. n = this._cache.getStore(e);
  14424. return {
  14425. "x-cloudbase-credentials": this._cache.getStore(t) + "/@@/" + n
  14426. };
  14427. }
  14428. }, {
  14429. key: "_onAnonymousConverted",
  14430. value: function _onAnonymousConverted(e) {
  14431. var t = e.data.env;
  14432. t === this.config.env && this._cache.updatePersistence(this.config.persistence);
  14433. }
  14434. }, {
  14435. key: "_onLoginTypeChanged",
  14436. value: function _onLoginTypeChanged(e) {
  14437. var _e$data = e.data,
  14438. t = _e$data.loginType,
  14439. n = _e$data.persistence,
  14440. s = _e$data.env;
  14441. s === this.config.env && (this._cache.updatePersistence(n), this._cache.setStore(this._cache.keys.loginTypeKey, t));
  14442. }
  14443. }]);
  14444. return rt;
  14445. }();
  14446. var it = function it(e, t) {
  14447. t = t || we();
  14448. var n = Ye(this.config.env),
  14449. s = e.cloudPath,
  14450. r = e.filePath,
  14451. i = e.onUploadProgress,
  14452. _e$fileType = e.fileType,
  14453. o = _e$fileType === void 0 ? "image" : _e$fileType;
  14454. return n.send("storage.getUploadMetadata", {
  14455. path: s
  14456. }).then(function (e) {
  14457. var _e$data2 = e.data,
  14458. a = _e$data2.url,
  14459. c = _e$data2.authorization,
  14460. u = _e$data2.token,
  14461. h = _e$data2.fileId,
  14462. l = _e$data2.cosFileId,
  14463. d = e.requestId,
  14464. p = {
  14465. key: s,
  14466. signature: c,
  14467. "x-cos-meta-fileid": l,
  14468. success_action_status: "201",
  14469. "x-cos-security-token": u
  14470. };
  14471. n.upload({
  14472. url: a,
  14473. data: p,
  14474. file: r,
  14475. name: s,
  14476. fileType: o,
  14477. onUploadProgress: i
  14478. }).then(function (e) {
  14479. 201 === e.statusCode ? t(null, {
  14480. fileID: h,
  14481. requestId: d
  14482. }) : t(new te({
  14483. code: "STORAGE_REQUEST_FAIL",
  14484. message: "STORAGE_REQUEST_FAIL: ".concat(e.data)
  14485. }));
  14486. }).catch(function (e) {
  14487. t(e);
  14488. });
  14489. }).catch(function (e) {
  14490. t(e);
  14491. }), t.promise;
  14492. },
  14493. ot = function ot(e, t) {
  14494. t = t || we();
  14495. var n = Ye(this.config.env),
  14496. s = e.cloudPath;
  14497. return n.send("storage.getUploadMetadata", {
  14498. path: s
  14499. }).then(function (e) {
  14500. t(null, e);
  14501. }).catch(function (e) {
  14502. t(e);
  14503. }), t.promise;
  14504. },
  14505. at = function at(_ref7, t) {
  14506. var e = _ref7.fileList;
  14507. if (t = t || we(), !e || !Array.isArray(e)) return {
  14508. code: "INVALID_PARAM",
  14509. message: "fileList必须是非空的数组"
  14510. };
  14511. var _iterator3 = _createForOfIteratorHelper(e),
  14512. _step3;
  14513. try {
  14514. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  14515. var _t8 = _step3.value;
  14516. if (!_t8 || "string" != typeof _t8) return {
  14517. code: "INVALID_PARAM",
  14518. message: "fileList的元素必须是非空的字符串"
  14519. };
  14520. }
  14521. } catch (err) {
  14522. _iterator3.e(err);
  14523. } finally {
  14524. _iterator3.f();
  14525. }
  14526. var n = {
  14527. fileid_list: e
  14528. };
  14529. return Ye(this.config.env).send("storage.batchDeleteFile", n).then(function (e) {
  14530. e.code ? t(null, e) : t(null, {
  14531. fileList: e.data.delete_list,
  14532. requestId: e.requestId
  14533. });
  14534. }).catch(function (e) {
  14535. t(e);
  14536. }), t.promise;
  14537. },
  14538. ct = function ct(_ref8, t) {
  14539. var e = _ref8.fileList;
  14540. t = t || we(), e && Array.isArray(e) || t(null, {
  14541. code: "INVALID_PARAM",
  14542. message: "fileList必须是非空的数组"
  14543. });
  14544. var n = [];
  14545. var _iterator4 = _createForOfIteratorHelper(e),
  14546. _step4;
  14547. try {
  14548. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  14549. var _s9 = _step4.value;
  14550. "object" == (0, _typeof2.default)(_s9) ? (_s9.hasOwnProperty("fileID") && _s9.hasOwnProperty("maxAge") || t(null, {
  14551. code: "INVALID_PARAM",
  14552. message: "fileList的元素必须是包含fileID和maxAge的对象"
  14553. }), n.push({
  14554. fileid: _s9.fileID,
  14555. max_age: _s9.maxAge
  14556. })) : "string" == typeof _s9 ? n.push({
  14557. fileid: _s9
  14558. }) : t(null, {
  14559. code: "INVALID_PARAM",
  14560. message: "fileList的元素必须是字符串"
  14561. });
  14562. }
  14563. } catch (err) {
  14564. _iterator4.e(err);
  14565. } finally {
  14566. _iterator4.f();
  14567. }
  14568. var s = {
  14569. file_list: n
  14570. };
  14571. return Ye(this.config.env).send("storage.batchGetDownloadUrl", s).then(function (e) {
  14572. e.code ? t(null, e) : t(null, {
  14573. fileList: e.data.download_list,
  14574. requestId: e.requestId
  14575. });
  14576. }).catch(function (e) {
  14577. t(e);
  14578. }), t.promise;
  14579. },
  14580. ut = /*#__PURE__*/function () {
  14581. var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(_ref9, t) {
  14582. var e, n, s, r;
  14583. return _regenerator.default.wrap(function _callee32$(_context32) {
  14584. while (1) {
  14585. switch (_context32.prev = _context32.next) {
  14586. case 0:
  14587. e = _ref9.fileID;
  14588. _context32.next = 3;
  14589. return ct.call(this, {
  14590. fileList: [{
  14591. fileID: e,
  14592. maxAge: 600
  14593. }]
  14594. });
  14595. case 3:
  14596. n = _context32.sent.fileList[0];
  14597. if (!("SUCCESS" !== n.code)) {
  14598. _context32.next = 6;
  14599. break;
  14600. }
  14601. return _context32.abrupt("return", t ? t(n) : new Promise(function (e) {
  14602. e(n);
  14603. }));
  14604. case 6:
  14605. s = Ye(this.config.env);
  14606. r = n.download_url;
  14607. if (!(r = encodeURI(r), !t)) {
  14608. _context32.next = 10;
  14609. break;
  14610. }
  14611. return _context32.abrupt("return", s.download({
  14612. url: r
  14613. }));
  14614. case 10:
  14615. _context32.t0 = t;
  14616. _context32.next = 13;
  14617. return s.download({
  14618. url: r
  14619. });
  14620. case 13:
  14621. _context32.t1 = _context32.sent;
  14622. (0, _context32.t0)(_context32.t1);
  14623. case 15:
  14624. case "end":
  14625. return _context32.stop();
  14626. }
  14627. }
  14628. }, _callee32, this);
  14629. }));
  14630. return function ut(_x27, _x28) {
  14631. return _ref10.apply(this, arguments);
  14632. };
  14633. }(),
  14634. ht = function ht(_ref11, i) {
  14635. var e = _ref11.name,
  14636. t = _ref11.data,
  14637. n = _ref11.query,
  14638. s = _ref11.parse,
  14639. r = _ref11.search;
  14640. var o = i || we();
  14641. var a;
  14642. try {
  14643. a = t ? JSON.stringify(t) : "";
  14644. } catch (e) {
  14645. return Promise.reject(e);
  14646. }
  14647. if (!e) return Promise.reject(new te({
  14648. code: "PARAM_ERROR",
  14649. message: "函数名不能为空"
  14650. }));
  14651. var c = {
  14652. inQuery: n,
  14653. parse: s,
  14654. search: r,
  14655. function_name: e,
  14656. request_data: a
  14657. };
  14658. return Ye(this.config.env).send("functions.invokeFunction", c).then(function (e) {
  14659. if (e.code) o(null, e);else {
  14660. var _t9 = e.data.response_data;
  14661. if (s) o(null, {
  14662. result: _t9,
  14663. requestId: e.requestId
  14664. });else try {
  14665. _t9 = JSON.parse(e.data.response_data), o(null, {
  14666. result: _t9,
  14667. requestId: e.requestId
  14668. });
  14669. } catch (e) {
  14670. o(new te({
  14671. message: "response data must be json"
  14672. }));
  14673. }
  14674. }
  14675. return o.promise;
  14676. }).catch(function (e) {
  14677. o(e);
  14678. }), o.promise;
  14679. },
  14680. lt = {
  14681. timeout: 15e3,
  14682. persistence: "session"
  14683. },
  14684. dt = {};
  14685. var pt = /*#__PURE__*/function () {
  14686. function pt(e) {
  14687. (0, _classCallCheck2.default)(this, pt);
  14688. this.config = e || this.config, this.authObj = void 0;
  14689. }
  14690. (0, _createClass2.default)(pt, [{
  14691. key: "init",
  14692. value: function init(e) {
  14693. switch (ke.adapter || (this.requestClient = new ke.adapter.reqClass({
  14694. timeout: e.timeout || 5e3,
  14695. timeoutMsg: "\u8BF7\u6C42\u5728".concat((e.timeout || 5e3) / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD")
  14696. })), this.config = _objectSpread(_objectSpread({}, lt), e), !0) {
  14697. case this.config.timeout > 6e5:
  14698. console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
  14699. break;
  14700. case this.config.timeout < 100:
  14701. console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
  14702. }
  14703. return new pt(this.config);
  14704. }
  14705. }, {
  14706. key: "auth",
  14707. value: function auth() {
  14708. var _ref12 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14709. e = _ref12.persistence;
  14710. if (this.authObj) return this.authObj;
  14711. var t = e || ke.adapter.primaryStorage || lt.persistence;
  14712. var n;
  14713. return t !== this.config.persistence && (this.config.persistence = t), function (e) {
  14714. var t = e.env;
  14715. xe[t] = new Ce(e), Oe[t] = new Ce(_objectSpread(_objectSpread({}, e), {}, {
  14716. persistence: "local"
  14717. }));
  14718. }(this.config), n = this.config, Ve[n.env] = new Ge(n), this.authObj = new rt(this.config), this.authObj;
  14719. }
  14720. }, {
  14721. key: "on",
  14722. value: function on(e, t) {
  14723. return Ne.apply(this, [e, t]);
  14724. }
  14725. }, {
  14726. key: "off",
  14727. value: function off(e, t) {
  14728. return Me.apply(this, [e, t]);
  14729. }
  14730. }, {
  14731. key: "callFunction",
  14732. value: function callFunction(e, t) {
  14733. return ht.apply(this, [e, t]);
  14734. }
  14735. }, {
  14736. key: "deleteFile",
  14737. value: function deleteFile(e, t) {
  14738. return at.apply(this, [e, t]);
  14739. }
  14740. }, {
  14741. key: "getTempFileURL",
  14742. value: function getTempFileURL(e, t) {
  14743. return ct.apply(this, [e, t]);
  14744. }
  14745. }, {
  14746. key: "downloadFile",
  14747. value: function downloadFile(e, t) {
  14748. return ut.apply(this, [e, t]);
  14749. }
  14750. }, {
  14751. key: "uploadFile",
  14752. value: function uploadFile(e, t) {
  14753. return it.apply(this, [e, t]);
  14754. }
  14755. }, {
  14756. key: "getUploadMetadata",
  14757. value: function getUploadMetadata(e, t) {
  14758. return ot.apply(this, [e, t]);
  14759. }
  14760. }, {
  14761. key: "registerExtension",
  14762. value: function registerExtension(e) {
  14763. dt[e.name] = e;
  14764. }
  14765. }, {
  14766. key: "invokeExtension",
  14767. value: function () {
  14768. var _invokeExtension = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(e, t) {
  14769. var n;
  14770. return _regenerator.default.wrap(function _callee33$(_context33) {
  14771. while (1) {
  14772. switch (_context33.prev = _context33.next) {
  14773. case 0:
  14774. n = dt[e];
  14775. if (n) {
  14776. _context33.next = 3;
  14777. break;
  14778. }
  14779. throw new te({
  14780. message: "\u6269\u5C55".concat(e, " \u5FC5\u987B\u5148\u6CE8\u518C")
  14781. });
  14782. case 3:
  14783. _context33.next = 5;
  14784. return n.invoke(t, this);
  14785. case 5:
  14786. return _context33.abrupt("return", _context33.sent);
  14787. case 6:
  14788. case "end":
  14789. return _context33.stop();
  14790. }
  14791. }
  14792. }, _callee33, this);
  14793. }));
  14794. function invokeExtension(_x29, _x30) {
  14795. return _invokeExtension.apply(this, arguments);
  14796. }
  14797. return invokeExtension;
  14798. }()
  14799. }, {
  14800. key: "useAdapters",
  14801. value: function useAdapters(e) {
  14802. var _ref13 = be(e) || {},
  14803. t = _ref13.adapter,
  14804. n = _ref13.runtime;
  14805. t && (ke.adapter = t), n && (ke.runtime = n);
  14806. }
  14807. }]);
  14808. return pt;
  14809. }();
  14810. var ft = new pt();
  14811. function gt(e, t, n) {
  14812. void 0 === n && (n = {});
  14813. var s = /\?/.test(t),
  14814. r = "";
  14815. for (var i in n) {
  14816. "" === r ? !s && (t += "?") : r += "&", r += i + "=" + encodeURIComponent(n[i]);
  14817. }
  14818. return /^http(s)?:\/\//.test(t += r) ? t : "" + e + t;
  14819. }
  14820. var mt = /*#__PURE__*/function () {
  14821. function mt() {
  14822. (0, _classCallCheck2.default)(this, mt);
  14823. }
  14824. (0, _createClass2.default)(mt, [{
  14825. key: "post",
  14826. value: function post(e) {
  14827. var t = e.url,
  14828. n = e.data,
  14829. s = e.headers;
  14830. return new Promise(function (e, r) {
  14831. ne.request({
  14832. url: gt("https:", t),
  14833. data: n,
  14834. method: "POST",
  14835. header: s,
  14836. success: function success(t) {
  14837. e(t);
  14838. },
  14839. fail: function fail(e) {
  14840. r(e);
  14841. }
  14842. });
  14843. });
  14844. }
  14845. }, {
  14846. key: "upload",
  14847. value: function upload(e) {
  14848. return new Promise(function (t, n) {
  14849. var s = e.url,
  14850. r = e.file,
  14851. i = e.data,
  14852. o = e.headers,
  14853. a = e.fileType,
  14854. c = ne.uploadFile({
  14855. url: gt("https:", s),
  14856. name: "file",
  14857. formData: Object.assign({}, i),
  14858. filePath: r,
  14859. fileType: a,
  14860. header: o,
  14861. success: function success(e) {
  14862. var n = {
  14863. statusCode: e.statusCode,
  14864. data: e.data || {}
  14865. };
  14866. 200 === e.statusCode && i.success_action_status && (n.statusCode = parseInt(i.success_action_status, 10)), t(n);
  14867. },
  14868. fail: function fail(e) {
  14869. n(new Error(e.errMsg || "uploadFile:fail"));
  14870. }
  14871. });
  14872. "function" == typeof e.onUploadProgress && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (t) {
  14873. e.onUploadProgress({
  14874. loaded: t.totalBytesSent,
  14875. total: t.totalBytesExpectedToSend
  14876. });
  14877. });
  14878. });
  14879. }
  14880. }]);
  14881. return mt;
  14882. }();
  14883. var yt = {
  14884. setItem: function setItem(e, t) {
  14885. ne.setStorageSync(e, t);
  14886. },
  14887. getItem: function getItem(e) {
  14888. return ne.getStorageSync(e);
  14889. },
  14890. removeItem: function removeItem(e) {
  14891. ne.removeStorageSync(e);
  14892. },
  14893. clear: function clear() {
  14894. ne.clearStorageSync();
  14895. }
  14896. };
  14897. var _t = {
  14898. genAdapter: function genAdapter() {
  14899. return {
  14900. root: {},
  14901. reqClass: mt,
  14902. localStorage: yt,
  14903. primaryStorage: "local"
  14904. };
  14905. },
  14906. isMatch: function isMatch() {
  14907. return !0;
  14908. },
  14909. runtime: "uni_app"
  14910. };
  14911. ft.useAdapters(_t);
  14912. var wt = ft,
  14913. vt = wt.init;
  14914. wt.init = function (e) {
  14915. e.env = e.spaceId;
  14916. var t = vt.call(this, e);
  14917. t.config.provider = "tencent", t.config.spaceId = e.spaceId;
  14918. var n = t.auth;
  14919. return t.auth = function (e) {
  14920. var t = n.call(this, e);
  14921. return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach(function (e) {
  14922. var n;
  14923. t[e] = (n = t[e], function (e) {
  14924. e = e || {};
  14925. var _ee = ee(e),
  14926. t = _ee.success,
  14927. s = _ee.fail,
  14928. r = _ee.complete;
  14929. if (!(t || s || r)) return n.call(this, e);
  14930. n.call(this, e).then(function (e) {
  14931. t && t(e), r && r(e);
  14932. }, function (e) {
  14933. s && s(e), r && r(e);
  14934. });
  14935. }).bind(t);
  14936. }), t;
  14937. }, t.customAuth = t.auth, t;
  14938. };
  14939. var It = wt;
  14940. var St = /*#__PURE__*/function (_le) {
  14941. (0, _inherits2.default)(St, _le);
  14942. var _super8 = _createSuper(St);
  14943. function St() {
  14944. (0, _classCallCheck2.default)(this, St);
  14945. return _super8.apply(this, arguments);
  14946. }
  14947. (0, _createClass2.default)(St, [{
  14948. key: "getAccessToken",
  14949. value: function getAccessToken() {
  14950. var _this11 = this;
  14951. return new Promise(function (e, t) {
  14952. var n = "Anonymous_Access_token";
  14953. _this11.setAccessToken(n), e(n);
  14954. });
  14955. }
  14956. }, {
  14957. key: "setupRequest",
  14958. value: function setupRequest(e, t) {
  14959. var n = Object.assign({}, e, {
  14960. spaceId: this.config.spaceId,
  14961. timestamp: Date.now()
  14962. }),
  14963. s = {
  14964. "Content-Type": "application/json"
  14965. };
  14966. "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = he.sign(n, this.config.clientSecret);
  14967. var r = ue();
  14968. s["x-client-info"] = encodeURIComponent(JSON.stringify(r));
  14969. var _se = se(),
  14970. i = _se.token;
  14971. return s["x-client-token"] = i, {
  14972. url: this.config.requestUrl,
  14973. method: "POST",
  14974. data: n,
  14975. dataType: "json",
  14976. header: JSON.parse(JSON.stringify(s))
  14977. };
  14978. }
  14979. }, {
  14980. key: "uploadFileToOSS",
  14981. value: function uploadFileToOSS(_ref14) {
  14982. var _this12 = this;
  14983. var e = _ref14.url,
  14984. t = _ref14.formData,
  14985. n = _ref14.name,
  14986. s = _ref14.filePath,
  14987. r = _ref14.fileType,
  14988. i = _ref14.onUploadProgress;
  14989. return new Promise(function (o, a) {
  14990. var c = _this12.adapter.uploadFile({
  14991. url: e,
  14992. formData: t,
  14993. name: n,
  14994. filePath: s,
  14995. fileType: r,
  14996. success: function success(e) {
  14997. e && e.statusCode < 400 ? o(e) : a(new te({
  14998. code: "UPLOAD_FAILED",
  14999. message: "文件上传失败"
  15000. }));
  15001. },
  15002. fail: function fail(e) {
  15003. a(new te({
  15004. code: e.code || "UPLOAD_FAILED",
  15005. message: e.message || e.errMsg || "文件上传失败"
  15006. }));
  15007. }
  15008. });
  15009. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  15010. i({
  15011. loaded: e.totalBytesSent,
  15012. total: e.totalBytesExpectedToSend
  15013. });
  15014. });
  15015. });
  15016. }
  15017. }, {
  15018. key: "uploadFile",
  15019. value: function uploadFile(_ref15) {
  15020. var _this13 = this;
  15021. var e = _ref15.filePath,
  15022. t = _ref15.cloudPath,
  15023. _ref15$fileType = _ref15.fileType,
  15024. n = _ref15$fileType === void 0 ? "image" : _ref15$fileType,
  15025. s = _ref15.onUploadProgress;
  15026. if (!t) throw new te({
  15027. code: "CLOUDPATH_REQUIRED",
  15028. message: "cloudPath不可为空"
  15029. });
  15030. var r;
  15031. return this.getOSSUploadOptionsFromPath({
  15032. cloudPath: t
  15033. }).then(function (t) {
  15034. var _t$result = t.result,
  15035. i = _t$result.url,
  15036. o = _t$result.formData,
  15037. a = _t$result.name;
  15038. r = t.result.fileUrl;
  15039. var c = {
  15040. url: i,
  15041. formData: o,
  15042. name: a,
  15043. filePath: e,
  15044. fileType: n
  15045. };
  15046. return _this13.uploadFileToOSS(Object.assign({}, c, {
  15047. onUploadProgress: s
  15048. }));
  15049. }).then(function () {
  15050. return _this13.reportOSSUpload({
  15051. cloudPath: t
  15052. });
  15053. }).then(function (t) {
  15054. return new Promise(function (n, s) {
  15055. t.success ? n({
  15056. success: !0,
  15057. filePath: e,
  15058. fileID: r
  15059. }) : s(new te({
  15060. code: "UPLOAD_FAILED",
  15061. message: "文件上传失败"
  15062. }));
  15063. });
  15064. });
  15065. }
  15066. }, {
  15067. key: "deleteFile",
  15068. value: function deleteFile(_ref16) {
  15069. var e = _ref16.fileList;
  15070. var t = {
  15071. method: "serverless.file.resource.delete",
  15072. params: JSON.stringify({
  15073. fileList: e
  15074. })
  15075. };
  15076. return this.request(this.setupRequest(t)).then(function (e) {
  15077. if (e.success) return e.result;
  15078. throw new te({
  15079. code: "DELETE_FILE_FAILED",
  15080. message: "删除文件失败"
  15081. });
  15082. });
  15083. }
  15084. }, {
  15085. key: "getTempFileURL",
  15086. value: function getTempFileURL() {
  15087. var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15088. e = _ref17.fileList,
  15089. t = _ref17.maxAge;
  15090. if (!Array.isArray(e) || 0 === e.length) throw new te({
  15091. code: "INVALID_PARAM",
  15092. message: "fileList的元素必须是非空的字符串"
  15093. });
  15094. var n = {
  15095. method: "serverless.file.resource.getTempFileURL",
  15096. params: JSON.stringify({
  15097. fileList: e,
  15098. maxAge: t
  15099. })
  15100. };
  15101. return this.request(this.setupRequest(n)).then(function (e) {
  15102. if (e.success) return {
  15103. fileList: e.result.fileList.map(function (e) {
  15104. return {
  15105. fileID: e.fileID,
  15106. tempFileURL: e.tempFileURL
  15107. };
  15108. })
  15109. };
  15110. throw new te({
  15111. code: "GET_TEMP_FILE_URL_FAILED",
  15112. message: "获取临时文件链接失败"
  15113. });
  15114. });
  15115. }
  15116. }]);
  15117. return St;
  15118. }(le);
  15119. var bt = {
  15120. init: function init(e) {
  15121. var t = new St(e),
  15122. n = {
  15123. signInAnonymously: function signInAnonymously() {
  15124. return t.authorize();
  15125. },
  15126. getLoginState: function getLoginState() {
  15127. return Promise.resolve(!1);
  15128. }
  15129. };
  15130. return t.auth = function () {
  15131. return n;
  15132. }, t.customAuth = t.auth, t;
  15133. }
  15134. },
  15135. kt = n(function (e, t) {
  15136. e.exports = r.enc.Hex;
  15137. });
  15138. function At() {
  15139. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  15140. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  15141. var n = t.data,
  15142. s = t.functionName,
  15143. r = t.method,
  15144. i = t.headers,
  15145. _t$signHeaderKeys = t.signHeaderKeys,
  15146. o = _t$signHeaderKeys === void 0 ? [] : _t$signHeaderKeys,
  15147. a = t.config,
  15148. c = Date.now(),
  15149. u = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (e) {
  15150. var t = 16 * Math.random() | 0;
  15151. return ("x" === e ? t : 3 & t | 8).toString(16);
  15152. }),
  15153. h = Object.assign({}, i, {
  15154. "x-from-app-id": a.spaceAppId,
  15155. "x-from-env-id": a.spaceId,
  15156. "x-to-env-id": a.spaceId,
  15157. "x-from-instance-id": c,
  15158. "x-from-function-name": s,
  15159. "x-client-timestamp": c,
  15160. "x-alipay-source": "client",
  15161. "x-request-id": u,
  15162. "x-alipay-callid": u,
  15163. "x-trace-id": u
  15164. }),
  15165. l = ["x-from-app-id", "x-from-env-id", "x-to-env-id", "x-from-instance-id", "x-from-function-name", "x-client-timestamp"].concat(o),
  15166. _ref18 = e.split("?") || [],
  15167. _ref19 = (0, _slicedToArray2.default)(_ref18, 2),
  15168. _ref19$ = _ref19[0],
  15169. d = _ref19$ === void 0 ? "" : _ref19$,
  15170. _ref19$2 = _ref19[1],
  15171. p = _ref19$2 === void 0 ? "" : _ref19$2,
  15172. f = function (e) {
  15173. var t = e.signedHeaders.join(";"),
  15174. n = e.signedHeaders.map(function (t) {
  15175. return "".concat(t.toLowerCase(), ":").concat(e.headers[t], "\n");
  15176. }).join(""),
  15177. s = ye(e.body).toString(kt),
  15178. r = "".concat(e.method.toUpperCase(), "\n").concat(e.path, "\n").concat(e.query, "\n").concat(n, "\n").concat(t, "\n").concat(s, "\n"),
  15179. i = ye(r).toString(kt),
  15180. o = "HMAC-SHA256\n".concat(e.timestamp, "\n").concat(i, "\n"),
  15181. a = _e(o, e.secretKey).toString(kt);
  15182. return "HMAC-SHA256 Credential=".concat(e.secretId, ", SignedHeaders=").concat(t, ", Signature=").concat(a);
  15183. }({
  15184. path: d,
  15185. query: p,
  15186. method: r,
  15187. headers: h,
  15188. timestamp: c,
  15189. body: JSON.stringify(n),
  15190. secretId: a.accessKey,
  15191. secretKey: a.secretKey,
  15192. signedHeaders: l.sort()
  15193. });
  15194. return {
  15195. url: "".concat(a.endpoint).concat(e),
  15196. headers: Object.assign({}, h, {
  15197. Authorization: f
  15198. })
  15199. };
  15200. }
  15201. function Pt(_ref20) {
  15202. var e = _ref20.url,
  15203. t = _ref20.data,
  15204. _ref20$method = _ref20.method,
  15205. n = _ref20$method === void 0 ? "POST" : _ref20$method,
  15206. _ref20$headers = _ref20.headers,
  15207. s = _ref20$headers === void 0 ? {} : _ref20$headers;
  15208. return new Promise(function (r, i) {
  15209. ne.request({
  15210. url: e,
  15211. method: n,
  15212. data: t,
  15213. header: s,
  15214. dataType: "json",
  15215. complete: function complete() {
  15216. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  15217. var t = s["x-trace-id"] || "";
  15218. if (!e.statusCode || e.statusCode >= 400) {
  15219. var _ref21 = e.data || {},
  15220. _n7 = _ref21.message,
  15221. _s10 = _ref21.errMsg,
  15222. _r3 = _ref21.trace_id;
  15223. return i(new te({
  15224. code: "SYS_ERR",
  15225. message: _n7 || _s10 || "request:fail",
  15226. requestId: _r3 || t
  15227. }));
  15228. }
  15229. r({
  15230. status: e.statusCode,
  15231. data: e.data,
  15232. headers: e.header,
  15233. requestId: t
  15234. });
  15235. }
  15236. });
  15237. });
  15238. }
  15239. function Tt(e, t) {
  15240. var n = e.path,
  15241. s = e.data,
  15242. _e$method = e.method,
  15243. r = _e$method === void 0 ? "GET" : _e$method,
  15244. _At = At(n, {
  15245. functionName: "",
  15246. data: s,
  15247. method: r,
  15248. headers: {
  15249. "x-alipay-cloud-mode": "oss",
  15250. "x-data-api-type": "oss",
  15251. "x-expire-timestamp": Date.now() + 6e4
  15252. },
  15253. signHeaderKeys: ["x-data-api-type", "x-expire-timestamp"],
  15254. config: t
  15255. }),
  15256. i = _At.url,
  15257. o = _At.headers;
  15258. return Pt({
  15259. url: i,
  15260. data: s,
  15261. method: r,
  15262. headers: o
  15263. }).then(function (e) {
  15264. var t = e.data || {};
  15265. if (!t.success) throw new te({
  15266. code: e.errCode,
  15267. message: e.errMsg,
  15268. requestId: e.requestId
  15269. });
  15270. return t.data || {};
  15271. }).catch(function (e) {
  15272. throw new te({
  15273. code: e.errCode,
  15274. message: e.errMsg,
  15275. requestId: e.requestId
  15276. });
  15277. });
  15278. }
  15279. function Ct() {
  15280. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  15281. var t = e.trim().replace(/^cloud:\/\//, ""),
  15282. n = t.indexOf("/");
  15283. if (n <= 0) throw new te({
  15284. code: "INVALID_PARAM",
  15285. message: "fileID不合法"
  15286. });
  15287. var s = t.substring(0, n),
  15288. r = t.substring(n + 1);
  15289. return s !== this.config.spaceId && console.warn("file ".concat(e, " does not belong to env ").concat(this.config.spaceId)), r;
  15290. }
  15291. function xt() {
  15292. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  15293. return "cloud://".concat(this.config.spaceId, "/").concat(e.replace(/^\/+/, ""));
  15294. }
  15295. var Ot = /*#__PURE__*/function () {
  15296. function Ot(e) {
  15297. (0, _classCallCheck2.default)(this, Ot);
  15298. if (["spaceId", "spaceAppId", "accessKey", "secretKey"].forEach(function (t) {
  15299. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error("".concat(t, " required"));
  15300. }), e.endpoint) {
  15301. if ("string" != typeof e.endpoint) throw new Error("endpoint must be string");
  15302. if (!/^https:\/\//.test(e.endpoint)) throw new Error("endpoint must start with https://");
  15303. e.endpoint = e.endpoint.replace(/\/$/, "");
  15304. }
  15305. this.config = Object.assign({}, e, {
  15306. endpoint: e.endpoint || "https://".concat(e.spaceId, ".api-hz.cloudbasefunction.cn")
  15307. });
  15308. }
  15309. (0, _createClass2.default)(Ot, [{
  15310. key: "callFunction",
  15311. value: function callFunction(e) {
  15312. return function (e, t) {
  15313. var n = e.name,
  15314. s = e.data,
  15315. r = "POST",
  15316. _At2 = At("/functions/invokeFunction", {
  15317. functionName: n,
  15318. data: s,
  15319. method: r,
  15320. headers: {
  15321. "x-to-function-name": n
  15322. },
  15323. signHeaderKeys: ["x-to-function-name"],
  15324. config: t
  15325. }),
  15326. i = _At2.url,
  15327. o = _At2.headers;
  15328. return Pt({
  15329. url: i,
  15330. data: s,
  15331. method: r,
  15332. headers: o
  15333. }).then(function (e) {
  15334. return {
  15335. errCode: 0,
  15336. success: !0,
  15337. requestId: e.requestId,
  15338. result: e.data
  15339. };
  15340. }).catch(function (e) {
  15341. throw new te({
  15342. code: e.errCode,
  15343. message: e.errMsg,
  15344. requestId: e.requestId
  15345. });
  15346. });
  15347. }(e, this.config);
  15348. }
  15349. }, {
  15350. key: "uploadFileToOSS",
  15351. value: function uploadFileToOSS(_ref22) {
  15352. var e = _ref22.url,
  15353. t = _ref22.filePath,
  15354. n = _ref22.fileType,
  15355. s = _ref22.formData,
  15356. r = _ref22.onUploadProgress;
  15357. return new Promise(function (i, o) {
  15358. var a = ne.uploadFile({
  15359. url: e,
  15360. filePath: t,
  15361. fileType: n,
  15362. formData: s,
  15363. name: "file",
  15364. success: function success(e) {
  15365. e && e.statusCode < 400 ? i(e) : o(new te({
  15366. code: "UPLOAD_FAILED",
  15367. message: "文件上传失败"
  15368. }));
  15369. },
  15370. fail: function fail(e) {
  15371. o(new te({
  15372. code: e.code || "UPLOAD_FAILED",
  15373. message: e.message || e.errMsg || "文件上传失败"
  15374. }));
  15375. }
  15376. });
  15377. "function" == typeof r && a && "function" == typeof a.onProgressUpdate && a.onProgressUpdate(function (e) {
  15378. r({
  15379. loaded: e.totalBytesSent,
  15380. total: e.totalBytesExpectedToSend
  15381. });
  15382. });
  15383. });
  15384. }
  15385. }, {
  15386. key: "uploadFile",
  15387. value: function () {
  15388. var _uploadFile2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(_ref23) {
  15389. var e, _ref23$cloudPath, t, _ref23$fileType, n, s, r, i, o, a, c;
  15390. return _regenerator.default.wrap(function _callee34$(_context34) {
  15391. while (1) {
  15392. switch (_context34.prev = _context34.next) {
  15393. case 0:
  15394. e = _ref23.filePath, _ref23$cloudPath = _ref23.cloudPath, t = _ref23$cloudPath === void 0 ? "" : _ref23$cloudPath, _ref23$fileType = _ref23.fileType, n = _ref23$fileType === void 0 ? "image" : _ref23$fileType, s = _ref23.onUploadProgress;
  15395. if (!("string" !== f(t))) {
  15396. _context34.next = 3;
  15397. break;
  15398. }
  15399. throw new te({
  15400. code: "INVALID_PARAM",
  15401. message: "cloudPath必须为字符串类型"
  15402. });
  15403. case 3:
  15404. if (t = t.trim()) {
  15405. _context34.next = 5;
  15406. break;
  15407. }
  15408. throw new te({
  15409. code: "INVALID_PARAM",
  15410. message: "cloudPath不可为空"
  15411. });
  15412. case 5:
  15413. if (!/:\/\//.test(t)) {
  15414. _context34.next = 7;
  15415. break;
  15416. }
  15417. throw new te({
  15418. code: "INVALID_PARAM",
  15419. message: "cloudPath不合法"
  15420. });
  15421. case 7:
  15422. _context34.next = 9;
  15423. return Tt({
  15424. path: "/".concat(t.replace(/^\//, ""), "?post_url")
  15425. }, this.config);
  15426. case 9:
  15427. r = _context34.sent;
  15428. i = r.file_id;
  15429. o = r.upload_url;
  15430. a = r.form_data;
  15431. c = a && a.reduce(function (e, t) {
  15432. return e[t.key] = t.value, e;
  15433. }, {});
  15434. return _context34.abrupt("return", this.uploadFileToOSS({
  15435. url: o,
  15436. filePath: e,
  15437. fileType: n,
  15438. formData: c,
  15439. onUploadProgress: s
  15440. }).then(function () {
  15441. return {
  15442. fileID: i
  15443. };
  15444. }));
  15445. case 15:
  15446. case "end":
  15447. return _context34.stop();
  15448. }
  15449. }
  15450. }, _callee34, this);
  15451. }));
  15452. function uploadFile(_x31) {
  15453. return _uploadFile2.apply(this, arguments);
  15454. }
  15455. return uploadFile;
  15456. }()
  15457. }, {
  15458. key: "getTempFileURL",
  15459. value: function () {
  15460. var _getTempFileURL = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(_ref24) {
  15461. var _this14 = this;
  15462. var e;
  15463. return _regenerator.default.wrap(function _callee35$(_context35) {
  15464. while (1) {
  15465. switch (_context35.prev = _context35.next) {
  15466. case 0:
  15467. e = _ref24.fileList;
  15468. return _context35.abrupt("return", new Promise(function (t, n) {
  15469. (!e || e.length < 0) && n(new te({
  15470. errCode: "INVALID_PARAM",
  15471. errMsg: "fileList不能为空数组"
  15472. })), e.length > 50 && n(new te({
  15473. errCode: "INVALID_PARAM",
  15474. errMsg: "fileList数组长度不能超过50"
  15475. }));
  15476. var s = [];
  15477. var _iterator5 = _createForOfIteratorHelper(e),
  15478. _step5;
  15479. try {
  15480. for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
  15481. var _t10 = _step5.value;
  15482. "string" !== f(_t10) && n(new te({
  15483. errCode: "INVALID_PARAM",
  15484. errMsg: "fileList的元素必须是非空的字符串"
  15485. }));
  15486. var _e17 = Ct.call(_this14, _t10);
  15487. s.push({
  15488. file_id: _e17,
  15489. expire: 600
  15490. });
  15491. }
  15492. } catch (err) {
  15493. _iterator5.e(err);
  15494. } finally {
  15495. _iterator5.f();
  15496. }
  15497. Tt({
  15498. path: "/?download_url",
  15499. data: {
  15500. file_list: s
  15501. },
  15502. method: "POST"
  15503. }, _this14.config).then(function (e) {
  15504. var _e$file_list = e.file_list,
  15505. n = _e$file_list === void 0 ? [] : _e$file_list;
  15506. t({
  15507. fileList: n.map(function (e) {
  15508. return {
  15509. fileID: xt.call(_this14, e.file_id),
  15510. tempFileURL: e.download_url
  15511. };
  15512. })
  15513. });
  15514. }).catch(function (e) {
  15515. return n(e);
  15516. });
  15517. }));
  15518. case 2:
  15519. case "end":
  15520. return _context35.stop();
  15521. }
  15522. }
  15523. }, _callee35);
  15524. }));
  15525. function getTempFileURL(_x32) {
  15526. return _getTempFileURL.apply(this, arguments);
  15527. }
  15528. return getTempFileURL;
  15529. }()
  15530. }]);
  15531. return Ot;
  15532. }();
  15533. var Et = {
  15534. init: function init(e) {
  15535. e.provider = "alipay";
  15536. var t = new Ot(e);
  15537. return t.auth = function () {
  15538. return {
  15539. signInAnonymously: function signInAnonymously() {
  15540. return Promise.resolve();
  15541. },
  15542. getLoginState: function getLoginState() {
  15543. return Promise.resolve(!0);
  15544. }
  15545. };
  15546. }, t;
  15547. }
  15548. };
  15549. function Lt(_ref25) {
  15550. var e = _ref25.data;
  15551. var t;
  15552. t = ue();
  15553. var n = JSON.parse(JSON.stringify(e || {}));
  15554. if (Object.assign(n, {
  15555. clientInfo: t
  15556. }), !n.uniIdToken) {
  15557. var _se2 = se(),
  15558. _e18 = _se2.token;
  15559. _e18 && (n.uniIdToken = _e18);
  15560. }
  15561. return n;
  15562. }
  15563. function Rt() {
  15564. return _Rt.apply(this, arguments);
  15565. }
  15566. function _Rt() {
  15567. _Rt = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee56() {
  15568. var _this27 = this;
  15569. var _ref67,
  15570. e,
  15571. t,
  15572. _this$__dev__,
  15573. n,
  15574. s,
  15575. r,
  15576. i,
  15577. o,
  15578. a,
  15579. _args6 = arguments;
  15580. return _regenerator.default.wrap(function _callee56$(_context56) {
  15581. while (1) {
  15582. switch (_context56.prev = _context56.next) {
  15583. case 0:
  15584. _ref67 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, e = _ref67.name, t = _ref67.data;
  15585. _context56.next = 3;
  15586. return this.__dev__.initLocalNetwork();
  15587. case 3:
  15588. _this$__dev__ = this.__dev__, n = _this$__dev__.localAddress, s = _this$__dev__.localPort, r = {
  15589. aliyun: "aliyun",
  15590. tencent: "tcb",
  15591. alipay: "alipay"
  15592. }[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);
  15593. return _context56.abrupt("return", new Promise(function (t, n) {
  15594. ne.request({
  15595. method: "POST",
  15596. url: o,
  15597. data: {
  15598. name: e,
  15599. platform: P,
  15600. provider: r,
  15601. spaceId: i
  15602. },
  15603. timeout: 3e3,
  15604. success: function success(e) {
  15605. t(e);
  15606. },
  15607. fail: function fail() {
  15608. t({
  15609. data: {
  15610. code: "NETWORK_ERROR",
  15611. message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。"
  15612. }
  15613. });
  15614. }
  15615. });
  15616. }).then(function () {
  15617. var _ref68 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15618. e = _ref68.data;
  15619. var _ref69 = e || {},
  15620. t = _ref69.code,
  15621. n = _ref69.message;
  15622. return {
  15623. code: 0 === t ? 0 : t || "SYS_ERR",
  15624. message: n || "SYS_ERR"
  15625. };
  15626. }).then(function (_ref70) {
  15627. var n = _ref70.code,
  15628. s = _ref70.message;
  15629. if (0 !== n) {
  15630. switch (n) {
  15631. case "MODULE_ENCRYPTED":
  15632. 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"));
  15633. break;
  15634. case "FUNCTION_ENCRYPTED":
  15635. 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"));
  15636. break;
  15637. case "ACTION_ENCRYPTED":
  15638. console.error(s || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
  15639. break;
  15640. case "NETWORK_ERROR":
  15641. {
  15642. var _e30 = "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下";
  15643. throw console.error(_e30), new Error(_e30);
  15644. }
  15645. case "SWITCH_TO_CLOUD":
  15646. break;
  15647. default:
  15648. {
  15649. 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");
  15650. throw console.error(_e31), new Error(_e31);
  15651. }
  15652. }
  15653. return _this27._callCloudFunction({
  15654. name: e,
  15655. data: t
  15656. });
  15657. }
  15658. return new Promise(function (e, n) {
  15659. var s = Lt.call(_this27, {
  15660. data: t
  15661. });
  15662. ne.request({
  15663. method: "POST",
  15664. url: a,
  15665. data: {
  15666. provider: r,
  15667. platform: P,
  15668. param: s
  15669. },
  15670. success: function success() {
  15671. var _ref71 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15672. t = _ref71.statusCode,
  15673. s = _ref71.data;
  15674. return !t || t >= 400 ? n(new te({
  15675. code: s.code || "SYS_ERR",
  15676. message: s.message || "request:fail"
  15677. })) : e({
  15678. result: s
  15679. });
  15680. },
  15681. fail: function fail(e) {
  15682. n(new te({
  15683. code: e.code || e.errCode || "SYS_ERR",
  15684. message: e.message || e.errMsg || "request:fail"
  15685. }));
  15686. }
  15687. });
  15688. });
  15689. }));
  15690. case 5:
  15691. case "end":
  15692. return _context56.stop();
  15693. }
  15694. }
  15695. }, _callee56, this);
  15696. }));
  15697. return _Rt.apply(this, arguments);
  15698. }
  15699. var Ut = [{
  15700. rule: /fc_function_not_found|FUNCTION_NOT_FOUND/,
  15701. content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",
  15702. mode: "append"
  15703. }];
  15704. var Nt = /[\\^$.*+?()[\]{}|]/g,
  15705. Dt = RegExp(Nt.source);
  15706. function Mt(e, t, n) {
  15707. return e.replace(new RegExp((s = t) && Dt.test(s) ? s.replace(Nt, "\\$&") : s, "g"), n);
  15708. var s;
  15709. }
  15710. var qt = "none",
  15711. Ft = "request",
  15712. Kt = "response",
  15713. jt = "both";
  15714. var $t = /*#__PURE__*/function () {
  15715. function $t() {
  15716. var _ref26 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15717. e = _ref26.secretType,
  15718. t = _ref26.uniCloudIns;
  15719. (0, _classCallCheck2.default)(this, $t);
  15720. this.clientType = "", this.secretType = e || qt, this.uniCloudIns = t;
  15721. var _this$uniCloudIns$con = this.uniCloudIns.config,
  15722. n = _this$uniCloudIns$con.provider,
  15723. s = _this$uniCloudIns$con.spaceId;
  15724. var r;
  15725. this.provider = n, this.spaceId = s, this.scopedGlobalCache = (r = this.uniCloudIns, L("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", r.config.spaceId)));
  15726. }
  15727. (0, _createClass2.default)($t, [{
  15728. key: "getSystemInfo",
  15729. value: function getSystemInfo() {
  15730. return this._systemInfo || (this._systemInfo = ae()), this._systemInfo;
  15731. }
  15732. }, {
  15733. key: "appId",
  15734. get: function get() {
  15735. return this.getSystemInfo().appId;
  15736. }
  15737. }, {
  15738. key: "deviceId",
  15739. get: function get() {
  15740. return this.getSystemInfo().deviceId;
  15741. }
  15742. }, {
  15743. key: "encryptData",
  15744. value: function () {
  15745. var _encryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36(e) {
  15746. return _regenerator.default.wrap(function _callee36$(_context36) {
  15747. while (1) {
  15748. switch (_context36.prev = _context36.next) {
  15749. case 0:
  15750. return _context36.abrupt("return", this.secretType === qt ? e : this.platformEncryptData(e));
  15751. case 1:
  15752. case "end":
  15753. return _context36.stop();
  15754. }
  15755. }
  15756. }, _callee36, this);
  15757. }));
  15758. function encryptData(_x33) {
  15759. return _encryptData.apply(this, arguments);
  15760. }
  15761. return encryptData;
  15762. }()
  15763. }, {
  15764. key: "decryptResult",
  15765. value: function () {
  15766. var _decryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37(e) {
  15767. var _ref27, t, n;
  15768. return _regenerator.default.wrap(function _callee37$(_context37) {
  15769. while (1) {
  15770. switch (_context37.prev = _context37.next) {
  15771. case 0:
  15772. if (!(this.secretType === qt)) {
  15773. _context37.next = 2;
  15774. break;
  15775. }
  15776. return _context37.abrupt("return", e);
  15777. case 2:
  15778. _ref27 = e || {}, t = _ref27.errCode, n = _ref27.content;
  15779. return _context37.abrupt("return", t || !n ? e : this.secretType === Ft ? n : this.platformDecryptResult(e));
  15780. case 4:
  15781. case "end":
  15782. return _context37.stop();
  15783. }
  15784. }
  15785. }, _callee37, this);
  15786. }));
  15787. function decryptResult(_x34) {
  15788. return _decryptResult.apply(this, arguments);
  15789. }
  15790. return decryptResult;
  15791. }()
  15792. }, {
  15793. key: "wrapVerifyClientCallFunction",
  15794. value: function wrapVerifyClientCallFunction(e) {
  15795. var t = this;
  15796. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38() {
  15797. var _ref29,
  15798. n,
  15799. _ref29$data,
  15800. s,
  15801. r,
  15802. _args38 = arguments;
  15803. return _regenerator.default.wrap(function _callee38$(_context38) {
  15804. while (1) {
  15805. switch (_context38.prev = _context38.next) {
  15806. case 0:
  15807. _ref29 = _args38.length > 0 && _args38[0] !== undefined ? _args38[0] : {}, n = _ref29.name, _ref29$data = _ref29.data, s = _ref29$data === void 0 ? {} : _ref29$data;
  15808. _context38.next = 3;
  15809. return t.prepare();
  15810. case 3:
  15811. _context38.next = 5;
  15812. return t.platformGetSignOption();
  15813. case 5:
  15814. (s = JSON.parse(JSON.stringify(s)))._uniCloudOptions = _context38.sent;
  15815. _context38.next = 8;
  15816. return e({
  15817. name: n,
  15818. data: s
  15819. });
  15820. case 8:
  15821. r = _context38.sent;
  15822. _context38.t0 = t.isClientKeyNotFound(r);
  15823. if (!_context38.t0) {
  15824. _context38.next = 19;
  15825. break;
  15826. }
  15827. _context38.next = 13;
  15828. return t.prepare({
  15829. forceUpdate: !0
  15830. });
  15831. case 13:
  15832. _context38.next = 15;
  15833. return t.platformGetSignOption();
  15834. case 15:
  15835. s._uniCloudOptions = _context38.sent;
  15836. _context38.next = 18;
  15837. return e({
  15838. name: n,
  15839. data: s
  15840. });
  15841. case 18:
  15842. r = _context38.sent;
  15843. case 19:
  15844. return _context38.abrupt("return", r);
  15845. case 20:
  15846. case "end":
  15847. return _context38.stop();
  15848. }
  15849. }
  15850. }, _callee38);
  15851. }));
  15852. }
  15853. }, {
  15854. key: "wrapEncryptDataCallFunction",
  15855. value: function wrapEncryptDataCallFunction(e) {
  15856. var t = this;
  15857. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39() {
  15858. var _ref31,
  15859. n,
  15860. _ref31$data,
  15861. s,
  15862. r,
  15863. i,
  15864. _r4,
  15865. _args39 = arguments;
  15866. return _regenerator.default.wrap(function _callee39$(_context39) {
  15867. while (1) {
  15868. switch (_context39.prev = _context39.next) {
  15869. case 0:
  15870. _ref31 = _args39.length > 0 && _args39[0] !== undefined ? _args39[0] : {}, n = _ref31.name, _ref31$data = _ref31.data, s = _ref31$data === void 0 ? {} : _ref31$data;
  15871. _context39.next = 3;
  15872. return t.prepare();
  15873. case 3:
  15874. _context39.next = 5;
  15875. return t.encryptData(s);
  15876. case 5:
  15877. r = _context39.sent;
  15878. _context39.next = 8;
  15879. return e({
  15880. name: n,
  15881. data: r
  15882. });
  15883. case 8:
  15884. i = _context39.sent;
  15885. if (!t.isClientKeyNotFound(i)) {
  15886. _context39.next = 21;
  15887. break;
  15888. }
  15889. _context39.next = 12;
  15890. return t.prepare({
  15891. forceUpdate: !0
  15892. });
  15893. case 12:
  15894. _context39.next = 14;
  15895. return t.encryptData(s);
  15896. case 14:
  15897. _r4 = _context39.sent;
  15898. _context39.next = 17;
  15899. return t.platformGetSignOption();
  15900. case 17:
  15901. s._uniCloudOptions = _context39.sent;
  15902. _context39.next = 20;
  15903. return e({
  15904. name: n,
  15905. data: _r4
  15906. });
  15907. case 20:
  15908. i = _context39.sent;
  15909. case 21:
  15910. _context39.next = 23;
  15911. return t.decryptResult(i.result);
  15912. case 23:
  15913. i.result = _context39.sent;
  15914. return _context39.abrupt("return", i);
  15915. case 25:
  15916. case "end":
  15917. return _context39.stop();
  15918. }
  15919. }
  15920. }, _callee39);
  15921. }));
  15922. }
  15923. }]);
  15924. return $t;
  15925. }();
  15926. /*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */
  15927. function Bt(e) {
  15928. return parseInt(e) === e;
  15929. }
  15930. function Wt(e) {
  15931. if (!Bt(e.length)) return !1;
  15932. for (var t = 0; t < e.length; t++) {
  15933. if (!Bt(e[t]) || e[t] < 0 || e[t] > 255) return !1;
  15934. }
  15935. return !0;
  15936. }
  15937. function Ht(e, t) {
  15938. if (e.buffer && "Uint8Array" === e.name) return t && (e = e.slice ? e.slice() : Array.prototype.slice.call(e)), e;
  15939. if (Array.isArray(e)) {
  15940. if (!Wt(e)) throw new Error("Array contains invalid value: " + e);
  15941. return new Uint8Array(e);
  15942. }
  15943. if (Bt(e.length) && Wt(e)) return new Uint8Array(e);
  15944. throw new Error("unsupported array-like object");
  15945. }
  15946. function zt(e) {
  15947. return new Uint8Array(e);
  15948. }
  15949. function Jt(e, t, n, s, r) {
  15950. null == s && null == r || (e = e.slice ? e.slice(s, r) : Array.prototype.slice.call(e, s, r)), t.set(e, n);
  15951. }
  15952. var Gt,
  15953. Vt = {
  15954. toBytes: function toBytes(e) {
  15955. var t = [],
  15956. n = 0;
  15957. for (e = encodeURI(e); n < e.length;) {
  15958. var s = e.charCodeAt(n++);
  15959. 37 === s ? (t.push(parseInt(e.substr(n, 2), 16)), n += 2) : t.push(s);
  15960. }
  15961. return Ht(t);
  15962. },
  15963. fromBytes: function fromBytes(e) {
  15964. for (var t = [], n = 0; n < e.length;) {
  15965. var s = e[n];
  15966. 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);
  15967. }
  15968. return t.join("");
  15969. }
  15970. },
  15971. Yt = (Gt = "0123456789abcdef", {
  15972. toBytes: function toBytes(e) {
  15973. for (var t = [], n = 0; n < e.length; n += 2) {
  15974. t.push(parseInt(e.substr(n, 2), 16));
  15975. }
  15976. return t;
  15977. },
  15978. fromBytes: function fromBytes(e) {
  15979. for (var t = [], n = 0; n < e.length; n++) {
  15980. var s = e[n];
  15981. t.push(Gt[(240 & s) >> 4] + Gt[15 & s]);
  15982. }
  15983. return t.join("");
  15984. }
  15985. }),
  15986. Qt = {
  15987. 16: 10,
  15988. 24: 12,
  15989. 32: 14
  15990. },
  15991. Xt = [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],
  15992. Zt = [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22],
  15993. en = [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],
  15994. tn = [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],
  15995. nn = [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],
  15996. sn = [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],
  15997. rn = [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],
  15998. on = [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],
  15999. an = [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],
  16000. cn = [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],
  16001. un = [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],
  16002. hn = [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],
  16003. ln = [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],
  16004. dn = [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],
  16005. pn = [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];
  16006. function fn(e) {
  16007. for (var t = [], n = 0; n < e.length; n += 4) {
  16008. t.push(e[n] << 24 | e[n + 1] << 16 | e[n + 2] << 8 | e[n + 3]);
  16009. }
  16010. return t;
  16011. }
  16012. var gn = /*#__PURE__*/function () {
  16013. function gn(e) {
  16014. (0, _classCallCheck2.default)(this, gn);
  16015. if (!(this instanceof gn)) throw Error("AES must be instanitated with `new`");
  16016. Object.defineProperty(this, "key", {
  16017. value: Ht(e, !0)
  16018. }), this._prepare();
  16019. }
  16020. (0, _createClass2.default)(gn, [{
  16021. key: "_prepare",
  16022. value: function _prepare() {
  16023. var e = Qt[this.key.length];
  16024. if (null == e) throw new Error("invalid key size (must be 16, 24 or 32 bytes)");
  16025. this._Ke = [], this._Kd = [];
  16026. for (var t = 0; t <= e; t++) {
  16027. this._Ke.push([0, 0, 0, 0]), this._Kd.push([0, 0, 0, 0]);
  16028. }
  16029. var n,
  16030. s = 4 * (e + 1),
  16031. r = this.key.length / 4,
  16032. i = fn(this.key);
  16033. for (t = 0; t < r; t++) {
  16034. n = t >> 2, this._Ke[n][t % 4] = i[t], this._Kd[e - n][t % 4] = i[t];
  16035. }
  16036. for (var o, a = 0, c = r; c < s;) {
  16037. if (o = i[r - 1], i[0] ^= Zt[o >> 16 & 255] << 24 ^ Zt[o >> 8 & 255] << 16 ^ Zt[255 & o] << 8 ^ Zt[o >> 24 & 255] ^ Xt[a] << 24, a += 1, 8 != r) for (t = 1; t < r; t++) {
  16038. i[t] ^= i[t - 1];
  16039. } else {
  16040. for (t = 1; t < r / 2; t++) {
  16041. i[t] ^= i[t - 1];
  16042. }
  16043. o = i[r / 2 - 1], i[r / 2] ^= Zt[255 & o] ^ Zt[o >> 8 & 255] << 8 ^ Zt[o >> 16 & 255] << 16 ^ Zt[o >> 24 & 255] << 24;
  16044. for (t = r / 2 + 1; t < r; t++) {
  16045. i[t] ^= i[t - 1];
  16046. }
  16047. }
  16048. for (t = 0; t < r && c < s;) {
  16049. u = c >> 2, h = c % 4, this._Ke[u][h] = i[t], this._Kd[e - u][h] = i[t++], c++;
  16050. }
  16051. }
  16052. for (var u = 1; u < e; u++) {
  16053. for (var h = 0; h < 4; h++) {
  16054. o = this._Kd[u][h], this._Kd[u][h] = hn[o >> 24 & 255] ^ ln[o >> 16 & 255] ^ dn[o >> 8 & 255] ^ pn[255 & o];
  16055. }
  16056. }
  16057. }
  16058. }, {
  16059. key: "encrypt",
  16060. value: function encrypt(e) {
  16061. if (16 != e.length) throw new Error("invalid plaintext size (must be 16 bytes)");
  16062. for (var t = this._Ke.length - 1, n = [0, 0, 0, 0], s = fn(e), r = 0; r < 4; r++) {
  16063. s[r] ^= this._Ke[0][r];
  16064. }
  16065. for (var i = 1; i < t; i++) {
  16066. for (r = 0; r < 4; r++) {
  16067. n[r] = tn[s[r] >> 24 & 255] ^ nn[s[(r + 1) % 4] >> 16 & 255] ^ sn[s[(r + 2) % 4] >> 8 & 255] ^ rn[255 & s[(r + 3) % 4]] ^ this._Ke[i][r];
  16068. }
  16069. s = n.slice();
  16070. }
  16071. var o,
  16072. a = zt(16);
  16073. for (r = 0; r < 4; r++) {
  16074. o = this._Ke[t][r], a[4 * r] = 255 & (Zt[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (Zt[s[(r + 1) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (Zt[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (Zt[255 & s[(r + 3) % 4]] ^ o);
  16075. }
  16076. return a;
  16077. }
  16078. }, {
  16079. key: "decrypt",
  16080. value: function decrypt(e) {
  16081. if (16 != e.length) throw new Error("invalid ciphertext size (must be 16 bytes)");
  16082. for (var t = this._Kd.length - 1, n = [0, 0, 0, 0], s = fn(e), r = 0; r < 4; r++) {
  16083. s[r] ^= this._Kd[0][r];
  16084. }
  16085. for (var i = 1; i < t; i++) {
  16086. for (r = 0; r < 4; r++) {
  16087. n[r] = on[s[r] >> 24 & 255] ^ an[s[(r + 3) % 4] >> 16 & 255] ^ cn[s[(r + 2) % 4] >> 8 & 255] ^ un[255 & s[(r + 1) % 4]] ^ this._Kd[i][r];
  16088. }
  16089. s = n.slice();
  16090. }
  16091. var o,
  16092. a = zt(16);
  16093. for (r = 0; r < 4; r++) {
  16094. o = this._Kd[t][r], a[4 * r] = 255 & (en[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (en[s[(r + 3) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (en[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (en[255 & s[(r + 1) % 4]] ^ o);
  16095. }
  16096. return a;
  16097. }
  16098. }]);
  16099. return gn;
  16100. }();
  16101. var mn = /*#__PURE__*/function () {
  16102. function mn(e) {
  16103. (0, _classCallCheck2.default)(this, mn);
  16104. if (!(this instanceof mn)) throw Error("AES must be instanitated with `new`");
  16105. this.description = "Electronic Code Block", this.name = "ecb", this._aes = new gn(e);
  16106. }
  16107. (0, _createClass2.default)(mn, [{
  16108. key: "encrypt",
  16109. value: function encrypt(e) {
  16110. if ((e = Ht(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  16111. for (var t = zt(e.length), n = zt(16), s = 0; s < e.length; s += 16) {
  16112. Jt(e, n, 0, s, s + 16), Jt(n = this._aes.encrypt(n), t, s);
  16113. }
  16114. return t;
  16115. }
  16116. }, {
  16117. key: "decrypt",
  16118. value: function decrypt(e) {
  16119. if ((e = Ht(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  16120. for (var t = zt(e.length), n = zt(16), s = 0; s < e.length; s += 16) {
  16121. Jt(e, n, 0, s, s + 16), Jt(n = this._aes.decrypt(n), t, s);
  16122. }
  16123. return t;
  16124. }
  16125. }]);
  16126. return mn;
  16127. }();
  16128. var yn = /*#__PURE__*/function () {
  16129. function yn(e, t) {
  16130. (0, _classCallCheck2.default)(this, yn);
  16131. if (!(this instanceof yn)) throw Error("AES must be instanitated with `new`");
  16132. if (this.description = "Cipher Block Chaining", this.name = "cbc", t) {
  16133. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  16134. } else t = zt(16);
  16135. this._lastCipherblock = Ht(t, !0), this._aes = new gn(e);
  16136. }
  16137. (0, _createClass2.default)(yn, [{
  16138. key: "encrypt",
  16139. value: function encrypt(e) {
  16140. if ((e = Ht(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  16141. for (var t = zt(e.length), n = zt(16), s = 0; s < e.length; s += 16) {
  16142. Jt(e, n, 0, s, s + 16);
  16143. for (var r = 0; r < 16; r++) {
  16144. n[r] ^= this._lastCipherblock[r];
  16145. }
  16146. this._lastCipherblock = this._aes.encrypt(n), Jt(this._lastCipherblock, t, s);
  16147. }
  16148. return t;
  16149. }
  16150. }, {
  16151. key: "decrypt",
  16152. value: function decrypt(e) {
  16153. if ((e = Ht(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  16154. for (var t = zt(e.length), n = zt(16), s = 0; s < e.length; s += 16) {
  16155. Jt(e, n, 0, s, s + 16), n = this._aes.decrypt(n);
  16156. for (var r = 0; r < 16; r++) {
  16157. t[s + r] = n[r] ^ this._lastCipherblock[r];
  16158. }
  16159. Jt(e, this._lastCipherblock, 0, s, s + 16);
  16160. }
  16161. return t;
  16162. }
  16163. }]);
  16164. return yn;
  16165. }();
  16166. var _n = /*#__PURE__*/function () {
  16167. function _n(e, t, n) {
  16168. (0, _classCallCheck2.default)(this, _n);
  16169. if (!(this instanceof _n)) throw Error("AES must be instanitated with `new`");
  16170. if (this.description = "Cipher Feedback", this.name = "cfb", t) {
  16171. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 size)");
  16172. } else t = zt(16);
  16173. n || (n = 1), this.segmentSize = n, this._shiftRegister = Ht(t, !0), this._aes = new gn(e);
  16174. }
  16175. (0, _createClass2.default)(_n, [{
  16176. key: "encrypt",
  16177. value: function encrypt(e) {
  16178. if (e.length % this.segmentSize != 0) throw new Error("invalid plaintext size (must be segmentSize bytes)");
  16179. for (var t, n = Ht(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  16180. t = this._aes.encrypt(this._shiftRegister);
  16181. for (var r = 0; r < this.segmentSize; r++) {
  16182. n[s + r] ^= t[r];
  16183. }
  16184. Jt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Jt(n, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  16185. }
  16186. return n;
  16187. }
  16188. }, {
  16189. key: "decrypt",
  16190. value: function decrypt(e) {
  16191. if (e.length % this.segmentSize != 0) throw new Error("invalid ciphertext size (must be segmentSize bytes)");
  16192. for (var t, n = Ht(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  16193. t = this._aes.encrypt(this._shiftRegister);
  16194. for (var r = 0; r < this.segmentSize; r++) {
  16195. n[s + r] ^= t[r];
  16196. }
  16197. Jt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Jt(e, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  16198. }
  16199. return n;
  16200. }
  16201. }]);
  16202. return _n;
  16203. }();
  16204. var wn = /*#__PURE__*/function () {
  16205. function wn(e, t) {
  16206. (0, _classCallCheck2.default)(this, wn);
  16207. if (!(this instanceof wn)) throw Error("AES must be instanitated with `new`");
  16208. if (this.description = "Output Feedback", this.name = "ofb", t) {
  16209. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  16210. } else t = zt(16);
  16211. this._lastPrecipher = Ht(t, !0), this._lastPrecipherIndex = 16, this._aes = new gn(e);
  16212. }
  16213. (0, _createClass2.default)(wn, [{
  16214. key: "encrypt",
  16215. value: function encrypt(e) {
  16216. for (var t = Ht(e, !0), n = 0; n < t.length; n++) {
  16217. 16 === this._lastPrecipherIndex && (this._lastPrecipher = this._aes.encrypt(this._lastPrecipher), this._lastPrecipherIndex = 0), t[n] ^= this._lastPrecipher[this._lastPrecipherIndex++];
  16218. }
  16219. return t;
  16220. }
  16221. }, {
  16222. key: "decrypt",
  16223. value: function decrypt(e) {
  16224. return this.encrypt(e);
  16225. }
  16226. }]);
  16227. return wn;
  16228. }();
  16229. var vn = /*#__PURE__*/function () {
  16230. function vn(e) {
  16231. (0, _classCallCheck2.default)(this, vn);
  16232. if (!(this instanceof vn)) throw Error("Counter must be instanitated with `new`");
  16233. 0 === e || e || (e = 1), "number" == typeof e ? (this._counter = zt(16), this.setValue(e)) : this.setBytes(e);
  16234. }
  16235. (0, _createClass2.default)(vn, [{
  16236. key: "setValue",
  16237. value: function setValue(e) {
  16238. if ("number" != typeof e || parseInt(e) != e) throw new Error("invalid counter value (must be an integer)");
  16239. if (e > Number.MAX_SAFE_INTEGER) throw new Error("integer value out of safe range");
  16240. for (var t = 15; t >= 0; --t) {
  16241. this._counter[t] = e % 256, e = parseInt(e / 256);
  16242. }
  16243. }
  16244. }, {
  16245. key: "setBytes",
  16246. value: function setBytes(e) {
  16247. if (16 != (e = Ht(e, !0)).length) throw new Error("invalid counter bytes size (must be 16 bytes)");
  16248. this._counter = e;
  16249. }
  16250. }, {
  16251. key: "increment",
  16252. value: function increment() {
  16253. for (var e = 15; e >= 0; e--) {
  16254. if (255 !== this._counter[e]) {
  16255. this._counter[e]++;
  16256. break;
  16257. }
  16258. this._counter[e] = 0;
  16259. }
  16260. }
  16261. }]);
  16262. return vn;
  16263. }();
  16264. var In = /*#__PURE__*/function () {
  16265. function In(e, t) {
  16266. (0, _classCallCheck2.default)(this, In);
  16267. if (!(this instanceof In)) throw Error("AES must be instanitated with `new`");
  16268. this.description = "Counter", this.name = "ctr", t instanceof vn || (t = new vn(t)), this._counter = t, this._remainingCounter = null, this._remainingCounterIndex = 16, this._aes = new gn(e);
  16269. }
  16270. (0, _createClass2.default)(In, [{
  16271. key: "encrypt",
  16272. value: function encrypt(e) {
  16273. for (var t = Ht(e, !0), n = 0; n < t.length; n++) {
  16274. 16 === this._remainingCounterIndex && (this._remainingCounter = this._aes.encrypt(this._counter._counter), this._remainingCounterIndex = 0, this._counter.increment()), t[n] ^= this._remainingCounter[this._remainingCounterIndex++];
  16275. }
  16276. return t;
  16277. }
  16278. }, {
  16279. key: "decrypt",
  16280. value: function decrypt(e) {
  16281. return this.encrypt(e);
  16282. }
  16283. }]);
  16284. return In;
  16285. }();
  16286. var Sn = {
  16287. AES: gn,
  16288. Counter: vn,
  16289. ModeOfOperation: {
  16290. ecb: mn,
  16291. cbc: yn,
  16292. cfb: _n,
  16293. ofb: wn,
  16294. ctr: In
  16295. },
  16296. utils: {
  16297. hex: Yt,
  16298. utf8: Vt
  16299. },
  16300. padding: {
  16301. pkcs7: {
  16302. pad: function pad(e) {
  16303. var t = 16 - (e = Ht(e, !0)).length % 16,
  16304. n = zt(e.length + t);
  16305. Jt(e, n);
  16306. for (var s = e.length; s < n.length; s++) {
  16307. n[s] = t;
  16308. }
  16309. return n;
  16310. },
  16311. strip: function strip(e) {
  16312. if ((e = Ht(e, !0)).length < 16) throw new Error("PKCS#7 invalid length");
  16313. var t = e[e.length - 1];
  16314. if (t > 16) throw new Error("PKCS#7 padding byte out of range");
  16315. for (var n = e.length - t, s = 0; s < t; s++) {
  16316. if (e[n + s] !== t) throw new Error("PKCS#7 invalid padding byte");
  16317. }
  16318. var r = zt(n);
  16319. return Jt(e, r, 0, 0, n), r;
  16320. }
  16321. }
  16322. },
  16323. _arrayTest: {
  16324. coerceArray: Ht,
  16325. createArray: zt,
  16326. copyArray: Jt
  16327. }
  16328. };
  16329. function bn(e, t, n) {
  16330. var s = new Uint8Array(uni.base64ToArrayBuffer(t)),
  16331. r = Sn.utils.utf8.toBytes(n),
  16332. i = Sn.utils.utf8.toBytes(e),
  16333. o = new Sn.ModeOfOperation.cbc(s, r),
  16334. a = Sn.padding.pkcs7.pad(i),
  16335. c = o.encrypt(a);
  16336. return uni.arrayBufferToBase64(c);
  16337. }
  16338. var kn = {
  16339. code: 2e4,
  16340. message: "System error"
  16341. },
  16342. An = {
  16343. code: 20101,
  16344. message: "Invalid client"
  16345. },
  16346. Pn = {
  16347. code: 20102,
  16348. message: "Get encrypt key failed"
  16349. },
  16350. Tn = {
  16351. 10001: "Secure network is not supported on current playground or unimpsdk",
  16352. 10003: "Config missing in current app. If the problem pesist, please contact DCloud.",
  16353. 10009: "Encrypt payload failed",
  16354. 10010: "Decrypt response failed"
  16355. };
  16356. function Cn(e) {
  16357. var _ref32 = e || {},
  16358. t = _ref32.errSubject,
  16359. n = _ref32.subject,
  16360. s = _ref32.errCode,
  16361. r = _ref32.errMsg,
  16362. i = _ref32.code,
  16363. o = _ref32.message,
  16364. a = _ref32.cause;
  16365. return new te({
  16366. subject: t || n || "uni-secure-network",
  16367. code: s || i || kn.code,
  16368. message: r || o,
  16369. cause: a
  16370. });
  16371. }
  16372. var xn,
  16373. On,
  16374. En = null;
  16375. var Ln = /*#__PURE__*/function (_$t) {
  16376. (0, _inherits2.default)(Ln, _$t);
  16377. var _super9 = _createSuper(Ln);
  16378. function Ln(e) {
  16379. var _this15;
  16380. (0, _classCallCheck2.default)(this, Ln);
  16381. _this15 = _super9.call(this, e), _this15.clientType = "mp-weixin", _this15.userEncryptKey = null;
  16382. return _this15;
  16383. }
  16384. (0, _createClass2.default)(Ln, [{
  16385. key: "isLogin",
  16386. value: function isLogin() {
  16387. return !!this.scopedGlobalCache.mpWeixinCode || !!this.scopedGlobalCache.mpWeixinOpenid;
  16388. }
  16389. }, {
  16390. key: "prepare",
  16391. value: function () {
  16392. var _prepare2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40() {
  16393. return _regenerator.default.wrap(function _callee40$(_context40) {
  16394. while (1) {
  16395. switch (_context40.prev = _context40.next) {
  16396. case 0:
  16397. if (this.isLogin()) {
  16398. _context40.next = 7;
  16399. break;
  16400. }
  16401. if (this.scopedGlobalCache.initPromise) {
  16402. _context40.next = 3;
  16403. break;
  16404. }
  16405. throw new Error("`uniCloud.initSecureNetworkByWeixin` has not yet been called");
  16406. case 3:
  16407. _context40.next = 5;
  16408. return this.scopedGlobalCache.initPromise;
  16409. case 5:
  16410. if (this.isLogin()) {
  16411. _context40.next = 7;
  16412. break;
  16413. }
  16414. throw new Error("uniCloud.initSecureNetworkByWeixin` has not yet been called or successfully excuted");
  16415. case 7:
  16416. case "end":
  16417. return _context40.stop();
  16418. }
  16419. }
  16420. }, _callee40, this);
  16421. }));
  16422. function prepare() {
  16423. return _prepare2.apply(this, arguments);
  16424. }
  16425. return prepare;
  16426. }()
  16427. }, {
  16428. key: "getUserEncryptKey",
  16429. value: function () {
  16430. var _getUserEncryptKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41() {
  16431. var _this16 = this;
  16432. var e;
  16433. return _regenerator.default.wrap(function _callee41$(_context41) {
  16434. while (1) {
  16435. switch (_context41.prev = _context41.next) {
  16436. case 0:
  16437. if (!this.userEncryptKey) {
  16438. _context41.next = 2;
  16439. break;
  16440. }
  16441. return _context41.abrupt("return", this.userEncryptKey);
  16442. case 2:
  16443. if (!(En && En.expireTime)) {
  16444. _context41.next = 6;
  16445. break;
  16446. }
  16447. e = Date.now();
  16448. if (!(En.expireTime - e > 0)) {
  16449. _context41.next = 6;
  16450. break;
  16451. }
  16452. return _context41.abrupt("return", (this.userEncryptKey = En, this.userEncryptKey));
  16453. case 6:
  16454. return _context41.abrupt("return", new Promise(function (e, t) {
  16455. uni.getUserCryptoManager().getLatestUserKey({
  16456. success: function success(t) {
  16457. En = t, _this16.userEncryptKey = t, e(_this16.userEncryptKey);
  16458. },
  16459. fail: function fail(e) {
  16460. t(Cn(_objectSpread(_objectSpread({}, Pn), {}, {
  16461. cause: e
  16462. })));
  16463. }
  16464. });
  16465. }));
  16466. case 7:
  16467. case "end":
  16468. return _context41.stop();
  16469. }
  16470. }
  16471. }, _callee41, this);
  16472. }));
  16473. function getUserEncryptKey() {
  16474. return _getUserEncryptKey.apply(this, arguments);
  16475. }
  16476. return getUserEncryptKey;
  16477. }()
  16478. }, {
  16479. key: "getWxAppId",
  16480. value: function getWxAppId() {
  16481. return wx.getAccountInfoSync().miniProgram.appId;
  16482. }
  16483. }, {
  16484. key: "platformGetSignOption",
  16485. value: function () {
  16486. var _platformGetSignOption = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42() {
  16487. var _yield$this$getUserEn, e, t, n;
  16488. return _regenerator.default.wrap(function _callee42$(_context42) {
  16489. while (1) {
  16490. switch (_context42.prev = _context42.next) {
  16491. case 0:
  16492. _context42.next = 2;
  16493. return this.getUserEncryptKey();
  16494. case 2:
  16495. _yield$this$getUserEn = _context42.sent;
  16496. e = _yield$this$getUserEn.encryptKey;
  16497. t = _yield$this$getUserEn.iv;
  16498. n = _yield$this$getUserEn.version;
  16499. return _context42.abrupt("return", {
  16500. verifyClientSign: bn(JSON.stringify({
  16501. data: JSON.stringify({}),
  16502. appId: this.appId,
  16503. deviceId: this.deviceId,
  16504. wxAppId: this.getWxAppId(),
  16505. simulator: "devtools" === ae().platform,
  16506. timestamp: Date.now()
  16507. }), e, t),
  16508. encryptKeyId: n,
  16509. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  16510. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  16511. });
  16512. case 7:
  16513. case "end":
  16514. return _context42.stop();
  16515. }
  16516. }
  16517. }, _callee42, this);
  16518. }));
  16519. function platformGetSignOption() {
  16520. return _platformGetSignOption.apply(this, arguments);
  16521. }
  16522. return platformGetSignOption;
  16523. }()
  16524. }, {
  16525. key: "platformEncryptData",
  16526. value: function () {
  16527. var _platformEncryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43(e) {
  16528. var _yield$this$getUserEn2, t, n, s, r;
  16529. return _regenerator.default.wrap(function _callee43$(_context43) {
  16530. while (1) {
  16531. switch (_context43.prev = _context43.next) {
  16532. case 0:
  16533. _context43.next = 2;
  16534. return this.getUserEncryptKey();
  16535. case 2:
  16536. _yield$this$getUserEn2 = _context43.sent;
  16537. t = _yield$this$getUserEn2.encryptKey;
  16538. n = _yield$this$getUserEn2.iv;
  16539. s = _yield$this$getUserEn2.version;
  16540. r = {
  16541. secretType: this.secretType,
  16542. encryptKeyId: s,
  16543. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  16544. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  16545. };
  16546. return _context43.abrupt("return", this.secretType === Kt ? {
  16547. content: e,
  16548. _uniCloudOptions: r
  16549. } : {
  16550. content: bn(JSON.stringify({
  16551. data: JSON.stringify(e),
  16552. appId: this.appId,
  16553. deviceId: this.deviceId,
  16554. wxAppId: this.getWxAppId(),
  16555. simulator: "devtools" === ae().platform,
  16556. timestamp: Date.now()
  16557. }), t, n),
  16558. _uniCloudOptions: r
  16559. });
  16560. case 8:
  16561. case "end":
  16562. return _context43.stop();
  16563. }
  16564. }
  16565. }, _callee43, this);
  16566. }));
  16567. function platformEncryptData(_x35) {
  16568. return _platformEncryptData.apply(this, arguments);
  16569. }
  16570. return platformEncryptData;
  16571. }()
  16572. }, {
  16573. key: "platformDecryptResult",
  16574. value: function () {
  16575. var _platformDecryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44(e) {
  16576. var t, _yield$this$getUserEn3, n, s;
  16577. return _regenerator.default.wrap(function _callee44$(_context44) {
  16578. while (1) {
  16579. switch (_context44.prev = _context44.next) {
  16580. case 0:
  16581. t = e.content;
  16582. _context44.next = 3;
  16583. return this.getUserEncryptKey();
  16584. case 3:
  16585. _yield$this$getUserEn3 = _context44.sent;
  16586. n = _yield$this$getUserEn3.encryptKey;
  16587. s = _yield$this$getUserEn3.iv;
  16588. return _context44.abrupt("return", JSON.parse(function (e, t, n) {
  16589. var s = new Uint8Array(uni.base64ToArrayBuffer(e)),
  16590. r = new Uint8Array(uni.base64ToArrayBuffer(t)),
  16591. i = Sn.utils.utf8.toBytes(n),
  16592. o = new Sn.ModeOfOperation.cbc(r, i),
  16593. a = Sn.padding.pkcs7.strip(o.decrypt(s));
  16594. return Sn.utils.utf8.fromBytes(a);
  16595. }(t, n, s)));
  16596. case 7:
  16597. case "end":
  16598. return _context44.stop();
  16599. }
  16600. }
  16601. }, _callee44, this);
  16602. }));
  16603. function platformDecryptResult(_x36) {
  16604. return _platformDecryptResult.apply(this, arguments);
  16605. }
  16606. return platformDecryptResult;
  16607. }()
  16608. }, {
  16609. key: "isClientKeyNotFound",
  16610. value: function isClientKeyNotFound() {
  16611. return !1;
  16612. }
  16613. }]);
  16614. return Ln;
  16615. }($t);
  16616. function Rn(e) {
  16617. var t = ["hasClientKey", "encryptGetClientKeyPayload", "setClientKey", "encrypt", "decrypt"],
  16618. n = {};
  16619. var _loop = function _loop(_s11) {
  16620. var r = t[_s11];
  16621. n[r] = function () {
  16622. for (var _len = arguments.length, t = new Array(_len), _key = 0; _key < _len; _key++) {
  16623. t[_key] = arguments[_key];
  16624. }
  16625. return new Promise(function (n, s) {
  16626. "function" == typeof e[r] ? e[r].apply(e, t.concat([function () {
  16627. var _ref33 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16628. e = _ref33.type,
  16629. t = _ref33.data,
  16630. r = _ref33.errCode,
  16631. i = _ref33.errMsg,
  16632. o = _ref33.errSubject,
  16633. a = _ref33.message;
  16634. "success" === e ? n(t) : s(Cn({
  16635. errCode: r,
  16636. errMsg: Tn[r] || i || a,
  16637. errSubject: o
  16638. }));
  16639. }])) : s(Cn({
  16640. message: "请检查manifest.json内是否开启安全网络模块,另外注意标准基座不支持安全网络模块"
  16641. }));
  16642. });
  16643. };
  16644. };
  16645. for (var _s11 = 0; _s11 < t.length; _s11++) {
  16646. _loop(_s11);
  16647. }
  16648. return n;
  16649. }
  16650. var Un = /*#__PURE__*/function (_$t2) {
  16651. (0, _inherits2.default)(Un, _$t2);
  16652. var _super10 = _createSuper(Un);
  16653. function Un(e) {
  16654. var _this17;
  16655. (0, _classCallCheck2.default)(this, Un);
  16656. _this17 = _super10.call(this, e), _this17.clientType = "app", _this17.appUtils = _objectSpread({}, Rn(uni.requireNativePlugin("plus"))), _this17.systemInfo = xn || (xn = ae());
  16657. return _this17;
  16658. }
  16659. (0, _createClass2.default)(Un, [{
  16660. key: "hasClientKey",
  16661. value: function () {
  16662. var _hasClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45() {
  16663. return _regenerator.default.wrap(function _callee45$(_context45) {
  16664. while (1) {
  16665. switch (_context45.prev = _context45.next) {
  16666. case 0:
  16667. _context45.next = 2;
  16668. return this.appUtils.hasClientKey({
  16669. provider: this.provider,
  16670. spaceId: this.spaceId
  16671. });
  16672. case 2:
  16673. this._hasClientKey = _context45.sent;
  16674. return _context45.abrupt("return", this._hasClientKey);
  16675. case 4:
  16676. case "end":
  16677. return _context45.stop();
  16678. }
  16679. }
  16680. }, _callee45, this);
  16681. }));
  16682. function hasClientKey() {
  16683. return _hasClientKey.apply(this, arguments);
  16684. }
  16685. return hasClientKey;
  16686. }()
  16687. }, {
  16688. key: "getAppClientKey",
  16689. value: function () {
  16690. var _getAppClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46() {
  16691. var _yield$this$appUtils$, e, t, n, s, r;
  16692. return _regenerator.default.wrap(function _callee46$(_context46) {
  16693. while (1) {
  16694. switch (_context46.prev = _context46.next) {
  16695. case 0:
  16696. _context46.next = 2;
  16697. return this.appUtils.encryptGetClientKeyPayload({
  16698. data: JSON.stringify({})
  16699. });
  16700. case 2:
  16701. _yield$this$appUtils$ = _context46.sent;
  16702. e = _yield$this$appUtils$.data;
  16703. t = _yield$this$appUtils$.key;
  16704. _context46.next = 7;
  16705. return this.uniCloudIns.callFunction({
  16706. name: "DCloud-clientDB",
  16707. data: {
  16708. redirectTo: "encryption",
  16709. action: "getAppClientKey",
  16710. data: e,
  16711. key: t
  16712. }
  16713. });
  16714. case 7:
  16715. _context46.t0 = _context46.sent.result;
  16716. if (_context46.t0) {
  16717. _context46.next = 10;
  16718. break;
  16719. }
  16720. _context46.t0 = {};
  16721. case 10:
  16722. n = _context46.t0;
  16723. if (!(0 !== n.errCode)) {
  16724. _context46.next = 13;
  16725. break;
  16726. }
  16727. throw function (e) {
  16728. return new te({
  16729. subject: e.errSubject || "uni-secure-network",
  16730. code: e.errCode || e.code || kn.code,
  16731. message: e.errMsg || e.message
  16732. });
  16733. }(n);
  16734. case 13:
  16735. s = n.clientKey, r = n.key;
  16736. _context46.next = 16;
  16737. return this.appUtils.setClientKey({
  16738. provider: this.provider,
  16739. spaceId: this.spaceId,
  16740. clientKey: s,
  16741. key: r
  16742. });
  16743. case 16:
  16744. case "end":
  16745. return _context46.stop();
  16746. }
  16747. }
  16748. }, _callee46, this);
  16749. }));
  16750. function getAppClientKey() {
  16751. return _getAppClientKey.apply(this, arguments);
  16752. }
  16753. return getAppClientKey;
  16754. }()
  16755. }, {
  16756. key: "ensureClientKey",
  16757. value: function () {
  16758. var _ensureClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47() {
  16759. var _this18 = this;
  16760. var _ref34,
  16761. _ref34$forceUpdate,
  16762. e,
  16763. _args47 = arguments;
  16764. return _regenerator.default.wrap(function _callee47$(_context47) {
  16765. while (1) {
  16766. switch (_context47.prev = _context47.next) {
  16767. case 0:
  16768. _ref34 = _args47.length > 0 && _args47[0] !== undefined ? _args47[0] : {}, _ref34$forceUpdate = _ref34.forceUpdate, e = _ref34$forceUpdate === void 0 ? !1 : _ref34$forceUpdate;
  16769. _context47.t1 = !0;
  16770. _context47.next = 4;
  16771. return this.hasClientKey();
  16772. case 4:
  16773. _context47.t2 = _context47.sent;
  16774. _context47.t0 = _context47.t1 !== _context47.t2;
  16775. if (_context47.t0) {
  16776. _context47.next = 8;
  16777. break;
  16778. }
  16779. _context47.t0 = e;
  16780. case 8:
  16781. if (!_context47.t0) {
  16782. _context47.next = 10;
  16783. break;
  16784. }
  16785. return _context47.abrupt("return", (e && this.scopedGlobalCache.initPromise && this.scopedGlobalCache.initStatus === l || !e && this.scopedGlobalCache.initPromise && this.scopedGlobalCache.initStatus !== p || (this.scopedGlobalCache.initPromise = this.getAppClientKey(), this.scopedGlobalCache.initPromise.then(function (e) {
  16786. _this18.scopedGlobalCache.initStatus = d;
  16787. }).catch(function (e) {
  16788. throw _this18.scopedGlobalCache.initStatus = p, e;
  16789. }), this.scopedGlobalCache.initStatus = l), this.scopedGlobalCache.initPromise));
  16790. case 10:
  16791. case "end":
  16792. return _context47.stop();
  16793. }
  16794. }
  16795. }, _callee47, this);
  16796. }));
  16797. function ensureClientKey() {
  16798. return _ensureClientKey.apply(this, arguments);
  16799. }
  16800. return ensureClientKey;
  16801. }()
  16802. }, {
  16803. key: "prepare",
  16804. value: function () {
  16805. var _prepare3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48() {
  16806. var _ref35,
  16807. _ref35$forceUpdate,
  16808. e,
  16809. _args48 = arguments;
  16810. return _regenerator.default.wrap(function _callee48$(_context48) {
  16811. while (1) {
  16812. switch (_context48.prev = _context48.next) {
  16813. case 0:
  16814. _ref35 = _args48.length > 0 && _args48[0] !== undefined ? _args48[0] : {}, _ref35$forceUpdate = _ref35.forceUpdate, e = _ref35$forceUpdate === void 0 ? !1 : _ref35$forceUpdate;
  16815. _context48.next = 3;
  16816. return this.ensureClientKey({
  16817. forceUpdate: e
  16818. });
  16819. case 3:
  16820. case "end":
  16821. return _context48.stop();
  16822. }
  16823. }
  16824. }, _callee48, this);
  16825. }));
  16826. function prepare() {
  16827. return _prepare3.apply(this, arguments);
  16828. }
  16829. return prepare;
  16830. }()
  16831. }, {
  16832. key: "platformGetSignOption",
  16833. value: function () {
  16834. var _platformGetSignOption2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49() {
  16835. var _yield$this$appUtils$2, e, t;
  16836. return _regenerator.default.wrap(function _callee49$(_context49) {
  16837. while (1) {
  16838. switch (_context49.prev = _context49.next) {
  16839. case 0:
  16840. _context49.next = 2;
  16841. return this.appUtils.encrypt({
  16842. provider: this.provider,
  16843. spaceId: this.spaceId,
  16844. data: JSON.stringify({})
  16845. });
  16846. case 2:
  16847. _yield$this$appUtils$2 = _context49.sent;
  16848. e = _yield$this$appUtils$2.data;
  16849. t = _yield$this$appUtils$2.key;
  16850. return _context49.abrupt("return", {
  16851. verifyClientSign: e,
  16852. encryptKeyId: t
  16853. });
  16854. case 6:
  16855. case "end":
  16856. return _context49.stop();
  16857. }
  16858. }
  16859. }, _callee49, this);
  16860. }));
  16861. function platformGetSignOption() {
  16862. return _platformGetSignOption2.apply(this, arguments);
  16863. }
  16864. return platformGetSignOption;
  16865. }()
  16866. }, {
  16867. key: "platformEncryptData",
  16868. value: function () {
  16869. var _platformEncryptData2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50(e) {
  16870. var _yield$this$appUtils$3, t, n, s;
  16871. return _regenerator.default.wrap(function _callee50$(_context50) {
  16872. while (1) {
  16873. switch (_context50.prev = _context50.next) {
  16874. case 0:
  16875. _context50.next = 2;
  16876. return this.appUtils.encrypt({
  16877. provider: this.provider,
  16878. spaceId: this.spaceId,
  16879. data: JSON.stringify(e)
  16880. });
  16881. case 2:
  16882. _yield$this$appUtils$3 = _context50.sent;
  16883. t = _yield$this$appUtils$3.data;
  16884. n = _yield$this$appUtils$3.key;
  16885. s = {
  16886. secretType: this.secretType,
  16887. encryptKeyId: n
  16888. };
  16889. return _context50.abrupt("return", this.secretType === Kt ? {
  16890. content: e,
  16891. _uniCloudOptions: s
  16892. } : {
  16893. content: t,
  16894. _uniCloudOptions: s
  16895. });
  16896. case 7:
  16897. case "end":
  16898. return _context50.stop();
  16899. }
  16900. }
  16901. }, _callee50, this);
  16902. }));
  16903. function platformEncryptData(_x37) {
  16904. return _platformEncryptData2.apply(this, arguments);
  16905. }
  16906. return platformEncryptData;
  16907. }()
  16908. }, {
  16909. key: "platformDecryptResult",
  16910. value: function () {
  16911. var _platformDecryptResult2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51(e) {
  16912. var t, _e$_uniCloudOptions, n, s, r;
  16913. return _regenerator.default.wrap(function _callee51$(_context51) {
  16914. while (1) {
  16915. switch (_context51.prev = _context51.next) {
  16916. case 0:
  16917. t = e.content;
  16918. _e$_uniCloudOptions = e._uniCloudOptions;
  16919. n = _e$_uniCloudOptions === void 0 ? {} : _e$_uniCloudOptions;
  16920. s = n.encryptKeyId;
  16921. _context51.next = 6;
  16922. return this.appUtils.decrypt({
  16923. provider: this.provider,
  16924. spaceId: this.spaceId,
  16925. data: t,
  16926. key: s
  16927. });
  16928. case 6:
  16929. r = _context51.sent;
  16930. return _context51.abrupt("return", JSON.parse(r.data));
  16931. case 8:
  16932. case "end":
  16933. return _context51.stop();
  16934. }
  16935. }
  16936. }, _callee51, this);
  16937. }));
  16938. function platformDecryptResult(_x38) {
  16939. return _platformDecryptResult2.apply(this, arguments);
  16940. }
  16941. return platformDecryptResult;
  16942. }()
  16943. }, {
  16944. key: "isClientKeyNotFound",
  16945. value: function isClientKeyNotFound() {
  16946. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  16947. var t = e.result || {};
  16948. return 70009 === t.errCode && "uni-secure-network" === t.errSubject;
  16949. }
  16950. }]);
  16951. return Un;
  16952. }($t);
  16953. function Nn() {
  16954. var _ref36 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16955. e = _ref36.secretType;
  16956. return e === Ft || e === Kt || e === jt;
  16957. }
  16958. function Dn() {
  16959. var _ref37 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16960. e = _ref37.name,
  16961. _ref37$data = _ref37.data,
  16962. t = _ref37$data === void 0 ? {} : _ref37$data;
  16963. return "app" === P && "DCloud-clientDB" === e && "encryption" === t.redirectTo && "getAppClientKey" === t.action;
  16964. }
  16965. function Mn() {
  16966. var _ref38 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16967. e = _ref38.provider,
  16968. t = _ref38.spaceId,
  16969. n = _ref38.functionName;
  16970. var _ae = ae(),
  16971. s = _ae.appId,
  16972. r = _ae.uniPlatform,
  16973. i = _ae.osName;
  16974. var o = r;
  16975. "app" === r && (o = i);
  16976. var a = function () {
  16977. var _ref39 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16978. e = _ref39.provider,
  16979. t = _ref39.spaceId;
  16980. var n = A;
  16981. if (!n) return {};
  16982. e = function (e) {
  16983. return "tencent" === e ? "tcb" : e;
  16984. }(e);
  16985. var s = n.find(function (n) {
  16986. return n.provider === e && n.spaceId === t;
  16987. });
  16988. return s && s.config;
  16989. }({
  16990. provider: e,
  16991. spaceId: t
  16992. });
  16993. if (!a || !a.accessControl || !a.accessControl.enable) return !1;
  16994. var c = a.accessControl.function || {},
  16995. u = Object.keys(c);
  16996. if (0 === u.length) return !0;
  16997. var h = function (e, t) {
  16998. var n, s, r;
  16999. for (var _i2 = 0; _i2 < e.length; _i2++) {
  17000. var _o2 = e[_i2];
  17001. _o2 !== t ? "*" !== _o2 ? _o2.split(",").map(function (e) {
  17002. return e.trim();
  17003. }).indexOf(t) > -1 && (s = _o2) : r = _o2 : n = _o2;
  17004. }
  17005. return n || s || r;
  17006. }(u, n);
  17007. if (!h) return !1;
  17008. if ((c[h] || []).find(function () {
  17009. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  17010. return e.appId === s && (e.platform || "").toLowerCase() === o.toLowerCase();
  17011. })) return !0;
  17012. 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")), Cn(An);
  17013. }
  17014. function qn(_ref40) {
  17015. var e = _ref40.functionName,
  17016. t = _ref40.result,
  17017. n = _ref40.logPvd;
  17018. if (S && this.__dev__.debugLog && t && t.requestId) {
  17019. var _s12 = JSON.stringify({
  17020. spaceId: this.config.spaceId,
  17021. functionName: e,
  17022. requestId: t.requestId
  17023. });
  17024. console.log("[".concat(n, "-request]").concat(_s12, "[/").concat(n, "-request]"));
  17025. }
  17026. }
  17027. function Fn(e) {
  17028. var t = e.callFunction,
  17029. n = function n(_n8) {
  17030. var _this19 = this;
  17031. var s = _n8.name;
  17032. _n8.data = Lt.call(e, {
  17033. data: _n8.data
  17034. });
  17035. var r = {
  17036. aliyun: "aliyun",
  17037. tencent: "tcb",
  17038. tcb: "tcb",
  17039. alipay: "alipay"
  17040. }[this.config.provider],
  17041. i = Nn(_n8),
  17042. o = Dn(_n8),
  17043. a = i || o;
  17044. return t.call(this, _n8).then(function (e) {
  17045. return e.errCode = 0, !a && qn.call(_this19, {
  17046. functionName: s,
  17047. result: e,
  17048. logPvd: r
  17049. }), Promise.resolve(e);
  17050. }, function (e) {
  17051. return !a && qn.call(_this19, {
  17052. functionName: s,
  17053. result: e,
  17054. logPvd: r
  17055. }), e && e.message && (e.message = function () {
  17056. var _ref41 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17057. _ref41$message = _ref41.message,
  17058. e = _ref41$message === void 0 ? "" : _ref41$message,
  17059. _ref41$extraInfo = _ref41.extraInfo,
  17060. t = _ref41$extraInfo === void 0 ? {} : _ref41$extraInfo,
  17061. _ref41$formatter = _ref41.formatter,
  17062. n = _ref41$formatter === void 0 ? [] : _ref41$formatter;
  17063. for (var _s13 = 0; _s13 < n.length; _s13++) {
  17064. var _n$_s = n[_s13],
  17065. _r5 = _n$_s.rule,
  17066. _i3 = _n$_s.content,
  17067. _o3 = _n$_s.mode,
  17068. _a = e.match(_r5);
  17069. if (!_a) continue;
  17070. var _c = _i3;
  17071. for (var _e19 = 1; _e19 < _a.length; _e19++) {
  17072. _c = Mt(_c, "{$".concat(_e19, "}"), _a[_e19]);
  17073. }
  17074. for (var _e20 in t) {
  17075. _c = Mt(_c, "{".concat(_e20, "}"), t[_e20]);
  17076. }
  17077. return "replace" === _o3 ? _c : e + _c;
  17078. }
  17079. return e;
  17080. }({
  17081. message: "[".concat(_n8.name, "]: ").concat(e.message),
  17082. formatter: Ut,
  17083. extraInfo: {
  17084. functionName: s
  17085. }
  17086. })), Promise.reject(e);
  17087. });
  17088. };
  17089. e.callFunction = function (t) {
  17090. var _e$config = e.config,
  17091. s = _e$config.provider,
  17092. r = _e$config.spaceId,
  17093. i = t.name;
  17094. var o, a;
  17095. if (t.data = t.data || {}, S && e.__dev__.debugInfo && !e.__dev__.debugInfo.forceRemote && C ? (e._callCloudFunction || (e._callCloudFunction = n, e._callLocalFunction = Rt), o = Rt) : o = n, o = o.bind(e), Dn(t)) a = n.call(e, t);else if (function (_ref42) {
  17096. var e = _ref42.name,
  17097. _ref42$data = _ref42.data,
  17098. t = _ref42$data === void 0 ? {} : _ref42$data;
  17099. return "mp-weixin" === P && "uni-id-co" === e && "secureNetworkHandshakeByWeixin" === t.method;
  17100. }(t)) a = o.call(e, t);else if (Nn(t)) {
  17101. a = new On({
  17102. secretType: t.secretType,
  17103. uniCloudIns: e
  17104. }).wrapEncryptDataCallFunction(n.bind(e))(t);
  17105. } else if (Mn({
  17106. provider: s,
  17107. spaceId: r,
  17108. functionName: i
  17109. })) {
  17110. a = new On({
  17111. secretType: t.secretType,
  17112. uniCloudIns: e
  17113. }).wrapVerifyClientCallFunction(n.bind(e))(t);
  17114. } else a = o(t);
  17115. return Object.defineProperty(a, "result", {
  17116. get: function get() {
  17117. return console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {};
  17118. }
  17119. }), a;
  17120. };
  17121. }
  17122. On = "mp-weixin" !== P && "app" !== P ? /*#__PURE__*/function () {
  17123. function _class2() {
  17124. (0, _classCallCheck2.default)(this, _class2);
  17125. throw Cn({
  17126. message: "Platform ".concat(P, " is not supported by secure network")
  17127. });
  17128. }
  17129. return (0, _createClass2.default)(_class2);
  17130. }() : k ? "mp-weixin" === P ? Ln : Un : /*#__PURE__*/function () {
  17131. function _class3() {
  17132. (0, _classCallCheck2.default)(this, _class3);
  17133. throw Cn({
  17134. message: "Platform ".concat(P, " is not enabled, please check whether secure network module is enabled in your manifest.json")
  17135. });
  17136. }
  17137. return (0, _createClass2.default)(_class3);
  17138. }();
  17139. var Kn = Symbol("CLIENT_DB_INTERNAL");
  17140. function jn(e, t) {
  17141. return e.then = "DoNotReturnProxyWithAFunctionNamedThen", e._internalType = Kn, e.inspect = null, e.__ob__ = void 0, new Proxy(e, {
  17142. get: function get(e, n, s) {
  17143. if ("_uniClient" === n) return null;
  17144. if ("symbol" == (0, _typeof2.default)(n)) return e[n];
  17145. if (n in e || "string" != typeof n) {
  17146. var _t11 = e[n];
  17147. return "function" == typeof _t11 ? _t11.bind(e) : _t11;
  17148. }
  17149. return t.get(e, n, s);
  17150. }
  17151. });
  17152. }
  17153. function $n(e) {
  17154. return {
  17155. on: function on(t, n) {
  17156. e[t] = e[t] || [], e[t].indexOf(n) > -1 || e[t].push(n);
  17157. },
  17158. off: function off(t, n) {
  17159. e[t] = e[t] || [];
  17160. var s = e[t].indexOf(n);
  17161. -1 !== s && e[t].splice(s, 1);
  17162. }
  17163. };
  17164. }
  17165. var Bn = ["db.Geo", "db.command", "command.aggregate"];
  17166. function Wn(e, t) {
  17167. return Bn.indexOf("".concat(e, ".").concat(t)) > -1;
  17168. }
  17169. function Hn(e) {
  17170. switch (f(e)) {
  17171. case "array":
  17172. return e.map(function (e) {
  17173. return Hn(e);
  17174. });
  17175. case "object":
  17176. return e._internalType === Kn || Object.keys(e).forEach(function (t) {
  17177. e[t] = Hn(e[t]);
  17178. }), e;
  17179. case "regexp":
  17180. return {
  17181. $regexp: {
  17182. source: e.source,
  17183. flags: e.flags
  17184. }
  17185. };
  17186. case "date":
  17187. return {
  17188. $date: e.toISOString()
  17189. };
  17190. default:
  17191. return e;
  17192. }
  17193. }
  17194. function zn(e) {
  17195. return e && e.content && e.content.$method;
  17196. }
  17197. var Jn = /*#__PURE__*/function () {
  17198. function Jn(e, t, n) {
  17199. (0, _classCallCheck2.default)(this, Jn);
  17200. this.content = e, this.prevStage = t || null, this.udb = null, this._database = n;
  17201. }
  17202. (0, _createClass2.default)(Jn, [{
  17203. key: "toJSON",
  17204. value: function toJSON() {
  17205. var e = this;
  17206. var t = [e.content];
  17207. for (; e.prevStage;) {
  17208. e = e.prevStage, t.push(e.content);
  17209. }
  17210. return {
  17211. $db: t.reverse().map(function (e) {
  17212. return {
  17213. $method: e.$method,
  17214. $param: Hn(e.$param)
  17215. };
  17216. })
  17217. };
  17218. }
  17219. }, {
  17220. key: "toString",
  17221. value: function toString() {
  17222. return JSON.stringify(this.toJSON());
  17223. }
  17224. }, {
  17225. key: "getAction",
  17226. value: function getAction() {
  17227. var e = this.toJSON().$db.find(function (e) {
  17228. return "action" === e.$method;
  17229. });
  17230. return e && e.$param && e.$param[0];
  17231. }
  17232. }, {
  17233. key: "getCommand",
  17234. value: function getCommand() {
  17235. return {
  17236. $db: this.toJSON().$db.filter(function (e) {
  17237. return "action" !== e.$method;
  17238. })
  17239. };
  17240. }
  17241. }, {
  17242. key: "isAggregate",
  17243. get: function get() {
  17244. var e = this;
  17245. for (; e;) {
  17246. var t = zn(e),
  17247. _n9 = zn(e.prevStage);
  17248. if ("aggregate" === t && "collection" === _n9 || "pipeline" === t) return !0;
  17249. e = e.prevStage;
  17250. }
  17251. return !1;
  17252. }
  17253. }, {
  17254. key: "isCommand",
  17255. get: function get() {
  17256. var e = this;
  17257. for (; e;) {
  17258. if ("command" === zn(e)) return !0;
  17259. e = e.prevStage;
  17260. }
  17261. return !1;
  17262. }
  17263. }, {
  17264. key: "isAggregateCommand",
  17265. get: function get() {
  17266. var e = this;
  17267. for (; e;) {
  17268. var t = zn(e),
  17269. _n10 = zn(e.prevStage);
  17270. if ("aggregate" === t && "command" === _n10) return !0;
  17271. e = e.prevStage;
  17272. }
  17273. return !1;
  17274. }
  17275. }, {
  17276. key: "getNextStageFn",
  17277. value: function getNextStageFn(e) {
  17278. var t = this;
  17279. return function () {
  17280. return Gn({
  17281. $method: e,
  17282. $param: Hn(Array.from(arguments))
  17283. }, t, t._database);
  17284. };
  17285. }
  17286. }, {
  17287. key: "count",
  17288. get: function get() {
  17289. return this.isAggregate ? this.getNextStageFn("count") : function () {
  17290. return this._send("count", Array.from(arguments));
  17291. };
  17292. }
  17293. }, {
  17294. key: "remove",
  17295. get: function get() {
  17296. return this.isCommand ? this.getNextStageFn("remove") : function () {
  17297. return this._send("remove", Array.from(arguments));
  17298. };
  17299. }
  17300. }, {
  17301. key: "get",
  17302. value: function get() {
  17303. return this._send("get", Array.from(arguments));
  17304. }
  17305. }, {
  17306. key: "add",
  17307. get: function get() {
  17308. return this.isCommand ? this.getNextStageFn("add") : function () {
  17309. return this._send("add", Array.from(arguments));
  17310. };
  17311. }
  17312. }, {
  17313. key: "update",
  17314. value: function update() {
  17315. return this._send("update", Array.from(arguments));
  17316. }
  17317. }, {
  17318. key: "end",
  17319. value: function end() {
  17320. return this._send("end", Array.from(arguments));
  17321. }
  17322. }, {
  17323. key: "set",
  17324. get: function get() {
  17325. return this.isCommand ? this.getNextStageFn("set") : function () {
  17326. throw new Error("JQL禁止使用set方法");
  17327. };
  17328. }
  17329. }, {
  17330. key: "_send",
  17331. value: function _send(e, t) {
  17332. var n = this.getAction(),
  17333. s = this.getCommand();
  17334. if (s.$db.push({
  17335. $method: e,
  17336. $param: Hn(t)
  17337. }), S) {
  17338. var _e21 = s.$db.find(function (e) {
  17339. return "collection" === e.$method;
  17340. }),
  17341. _t12 = _e21 && _e21.$param;
  17342. _t12 && 1 === _t12.length && "string" == typeof _e21.$param[0] && _e21.$param[0].indexOf(",") > -1 && console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
  17343. }
  17344. return this._database._callCloudFunction({
  17345. action: n,
  17346. command: s
  17347. });
  17348. }
  17349. }]);
  17350. return Jn;
  17351. }();
  17352. function Gn(e, t, n) {
  17353. return jn(new Jn(e, t, n), {
  17354. get: function get(e, t) {
  17355. var s = "db";
  17356. return e && e.content && (s = e.content.$method), Wn(s, t) ? Gn({
  17357. $method: t
  17358. }, e, n) : function () {
  17359. return Gn({
  17360. $method: t,
  17361. $param: Hn(Array.from(arguments))
  17362. }, e, n);
  17363. };
  17364. }
  17365. });
  17366. }
  17367. function Vn(_ref43) {
  17368. var e = _ref43.path,
  17369. t = _ref43.method;
  17370. return /*#__PURE__*/function () {
  17371. function _class4() {
  17372. (0, _classCallCheck2.default)(this, _class4);
  17373. this.param = Array.from(arguments);
  17374. }
  17375. (0, _createClass2.default)(_class4, [{
  17376. key: "toJSON",
  17377. value: function toJSON() {
  17378. return {
  17379. $newDb: [].concat((0, _toConsumableArray2.default)(e.map(function (e) {
  17380. return {
  17381. $method: e
  17382. };
  17383. })), [{
  17384. $method: t,
  17385. $param: this.param
  17386. }])
  17387. };
  17388. }
  17389. }, {
  17390. key: "toString",
  17391. value: function toString() {
  17392. return JSON.stringify(this.toJSON());
  17393. }
  17394. }]);
  17395. return _class4;
  17396. }();
  17397. }
  17398. function Yn(e) {
  17399. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17400. return jn(new e(t), {
  17401. get: function get(e, t) {
  17402. return Wn("db", t) ? Gn({
  17403. $method: t
  17404. }, null, e) : function () {
  17405. return Gn({
  17406. $method: t,
  17407. $param: Hn(Array.from(arguments))
  17408. }, null, e);
  17409. };
  17410. }
  17411. });
  17412. }
  17413. var Qn = /*#__PURE__*/function (_ref44) {
  17414. (0, _inherits2.default)(Qn, _ref44);
  17415. var _super11 = _createSuper(Qn);
  17416. function Qn() {
  17417. (0, _classCallCheck2.default)(this, Qn);
  17418. return _super11.apply(this, arguments);
  17419. }
  17420. (0, _createClass2.default)(Qn, [{
  17421. key: "_parseResult",
  17422. value: function _parseResult(e) {
  17423. return this._isJQL ? e.result : e;
  17424. }
  17425. }, {
  17426. key: "_callCloudFunction",
  17427. value: function _callCloudFunction(_ref45) {
  17428. var _this20 = this;
  17429. var e = _ref45.action,
  17430. t = _ref45.command,
  17431. n = _ref45.multiCommand,
  17432. s = _ref45.queryList;
  17433. function r(e, t) {
  17434. if (n && s) for (var _n11 = 0; _n11 < s.length; _n11++) {
  17435. var _r6 = s[_n11];
  17436. _r6.udb && "function" == typeof _r6.udb.setResult && (t ? _r6.udb.setResult(t) : _r6.udb.setResult(e.result.dataList[_n11]));
  17437. }
  17438. }
  17439. var i = this,
  17440. o = this._isJQL ? "databaseForJQL" : "database";
  17441. function a(e) {
  17442. return i._callback("error", [e]), M(q(o, "fail"), e).then(function () {
  17443. return M(q(o, "complete"), e);
  17444. }).then(function () {
  17445. return r(null, e), Y(j, {
  17446. type: W,
  17447. content: e
  17448. }), Promise.reject(e);
  17449. });
  17450. }
  17451. var c = M(q(o, "invoke")),
  17452. u = this._uniClient;
  17453. return c.then(function () {
  17454. return u.callFunction({
  17455. name: "DCloud-clientDB",
  17456. type: h,
  17457. data: {
  17458. action: e,
  17459. command: t,
  17460. multiCommand: n
  17461. }
  17462. });
  17463. }).then(function (e) {
  17464. var _e$result = e.result,
  17465. t = _e$result.code,
  17466. n = _e$result.message,
  17467. s = _e$result.token,
  17468. c = _e$result.tokenExpired,
  17469. _e$result$systemInfo = _e$result.systemInfo,
  17470. u = _e$result$systemInfo === void 0 ? [] : _e$result$systemInfo;
  17471. if (u) for (var _e22 = 0; _e22 < u.length; _e22++) {
  17472. var _u$_e = u[_e22],
  17473. _t13 = _u$_e.level,
  17474. _n12 = _u$_e.message,
  17475. _s14 = _u$_e.detail,
  17476. _r7 = console["app" === P && "warn" === _t13 ? "error" : _t13] || console.log;
  17477. var _i4 = "[System Info]" + _n12;
  17478. _s14 && (_i4 = "".concat(_i4, "\n\u8BE6\u7EC6\u4FE1\u606F\uFF1A").concat(_s14)), _r7(_i4);
  17479. }
  17480. if (t) {
  17481. return a(new te({
  17482. code: t,
  17483. message: n,
  17484. requestId: e.requestId
  17485. }));
  17486. }
  17487. e.result.errCode = e.result.errCode || e.result.code, e.result.errMsg = e.result.errMsg || e.result.message, s && c && (re({
  17488. token: s,
  17489. tokenExpired: c
  17490. }), _this20._callbackAuth("refreshToken", [{
  17491. token: s,
  17492. tokenExpired: c
  17493. }]), _this20._callback("refreshToken", [{
  17494. token: s,
  17495. tokenExpired: c
  17496. }]), Y(B, {
  17497. token: s,
  17498. tokenExpired: c
  17499. }));
  17500. var h = [{
  17501. prop: "affectedDocs",
  17502. tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"
  17503. }, {
  17504. prop: "code",
  17505. tips: "code不再推荐使用,请使用errCode替代"
  17506. }, {
  17507. prop: "message",
  17508. tips: "message不再推荐使用,请使用errMsg替代"
  17509. }];
  17510. var _loop2 = function _loop2(_t14) {
  17511. var _h$_t = h[_t14],
  17512. n = _h$_t.prop,
  17513. s = _h$_t.tips;
  17514. if (n in e.result) {
  17515. var _t15 = e.result[n];
  17516. Object.defineProperty(e.result, n, {
  17517. get: function get() {
  17518. return console.warn(s), _t15;
  17519. }
  17520. });
  17521. }
  17522. };
  17523. for (var _t14 = 0; _t14 < h.length; _t14++) {
  17524. _loop2(_t14);
  17525. }
  17526. return function (e) {
  17527. return M(q(o, "success"), e).then(function () {
  17528. return M(q(o, "complete"), e);
  17529. }).then(function () {
  17530. r(e, null);
  17531. var t = i._parseResult(e);
  17532. return Y(j, {
  17533. type: W,
  17534. content: t
  17535. }), Promise.resolve(t);
  17536. });
  17537. }(e);
  17538. }, function (e) {
  17539. /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
  17540. return a(new te({
  17541. code: e.code || "SYSTEM_ERROR",
  17542. message: e.message,
  17543. requestId: e.requestId
  17544. }));
  17545. });
  17546. }
  17547. }]);
  17548. return Qn;
  17549. }( /*#__PURE__*/function () {
  17550. function _class5() {
  17551. var _ref46 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17552. _ref46$uniClient = _ref46.uniClient,
  17553. e = _ref46$uniClient === void 0 ? {} : _ref46$uniClient,
  17554. _ref46$isJQL = _ref46.isJQL,
  17555. t = _ref46$isJQL === void 0 ? !1 : _ref46$isJQL;
  17556. (0, _classCallCheck2.default)(this, _class5);
  17557. this._uniClient = e, this._authCallBacks = {}, this._dbCallBacks = {}, e._isDefault && (this._dbCallBacks = L("_globalUniCloudDatabaseCallback")), t || (this.auth = $n(this._authCallBacks)), this._isJQL = t, Object.assign(this, $n(this._dbCallBacks)), this.env = jn({}, {
  17558. get: function get(e, t) {
  17559. return {
  17560. $env: t
  17561. };
  17562. }
  17563. }), this.Geo = jn({}, {
  17564. get: function get(e, t) {
  17565. return Vn({
  17566. path: ["Geo"],
  17567. method: t
  17568. });
  17569. }
  17570. }), this.serverDate = Vn({
  17571. path: [],
  17572. method: "serverDate"
  17573. }), this.RegExp = Vn({
  17574. path: [],
  17575. method: "RegExp"
  17576. });
  17577. }
  17578. (0, _createClass2.default)(_class5, [{
  17579. key: "getCloudEnv",
  17580. value: function getCloudEnv(e) {
  17581. if ("string" != typeof e || !e.trim()) throw new Error("getCloudEnv参数错误");
  17582. return {
  17583. $env: e.replace("$cloudEnv_", "")
  17584. };
  17585. }
  17586. }, {
  17587. key: "_callback",
  17588. value: function _callback(e, t) {
  17589. var n = this._dbCallBacks;
  17590. n[e] && n[e].forEach(function (e) {
  17591. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  17592. });
  17593. }
  17594. }, {
  17595. key: "_callbackAuth",
  17596. value: function _callbackAuth(e, t) {
  17597. var n = this._authCallBacks;
  17598. n[e] && n[e].forEach(function (e) {
  17599. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  17600. });
  17601. }
  17602. }, {
  17603. key: "multiSend",
  17604. value: function multiSend() {
  17605. var e = Array.from(arguments),
  17606. t = e.map(function (e) {
  17607. var t = e.getAction(),
  17608. n = e.getCommand();
  17609. if ("getTemp" !== n.$db[n.$db.length - 1].$method) throw new Error("multiSend只支持子命令内使用getTemp");
  17610. return {
  17611. action: t,
  17612. command: n
  17613. };
  17614. });
  17615. return this._callCloudFunction({
  17616. multiCommand: t,
  17617. queryList: e
  17618. });
  17619. }
  17620. }]);
  17621. return _class5;
  17622. }());
  17623. var Xn = "token无效,跳转登录页面",
  17624. Zn = "token过期,跳转登录页面",
  17625. es = {
  17626. TOKEN_INVALID_TOKEN_EXPIRED: Zn,
  17627. TOKEN_INVALID_INVALID_CLIENTID: Xn,
  17628. TOKEN_INVALID: Xn,
  17629. TOKEN_INVALID_WRONG_TOKEN: Xn,
  17630. TOKEN_INVALID_ANONYMOUS_USER: Xn
  17631. },
  17632. ts = {
  17633. "uni-id-token-expired": Zn,
  17634. "uni-id-check-token-failed": Xn,
  17635. "uni-id-token-not-exist": Xn,
  17636. "uni-id-check-device-feature-failed": Xn
  17637. };
  17638. function ns(e, t) {
  17639. var n = "";
  17640. return n = e ? "".concat(e, "/").concat(t) : t, n.replace(/^\//, "");
  17641. }
  17642. function ss() {
  17643. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  17644. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
  17645. var n = [],
  17646. s = [];
  17647. return e.forEach(function (e) {
  17648. !0 === e.needLogin ? n.push(ns(t, e.path)) : !1 === e.needLogin && s.push(ns(t, e.path));
  17649. }), {
  17650. needLoginPage: n,
  17651. notNeedLoginPage: s
  17652. };
  17653. }
  17654. function rs(e) {
  17655. return e.split("?")[0].replace(/^\//, "");
  17656. }
  17657. function is() {
  17658. return function (e) {
  17659. var t = e && e.$page && e.$page.fullPath || "";
  17660. return t ? ("/" !== t.charAt(0) && (t = "/" + t), t) : t;
  17661. }(function () {
  17662. var e = getCurrentPages();
  17663. return e[e.length - 1];
  17664. }());
  17665. }
  17666. function os() {
  17667. return rs(is());
  17668. }
  17669. function as() {
  17670. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  17671. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17672. if (!e) return !1;
  17673. if (!(t && t.list && t.list.length)) return !1;
  17674. var n = t.list,
  17675. s = rs(e);
  17676. return n.some(function (e) {
  17677. return e.pagePath === s;
  17678. });
  17679. }
  17680. var cs = !!_pages.default.uniIdRouter;
  17681. var _ref47 = function () {
  17682. var _ref28 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _pages.default,
  17683. _ref28$pages = _ref28.pages,
  17684. t = _ref28$pages === void 0 ? [] : _ref28$pages,
  17685. _ref28$subPackages = _ref28.subPackages,
  17686. n = _ref28$subPackages === void 0 ? [] : _ref28$subPackages,
  17687. _ref28$uniIdRouter = _ref28.uniIdRouter,
  17688. s = _ref28$uniIdRouter === void 0 ? {} : _ref28$uniIdRouter,
  17689. _ref28$tabBar = _ref28.tabBar,
  17690. r = _ref28$tabBar === void 0 ? {} : _ref28$tabBar;
  17691. var i = s.loginPage,
  17692. _s$needLogin = s.needLogin,
  17693. o = _s$needLogin === void 0 ? [] : _s$needLogin,
  17694. _s$resToLogin = s.resToLogin,
  17695. a = _s$resToLogin === void 0 ? !0 : _s$resToLogin,
  17696. _ss = ss(t),
  17697. c = _ss.needLoginPage,
  17698. u = _ss.notNeedLoginPage,
  17699. _ref30 = function () {
  17700. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  17701. var t = [],
  17702. n = [];
  17703. return e.forEach(function (e) {
  17704. var s = e.root,
  17705. _e$pages = e.pages,
  17706. r = _e$pages === void 0 ? [] : _e$pages,
  17707. _ss2 = ss(r, s),
  17708. i = _ss2.needLoginPage,
  17709. o = _ss2.notNeedLoginPage;
  17710. t.push.apply(t, (0, _toConsumableArray2.default)(i)), n.push.apply(n, (0, _toConsumableArray2.default)(o));
  17711. }), {
  17712. needLoginPage: t,
  17713. notNeedLoginPage: n
  17714. };
  17715. }(n),
  17716. h = _ref30.needLoginPage,
  17717. l = _ref30.notNeedLoginPage;
  17718. return {
  17719. loginPage: i,
  17720. routerNeedLogin: o,
  17721. resToLogin: a,
  17722. needLoginPage: [].concat((0, _toConsumableArray2.default)(c), (0, _toConsumableArray2.default)(h)),
  17723. notNeedLoginPage: [].concat((0, _toConsumableArray2.default)(u), (0, _toConsumableArray2.default)(l)),
  17724. loginPageInTabBar: as(i, r)
  17725. };
  17726. }(),
  17727. us = _ref47.loginPage,
  17728. hs = _ref47.routerNeedLogin,
  17729. ls = _ref47.resToLogin,
  17730. ds = _ref47.needLoginPage,
  17731. ps = _ref47.notNeedLoginPage,
  17732. fs = _ref47.loginPageInTabBar;
  17733. if (ds.indexOf(us) > -1) throw new Error("Login page [".concat(us, "] should not be \"needLogin\", please check your pages.json"));
  17734. function gs(e) {
  17735. var t = os();
  17736. if ("/" === e.charAt(0)) return e;
  17737. var _e$split = e.split("?"),
  17738. _e$split2 = (0, _slicedToArray2.default)(_e$split, 2),
  17739. n = _e$split2[0],
  17740. s = _e$split2[1],
  17741. r = n.replace(/^\//, "").split("/"),
  17742. i = t.split("/");
  17743. i.pop();
  17744. for (var _e23 = 0; _e23 < r.length; _e23++) {
  17745. var _t16 = r[_e23];
  17746. ".." === _t16 ? i.pop() : "." !== _t16 && i.push(_t16);
  17747. }
  17748. return "" === i[0] && i.shift(), "/" + i.join("/") + (s ? "?" + s : "");
  17749. }
  17750. function ms(e) {
  17751. var t = rs(gs(e));
  17752. return !(ps.indexOf(t) > -1) && (ds.indexOf(t) > -1 || hs.some(function (t) {
  17753. return function (e, t) {
  17754. return new RegExp(t).test(e);
  17755. }(e, t);
  17756. }));
  17757. }
  17758. function ys(_ref48) {
  17759. var e = _ref48.redirect;
  17760. var t = rs(e),
  17761. n = rs(us);
  17762. return os() !== n && t !== n;
  17763. }
  17764. function _s() {
  17765. var _ref49 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17766. e = _ref49.api,
  17767. t = _ref49.redirect;
  17768. if (!t || !ys({
  17769. redirect: t
  17770. })) return;
  17771. var n = function (e, t) {
  17772. return "/" !== e.charAt(0) && (e = "/" + e), t ? e.indexOf("?") > -1 ? e + "&uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e + "?uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e;
  17773. }(us, t);
  17774. fs ? "navigateTo" !== e && "redirectTo" !== e || (e = "switchTab") : "switchTab" === e && (e = "navigateTo");
  17775. var s = {
  17776. navigateTo: uni.navigateTo,
  17777. redirectTo: uni.redirectTo,
  17778. switchTab: uni.switchTab,
  17779. reLaunch: uni.reLaunch
  17780. };
  17781. setTimeout(function () {
  17782. s[e]({
  17783. url: n
  17784. });
  17785. });
  17786. }
  17787. function ws() {
  17788. var _ref50 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17789. e = _ref50.url;
  17790. var t = {
  17791. abortLoginPageJump: !1,
  17792. autoToLoginPage: !1
  17793. },
  17794. n = function () {
  17795. var _se3 = se(),
  17796. e = _se3.token,
  17797. t = _se3.tokenExpired;
  17798. var n;
  17799. if (e) {
  17800. if (t < Date.now()) {
  17801. var _e24 = "uni-id-token-expired";
  17802. n = {
  17803. errCode: _e24,
  17804. errMsg: ts[_e24]
  17805. };
  17806. }
  17807. } else {
  17808. var _e25 = "uni-id-check-token-failed";
  17809. n = {
  17810. errCode: _e25,
  17811. errMsg: ts[_e25]
  17812. };
  17813. }
  17814. return n;
  17815. }();
  17816. if (ms(e) && n) {
  17817. n.uniIdRedirectUrl = e;
  17818. if (J($).length > 0) return setTimeout(function () {
  17819. Y($, n);
  17820. }, 0), t.abortLoginPageJump = !0, t;
  17821. t.autoToLoginPage = !0;
  17822. }
  17823. return t;
  17824. }
  17825. function vs() {
  17826. !function () {
  17827. var e = is(),
  17828. _ws = ws({
  17829. url: e
  17830. }),
  17831. t = _ws.abortLoginPageJump,
  17832. n = _ws.autoToLoginPage;
  17833. t || n && _s({
  17834. api: "redirectTo",
  17835. redirect: e
  17836. });
  17837. }();
  17838. var e = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
  17839. var _loop3 = function _loop3(_t17) {
  17840. var n = e[_t17];
  17841. uni.addInterceptor(n, {
  17842. invoke: function invoke(e) {
  17843. var _ws2 = ws({
  17844. url: e.url
  17845. }),
  17846. t = _ws2.abortLoginPageJump,
  17847. s = _ws2.autoToLoginPage;
  17848. return t ? e : s ? (_s({
  17849. api: n,
  17850. redirect: gs(e.url)
  17851. }), !1) : e;
  17852. }
  17853. });
  17854. };
  17855. for (var _t17 = 0; _t17 < e.length; _t17++) {
  17856. _loop3(_t17);
  17857. }
  17858. }
  17859. function Is() {
  17860. this.onResponse(function (e) {
  17861. var t = e.type,
  17862. n = e.content;
  17863. var s = !1;
  17864. switch (t) {
  17865. case "cloudobject":
  17866. s = function (e) {
  17867. if ("object" != (0, _typeof2.default)(e)) return !1;
  17868. var _ref51 = e || {},
  17869. t = _ref51.errCode;
  17870. return t in ts;
  17871. }(n);
  17872. break;
  17873. case "clientdb":
  17874. s = function (e) {
  17875. if ("object" != (0, _typeof2.default)(e)) return !1;
  17876. var _ref52 = e || {},
  17877. t = _ref52.errCode;
  17878. return t in es;
  17879. }(n);
  17880. }
  17881. s && function () {
  17882. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  17883. var t = J($);
  17884. Z().then(function () {
  17885. var n = is();
  17886. if (n && ys({
  17887. redirect: n
  17888. })) return t.length > 0 ? Y($, Object.assign({
  17889. uniIdRedirectUrl: n
  17890. }, e)) : void (us && _s({
  17891. api: "navigateTo",
  17892. redirect: n
  17893. }));
  17894. });
  17895. }(n);
  17896. });
  17897. }
  17898. function Ss(e) {
  17899. !function (e) {
  17900. e.onResponse = function (e) {
  17901. G(j, e);
  17902. }, e.offResponse = function (e) {
  17903. V(j, e);
  17904. };
  17905. }(e), function (e) {
  17906. e.onNeedLogin = function (e) {
  17907. G($, e);
  17908. }, e.offNeedLogin = function (e) {
  17909. V($, e);
  17910. }, cs && (L("_globalUniCloudStatus").needLoginInit || (L("_globalUniCloudStatus").needLoginInit = !0, Z().then(function () {
  17911. vs.call(e);
  17912. }), ls && Is.call(e)));
  17913. }(e), function (e) {
  17914. e.onRefreshToken = function (e) {
  17915. G(B, e);
  17916. }, e.offRefreshToken = function (e) {
  17917. V(B, e);
  17918. };
  17919. }(e);
  17920. }
  17921. var bs;
  17922. var ks = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  17923. As = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  17924. function Ps() {
  17925. var e = se().token || "",
  17926. t = e.split(".");
  17927. if (!e || 3 !== t.length) return {
  17928. uid: null,
  17929. role: [],
  17930. permission: [],
  17931. tokenExpired: 0
  17932. };
  17933. var n;
  17934. try {
  17935. n = JSON.parse((s = t[1], decodeURIComponent(bs(s).split("").map(function (e) {
  17936. return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2);
  17937. }).join(""))));
  17938. } catch (e) {
  17939. throw new Error("获取当前用户信息出错,详细错误信息为:" + e.message);
  17940. }
  17941. var s;
  17942. return n.tokenExpired = 1e3 * n.exp, delete n.exp, delete n.iat, n;
  17943. }
  17944. bs = "function" != typeof atob ? function (e) {
  17945. if (e = String(e).replace(/[\t\n\f\r ]+/g, ""), !As.test(e)) throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  17946. var t;
  17947. e += "==".slice(2 - (3 & e.length));
  17948. for (var n, s, r = "", i = 0; i < e.length;) {
  17949. t = ks.indexOf(e.charAt(i++)) << 18 | ks.indexOf(e.charAt(i++)) << 12 | (n = ks.indexOf(e.charAt(i++))) << 6 | (s = ks.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);
  17950. }
  17951. return r;
  17952. } : atob;
  17953. var Ts = n(function (e, t) {
  17954. Object.defineProperty(t, "__esModule", {
  17955. value: !0
  17956. });
  17957. var n = "chooseAndUploadFile:ok",
  17958. s = "chooseAndUploadFile:fail";
  17959. function r(e, t) {
  17960. return e.tempFiles.forEach(function (e, n) {
  17961. 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("."));
  17962. }), e.tempFilePaths || (e.tempFilePaths = e.tempFiles.map(function (e) {
  17963. return e.path;
  17964. })), e;
  17965. }
  17966. function i(e, t, _ref53) {
  17967. var s = _ref53.onChooseFile,
  17968. r = _ref53.onUploadProgress;
  17969. return t.then(function (e) {
  17970. if (s) {
  17971. var _t18 = s(e);
  17972. if (void 0 !== _t18) return Promise.resolve(_t18).then(function (t) {
  17973. return void 0 === t ? e : t;
  17974. });
  17975. }
  17976. return e;
  17977. }).then(function (t) {
  17978. return !1 === t ? {
  17979. errMsg: n,
  17980. tempFilePaths: [],
  17981. tempFiles: []
  17982. } : function (e, t) {
  17983. var s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;
  17984. var r = arguments.length > 3 ? arguments[3] : undefined;
  17985. (t = Object.assign({}, t)).errMsg = n;
  17986. var i = t.tempFiles,
  17987. o = i.length;
  17988. var a = 0;
  17989. return new Promise(function (n) {
  17990. for (; a < s;) {
  17991. c();
  17992. }
  17993. function c() {
  17994. var s = a++;
  17995. if (s >= o) return void (!i.find(function (e) {
  17996. return !e.url && !e.errMsg;
  17997. }) && n(t));
  17998. var u = i[s];
  17999. e.uploadFile({
  18000. filePath: u.path,
  18001. cloudPath: u.cloudPath,
  18002. fileType: u.fileType,
  18003. cloudPathAsRealPath: u.cloudPathAsRealPath,
  18004. onUploadProgress: function onUploadProgress(e) {
  18005. e.index = s, e.tempFile = u, e.tempFilePath = u.path, r && r(e);
  18006. }
  18007. }).then(function (e) {
  18008. u.url = e.fileID, s < o && c();
  18009. }).catch(function (e) {
  18010. u.errMsg = e.errMsg || e.message, s < o && c();
  18011. });
  18012. }
  18013. });
  18014. }(e, t, 5, r);
  18015. });
  18016. }
  18017. t.initChooseAndUploadFile = function (e) {
  18018. return function () {
  18019. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  18020. type: "all"
  18021. };
  18022. return "image" === t.type ? i(e, function (e) {
  18023. var t = e.count,
  18024. n = e.sizeType,
  18025. _e$sourceType = e.sourceType,
  18026. i = _e$sourceType === void 0 ? ["album", "camera"] : _e$sourceType,
  18027. o = e.extension;
  18028. return new Promise(function (e, a) {
  18029. uni.chooseImage({
  18030. count: t,
  18031. sizeType: n,
  18032. sourceType: i,
  18033. extension: o,
  18034. success: function success(t) {
  18035. e(r(t, "image"));
  18036. },
  18037. fail: function fail(e) {
  18038. a({
  18039. errMsg: e.errMsg.replace("chooseImage:fail", s)
  18040. });
  18041. }
  18042. });
  18043. });
  18044. }(t), t) : "video" === t.type ? i(e, function (e) {
  18045. var t = e.camera,
  18046. n = e.compressed,
  18047. i = e.maxDuration,
  18048. _e$sourceType2 = e.sourceType,
  18049. o = _e$sourceType2 === void 0 ? ["album", "camera"] : _e$sourceType2,
  18050. a = e.extension;
  18051. return new Promise(function (e, c) {
  18052. uni.chooseVideo({
  18053. camera: t,
  18054. compressed: n,
  18055. maxDuration: i,
  18056. sourceType: o,
  18057. extension: a,
  18058. success: function success(t) {
  18059. var n = t.tempFilePath,
  18060. s = t.duration,
  18061. i = t.size,
  18062. o = t.height,
  18063. a = t.width;
  18064. e(r({
  18065. errMsg: "chooseVideo:ok",
  18066. tempFilePaths: [n],
  18067. tempFiles: [{
  18068. name: t.tempFile && t.tempFile.name || "",
  18069. path: n,
  18070. size: i,
  18071. type: t.tempFile && t.tempFile.type || "",
  18072. width: a,
  18073. height: o,
  18074. duration: s,
  18075. fileType: "video",
  18076. cloudPath: ""
  18077. }]
  18078. }, "video"));
  18079. },
  18080. fail: function fail(e) {
  18081. c({
  18082. errMsg: e.errMsg.replace("chooseVideo:fail", s)
  18083. });
  18084. }
  18085. });
  18086. });
  18087. }(t), t) : i(e, function (e) {
  18088. var t = e.count,
  18089. n = e.extension;
  18090. return new Promise(function (e, i) {
  18091. var o = uni.chooseFile;
  18092. if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (o = wx.chooseMessageFile), "function" != typeof o) return i({
  18093. errMsg: s + " 请指定 type 类型,该平台仅支持选择 image 或 video。"
  18094. });
  18095. o({
  18096. type: "all",
  18097. count: t,
  18098. extension: n,
  18099. success: function success(t) {
  18100. e(r(t));
  18101. },
  18102. fail: function fail(e) {
  18103. i({
  18104. errMsg: e.errMsg.replace("chooseFile:fail", s)
  18105. });
  18106. }
  18107. });
  18108. });
  18109. }(t), t);
  18110. };
  18111. };
  18112. }),
  18113. Cs = t(Ts);
  18114. var xs = "manual";
  18115. function Os(e) {
  18116. return {
  18117. props: {
  18118. localdata: {
  18119. type: Array,
  18120. default: function _default() {
  18121. return [];
  18122. }
  18123. },
  18124. options: {
  18125. type: [Object, Array],
  18126. default: function _default() {
  18127. return {};
  18128. }
  18129. },
  18130. spaceInfo: {
  18131. type: Object,
  18132. default: function _default() {
  18133. return {};
  18134. }
  18135. },
  18136. collection: {
  18137. type: [String, Array],
  18138. default: ""
  18139. },
  18140. action: {
  18141. type: String,
  18142. default: ""
  18143. },
  18144. field: {
  18145. type: String,
  18146. default: ""
  18147. },
  18148. orderby: {
  18149. type: String,
  18150. default: ""
  18151. },
  18152. where: {
  18153. type: [String, Object],
  18154. default: ""
  18155. },
  18156. pageData: {
  18157. type: String,
  18158. default: "add"
  18159. },
  18160. pageCurrent: {
  18161. type: Number,
  18162. default: 1
  18163. },
  18164. pageSize: {
  18165. type: Number,
  18166. default: 20
  18167. },
  18168. getcount: {
  18169. type: [Boolean, String],
  18170. default: !1
  18171. },
  18172. gettree: {
  18173. type: [Boolean, String],
  18174. default: !1
  18175. },
  18176. gettreepath: {
  18177. type: [Boolean, String],
  18178. default: !1
  18179. },
  18180. startwith: {
  18181. type: String,
  18182. default: ""
  18183. },
  18184. limitlevel: {
  18185. type: Number,
  18186. default: 10
  18187. },
  18188. groupby: {
  18189. type: String,
  18190. default: ""
  18191. },
  18192. groupField: {
  18193. type: String,
  18194. default: ""
  18195. },
  18196. distinct: {
  18197. type: [Boolean, String],
  18198. default: !1
  18199. },
  18200. foreignKey: {
  18201. type: String,
  18202. default: ""
  18203. },
  18204. loadtime: {
  18205. type: String,
  18206. default: "auto"
  18207. },
  18208. manual: {
  18209. type: Boolean,
  18210. default: !1
  18211. }
  18212. },
  18213. data: function data() {
  18214. return {
  18215. mixinDatacomLoading: !1,
  18216. mixinDatacomHasMore: !1,
  18217. mixinDatacomResData: [],
  18218. mixinDatacomErrorMessage: "",
  18219. mixinDatacomPage: {}
  18220. };
  18221. },
  18222. created: function created() {
  18223. var _this21 = this;
  18224. this.mixinDatacomPage = {
  18225. current: this.pageCurrent,
  18226. size: this.pageSize,
  18227. count: 0
  18228. }, this.$watch(function () {
  18229. var e = [];
  18230. return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach(function (t) {
  18231. e.push(_this21[t]);
  18232. }), e;
  18233. }, function (e, t) {
  18234. if (_this21.loadtime === xs) return;
  18235. var n = !1;
  18236. var s = [];
  18237. for (var _r8 = 2; _r8 < e.length; _r8++) {
  18238. e[_r8] !== t[_r8] && (s.push(e[_r8]), n = !0);
  18239. }
  18240. e[0] !== t[0] && (_this21.mixinDatacomPage.current = _this21.pageCurrent), _this21.mixinDatacomPage.size = _this21.pageSize, _this21.onMixinDatacomPropsChange(n, s);
  18241. });
  18242. },
  18243. methods: {
  18244. onMixinDatacomPropsChange: function onMixinDatacomPropsChange(e, t) {},
  18245. mixinDatacomEasyGet: function mixinDatacomEasyGet() {
  18246. var _this22 = this;
  18247. var _ref54 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18248. _ref54$getone = _ref54.getone,
  18249. e = _ref54$getone === void 0 ? !1 : _ref54$getone,
  18250. t = _ref54.success,
  18251. n = _ref54.fail;
  18252. this.mixinDatacomLoading || (this.mixinDatacomLoading = !0, this.mixinDatacomErrorMessage = "", this.mixinDatacomGet().then(function (n) {
  18253. _this22.mixinDatacomLoading = !1;
  18254. var _n$result = n.result,
  18255. s = _n$result.data,
  18256. r = _n$result.count;
  18257. _this22.getcount && (_this22.mixinDatacomPage.count = r), _this22.mixinDatacomHasMore = s.length < _this22.pageSize;
  18258. var i = e ? s.length ? s[0] : void 0 : s;
  18259. _this22.mixinDatacomResData = i, t && t(i);
  18260. }).catch(function (e) {
  18261. _this22.mixinDatacomLoading = !1, _this22.mixinDatacomErrorMessage = e, n && n(e);
  18262. }));
  18263. },
  18264. mixinDatacomGet: function mixinDatacomGet() {
  18265. var _n13;
  18266. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  18267. var n = e.database(this.spaceInfo);
  18268. var s = t.action || this.action;
  18269. s && (n = n.action(s));
  18270. var r = t.collection || this.collection;
  18271. n = Array.isArray(r) ? (_n13 = n).collection.apply(_n13, (0, _toConsumableArray2.default)(r)) : n.collection(r);
  18272. var i = t.where || this.where;
  18273. i && Object.keys(i).length && (n = n.where(i));
  18274. var o = t.field || this.field;
  18275. o && (n = n.field(o));
  18276. var a = t.foreignKey || this.foreignKey;
  18277. a && (n = n.foreignKey(a));
  18278. var c = t.groupby || this.groupby;
  18279. c && (n = n.groupBy(c));
  18280. var u = t.groupField || this.groupField;
  18281. u && (n = n.groupField(u));
  18282. !0 === (void 0 !== t.distinct ? t.distinct : this.distinct) && (n = n.distinct());
  18283. var h = t.orderby || this.orderby;
  18284. h && (n = n.orderBy(h));
  18285. var l = void 0 !== t.pageCurrent ? t.pageCurrent : this.mixinDatacomPage.current,
  18286. d = void 0 !== t.pageSize ? t.pageSize : this.mixinDatacomPage.size,
  18287. p = void 0 !== t.getcount ? t.getcount : this.getcount,
  18288. f = void 0 !== t.gettree ? t.gettree : this.gettree,
  18289. g = void 0 !== t.gettreepath ? t.gettreepath : this.gettreepath,
  18290. m = {
  18291. getCount: p
  18292. },
  18293. y = {
  18294. limitLevel: void 0 !== t.limitlevel ? t.limitlevel : this.limitlevel,
  18295. startWith: void 0 !== t.startwith ? t.startwith : this.startwith
  18296. };
  18297. return f && (m.getTree = y), g && (m.getTreePath = y), n = n.skip(d * (l - 1)).limit(d).get(m), n;
  18298. }
  18299. }
  18300. };
  18301. }
  18302. function Es(e) {
  18303. return function (t) {
  18304. var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  18305. n = function (e) {
  18306. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  18307. 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;
  18308. }({
  18309. customUI: !1,
  18310. loadingOptions: {
  18311. title: "加载中...",
  18312. mask: !0
  18313. },
  18314. errorOptions: {
  18315. type: "modal",
  18316. retry: !1
  18317. }
  18318. }, n);
  18319. var _n14 = n,
  18320. s = _n14.customUI,
  18321. r = _n14.loadingOptions,
  18322. i = _n14.errorOptions,
  18323. o = _n14.parseSystemError,
  18324. a = !s;
  18325. return new Proxy({}, {
  18326. get: function get(s, c) {
  18327. switch (c) {
  18328. case "toString":
  18329. return "[object UniCloudObject]";
  18330. case "toJSON":
  18331. return {};
  18332. }
  18333. return function () {
  18334. var _ref55 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18335. e = _ref55.fn,
  18336. t = _ref55.interceptorName,
  18337. n = _ref55.getCallbackArgs;
  18338. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52() {
  18339. var _len2,
  18340. s,
  18341. _key2,
  18342. r,
  18343. i,
  18344. o,
  18345. _args = arguments;
  18346. return _regenerator.default.wrap(function _callee52$(_context52) {
  18347. while (1) {
  18348. switch (_context52.prev = _context52.next) {
  18349. case 0:
  18350. for (_len2 = _args.length, s = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  18351. s[_key2] = _args[_key2];
  18352. }
  18353. r = n ? n({
  18354. params: s
  18355. }) : {};
  18356. _context52.prev = 2;
  18357. _context52.next = 5;
  18358. return M(q(t, "invoke"), _objectSpread({}, r));
  18359. case 5:
  18360. _context52.next = 7;
  18361. return e.apply(void 0, s);
  18362. case 7:
  18363. i = _context52.sent;
  18364. _context52.next = 10;
  18365. return M(q(t, "success"), _objectSpread(_objectSpread({}, r), {}, {
  18366. result: i
  18367. }));
  18368. case 10:
  18369. return _context52.abrupt("return", i);
  18370. case 13:
  18371. _context52.prev = 13;
  18372. _context52.t0 = _context52["catch"](2);
  18373. o = _context52.t0;
  18374. _context52.next = 18;
  18375. return M(q(t, "fail"), _objectSpread(_objectSpread({}, r), {}, {
  18376. error: o
  18377. }));
  18378. case 18:
  18379. throw o;
  18380. case 19:
  18381. _context52.prev = 19;
  18382. _context52.next = 22;
  18383. return M(q(t, "complete"), o ? _objectSpread(_objectSpread({}, r), {}, {
  18384. error: o
  18385. }) : _objectSpread(_objectSpread({}, r), {}, {
  18386. result: i
  18387. }));
  18388. case 22:
  18389. return _context52.finish(19);
  18390. case 23:
  18391. case "end":
  18392. return _context52.stop();
  18393. }
  18394. }
  18395. }, _callee52, null, [[2, 13, 19, 23]]);
  18396. }));
  18397. }({
  18398. fn: function () {
  18399. var _s15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54() {
  18400. var l,
  18401. _len3,
  18402. h,
  18403. _key3,
  18404. d,
  18405. p,
  18406. _ref57,
  18407. f,
  18408. g,
  18409. m,
  18410. y,
  18411. _e26,
  18412. _yield,
  18413. _t19,
  18414. _n15,
  18415. _args4 = arguments;
  18416. return _regenerator.default.wrap(function _callee54$(_context54) {
  18417. while (1) {
  18418. switch (_context54.prev = _context54.next) {
  18419. case 0:
  18420. a && uni.showLoading({
  18421. title: r.title,
  18422. mask: r.mask
  18423. });
  18424. for (_len3 = _args4.length, h = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  18425. h[_key3] = _args4[_key3];
  18426. }
  18427. d = {
  18428. name: t,
  18429. type: u,
  18430. data: {
  18431. method: c,
  18432. params: h
  18433. }
  18434. };
  18435. "object" == (0, _typeof2.default)(n.secretMethods) && function (e, t) {
  18436. var n = t.data.method,
  18437. s = e.secretMethods || {},
  18438. r = s[n] || s["*"];
  18439. r && (t.secretType = r);
  18440. }(n, d);
  18441. p = !1;
  18442. _context54.prev = 5;
  18443. _context54.next = 8;
  18444. return e.callFunction(d);
  18445. case 8:
  18446. l = _context54.sent;
  18447. _context54.next = 14;
  18448. break;
  18449. case 11:
  18450. _context54.prev = 11;
  18451. _context54.t0 = _context54["catch"](5);
  18452. p = !0, l = {
  18453. result: new te(_context54.t0)
  18454. };
  18455. case 14:
  18456. _ref57 = l.result || {}, f = _ref57.errSubject, g = _ref57.errCode, m = _ref57.errMsg, y = _ref57.newToken;
  18457. if (!(a && uni.hideLoading(), y && y.token && y.tokenExpired && (re(y), Y(B, _objectSpread({}, y))), g)) {
  18458. _context54.next = 39;
  18459. break;
  18460. }
  18461. _e26 = m;
  18462. if (!(p && o)) {
  18463. _context54.next = 24;
  18464. break;
  18465. }
  18466. _context54.next = 20;
  18467. return o({
  18468. objectName: t,
  18469. methodName: c,
  18470. params: h,
  18471. errSubject: f,
  18472. errCode: g,
  18473. errMsg: m
  18474. });
  18475. case 20:
  18476. _context54.t1 = _context54.sent.errMsg;
  18477. if (_context54.t1) {
  18478. _context54.next = 23;
  18479. break;
  18480. }
  18481. _context54.t1 = m;
  18482. case 23:
  18483. _e26 = _context54.t1;
  18484. case 24:
  18485. if (!a) {
  18486. _context54.next = 37;
  18487. break;
  18488. }
  18489. if (!("toast" === i.type)) {
  18490. _context54.next = 29;
  18491. break;
  18492. }
  18493. uni.showToast({
  18494. title: _e26,
  18495. icon: "none"
  18496. });
  18497. _context54.next = 37;
  18498. break;
  18499. case 29:
  18500. if (!("modal" !== i.type)) {
  18501. _context54.next = 31;
  18502. break;
  18503. }
  18504. throw new Error("Invalid errorOptions.type: ".concat(i.type));
  18505. case 31:
  18506. _context54.next = 33;
  18507. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53() {
  18508. var _ref59,
  18509. e,
  18510. t,
  18511. n,
  18512. s,
  18513. r,
  18514. _args2 = arguments;
  18515. return _regenerator.default.wrap(function _callee53$(_context53) {
  18516. while (1) {
  18517. switch (_context53.prev = _context53.next) {
  18518. case 0:
  18519. _ref59 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, e = _ref59.title, t = _ref59.content, n = _ref59.showCancel, s = _ref59.cancelText, r = _ref59.confirmText;
  18520. return _context53.abrupt("return", new Promise(function (i, o) {
  18521. uni.showModal({
  18522. title: e,
  18523. content: t,
  18524. showCancel: n,
  18525. cancelText: s,
  18526. confirmText: r,
  18527. success: function success(e) {
  18528. i(e);
  18529. },
  18530. fail: function fail() {
  18531. i({
  18532. confirm: !1,
  18533. cancel: !0
  18534. });
  18535. }
  18536. });
  18537. }));
  18538. case 2:
  18539. case "end":
  18540. return _context53.stop();
  18541. }
  18542. }
  18543. }, _callee53);
  18544. }))({
  18545. title: "提示",
  18546. content: _e26,
  18547. showCancel: i.retry,
  18548. cancelText: "取消",
  18549. confirmText: i.retry ? "重试" : "确定"
  18550. });
  18551. case 33:
  18552. _yield = _context54.sent;
  18553. _t19 = _yield.confirm;
  18554. if (!(i.retry && _t19)) {
  18555. _context54.next = 37;
  18556. break;
  18557. }
  18558. return _context54.abrupt("return", s.apply(void 0, h));
  18559. case 37:
  18560. _n15 = new te({
  18561. subject: f,
  18562. code: g,
  18563. message: m,
  18564. requestId: l.requestId
  18565. });
  18566. throw _n15.detail = l.result, Y(j, {
  18567. type: z,
  18568. content: _n15
  18569. }), _n15;
  18570. case 39:
  18571. return _context54.abrupt("return", (Y(j, {
  18572. type: z,
  18573. content: l.result
  18574. }), l.result));
  18575. case 40:
  18576. case "end":
  18577. return _context54.stop();
  18578. }
  18579. }
  18580. }, _callee54, null, [[5, 11]]);
  18581. }));
  18582. function s() {
  18583. return _s15.apply(this, arguments);
  18584. }
  18585. return s;
  18586. }(),
  18587. interceptorName: "callObject",
  18588. getCallbackArgs: function getCallbackArgs() {
  18589. var _ref60 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18590. e = _ref60.params;
  18591. return {
  18592. objectName: t,
  18593. methodName: c,
  18594. params: e
  18595. };
  18596. }
  18597. });
  18598. }
  18599. });
  18600. };
  18601. }
  18602. function Ls(e) {
  18603. return L("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e.config.spaceId));
  18604. }
  18605. function Rs() {
  18606. return _Rs.apply(this, arguments);
  18607. }
  18608. function _Rs() {
  18609. _Rs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57() {
  18610. var _ref72,
  18611. e,
  18612. _ref72$callLoginByWei,
  18613. t,
  18614. n,
  18615. s,
  18616. r,
  18617. _args7 = arguments;
  18618. return _regenerator.default.wrap(function _callee57$(_context57) {
  18619. while (1) {
  18620. switch (_context57.prev = _context57.next) {
  18621. case 0:
  18622. _ref72 = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {}, e = _ref72.openid, _ref72$callLoginByWei = _ref72.callLoginByWeixin, t = _ref72$callLoginByWei === void 0 ? !1 : _ref72$callLoginByWei;
  18623. n = Ls(this);
  18624. if (!("mp-weixin" !== P)) {
  18625. _context57.next = 4;
  18626. break;
  18627. }
  18628. throw new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `".concat(P, "`"));
  18629. case 4:
  18630. if (!(e && t)) {
  18631. _context57.next = 6;
  18632. break;
  18633. }
  18634. throw new Error("[SecureNetwork] openid and callLoginByWeixin cannot be passed at the same time");
  18635. case 6:
  18636. if (!e) {
  18637. _context57.next = 8;
  18638. break;
  18639. }
  18640. return _context57.abrupt("return", (n.mpWeixinOpenid = e, {}));
  18641. case 8:
  18642. _context57.next = 10;
  18643. return new Promise(function (e, t) {
  18644. uni.login({
  18645. success: function success(t) {
  18646. e(t.code);
  18647. },
  18648. fail: function fail(e) {
  18649. t(new Error(e.errMsg));
  18650. }
  18651. });
  18652. });
  18653. case 10:
  18654. s = _context57.sent;
  18655. r = this.importObject("uni-id-co", {
  18656. customUI: !0
  18657. });
  18658. _context57.next = 14;
  18659. return r.secureNetworkHandshakeByWeixin({
  18660. code: s,
  18661. callLoginByWeixin: t
  18662. });
  18663. case 14:
  18664. n.mpWeixinCode = s;
  18665. return _context57.abrupt("return", {
  18666. code: s
  18667. });
  18668. case 16:
  18669. case "end":
  18670. return _context57.stop();
  18671. }
  18672. }
  18673. }, _callee57, this);
  18674. }));
  18675. return _Rs.apply(this, arguments);
  18676. }
  18677. function Us(_x39) {
  18678. return _Us.apply(this, arguments);
  18679. }
  18680. function _Us() {
  18681. _Us = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58(e) {
  18682. var t;
  18683. return _regenerator.default.wrap(function _callee58$(_context58) {
  18684. while (1) {
  18685. switch (_context58.prev = _context58.next) {
  18686. case 0:
  18687. t = Ls(this);
  18688. return _context58.abrupt("return", (t.initPromise || (t.initPromise = Rs.call(this, e)), t.initPromise));
  18689. case 2:
  18690. case "end":
  18691. return _context58.stop();
  18692. }
  18693. }
  18694. }, _callee58, this);
  18695. }));
  18696. return _Us.apply(this, arguments);
  18697. }
  18698. function Ns(e) {
  18699. return function () {
  18700. var _ref61 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18701. t = _ref61.openid,
  18702. _ref61$callLoginByWei = _ref61.callLoginByWeixin,
  18703. n = _ref61$callLoginByWei === void 0 ? !1 : _ref61$callLoginByWei;
  18704. return Us.call(e, {
  18705. openid: t,
  18706. callLoginByWeixin: n
  18707. });
  18708. };
  18709. }
  18710. function Ds(e) {
  18711. var t = {
  18712. getSystemInfo: uni.getSystemInfo,
  18713. getPushClientId: uni.getPushClientId
  18714. };
  18715. return function (n) {
  18716. return new Promise(function (s, r) {
  18717. t[e](_objectSpread(_objectSpread({}, n), {}, {
  18718. success: function success(e) {
  18719. s(e);
  18720. },
  18721. fail: function fail(e) {
  18722. r(e);
  18723. }
  18724. }));
  18725. });
  18726. };
  18727. }
  18728. var Ms = /*#__PURE__*/function (_ref62) {
  18729. (0, _inherits2.default)(Ms, _ref62);
  18730. var _super12 = _createSuper(Ms);
  18731. function Ms() {
  18732. var _this23;
  18733. (0, _classCallCheck2.default)(this, Ms);
  18734. _this23 = _super12.call(this), _this23._uniPushMessageCallback = _this23._receivePushMessage.bind((0, _assertThisInitialized2.default)(_this23)), _this23._currentMessageId = -1, _this23._payloadQueue = [];
  18735. return _this23;
  18736. }
  18737. (0, _createClass2.default)(Ms, [{
  18738. key: "init",
  18739. value: function init() {
  18740. var _this24 = this;
  18741. return Promise.all([Ds("getSystemInfo")(), Ds("getPushClientId")()]).then(function () {
  18742. var _ref63 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [],
  18743. _ref64 = (0, _slicedToArray2.default)(_ref63, 2),
  18744. _ref64$ = _ref64[0];
  18745. _ref64$ = _ref64$ === void 0 ? {} : _ref64$;
  18746. var e = _ref64$.appId,
  18747. _ref64$2 = _ref64[1];
  18748. _ref64$2 = _ref64$2 === void 0 ? {} : _ref64$2;
  18749. var t = _ref64$2.cid;
  18750. if (!e) throw new Error("Invalid appId, please check the manifest.json file");
  18751. if (!t) throw new Error("Invalid push client id");
  18752. _this24._appId = e, _this24._pushClientId = t, _this24._seqId = Date.now() + "-" + Math.floor(9e5 * Math.random() + 1e5), _this24.emit("open"), _this24._initMessageListener();
  18753. }, function (e) {
  18754. throw _this24.emit("error", e), _this24.close(), e;
  18755. });
  18756. }
  18757. }, {
  18758. key: "open",
  18759. value: function () {
  18760. var _open = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55() {
  18761. return _regenerator.default.wrap(function _callee55$(_context55) {
  18762. while (1) {
  18763. switch (_context55.prev = _context55.next) {
  18764. case 0:
  18765. return _context55.abrupt("return", this.init());
  18766. case 1:
  18767. case "end":
  18768. return _context55.stop();
  18769. }
  18770. }
  18771. }, _callee55, this);
  18772. }));
  18773. function open() {
  18774. return _open.apply(this, arguments);
  18775. }
  18776. return open;
  18777. }()
  18778. }, {
  18779. key: "_isUniCloudSSE",
  18780. value: function _isUniCloudSSE(e) {
  18781. if ("receive" !== e.type) return !1;
  18782. var t = e && e.data && e.data.payload;
  18783. return !(!t || "UNI_CLOUD_SSE" !== t.channel || t.seqId !== this._seqId);
  18784. }
  18785. }, {
  18786. key: "_receivePushMessage",
  18787. value: function _receivePushMessage(e) {
  18788. if (!this._isUniCloudSSE(e)) return;
  18789. var t = e && e.data && e.data.payload,
  18790. n = t.action,
  18791. s = t.messageId,
  18792. r = t.message;
  18793. this._payloadQueue.push({
  18794. action: n,
  18795. messageId: s,
  18796. message: r
  18797. }), this._consumMessage();
  18798. }
  18799. }, {
  18800. key: "_consumMessage",
  18801. value: function _consumMessage() {
  18802. var _this25 = this;
  18803. for (;;) {
  18804. var _e27 = this._payloadQueue.find(function (e) {
  18805. return e.messageId === _this25._currentMessageId + 1;
  18806. });
  18807. if (!_e27) break;
  18808. this._currentMessageId++, this._parseMessagePayload(_e27);
  18809. }
  18810. }
  18811. }, {
  18812. key: "_parseMessagePayload",
  18813. value: function _parseMessagePayload(e) {
  18814. var t = e.action,
  18815. n = e.messageId,
  18816. s = e.message;
  18817. "end" === t ? this._end({
  18818. messageId: n,
  18819. message: s
  18820. }) : "message" === t && this._appendMessage({
  18821. messageId: n,
  18822. message: s
  18823. });
  18824. }
  18825. }, {
  18826. key: "_appendMessage",
  18827. value: function _appendMessage() {
  18828. var _ref65 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18829. e = _ref65.messageId,
  18830. t = _ref65.message;
  18831. this.emit("message", t);
  18832. }
  18833. }, {
  18834. key: "_end",
  18835. value: function _end() {
  18836. var _ref66 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18837. e = _ref66.messageId,
  18838. t = _ref66.message;
  18839. this.emit("end", t), this.close();
  18840. }
  18841. }, {
  18842. key: "_initMessageListener",
  18843. value: function _initMessageListener() {
  18844. uni.onPushMessage(this._uniPushMessageCallback);
  18845. }
  18846. }, {
  18847. key: "_destroy",
  18848. value: function _destroy() {
  18849. uni.offPushMessage(this._uniPushMessageCallback);
  18850. }
  18851. }, {
  18852. key: "toJSON",
  18853. value: function toJSON() {
  18854. return {
  18855. appId: this._appId,
  18856. pushClientId: this._pushClientId,
  18857. seqId: this._seqId
  18858. };
  18859. }
  18860. }, {
  18861. key: "close",
  18862. value: function close() {
  18863. this._destroy(), this.emit("close");
  18864. }
  18865. }]);
  18866. return Ms;
  18867. }( /*#__PURE__*/function () {
  18868. function _class6() {
  18869. (0, _classCallCheck2.default)(this, _class6);
  18870. this._callback = {};
  18871. }
  18872. (0, _createClass2.default)(_class6, [{
  18873. key: "addListener",
  18874. value: function addListener(e, t) {
  18875. this._callback[e] || (this._callback[e] = []), this._callback[e].push(t);
  18876. }
  18877. }, {
  18878. key: "on",
  18879. value: function on(e, t) {
  18880. return this.addListener(e, t);
  18881. }
  18882. }, {
  18883. key: "removeListener",
  18884. value: function removeListener(e, t) {
  18885. if (!t) throw new Error('The "listener" argument must be of type function. Received undefined');
  18886. var n = this._callback[e];
  18887. if (!n) return;
  18888. var s = function (e, t) {
  18889. for (var _n16 = e.length - 1; _n16 >= 0; _n16--) {
  18890. if (e[_n16] === t) return _n16;
  18891. }
  18892. return -1;
  18893. }(n, t);
  18894. n.splice(s, 1);
  18895. }
  18896. }, {
  18897. key: "off",
  18898. value: function off(e, t) {
  18899. return this.removeListener(e, t);
  18900. }
  18901. }, {
  18902. key: "removeAllListener",
  18903. value: function removeAllListener(e) {
  18904. delete this._callback[e];
  18905. }
  18906. }, {
  18907. key: "emit",
  18908. value: function emit(e) {
  18909. var n = this._callback[e];
  18910. for (var _len4 = arguments.length, t = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
  18911. t[_key4 - 1] = arguments[_key4];
  18912. }
  18913. if (n) for (var _e28 = 0; _e28 < n.length; _e28++) {
  18914. n[_e28].apply(n, t);
  18915. }
  18916. }
  18917. }]);
  18918. return _class6;
  18919. }());
  18920. function qs(_x40, _x41) {
  18921. return _qs.apply(this, arguments);
  18922. }
  18923. function _qs() {
  18924. _qs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee59(e, t) {
  18925. var n, _e32, s;
  18926. return _regenerator.default.wrap(function _callee59$(_context59) {
  18927. while (1) {
  18928. switch (_context59.prev = _context59.next) {
  18929. case 0:
  18930. n = "http://".concat(e, ":").concat(t, "/system/ping");
  18931. _context59.prev = 1;
  18932. _context59.next = 4;
  18933. return s = {
  18934. url: n,
  18935. timeout: 500
  18936. }, new Promise(function (e, t) {
  18937. ne.request(_objectSpread(_objectSpread({}, s), {}, {
  18938. success: function success(t) {
  18939. e(t);
  18940. },
  18941. fail: function fail(e) {
  18942. t(e);
  18943. }
  18944. }));
  18945. });
  18946. case 4:
  18947. _e32 = _context59.sent;
  18948. return _context59.abrupt("return", !(!_e32.data || 0 !== _e32.data.code));
  18949. case 8:
  18950. _context59.prev = 8;
  18951. _context59.t0 = _context59["catch"](1);
  18952. return _context59.abrupt("return", !1);
  18953. case 11:
  18954. case "end":
  18955. return _context59.stop();
  18956. }
  18957. }
  18958. }, _callee59, null, [[1, 8]]);
  18959. }));
  18960. return _qs.apply(this, arguments);
  18961. }
  18962. function Fs(_x42) {
  18963. return _Fs.apply(this, arguments);
  18964. }
  18965. function _Fs() {
  18966. _Fs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee61(e) {
  18967. var _ae2, _e33, _t21, t, _t$debugInfo, n, s, _yield2, r, i, o;
  18968. return _regenerator.default.wrap(function _callee61$(_context61) {
  18969. while (1) {
  18970. switch (_context61.prev = _context61.next) {
  18971. case 0:
  18972. if (S) {
  18973. _context61.next = 2;
  18974. break;
  18975. }
  18976. return _context61.abrupt("return", Promise.resolve());
  18977. case 2:
  18978. if ("app" === P) {
  18979. _ae2 = ae(), _e33 = _ae2.osName, _t21 = _ae2.osVersion;
  18980. "ios" === _e33 && function (e) {
  18981. if (!e || "string" != typeof e) return 0;
  18982. var t = e.match(/^(\d+)./);
  18983. return t && t[1] ? parseInt(t[1]) : 0;
  18984. }(_t21) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发模式生效,发行模式会连接uniCloud云端服务)");
  18985. }
  18986. t = e.__dev__;
  18987. if (t.debugInfo) {
  18988. _context61.next = 6;
  18989. break;
  18990. }
  18991. return _context61.abrupt("return");
  18992. case 6:
  18993. _t$debugInfo = t.debugInfo;
  18994. n = _t$debugInfo.address;
  18995. s = _t$debugInfo.servePort;
  18996. _context61.next = 11;
  18997. return function () {
  18998. var _ref73 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee60(e, t) {
  18999. var n, _s16, _r9;
  19000. return _regenerator.default.wrap(function _callee60$(_context60) {
  19001. while (1) {
  19002. switch (_context60.prev = _context60.next) {
  19003. case 0:
  19004. _s16 = 0;
  19005. case 1:
  19006. if (!(_s16 < e.length)) {
  19007. _context60.next = 11;
  19008. break;
  19009. }
  19010. _r9 = e[_s16];
  19011. _context60.next = 5;
  19012. return qs(_r9, t);
  19013. case 5:
  19014. if (!_context60.sent) {
  19015. _context60.next = 8;
  19016. break;
  19017. }
  19018. n = _r9;
  19019. return _context60.abrupt("break", 11);
  19020. case 8:
  19021. _s16++;
  19022. _context60.next = 1;
  19023. break;
  19024. case 11:
  19025. return _context60.abrupt("return", {
  19026. address: n,
  19027. port: t
  19028. });
  19029. case 12:
  19030. case "end":
  19031. return _context60.stop();
  19032. }
  19033. }
  19034. }, _callee60);
  19035. }));
  19036. return function (_x43, _x44) {
  19037. return _ref73.apply(this, arguments);
  19038. };
  19039. }()(n, s);
  19040. case 11:
  19041. _yield2 = _context61.sent;
  19042. r = _yield2.address;
  19043. if (!r) {
  19044. _context61.next = 15;
  19045. break;
  19046. }
  19047. return _context61.abrupt("return", (t.localAddress = r, void (t.localPort = s)));
  19048. case 15:
  19049. i = console["app" === P ? "error" : "warn"];
  19050. o = "";
  19051. 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" === P && (o += "\n- 部分浏览器开启节流模式之后访问本地地址受限,请检查是否启用了节流模式"), 0 === P.indexOf("mp-") && (o += "\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"), !t.debugInfo.forceRemote)) {
  19052. _context61.next = 19;
  19053. break;
  19054. }
  19055. throw new Error(o);
  19056. case 19:
  19057. i(o);
  19058. case 20:
  19059. case "end":
  19060. return _context61.stop();
  19061. }
  19062. }
  19063. }, _callee61);
  19064. }));
  19065. return _Fs.apply(this, arguments);
  19066. }
  19067. function Ks(e) {
  19068. e._initPromiseHub || (e._initPromiseHub = new v({
  19069. createPromise: function createPromise() {
  19070. var t = Promise.resolve();
  19071. var n;
  19072. n = 1, t = new Promise(function (e) {
  19073. setTimeout(function () {
  19074. e();
  19075. }, n);
  19076. });
  19077. var s = e.auth();
  19078. return t.then(function () {
  19079. return s.getLoginState();
  19080. }).then(function (e) {
  19081. return e ? Promise.resolve() : s.signInAnonymously();
  19082. });
  19083. }
  19084. }));
  19085. }
  19086. var js = {
  19087. tcb: It,
  19088. tencent: It,
  19089. aliyun: de,
  19090. private: bt,
  19091. alipay: Et
  19092. };
  19093. var $s = new ( /*#__PURE__*/function () {
  19094. function _class7() {
  19095. (0, _classCallCheck2.default)(this, _class7);
  19096. }
  19097. (0, _createClass2.default)(_class7, [{
  19098. key: "init",
  19099. value: function init(e) {
  19100. var t = {};
  19101. var n = js[e.provider];
  19102. if (!n) throw new Error("未提供正确的provider参数");
  19103. t = n.init(e), S && function (e) {
  19104. if (!S) return;
  19105. var t = {};
  19106. e.__dev__ = t, t.debugLog = S && ("web" === P && navigator.userAgent.indexOf("HBuilderX") > 0 || "app" === P);
  19107. var n = T;
  19108. n && !n.code && (t.debugInfo = n);
  19109. var s = new v({
  19110. createPromise: function createPromise() {
  19111. return Fs(e);
  19112. }
  19113. });
  19114. t.initLocalNetwork = function () {
  19115. return s.exec();
  19116. };
  19117. }(t), Ks(t), Fn(t), function (e) {
  19118. var t = e.uploadFile;
  19119. e.uploadFile = function (e) {
  19120. return t.call(this, e);
  19121. };
  19122. }(t), function (e) {
  19123. e.database = function (t) {
  19124. if (t && Object.keys(t).length > 0) return e.init(t).database();
  19125. if (this._database) return this._database;
  19126. var n = Yn(Qn, {
  19127. uniClient: e
  19128. });
  19129. return this._database = n, n;
  19130. }, e.databaseForJQL = function (t) {
  19131. if (t && Object.keys(t).length > 0) return e.init(t).databaseForJQL();
  19132. if (this._databaseForJQL) return this._databaseForJQL;
  19133. var n = Yn(Qn, {
  19134. uniClient: e,
  19135. isJQL: !0
  19136. });
  19137. return this._databaseForJQL = n, n;
  19138. };
  19139. }(t), function (e) {
  19140. e.getCurrentUserInfo = Ps, e.chooseAndUploadFile = Cs.initChooseAndUploadFile(e), Object.assign(e, {
  19141. get mixinDatacom() {
  19142. return Os(e);
  19143. }
  19144. }), e.SSEChannel = Ms, e.initSecureNetworkByWeixin = Ns(e), e.importObject = Es(e);
  19145. }(t);
  19146. return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach(function (e) {
  19147. if (!t[e]) return;
  19148. var n = t[e];
  19149. t[e] = function () {
  19150. return n.apply(t, Array.from(arguments));
  19151. }, t[e] = function (e, t) {
  19152. return function (n) {
  19153. var _this26 = this;
  19154. var s = !1;
  19155. if ("callFunction" === t) {
  19156. var _e29 = n && n.type || c;
  19157. s = _e29 !== c;
  19158. }
  19159. var r = "callFunction" === t && !s,
  19160. i = this._initPromiseHub.exec();
  19161. n = n || {};
  19162. var _ee2 = ee(n),
  19163. o = _ee2.success,
  19164. a = _ee2.fail,
  19165. u = _ee2.complete,
  19166. h = i.then(function () {
  19167. return s ? Promise.resolve() : M(q(t, "invoke"), n);
  19168. }).then(function () {
  19169. return e.call(_this26, n);
  19170. }).then(function (e) {
  19171. return s ? Promise.resolve(e) : M(q(t, "success"), e).then(function () {
  19172. return M(q(t, "complete"), e);
  19173. }).then(function () {
  19174. return r && Y(j, {
  19175. type: H,
  19176. content: e
  19177. }), Promise.resolve(e);
  19178. });
  19179. }, function (e) {
  19180. return s ? Promise.reject(e) : M(q(t, "fail"), e).then(function () {
  19181. return M(q(t, "complete"), e);
  19182. }).then(function () {
  19183. return Y(j, {
  19184. type: H,
  19185. content: e
  19186. }), Promise.reject(e);
  19187. });
  19188. });
  19189. if (!(o || a || u)) return h;
  19190. h.then(function (e) {
  19191. o && o(e), u && u(e), r && Y(j, {
  19192. type: H,
  19193. content: e
  19194. });
  19195. }, function (e) {
  19196. a && a(e), u && u(e), r && Y(j, {
  19197. type: H,
  19198. content: e
  19199. });
  19200. });
  19201. };
  19202. }(t[e], e).bind(t);
  19203. }), t.init = this.init, t;
  19204. }
  19205. }]);
  19206. return _class7;
  19207. }())();
  19208. (function () {
  19209. var e = C;
  19210. var t = {};
  19211. if (e && 1 === e.length) t = e[0], $s = $s.init(t), $s._isDefault = !0;else {
  19212. var _t20 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
  19213. var _n17;
  19214. _n17 = e && e.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : x ? "应用未关联服务空间,请在uniCloud目录右键关联服务空间" : "uni-app cli项目内使用uniCloud需要使用HBuilderX的运行菜单运行项目,且需要在uniCloud目录关联服务空间", _t20.forEach(function (e) {
  19215. $s[e] = function () {
  19216. return console.error(_n17), Promise.reject(new te({
  19217. code: "SYS_ERR",
  19218. message: _n17
  19219. }));
  19220. };
  19221. });
  19222. }
  19223. Object.assign($s, {
  19224. get mixinDatacom() {
  19225. return Os($s);
  19226. }
  19227. }), Ss($s), $s.addInterceptor = N, $s.removeInterceptor = D, $s.interceptObject = F, S && "web" === P && (window.uniCloud = $s);
  19228. })();
  19229. var Bs = $s;
  19230. exports.default = Bs;
  19231. /* 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"]))
  19232. /***/ }),
  19233. /***/ 405:
  19234. /*!****************************************************************!*\
  19235. !*** ./node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
  19236. \****************************************************************/
  19237. /*! no static exports found */
  19238. /***/ (function(module, exports, __webpack_require__) {
  19239. var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ 388);
  19240. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  19241. var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ 406);
  19242. var construct = __webpack_require__(/*! ./construct.js */ 15);
  19243. function _wrapNativeSuper(Class) {
  19244. var _cache = typeof Map === "function" ? new Map() : undefined;
  19245. module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
  19246. if (Class === null || !isNativeFunction(Class)) return Class;
  19247. if (typeof Class !== "function") {
  19248. throw new TypeError("Super expression must either be null or a function");
  19249. }
  19250. if (typeof _cache !== "undefined") {
  19251. if (_cache.has(Class)) return _cache.get(Class);
  19252. _cache.set(Class, Wrapper);
  19253. }
  19254. function Wrapper() {
  19255. return construct(Class, arguments, getPrototypeOf(this).constructor);
  19256. }
  19257. Wrapper.prototype = Object.create(Class.prototype, {
  19258. constructor: {
  19259. value: Wrapper,
  19260. enumerable: false,
  19261. writable: true,
  19262. configurable: true
  19263. }
  19264. });
  19265. return setPrototypeOf(Wrapper, Class);
  19266. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19267. return _wrapNativeSuper(Class);
  19268. }
  19269. module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19270. /***/ }),
  19271. /***/ 406:
  19272. /*!*****************************************************************!*\
  19273. !*** ./node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
  19274. \*****************************************************************/
  19275. /*! no static exports found */
  19276. /***/ (function(module, exports) {
  19277. function _isNativeFunction(fn) {
  19278. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  19279. }
  19280. module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19281. /***/ }),
  19282. /***/ 407:
  19283. /*!***************************************************************************************!*\
  19284. !*** E:/work/Project_newGit/hptwxMiniProgram/pages.json?{"type":"origin-pages-json"} ***!
  19285. \***************************************************************************************/
  19286. /*! no static exports found */
  19287. /***/ (function(module, exports, __webpack_require__) {
  19288. "use strict";
  19289. Object.defineProperty(exports, "__esModule", {
  19290. value: true
  19291. });
  19292. exports.default = void 0;
  19293. var _default = {
  19294. "pages": [{
  19295. "path": "pages/index/index",
  19296. "style": {
  19297. "navigationBarTitleText": "六院联创促进医院高质量发展"
  19298. }
  19299. }, {
  19300. "path": "pages/history/history",
  19301. "style": {
  19302. "navigationBarTitleText": "操作记录",
  19303. "enablePullDownRefresh": true
  19304. }
  19305. }, {
  19306. "path": "pages/history/detail/detail",
  19307. "style": {
  19308. "navigationBarTitleText": "操作记录详情"
  19309. }
  19310. }, {
  19311. "path": "pages/myCenter/myCenter",
  19312. "style": {
  19313. "navigationBarTitleText": "我的",
  19314. "enablePullDownRefresh": true
  19315. }
  19316. }, {
  19317. "path": "pages/login/index",
  19318. "style": {
  19319. "navigationBarTitleText": "登录"
  19320. }
  19321. }, {
  19322. "path": "pages/authorizedLogin/index",
  19323. "style": {
  19324. "navigationBarTitleText": "授权登录"
  19325. }
  19326. }, {
  19327. "path": "pages/service_agreement/service_agreement",
  19328. "style": {
  19329. "navigationBarTitleText": "隐私协议"
  19330. }
  19331. }, {
  19332. "path": "pages/app_views/satisfaction_evaluation/satisfaction_evaluation",
  19333. "style": {
  19334. "navigationBarTitleText": "满意度评价",
  19335. "enablePullDownRefresh": false
  19336. }
  19337. }, {
  19338. "path": "pages/app_views/safe_checked/safe_checked",
  19339. "style": {
  19340. "navigationBarTitleText": "安全巡检",
  19341. "enablePullDownRefresh": false
  19342. }
  19343. }, {
  19344. "path": "pages/app_views/danger/submit/submit",
  19345. "style": {
  19346. "navigationBarTitleText": "登记隐患",
  19347. "enablePullDownRefresh": false
  19348. }
  19349. }, {
  19350. "path": "pages/app_views/equipment_maintenance/equipment_maintenance",
  19351. "style": {
  19352. "navigationBarTitleText": "设备保养",
  19353. "enablePullDownRefresh": false
  19354. }
  19355. }, {
  19356. "path": "pages/app_views/problem_feedback/problem_feedback",
  19357. "style": {
  19358. "navigationBarTitleText": "问题反馈",
  19359. "enablePullDownRefresh": false
  19360. }
  19361. }, {
  19362. "path": "pages/app_views/danger/handle/handle",
  19363. "style": {
  19364. "navigationBarTitleText": "隐患处理",
  19365. "enablePullDownRefresh": false
  19366. }
  19367. }, {
  19368. "path": "pages/app_views/checkList/index/index",
  19369. "style": {
  19370. "navigationBarTitleText": "清单",
  19371. "enablePullDownRefresh": false
  19372. }
  19373. }, {
  19374. "path": "pages/app_views/checkList/form/form",
  19375. "style": {
  19376. "navigationBarTitleText": "风险点巡检",
  19377. "enablePullDownRefresh": false
  19378. }
  19379. }, {
  19380. "path": "pages/app_views/hazard/index/index",
  19381. "style": {
  19382. "navigationBarTitleText": "危险源",
  19383. "enablePullDownRefresh": false
  19384. }
  19385. }, {
  19386. "path": "pages/app_views/hazard/form/form",
  19387. "style": {
  19388. "navigationBarTitleText": "隐患提交",
  19389. "enablePullDownRefresh": false
  19390. }
  19391. }, {
  19392. "path": "pages/myCenter/profile/profile",
  19393. "style": {
  19394. "navigationBarTitleText": "个人信息",
  19395. "enablePullDownRefresh": false
  19396. }
  19397. }, {
  19398. "path": "pages/task/task",
  19399. "style": {
  19400. "navigationBarTitleText": "代办任务",
  19401. "enablePullDownRefresh": true
  19402. }
  19403. }, {
  19404. "path": "pages/danger/danger",
  19405. "style": {
  19406. "navigationBarTitleText": "待处理隐患",
  19407. "enablePullDownRefresh": true
  19408. }
  19409. }, {
  19410. "path": "pages/app_views/problem_feedback/record/record",
  19411. "style": {
  19412. "navigationBarTitleText": "问题反馈记录",
  19413. "enablePullDownRefresh": false
  19414. }
  19415. }, {
  19416. "path": "pages/app_views/problem_feedback/form/form",
  19417. "style": {
  19418. "navigationBarTitleText": "问题反馈处理",
  19419. "enablePullDownRefresh": false
  19420. }
  19421. }, {
  19422. "path": "pages/app_views/checkList/detail/detail",
  19423. "style": {
  19424. "navigationBarTitleText": "检查表详情",
  19425. "enablePullDownRefresh": false
  19426. }
  19427. }, {
  19428. "path": "pages/app_views/clockIn/index",
  19429. "style": {
  19430. "navigationBarTitleText": "打卡签到",
  19431. "enablePullDownRefresh": false
  19432. }
  19433. }, {
  19434. "path": "pages/index/detail/detail",
  19435. "style": {
  19436. "navigationBarTitleText": "快捷操作",
  19437. "enablePullDownRefresh": false
  19438. }
  19439. }, {
  19440. "path": "pages/index/handle/danger/index/index",
  19441. "style": {
  19442. "navigationBarTitleText": "隐患处理",
  19443. "enablePullDownRefresh": false
  19444. }
  19445. }, {
  19446. "path": "pages/index/handle/danger/index/submit",
  19447. "style": {
  19448. "navigationBarTitleText": "隐患登记",
  19449. "enablePullDownRefresh": false
  19450. }
  19451. }, {
  19452. "path": "pages/index/handle/task/task",
  19453. "style": {
  19454. "navigationBarTitleText": "任务处理",
  19455. "enablePullDownRefresh": false
  19456. }
  19457. }, {
  19458. "path": "pages/index/handle/task/checkList/form/form",
  19459. "style": {
  19460. "navigationBarTitleText": "任务检查表处理",
  19461. "enablePullDownRefresh": false
  19462. }
  19463. }, {
  19464. "path": "pages/index/handle/alert/alert",
  19465. "style": {
  19466. "navigationBarTitleText": "预警处理",
  19467. "enablePullDownRefresh": false
  19468. }
  19469. }, {
  19470. "path": "pages/index/handle/warning/warning",
  19471. "style": {
  19472. "navigationBarTitleText": "告警处理",
  19473. "enablePullDownRefresh": false
  19474. }
  19475. }, {
  19476. "path": "pages/index/handle/task/checkList/form/transferCheckTask",
  19477. "style": {
  19478. "navigationBarTitleText": "转交任务",
  19479. "enablePullDownRefresh": false
  19480. }
  19481. }, {
  19482. "path": "pages/index/handle/task/hazardRecord/hazardRecord",
  19483. "style": {
  19484. "navigationBarTitleText": "处理任务",
  19485. "enablePullDownRefresh": false
  19486. }
  19487. }, {
  19488. "path": "pages/index/handle/task/hazardRecord/form",
  19489. "style": {
  19490. "navigationBarTitleText": "处理检查",
  19491. "enablePullDownRefresh": false
  19492. }
  19493. }],
  19494. "tabBar": {
  19495. "color": "#7A7E83",
  19496. "selectedColor": "#1296db",
  19497. "borderStyle": "black",
  19498. "backgroundColor": "#ffffff",
  19499. "list": [{
  19500. "pagePath": "pages/index/index",
  19501. "iconPath": "static/tabbar/index.png",
  19502. "selectedIconPath": "static/tabbar/indexEd.png",
  19503. "text": "首页"
  19504. }, {
  19505. "pagePath": "pages/history/history",
  19506. "iconPath": "static/tabbar/history.png",
  19507. "selectedIconPath": "static/tabbar/historyEd.png",
  19508. "text": "操作记录"
  19509. }, {
  19510. "pagePath": "pages/myCenter/myCenter",
  19511. "iconPath": "static/tabbar/myCenter.png",
  19512. "selectedIconPath": "static/tabbar/myCenterEd.png",
  19513. "text": "我的"
  19514. }]
  19515. },
  19516. "globalStyle": {
  19517. "navigationBarTextStyle": "black",
  19518. "navigationBarTitleText": "uni-app",
  19519. "navigationBarBackgroundColor": "#F8F8F8",
  19520. "backgroundColor": "#F8F8F8"
  19521. },
  19522. "permission": {
  19523. "scope.userLocation": {
  19524. "desc": "你的位置信息将用于打卡签到定位"
  19525. }
  19526. },
  19527. "uniIdRouter": {}
  19528. };
  19529. exports.default = _default;
  19530. /***/ }),
  19531. /***/ 408:
  19532. /*!**************************************************************************!*\
  19533. !*** E:/work/Project_newGit/hptwxMiniProgram/pages.json?{"type":"stat"} ***!
  19534. \**************************************************************************/
  19535. /*! no static exports found */
  19536. /***/ (function(module, exports, __webpack_require__) {
  19537. "use strict";
  19538. Object.defineProperty(exports, "__esModule", {
  19539. value: true
  19540. });
  19541. exports.default = void 0;
  19542. var _default = {
  19543. "appid": "__UNI__2E20170"
  19544. };
  19545. exports.default = _default;
  19546. /***/ }),
  19547. /***/ 41:
  19548. /*!*******************************************************************!*\
  19549. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  19550. \*******************************************************************/
  19551. /*! no static exports found */
  19552. /***/ (function(module, exports, __webpack_require__) {
  19553. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  19554. function _regeneratorRuntime() {
  19555. "use strict";
  19556. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  19557. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  19558. return exports;
  19559. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19560. var exports = {},
  19561. Op = Object.prototype,
  19562. hasOwn = Op.hasOwnProperty,
  19563. defineProperty = Object.defineProperty || function (obj, key, desc) {
  19564. obj[key] = desc.value;
  19565. },
  19566. $Symbol = "function" == typeof Symbol ? Symbol : {},
  19567. iteratorSymbol = $Symbol.iterator || "@@iterator",
  19568. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  19569. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  19570. function define(obj, key, value) {
  19571. return Object.defineProperty(obj, key, {
  19572. value: value,
  19573. enumerable: !0,
  19574. configurable: !0,
  19575. writable: !0
  19576. }), obj[key];
  19577. }
  19578. try {
  19579. define({}, "");
  19580. } catch (err) {
  19581. define = function define(obj, key, value) {
  19582. return obj[key] = value;
  19583. };
  19584. }
  19585. function wrap(innerFn, outerFn, self, tryLocsList) {
  19586. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  19587. generator = Object.create(protoGenerator.prototype),
  19588. context = new Context(tryLocsList || []);
  19589. return defineProperty(generator, "_invoke", {
  19590. value: makeInvokeMethod(innerFn, self, context)
  19591. }), generator;
  19592. }
  19593. function tryCatch(fn, obj, arg) {
  19594. try {
  19595. return {
  19596. type: "normal",
  19597. arg: fn.call(obj, arg)
  19598. };
  19599. } catch (err) {
  19600. return {
  19601. type: "throw",
  19602. arg: err
  19603. };
  19604. }
  19605. }
  19606. exports.wrap = wrap;
  19607. var ContinueSentinel = {};
  19608. function Generator() {}
  19609. function GeneratorFunction() {}
  19610. function GeneratorFunctionPrototype() {}
  19611. var IteratorPrototype = {};
  19612. define(IteratorPrototype, iteratorSymbol, function () {
  19613. return this;
  19614. });
  19615. var getProto = Object.getPrototypeOf,
  19616. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  19617. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  19618. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  19619. function defineIteratorMethods(prototype) {
  19620. ["next", "throw", "return"].forEach(function (method) {
  19621. define(prototype, method, function (arg) {
  19622. return this._invoke(method, arg);
  19623. });
  19624. });
  19625. }
  19626. function AsyncIterator(generator, PromiseImpl) {
  19627. function invoke(method, arg, resolve, reject) {
  19628. var record = tryCatch(generator[method], generator, arg);
  19629. if ("throw" !== record.type) {
  19630. var result = record.arg,
  19631. value = result.value;
  19632. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  19633. invoke("next", value, resolve, reject);
  19634. }, function (err) {
  19635. invoke("throw", err, resolve, reject);
  19636. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  19637. result.value = unwrapped, resolve(result);
  19638. }, function (error) {
  19639. return invoke("throw", error, resolve, reject);
  19640. });
  19641. }
  19642. reject(record.arg);
  19643. }
  19644. var previousPromise;
  19645. defineProperty(this, "_invoke", {
  19646. value: function value(method, arg) {
  19647. function callInvokeWithMethodAndArg() {
  19648. return new PromiseImpl(function (resolve, reject) {
  19649. invoke(method, arg, resolve, reject);
  19650. });
  19651. }
  19652. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  19653. }
  19654. });
  19655. }
  19656. function makeInvokeMethod(innerFn, self, context) {
  19657. var state = "suspendedStart";
  19658. return function (method, arg) {
  19659. if ("executing" === state) throw new Error("Generator is already running");
  19660. if ("completed" === state) {
  19661. if ("throw" === method) throw arg;
  19662. return doneResult();
  19663. }
  19664. for (context.method = method, context.arg = arg;;) {
  19665. var delegate = context.delegate;
  19666. if (delegate) {
  19667. var delegateResult = maybeInvokeDelegate(delegate, context);
  19668. if (delegateResult) {
  19669. if (delegateResult === ContinueSentinel) continue;
  19670. return delegateResult;
  19671. }
  19672. }
  19673. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  19674. if ("suspendedStart" === state) throw state = "completed", context.arg;
  19675. context.dispatchException(context.arg);
  19676. } else "return" === context.method && context.abrupt("return", context.arg);
  19677. state = "executing";
  19678. var record = tryCatch(innerFn, self, context);
  19679. if ("normal" === record.type) {
  19680. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  19681. return {
  19682. value: record.arg,
  19683. done: context.done
  19684. };
  19685. }
  19686. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  19687. }
  19688. };
  19689. }
  19690. function maybeInvokeDelegate(delegate, context) {
  19691. var methodName = context.method,
  19692. method = delegate.iterator[methodName];
  19693. 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;
  19694. var record = tryCatch(method, delegate.iterator, context.arg);
  19695. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  19696. var info = record.arg;
  19697. 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);
  19698. }
  19699. function pushTryEntry(locs) {
  19700. var entry = {
  19701. tryLoc: locs[0]
  19702. };
  19703. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  19704. }
  19705. function resetTryEntry(entry) {
  19706. var record = entry.completion || {};
  19707. record.type = "normal", delete record.arg, entry.completion = record;
  19708. }
  19709. function Context(tryLocsList) {
  19710. this.tryEntries = [{
  19711. tryLoc: "root"
  19712. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  19713. }
  19714. function values(iterable) {
  19715. if (iterable) {
  19716. var iteratorMethod = iterable[iteratorSymbol];
  19717. if (iteratorMethod) return iteratorMethod.call(iterable);
  19718. if ("function" == typeof iterable.next) return iterable;
  19719. if (!isNaN(iterable.length)) {
  19720. var i = -1,
  19721. next = function next() {
  19722. for (; ++i < iterable.length;) {
  19723. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  19724. }
  19725. return next.value = undefined, next.done = !0, next;
  19726. };
  19727. return next.next = next;
  19728. }
  19729. }
  19730. return {
  19731. next: doneResult
  19732. };
  19733. }
  19734. function doneResult() {
  19735. return {
  19736. value: undefined,
  19737. done: !0
  19738. };
  19739. }
  19740. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  19741. value: GeneratorFunctionPrototype,
  19742. configurable: !0
  19743. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  19744. value: GeneratorFunction,
  19745. configurable: !0
  19746. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  19747. var ctor = "function" == typeof genFun && genFun.constructor;
  19748. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  19749. }, exports.mark = function (genFun) {
  19750. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  19751. }, exports.awrap = function (arg) {
  19752. return {
  19753. __await: arg
  19754. };
  19755. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  19756. return this;
  19757. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  19758. void 0 === PromiseImpl && (PromiseImpl = Promise);
  19759. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  19760. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  19761. return result.done ? result.value : iter.next();
  19762. });
  19763. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  19764. return this;
  19765. }), define(Gp, "toString", function () {
  19766. return "[object Generator]";
  19767. }), exports.keys = function (val) {
  19768. var object = Object(val),
  19769. keys = [];
  19770. for (var key in object) {
  19771. keys.push(key);
  19772. }
  19773. return keys.reverse(), function next() {
  19774. for (; keys.length;) {
  19775. var key = keys.pop();
  19776. if (key in object) return next.value = key, next.done = !1, next;
  19777. }
  19778. return next.done = !0, next;
  19779. };
  19780. }, exports.values = values, Context.prototype = {
  19781. constructor: Context,
  19782. reset: function reset(skipTempReset) {
  19783. 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) {
  19784. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  19785. }
  19786. },
  19787. stop: function stop() {
  19788. this.done = !0;
  19789. var rootRecord = this.tryEntries[0].completion;
  19790. if ("throw" === rootRecord.type) throw rootRecord.arg;
  19791. return this.rval;
  19792. },
  19793. dispatchException: function dispatchException(exception) {
  19794. if (this.done) throw exception;
  19795. var context = this;
  19796. function handle(loc, caught) {
  19797. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  19798. }
  19799. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  19800. var entry = this.tryEntries[i],
  19801. record = entry.completion;
  19802. if ("root" === entry.tryLoc) return handle("end");
  19803. if (entry.tryLoc <= this.prev) {
  19804. var hasCatch = hasOwn.call(entry, "catchLoc"),
  19805. hasFinally = hasOwn.call(entry, "finallyLoc");
  19806. if (hasCatch && hasFinally) {
  19807. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  19808. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  19809. } else if (hasCatch) {
  19810. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  19811. } else {
  19812. if (!hasFinally) throw new Error("try statement without catch or finally");
  19813. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  19814. }
  19815. }
  19816. }
  19817. },
  19818. abrupt: function abrupt(type, arg) {
  19819. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  19820. var entry = this.tryEntries[i];
  19821. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  19822. var finallyEntry = entry;
  19823. break;
  19824. }
  19825. }
  19826. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  19827. var record = finallyEntry ? finallyEntry.completion : {};
  19828. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  19829. },
  19830. complete: function complete(record, afterLoc) {
  19831. if ("throw" === record.type) throw record.arg;
  19832. 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;
  19833. },
  19834. finish: function finish(finallyLoc) {
  19835. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  19836. var entry = this.tryEntries[i];
  19837. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  19838. }
  19839. },
  19840. "catch": function _catch(tryLoc) {
  19841. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  19842. var entry = this.tryEntries[i];
  19843. if (entry.tryLoc === tryLoc) {
  19844. var record = entry.completion;
  19845. if ("throw" === record.type) {
  19846. var thrown = record.arg;
  19847. resetTryEntry(entry);
  19848. }
  19849. return thrown;
  19850. }
  19851. }
  19852. throw new Error("illegal catch attempt");
  19853. },
  19854. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  19855. return this.delegate = {
  19856. iterator: values(iterable),
  19857. resultName: resultName,
  19858. nextLoc: nextLoc
  19859. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  19860. }
  19861. }, exports;
  19862. }
  19863. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19864. /***/ }),
  19865. /***/ 42:
  19866. /*!*****************************************************************!*\
  19867. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  19868. \*****************************************************************/
  19869. /*! no static exports found */
  19870. /***/ (function(module, exports) {
  19871. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  19872. try {
  19873. var info = gen[key](arg);
  19874. var value = info.value;
  19875. } catch (error) {
  19876. reject(error);
  19877. return;
  19878. }
  19879. if (info.done) {
  19880. resolve(value);
  19881. } else {
  19882. Promise.resolve(value).then(_next, _throw);
  19883. }
  19884. }
  19885. function _asyncToGenerator(fn) {
  19886. return function () {
  19887. var self = this,
  19888. args = arguments;
  19889. return new Promise(function (resolve, reject) {
  19890. var gen = fn.apply(self, args);
  19891. function _next(value) {
  19892. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  19893. }
  19894. function _throw(err) {
  19895. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  19896. }
  19897. _next(undefined);
  19898. });
  19899. };
  19900. }
  19901. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19902. /***/ }),
  19903. /***/ 423:
  19904. /*!****************************************************************************************************************************!*\
  19905. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/index.js ***!
  19906. \****************************************************************************************************************************/
  19907. /*! no static exports found */
  19908. /***/ (function(module, exports, __webpack_require__) {
  19909. "use strict";
  19910. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  19911. Object.defineProperty(exports, "__esModule", {
  19912. value: true
  19913. });
  19914. exports.default = void 0;
  19915. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 424));
  19916. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 425));
  19917. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 426));
  19918. var _default = {
  19919. en: _en.default,
  19920. 'zh-Hans': _zhHans.default,
  19921. 'zh-Hant': _zhHant.default
  19922. };
  19923. exports.default = _default;
  19924. /***/ }),
  19925. /***/ 424:
  19926. /*!***************************************************************************************************************************!*\
  19927. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/en.json ***!
  19928. \***************************************************************************************************************************/
  19929. /*! 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 */
  19930. /***/ (function(module) {
  19931. module.exports = JSON.parse("{\"uni-datetime-picker.selectDate\":\"select date\",\"uni-datetime-picker.selectTime\":\"select time\",\"uni-datetime-picker.selectDateTime\":\"select date and time\",\"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\"}");
  19932. /***/ }),
  19933. /***/ 425:
  19934. /*!********************************************************************************************************************************!*\
  19935. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hans.json ***!
  19936. \********************************************************************************************************************************/
  19937. /*! 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 */
  19938. /***/ (function(module) {
  19939. 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\":\"确认\"}");
  19940. /***/ }),
  19941. /***/ 426:
  19942. /*!********************************************************************************************************************************!*\
  19943. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hant.json ***!
  19944. \********************************************************************************************************************************/
  19945. /*! 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 */
  19946. /***/ (function(module) {
  19947. 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\":\"確認\"}");
  19948. /***/ }),
  19949. /***/ 427:
  19950. /*!**********************************************************************************************************************!*\
  19951. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js ***!
  19952. \**********************************************************************************************************************/
  19953. /*! no static exports found */
  19954. /***/ (function(module, exports, __webpack_require__) {
  19955. "use strict";
  19956. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  19957. Object.defineProperty(exports, "__esModule", {
  19958. value: true
  19959. });
  19960. exports.Calendar = void 0;
  19961. exports.addZero = addZero;
  19962. exports.checkDate = checkDate;
  19963. exports.dateCompare = dateCompare;
  19964. exports.fixIosDateFormat = fixIosDateFormat;
  19965. exports.getDate = getDate;
  19966. exports.getDateTime = getDateTime;
  19967. exports.getDefaultSecond = getDefaultSecond;
  19968. exports.getTime = getTime;
  19969. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  19970. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  19971. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  19972. var Calendar = /*#__PURE__*/function () {
  19973. function Calendar() {
  19974. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  19975. selected = _ref.selected,
  19976. startDate = _ref.startDate,
  19977. endDate = _ref.endDate,
  19978. range = _ref.range;
  19979. (0, _classCallCheck2.default)(this, Calendar);
  19980. // 当前日期
  19981. this.date = this.getDateObj(new Date()); // 当前初入日期
  19982. // 打点信息
  19983. this.selected = selected || [];
  19984. // 起始时间
  19985. this.startDate = startDate;
  19986. // 终止时间
  19987. this.endDate = endDate;
  19988. // 是否范围选择
  19989. this.range = range;
  19990. // 多选状态
  19991. this.cleanMultipleStatus();
  19992. // 每周日期
  19993. this.weeks = {};
  19994. this.lastHover = false;
  19995. }
  19996. /**
  19997. * 设置日期
  19998. * @param {Object} date
  19999. */
  20000. (0, _createClass2.default)(Calendar, [{
  20001. key: "setDate",
  20002. value: function setDate(date) {
  20003. var selectDate = this.getDateObj(date);
  20004. this.getWeeks(selectDate.fullDate);
  20005. }
  20006. /**
  20007. * 清理多选状态
  20008. */
  20009. }, {
  20010. key: "cleanMultipleStatus",
  20011. value: function cleanMultipleStatus() {
  20012. this.multipleStatus = {
  20013. before: '',
  20014. after: '',
  20015. data: []
  20016. };
  20017. }
  20018. }, {
  20019. key: "setStartDate",
  20020. value: function setStartDate(startDate) {
  20021. this.startDate = startDate;
  20022. }
  20023. }, {
  20024. key: "setEndDate",
  20025. value: function setEndDate(endDate) {
  20026. this.endDate = endDate;
  20027. }
  20028. }, {
  20029. key: "getPreMonthObj",
  20030. value: function getPreMonthObj(date) {
  20031. date = fixIosDateFormat(date);
  20032. date = new Date(date);
  20033. var oldMonth = date.getMonth();
  20034. date.setMonth(oldMonth - 1);
  20035. var newMonth = date.getMonth();
  20036. if (oldMonth !== 0 && newMonth - oldMonth === 0) {
  20037. date.setMonth(newMonth - 1);
  20038. }
  20039. return this.getDateObj(date);
  20040. }
  20041. }, {
  20042. key: "getNextMonthObj",
  20043. value: function getNextMonthObj(date) {
  20044. date = fixIosDateFormat(date);
  20045. date = new Date(date);
  20046. var oldMonth = date.getMonth();
  20047. date.setMonth(oldMonth + 1);
  20048. var newMonth = date.getMonth();
  20049. if (newMonth - oldMonth > 1) {
  20050. date.setMonth(newMonth - 1);
  20051. }
  20052. return this.getDateObj(date);
  20053. }
  20054. /**
  20055. * 获取指定格式Date对象
  20056. */
  20057. }, {
  20058. key: "getDateObj",
  20059. value: function getDateObj(date) {
  20060. date = fixIosDateFormat(date);
  20061. date = new Date(date);
  20062. return {
  20063. fullDate: getDate(date),
  20064. year: date.getFullYear(),
  20065. month: addZero(date.getMonth() + 1),
  20066. date: addZero(date.getDate()),
  20067. day: date.getDay()
  20068. };
  20069. }
  20070. /**
  20071. * 获取上一个月日期集合
  20072. */
  20073. }, {
  20074. key: "getPreMonthDays",
  20075. value: function getPreMonthDays(amount, dateObj) {
  20076. var _this = this;
  20077. var result = [];
  20078. var _loop = function _loop(i) {
  20079. var month = dateObj.month > 1 ? dateObj.month - 1 : 12;
  20080. var year = month === 12 ? dateObj.year - 1 : dateObj.year;
  20081. var date = new Date(year, month, -i).getDate();
  20082. var fullDate = "".concat(year, "-").concat(addZero(month), "-").concat(addZero(date));
  20083. var multiples = _this.multipleStatus.data;
  20084. var multiplesStatus = -1;
  20085. if (_this.range && multiples) {
  20086. multiplesStatus = multiples.findIndex(function (item) {
  20087. return _this.dateEqual(item, fullDate);
  20088. });
  20089. }
  20090. var checked = multiplesStatus !== -1;
  20091. // 获取打点信息
  20092. var extraInfo = _this.selected && _this.selected.find(function (item) {
  20093. if (_this.dateEqual(fullDate, item.date)) {
  20094. return item;
  20095. }
  20096. });
  20097. result.push({
  20098. fullDate: fullDate,
  20099. year: year,
  20100. month: month,
  20101. date: date,
  20102. multiple: _this.range ? checked : false,
  20103. beforeMultiple: _this.isLogicBefore(fullDate, _this.multipleStatus.before, _this.multipleStatus.after),
  20104. afterMultiple: _this.isLogicAfter(fullDate, _this.multipleStatus.before, _this.multipleStatus.after),
  20105. disable: _this.startDate && !dateCompare(_this.startDate, fullDate) || _this.endDate && !dateCompare(fullDate, _this.endDate),
  20106. isToday: fullDate === _this.date.fullDate,
  20107. userChecked: false,
  20108. extraInfo: extraInfo
  20109. });
  20110. };
  20111. for (var i = amount - 1; i >= 0; i--) {
  20112. _loop(i);
  20113. }
  20114. return result;
  20115. }
  20116. /**
  20117. * 获取本月日期集合
  20118. */
  20119. }, {
  20120. key: "getCurrentMonthDays",
  20121. value: function getCurrentMonthDays(amount, dateObj) {
  20122. var _this2 = this;
  20123. var result = [];
  20124. var fullDate = this.date.fullDate;
  20125. var _loop2 = function _loop2(i) {
  20126. var currentDate = "".concat(dateObj.year, "-").concat(dateObj.month, "-").concat(addZero(i));
  20127. var isToday = fullDate === currentDate;
  20128. // 获取打点信息
  20129. var extraInfo = _this2.selected && _this2.selected.find(function (item) {
  20130. if (_this2.dateEqual(currentDate, item.date)) {
  20131. return item;
  20132. }
  20133. });
  20134. // 日期禁用
  20135. var disableBefore = true;
  20136. var disableAfter = true;
  20137. if (_this2.startDate) {
  20138. disableBefore = dateCompare(_this2.startDate, currentDate);
  20139. }
  20140. if (_this2.endDate) {
  20141. disableAfter = dateCompare(currentDate, _this2.endDate);
  20142. }
  20143. var multiples = _this2.multipleStatus.data;
  20144. var multiplesStatus = -1;
  20145. if (_this2.range && multiples) {
  20146. multiplesStatus = multiples.findIndex(function (item) {
  20147. return _this2.dateEqual(item, currentDate);
  20148. });
  20149. }
  20150. var checked = multiplesStatus !== -1;
  20151. result.push({
  20152. fullDate: currentDate,
  20153. year: dateObj.year,
  20154. month: dateObj.month,
  20155. date: i,
  20156. multiple: _this2.range ? checked : false,
  20157. beforeMultiple: _this2.isLogicBefore(currentDate, _this2.multipleStatus.before, _this2.multipleStatus.after),
  20158. afterMultiple: _this2.isLogicAfter(currentDate, _this2.multipleStatus.before, _this2.multipleStatus.after),
  20159. disable: _this2.startDate && !dateCompare(_this2.startDate, currentDate) || _this2.endDate && !dateCompare(currentDate, _this2.endDate),
  20160. isToday: isToday,
  20161. userChecked: false,
  20162. extraInfo: extraInfo
  20163. });
  20164. };
  20165. for (var i = 1; i <= amount; i++) {
  20166. _loop2(i);
  20167. }
  20168. return result;
  20169. }
  20170. /**
  20171. * 获取下一个月日期集合
  20172. */
  20173. }, {
  20174. key: "_getNextMonthDays",
  20175. value: function _getNextMonthDays(amount, dateObj) {
  20176. var _this3 = this;
  20177. var result = [];
  20178. var month = dateObj.month + 1;
  20179. var _loop3 = function _loop3(i) {
  20180. var month = dateObj.month === 12 ? 1 : dateObj.month * 1 + 1;
  20181. var year = month === 1 ? dateObj.year + 1 : dateObj.year;
  20182. var fullDate = "".concat(year, "-").concat(addZero(month), "-").concat(addZero(i));
  20183. var multiples = _this3.multipleStatus.data;
  20184. var multiplesStatus = -1;
  20185. if (_this3.range && multiples) {
  20186. multiplesStatus = multiples.findIndex(function (item) {
  20187. return _this3.dateEqual(item, fullDate);
  20188. });
  20189. }
  20190. var checked = multiplesStatus !== -1;
  20191. // 获取打点信息
  20192. var extraInfo = _this3.selected && _this3.selected.find(function (item) {
  20193. if (_this3.dateEqual(fullDate, item.date)) {
  20194. return item;
  20195. }
  20196. });
  20197. result.push({
  20198. fullDate: fullDate,
  20199. year: year,
  20200. date: i,
  20201. month: month,
  20202. multiple: _this3.range ? checked : false,
  20203. beforeMultiple: _this3.isLogicBefore(fullDate, _this3.multipleStatus.before, _this3.multipleStatus.after),
  20204. afterMultiple: _this3.isLogicAfter(fullDate, _this3.multipleStatus.before, _this3.multipleStatus.after),
  20205. disable: _this3.startDate && !dateCompare(_this3.startDate, fullDate) || _this3.endDate && !dateCompare(fullDate, _this3.endDate),
  20206. isToday: fullDate === _this3.date.fullDate,
  20207. userChecked: false,
  20208. extraInfo: extraInfo
  20209. });
  20210. };
  20211. for (var i = 1; i <= amount; i++) {
  20212. _loop3(i);
  20213. }
  20214. return result;
  20215. }
  20216. /**
  20217. * 获取当前日期详情
  20218. * @param {Object} date
  20219. */
  20220. }, {
  20221. key: "getInfo",
  20222. value: function getInfo(date) {
  20223. var _this4 = this;
  20224. if (!date) {
  20225. date = new Date();
  20226. }
  20227. return this.calendar.find(function (item) {
  20228. return item.fullDate === _this4.getDateObj(date).fullDate;
  20229. });
  20230. }
  20231. /**
  20232. * 比较时间是否相等
  20233. */
  20234. }, {
  20235. key: "dateEqual",
  20236. value: function dateEqual(before, after) {
  20237. before = new Date(fixIosDateFormat(before));
  20238. after = new Date(fixIosDateFormat(after));
  20239. return before.valueOf() === after.valueOf();
  20240. }
  20241. /**
  20242. * 比较真实起始日期
  20243. */
  20244. }, {
  20245. key: "isLogicBefore",
  20246. value: function isLogicBefore(currentDate, before, after) {
  20247. var logicBefore = before;
  20248. if (before && after) {
  20249. logicBefore = dateCompare(before, after) ? before : after;
  20250. }
  20251. return this.dateEqual(logicBefore, currentDate);
  20252. }
  20253. }, {
  20254. key: "isLogicAfter",
  20255. value: function isLogicAfter(currentDate, before, after) {
  20256. var logicAfter = after;
  20257. if (before && after) {
  20258. logicAfter = dateCompare(before, after) ? after : before;
  20259. }
  20260. return this.dateEqual(logicAfter, currentDate);
  20261. }
  20262. /**
  20263. * 获取日期范围内所有日期
  20264. * @param {Object} begin
  20265. * @param {Object} end
  20266. */
  20267. }, {
  20268. key: "geDateAll",
  20269. value: function geDateAll(begin, end) {
  20270. var arr = [];
  20271. var ab = begin.split('-');
  20272. var ae = end.split('-');
  20273. var db = new Date();
  20274. db.setFullYear(ab[0], ab[1] - 1, ab[2]);
  20275. var de = new Date();
  20276. de.setFullYear(ae[0], ae[1] - 1, ae[2]);
  20277. var unixDb = db.getTime() - 24 * 60 * 60 * 1000;
  20278. var unixDe = de.getTime() - 24 * 60 * 60 * 1000;
  20279. for (var k = unixDb; k <= unixDe;) {
  20280. k = k + 24 * 60 * 60 * 1000;
  20281. arr.push(this.getDateObj(new Date(parseInt(k))).fullDate);
  20282. }
  20283. return arr;
  20284. }
  20285. /**
  20286. * 获取多选状态
  20287. */
  20288. }, {
  20289. key: "setMultiple",
  20290. value: function setMultiple(fullDate) {
  20291. if (!this.range) return;
  20292. var _this$multipleStatus = this.multipleStatus,
  20293. before = _this$multipleStatus.before,
  20294. after = _this$multipleStatus.after;
  20295. if (before && after) {
  20296. if (!this.lastHover) {
  20297. this.lastHover = true;
  20298. return;
  20299. }
  20300. this.multipleStatus.before = fullDate;
  20301. this.multipleStatus.after = '';
  20302. this.multipleStatus.data = [];
  20303. this.multipleStatus.fulldate = '';
  20304. this.lastHover = false;
  20305. } else {
  20306. if (!before) {
  20307. this.multipleStatus.before = fullDate;
  20308. this.lastHover = false;
  20309. } else {
  20310. this.multipleStatus.after = fullDate;
  20311. if (dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
  20312. this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
  20313. } else {
  20314. this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
  20315. }
  20316. this.lastHover = true;
  20317. }
  20318. }
  20319. this.getWeeks(fullDate);
  20320. }
  20321. /**
  20322. * 鼠标 hover 更新多选状态
  20323. */
  20324. }, {
  20325. key: "setHoverMultiple",
  20326. value: function setHoverMultiple(fullDate) {
  20327. if (!this.range || this.lastHover) return;
  20328. var before = this.multipleStatus.before;
  20329. if (!before) {
  20330. this.multipleStatus.before = fullDate;
  20331. } else {
  20332. this.multipleStatus.after = fullDate;
  20333. if (dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
  20334. this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
  20335. } else {
  20336. this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
  20337. }
  20338. }
  20339. this.getWeeks(fullDate);
  20340. }
  20341. /**
  20342. * 更新默认值多选状态
  20343. */
  20344. }, {
  20345. key: "setDefaultMultiple",
  20346. value: function setDefaultMultiple(before, after) {
  20347. this.multipleStatus.before = before;
  20348. this.multipleStatus.after = after;
  20349. if (before && after) {
  20350. if (dateCompare(before, after)) {
  20351. this.multipleStatus.data = this.geDateAll(before, after);
  20352. this.getWeeks(after);
  20353. } else {
  20354. this.multipleStatus.data = this.geDateAll(after, before);
  20355. this.getWeeks(before);
  20356. }
  20357. }
  20358. }
  20359. /**
  20360. * 获取每周数据
  20361. * @param {Object} dateData
  20362. */
  20363. }, {
  20364. key: "getWeeks",
  20365. value: function getWeeks(dateData) {
  20366. var _this$getDateObj = this.getDateObj(dateData),
  20367. year = _this$getDateObj.year,
  20368. month = _this$getDateObj.month;
  20369. var preMonthDayAmount = new Date(year, month - 1, 1).getDay();
  20370. var preMonthDays = this.getPreMonthDays(preMonthDayAmount, this.getDateObj(dateData));
  20371. var currentMonthDayAmount = new Date(year, month, 0).getDate();
  20372. var currentMonthDays = this.getCurrentMonthDays(currentMonthDayAmount, this.getDateObj(dateData));
  20373. var nextMonthDayAmount = 42 - preMonthDayAmount - currentMonthDayAmount;
  20374. var nextMonthDays = this._getNextMonthDays(nextMonthDayAmount, this.getDateObj(dateData));
  20375. var calendarDays = [].concat((0, _toConsumableArray2.default)(preMonthDays), (0, _toConsumableArray2.default)(currentMonthDays), (0, _toConsumableArray2.default)(nextMonthDays));
  20376. var weeks = new Array(6);
  20377. for (var i = 0; i < calendarDays.length; i++) {
  20378. var index = Math.floor(i / 7);
  20379. if (!weeks[index]) {
  20380. weeks[index] = new Array(7);
  20381. }
  20382. weeks[index][i % 7] = calendarDays[i];
  20383. }
  20384. this.calendar = calendarDays;
  20385. this.weeks = weeks;
  20386. }
  20387. }]);
  20388. return Calendar;
  20389. }();
  20390. exports.Calendar = Calendar;
  20391. function getDateTime(date, hideSecond) {
  20392. return "".concat(getDate(date), " ").concat(getTime(date, hideSecond));
  20393. }
  20394. function getDate(date) {
  20395. date = fixIosDateFormat(date);
  20396. date = new Date(date);
  20397. var year = date.getFullYear();
  20398. var month = date.getMonth() + 1;
  20399. var day = date.getDate();
  20400. return "".concat(year, "-").concat(addZero(month), "-").concat(addZero(day));
  20401. }
  20402. function getTime(date, hideSecond) {
  20403. date = fixIosDateFormat(date);
  20404. date = new Date(date);
  20405. var hour = date.getHours();
  20406. var minute = date.getMinutes();
  20407. var second = date.getSeconds();
  20408. return hideSecond ? "".concat(addZero(hour), ":").concat(addZero(minute)) : "".concat(addZero(hour), ":").concat(addZero(minute), ":").concat(addZero(second));
  20409. }
  20410. function addZero(num) {
  20411. if (num < 10) {
  20412. num = "0".concat(num);
  20413. }
  20414. return num;
  20415. }
  20416. function getDefaultSecond(hideSecond) {
  20417. return hideSecond ? '00:00' : '00:00:00';
  20418. }
  20419. function dateCompare(startDate, endDate) {
  20420. startDate = new Date(fixIosDateFormat(startDate));
  20421. endDate = new Date(fixIosDateFormat(endDate));
  20422. return startDate <= endDate;
  20423. }
  20424. function checkDate(date) {
  20425. var dateReg = /((19|20)\d{2})(-|\/)\d{1,2}(-|\/)\d{1,2}/g;
  20426. return date.match(dateReg);
  20427. }
  20428. var dateTimeReg = /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])( [0-5]?[0-9]:[0-5]?[0-9]:[0-5]?[0-9])?$/;
  20429. function fixIosDateFormat(value) {
  20430. if (typeof value === 'string' && dateTimeReg.test(value)) {
  20431. value = value.replace(/-/g, '/');
  20432. }
  20433. return value;
  20434. }
  20435. /***/ }),
  20436. /***/ 43:
  20437. /*!*****************************************************************!*\
  20438. !*** E:/work/Project_newGit/hptwxMiniProgram/static/avatar.png ***!
  20439. \*****************************************************************/
  20440. /*! no static exports found */
  20441. /***/ (function(module, exports) {
  20442. module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAAe1BMVEUAAACKioqLi4uKioqKioqJiYmKioqKioqJiYmMjIyKioqKioqKioqKioqLi4uKioqKioqKioqKioqLi4uKioqKioqIiIiKioqOjo6KioqKioqKioqKioqKioqKioqKioqHh4eMjIyKioqLi4uKioqKioqLi4uKioqKiorfp5FpAAAAKHRSTlMA3E+S6IHxx0kJuKv3ymI7XbWcfSNVRtIQ+tXBr4x1aj8yv70piRbh3pKoQwAAA+dJREFUeNrE1teaqkAQBOAaRAaUoCgopjWtW+//hOfW/UzVhLP/NWFmur6eRivrIt/P/cqFUdNEoVv5+T4v1vgvknp8DvlUeB7XCQZVjy8p30ov4xoDiUeOEjeKB/z736yhmtBsUqEvsy1b2c7Qhzxja1mOrk5TdjI9oYtkkbKjdJGgtcCzBz5AS2P2ZIw2ljv2ZreEWeDYIxf0e/zDl+GbvfuGwYgDGEF24SAuEIUcSAhJxMFEEGw4oA0+mnBQE3xQcmBll/4zfEcKaJDtv+Lren2Nv/YZDQK8tHRUlcENd25BSZVb4pWdHKUaD2o5vruuAUhzPJWn3WIQUBPGeCEOu8Qg8ZS4BC8ljhKf4NGCEo+3PCULPDilVDh84KhIH6f1KRXRFR9cIyqmDwm2pad7M8vxWyauWzClIsMvM0qOEBwpmeHe1nqTdb9Rt7hTUVJAUlBSmaeQDUQb62wSUzLqeaqPrS8cITpaN+SoaCBrqHDGCoSQhZTEtgo4yBwlI9vjGWSZaUs1NVvIttTUlkGAK8hWtIwFc2p+IPuhZg4ASUpNBFlETZoAKKiCjKrCEAGygqgiDSE4U1VCVFJ1lruW3gqtn1xTF0ASULdGQd0Ekgl1BXIazCCY0SDHngYeAk+DPea0OOCjAy3m8DSJ8UFME48VbZZ4a0mbFRyNbnjjRiOHkFYHof6yEBHNSqEFqyI0tPMVnqg87Ro0bGP6r3mz220QhqGwQ1a6EFJoBy2TJgJSL/b+T7jbSajqsQ1yvuuq6o+J7ZNzus0+Fn8lfIu18Wse/tV+vkr1c83lwCP6uR9nHx+aKwQn1N19HrshEBGFoRuzF6r8jgSfvo55oA1DjrXgVyR26d6qQC8I1Y39QBGzeuLyZjGOzFrmteMGUckaVjvmDCSpJ4g+cQaS7oiLR88YySZND9J3pQmdoT8WYrGAb4suJonYJHQx+TrKAnECV7MOueQR8YMtp6GVCgN6maANkEDxJCFPQKAAiqAnMT0k0dyl1gu9FeQOyHSJVCREefSyP0D/J3hgm2pISYPseU6kSajVCgc0r0hqItBeP4ErAjELsmk3wBIm5gaU18ivAH0VjO/l7XqiHZhqQHzvXx/Veq7IAZOAKUzKjJywF14b1DfFC/C4OtoJhxwwa8udwzVTersiFo5MO5ERCweFM3oK6E+Cc4BettJOrOBXO20VQRyOengC52jaDXTKHxxwSyahBs1sVDH9CiJHQ1WyodHe0mlvarW39dobm+2t3fbmdnt7v33AwT7iYR9ysY/52AedCoh62Yfd7ON+BQQeC4h8FhB6LSD2W0DwuYTodwnh9wPi/38f4pWf21QKgQAAAABJRU5ErkJggg=="
  20443. /***/ }),
  20444. /***/ 44:
  20445. /*!**************************************************************!*\
  20446. !*** E:/work/Project_newGit/hptwxMiniProgram/api/openApi.js ***!
  20447. \**************************************************************/
  20448. /*! no static exports found */
  20449. /***/ (function(module, exports, __webpack_require__) {
  20450. "use strict";
  20451. Object.defineProperty(exports, "__esModule", {
  20452. value: true
  20453. });
  20454. exports.wxDecryptUserInfo = wxDecryptUserInfo;
  20455. exports.wxLogin = wxLogin;
  20456. var _openRequest = __webpack_require__(/*! @/utils/openRequest.js */ 45);
  20457. /**
  20458. * WX登陆
  20459. * @param jsCode 二维码
  20460. * @returns
  20461. */
  20462. function wxLogin(data) {
  20463. return (0, _openRequest.request)({
  20464. url: "/wx/login",
  20465. method: 'GET',
  20466. data: data
  20467. });
  20468. }
  20469. /**
  20470. * 解密WX用户数据
  20471. * @param jsCode 二维码
  20472. * @returns
  20473. */
  20474. function wxDecryptUserInfo(data) {
  20475. return (0, _openRequest.request)({
  20476. url: "/wx/userInfo/decrypt",
  20477. method: 'POST',
  20478. data: data
  20479. });
  20480. }
  20481. /***/ }),
  20482. /***/ 442:
  20483. /*!********************************************************************************************************************************!*\
  20484. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js ***!
  20485. \********************************************************************************************************************************/
  20486. /*! no static exports found */
  20487. /***/ (function(module, exports, __webpack_require__) {
  20488. "use strict";
  20489. /* WEBPACK VAR INJECTION */(function(uni, wx, uniCloud) {
  20490. Object.defineProperty(exports, "__esModule", {
  20491. value: true
  20492. });
  20493. exports.chooseAndUploadFile = chooseAndUploadFile;
  20494. exports.uploadCloudFiles = uploadCloudFiles;
  20495. var ERR_MSG_OK = 'chooseAndUploadFile:ok';
  20496. var ERR_MSG_FAIL = 'chooseAndUploadFile:fail';
  20497. function chooseImage(opts) {
  20498. var count = opts.count,
  20499. _opts$sizeType = opts.sizeType,
  20500. sizeType = _opts$sizeType === void 0 ? ['original', 'compressed'] : _opts$sizeType,
  20501. sourceType = opts.sourceType,
  20502. extension = opts.extension;
  20503. return new Promise(function (resolve, reject) {
  20504. uni.chooseImage({
  20505. count: count,
  20506. sizeType: sizeType,
  20507. sourceType: sourceType,
  20508. extension: extension,
  20509. success: function success(res) {
  20510. resolve(normalizeChooseAndUploadFileRes(res, 'image'));
  20511. },
  20512. fail: function fail(res) {
  20513. reject({
  20514. errMsg: res.errMsg.replace('chooseImage:fail', ERR_MSG_FAIL)
  20515. });
  20516. }
  20517. });
  20518. });
  20519. }
  20520. function chooseVideo(opts) {
  20521. var camera = opts.camera,
  20522. compressed = opts.compressed,
  20523. maxDuration = opts.maxDuration,
  20524. sourceType = opts.sourceType,
  20525. extension = opts.extension;
  20526. return new Promise(function (resolve, reject) {
  20527. uni.chooseVideo({
  20528. camera: camera,
  20529. compressed: compressed,
  20530. maxDuration: maxDuration,
  20531. sourceType: sourceType,
  20532. extension: extension,
  20533. success: function success(res) {
  20534. var tempFilePath = res.tempFilePath,
  20535. duration = res.duration,
  20536. size = res.size,
  20537. height = res.height,
  20538. width = res.width;
  20539. resolve(normalizeChooseAndUploadFileRes({
  20540. errMsg: 'chooseVideo:ok',
  20541. tempFilePaths: [tempFilePath],
  20542. tempFiles: [{
  20543. name: res.tempFile && res.tempFile.name || '',
  20544. path: tempFilePath,
  20545. size: size,
  20546. type: res.tempFile && res.tempFile.type || '',
  20547. width: width,
  20548. height: height,
  20549. duration: duration,
  20550. fileType: 'video',
  20551. cloudPath: ''
  20552. }]
  20553. }, 'video'));
  20554. },
  20555. fail: function fail(res) {
  20556. reject({
  20557. errMsg: res.errMsg.replace('chooseVideo:fail', ERR_MSG_FAIL)
  20558. });
  20559. }
  20560. });
  20561. });
  20562. }
  20563. function chooseAll(opts) {
  20564. var count = opts.count,
  20565. extension = opts.extension;
  20566. return new Promise(function (resolve, reject) {
  20567. var chooseFile = uni.chooseFile;
  20568. if (typeof wx !== 'undefined' && typeof wx.chooseMessageFile === 'function') {
  20569. chooseFile = wx.chooseMessageFile;
  20570. }
  20571. if (typeof chooseFile !== 'function') {
  20572. return reject({
  20573. errMsg: ERR_MSG_FAIL + ' 请指定 type 类型,该平台仅支持选择 image 或 video。'
  20574. });
  20575. }
  20576. chooseFile({
  20577. type: 'all',
  20578. count: count,
  20579. extension: extension,
  20580. success: function success(res) {
  20581. resolve(normalizeChooseAndUploadFileRes(res));
  20582. },
  20583. fail: function fail(res) {
  20584. reject({
  20585. errMsg: res.errMsg.replace('chooseFile:fail', ERR_MSG_FAIL)
  20586. });
  20587. }
  20588. });
  20589. });
  20590. }
  20591. function normalizeChooseAndUploadFileRes(res, fileType) {
  20592. res.tempFiles.forEach(function (item, index) {
  20593. if (!item.name) {
  20594. item.name = item.path.substring(item.path.lastIndexOf('/') + 1);
  20595. }
  20596. if (fileType) {
  20597. item.fileType = fileType;
  20598. }
  20599. item.cloudPath = Date.now() + '_' + index + item.name.substring(item.name.lastIndexOf('.'));
  20600. });
  20601. if (!res.tempFilePaths) {
  20602. res.tempFilePaths = res.tempFiles.map(function (file) {
  20603. return file.path;
  20604. });
  20605. }
  20606. return res;
  20607. }
  20608. function uploadCloudFiles(files) {
  20609. var max = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
  20610. var _onUploadProgress = arguments.length > 2 ? arguments[2] : undefined;
  20611. files = JSON.parse(JSON.stringify(files));
  20612. var len = files.length;
  20613. var count = 0;
  20614. var self = this;
  20615. return new Promise(function (resolve) {
  20616. while (count < max) {
  20617. next();
  20618. }
  20619. function next() {
  20620. var cur = count++;
  20621. if (cur >= len) {
  20622. !files.find(function (item) {
  20623. return !item.url && !item.errMsg;
  20624. }) && resolve(files);
  20625. return;
  20626. }
  20627. var fileItem = files[cur];
  20628. var index = self.files.findIndex(function (v) {
  20629. return v.uuid === fileItem.uuid;
  20630. });
  20631. fileItem.url = '';
  20632. delete fileItem.errMsg;
  20633. uniCloud.uploadFile({
  20634. filePath: fileItem.path,
  20635. cloudPath: fileItem.cloudPath,
  20636. fileType: fileItem.fileType,
  20637. onUploadProgress: function onUploadProgress(res) {
  20638. res.index = index;
  20639. _onUploadProgress && _onUploadProgress(res);
  20640. }
  20641. }).then(function (res) {
  20642. fileItem.url = res.fileID;
  20643. fileItem.index = index;
  20644. if (cur < len) {
  20645. next();
  20646. }
  20647. }).catch(function (res) {
  20648. fileItem.errMsg = res.errMsg || res.message;
  20649. fileItem.index = index;
  20650. if (cur < len) {
  20651. next();
  20652. }
  20653. });
  20654. }
  20655. });
  20656. }
  20657. function uploadFiles(choosePromise, _ref) {
  20658. var onChooseFile = _ref.onChooseFile,
  20659. onUploadProgress = _ref.onUploadProgress;
  20660. return choosePromise.then(function (res) {
  20661. if (onChooseFile) {
  20662. var customChooseRes = onChooseFile(res);
  20663. if (typeof customChooseRes !== 'undefined') {
  20664. return Promise.resolve(customChooseRes).then(function (chooseRes) {
  20665. return typeof chooseRes === 'undefined' ? res : chooseRes;
  20666. });
  20667. }
  20668. }
  20669. return res;
  20670. }).then(function (res) {
  20671. if (res === false) {
  20672. return {
  20673. errMsg: ERR_MSG_OK,
  20674. tempFilePaths: [],
  20675. tempFiles: []
  20676. };
  20677. }
  20678. return res;
  20679. });
  20680. }
  20681. function chooseAndUploadFile() {
  20682. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  20683. type: 'all'
  20684. };
  20685. if (opts.type === 'image') {
  20686. return uploadFiles(chooseImage(opts), opts);
  20687. } else if (opts.type === 'video') {
  20688. return uploadFiles(chooseVideo(opts), opts);
  20689. }
  20690. return uploadFiles(chooseAll(opts), opts);
  20691. }
  20692. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js */ 404)["default"]))
  20693. /***/ }),
  20694. /***/ 443:
  20695. /*!***************************************************************************************************************!*\
  20696. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-file-picker/components/uni-file-picker/utils.js ***!
  20697. \***************************************************************************************************************/
  20698. /*! no static exports found */
  20699. /***/ (function(module, exports, __webpack_require__) {
  20700. "use strict";
  20701. /* WEBPACK VAR INJECTION */(function(uni) {
  20702. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  20703. Object.defineProperty(exports, "__esModule", {
  20704. value: true
  20705. });
  20706. exports.get_files_and_is_max = exports.get_file_info = exports.get_file_ext = exports.get_file_data = exports.get_extname = void 0;
  20707. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 40));
  20708. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 42));
  20709. /**
  20710. * 获取文件名和后缀
  20711. * @param {String} name
  20712. */
  20713. var get_file_ext = function get_file_ext(name) {
  20714. var last_len = name.lastIndexOf('.');
  20715. var len = name.length;
  20716. return {
  20717. name: name.substring(0, last_len),
  20718. ext: name.substring(last_len + 1, len)
  20719. };
  20720. };
  20721. /**
  20722. * 获取扩展名
  20723. * @param {Array} fileExtname
  20724. */
  20725. exports.get_file_ext = get_file_ext;
  20726. var get_extname = function get_extname(fileExtname) {
  20727. if (!Array.isArray(fileExtname)) {
  20728. var extname = fileExtname.replace(/(\[|\])/g, '');
  20729. return extname.split(',');
  20730. } else {
  20731. return fileExtname;
  20732. }
  20733. return [];
  20734. };
  20735. /**
  20736. * 获取文件和检测是否可选
  20737. */
  20738. exports.get_extname = get_extname;
  20739. var get_files_and_is_max = function get_files_and_is_max(res, _extname) {
  20740. var filePaths = [];
  20741. var files = [];
  20742. if (!_extname || _extname.length === 0) {
  20743. return {
  20744. filePaths: filePaths,
  20745. files: files
  20746. };
  20747. }
  20748. res.tempFiles.forEach(function (v) {
  20749. var fileFullName = get_file_ext(v.name);
  20750. var extname = fileFullName.ext.toLowerCase();
  20751. if (_extname.indexOf(extname) !== -1) {
  20752. files.push(v);
  20753. filePaths.push(v.path);
  20754. }
  20755. });
  20756. if (files.length !== res.tempFiles.length) {
  20757. uni.showToast({
  20758. title: "\u5F53\u524D\u9009\u62E9\u4E86".concat(res.tempFiles.length, "\u4E2A\u6587\u4EF6 \uFF0C").concat(res.tempFiles.length - files.length, " \u4E2A\u6587\u4EF6\u683C\u5F0F\u4E0D\u6B63\u786E"),
  20759. icon: 'none',
  20760. duration: 5000
  20761. });
  20762. }
  20763. return {
  20764. filePaths: filePaths,
  20765. files: files
  20766. };
  20767. };
  20768. /**
  20769. * 获取图片信息
  20770. * @param {Object} filepath
  20771. */
  20772. exports.get_files_and_is_max = get_files_and_is_max;
  20773. var get_file_info = function get_file_info(filepath) {
  20774. return new Promise(function (resolve, reject) {
  20775. uni.getImageInfo({
  20776. src: filepath,
  20777. success: function success(res) {
  20778. resolve(res);
  20779. },
  20780. fail: function fail(err) {
  20781. reject(err);
  20782. }
  20783. });
  20784. });
  20785. };
  20786. /**
  20787. * 获取封装数据
  20788. */
  20789. exports.get_file_info = get_file_info;
  20790. var get_file_data = /*#__PURE__*/function () {
  20791. var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(files) {
  20792. var type,
  20793. fileFullName,
  20794. extname,
  20795. filedata,
  20796. imageinfo,
  20797. _args = arguments;
  20798. return _regenerator.default.wrap(function _callee$(_context) {
  20799. while (1) {
  20800. switch (_context.prev = _context.next) {
  20801. case 0:
  20802. type = _args.length > 1 && _args[1] !== undefined ? _args[1] : 'image';
  20803. // 最终需要上传数据库的数据
  20804. fileFullName = get_file_ext(files.name);
  20805. extname = fileFullName.ext.toLowerCase();
  20806. filedata = {
  20807. name: files.name,
  20808. uuid: files.uuid,
  20809. extname: extname || '',
  20810. cloudPath: files.cloudPath,
  20811. fileType: files.fileType,
  20812. url: files.path || files.path,
  20813. size: files.size,
  20814. //单位是字节
  20815. image: {},
  20816. path: files.path,
  20817. video: {}
  20818. };
  20819. if (!(type === 'image')) {
  20820. _context.next = 14;
  20821. break;
  20822. }
  20823. _context.next = 7;
  20824. return get_file_info(files.path);
  20825. case 7:
  20826. imageinfo = _context.sent;
  20827. delete filedata.video;
  20828. filedata.image.width = imageinfo.width;
  20829. filedata.image.height = imageinfo.height;
  20830. filedata.image.location = imageinfo.path;
  20831. _context.next = 15;
  20832. break;
  20833. case 14:
  20834. delete filedata.image;
  20835. case 15:
  20836. return _context.abrupt("return", filedata);
  20837. case 16:
  20838. case "end":
  20839. return _context.stop();
  20840. }
  20841. }
  20842. }, _callee);
  20843. }));
  20844. return function get_file_data(_x) {
  20845. return _ref.apply(this, arguments);
  20846. };
  20847. }();
  20848. exports.get_file_data = get_file_data;
  20849. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  20850. /***/ }),
  20851. /***/ 45:
  20852. /*!********************************************************************!*\
  20853. !*** E:/work/Project_newGit/hptwxMiniProgram/utils/openRequest.js ***!
  20854. \********************************************************************/
  20855. /*! no static exports found */
  20856. /***/ (function(module, exports, __webpack_require__) {
  20857. "use strict";
  20858. /* WEBPACK VAR INJECTION */(function(uni) {
  20859. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  20860. Object.defineProperty(exports, "__esModule", {
  20861. value: true
  20862. });
  20863. exports.request = request;
  20864. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 40));
  20865. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  20866. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 42));
  20867. var _index = _interopRequireDefault(__webpack_require__(/*! @/config/index.js */ 46));
  20868. 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; }
  20869. 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; }
  20870. var baseUrl = true ? _index.default.base.dev : undefined;
  20871. function request(_x) {
  20872. return _request.apply(this, arguments);
  20873. }
  20874. function _request() {
  20875. _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(parmas) {
  20876. return _regenerator.default.wrap(function _callee$(_context) {
  20877. while (1) {
  20878. switch (_context.prev = _context.next) {
  20879. case 0:
  20880. return _context.abrupt("return", new Promise(function (resolve, reject) {
  20881. try {
  20882. uni.showLoading({
  20883. title: '加载中',
  20884. mask: true
  20885. });
  20886. uni.request(_objectSpread(_objectSpread({}, formatRequestBody(parmas)), {}, {
  20887. success: function success(response) {
  20888. var data = response.data;
  20889. var code = data.code;
  20890. var msg = data.msg;
  20891. if (code === 200) {
  20892. resolve(data);
  20893. } else {
  20894. if (code === 401) {
  20895. uni.showToast({
  20896. title: msg || "登录失效!",
  20897. mask: true,
  20898. icon: "none",
  20899. complete: function complete() {
  20900. uni.redirectTo({
  20901. url: '/pages/authorizedLogin/index'
  20902. });
  20903. }
  20904. });
  20905. } else {
  20906. reject(data);
  20907. uni.showToast({
  20908. title: msg,
  20909. mask: true,
  20910. icon: "none"
  20911. });
  20912. }
  20913. }
  20914. },
  20915. fail: function fail(res) {
  20916. uni.showToast({
  20917. title: res,
  20918. mask: true,
  20919. icon: "none"
  20920. });
  20921. reject(res);
  20922. },
  20923. complete: function complete(res) {
  20924. uni.hideLoading();
  20925. }
  20926. }));
  20927. } catch (err) {
  20928. console.log(err);
  20929. reject(err);
  20930. }
  20931. }));
  20932. case 1:
  20933. case "end":
  20934. return _context.stop();
  20935. }
  20936. }
  20937. }, _callee);
  20938. }));
  20939. return _request.apply(this, arguments);
  20940. }
  20941. function formatRequestBody(parmas) {
  20942. var url = parmas.url;
  20943. url = baseUrl + url;
  20944. var data = _objectSpread({}, parmas.data);
  20945. var header = _objectSpread({}, parmas.header);
  20946. header['AppID'] = _index.default.appID;
  20947. header['AppKey'] = _index.default.appKey;
  20948. header['AppSecret'] = _index.default.appSecret;
  20949. var method = parmas.method || "get";
  20950. var dataType = parmas.dataType || "json";
  20951. var requestBody = {
  20952. url: url,
  20953. data: data,
  20954. header: header,
  20955. method: method,
  20956. dataType: dataType
  20957. };
  20958. return requestBody;
  20959. }
  20960. ;
  20961. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  20962. /***/ }),
  20963. /***/ 46:
  20964. /*!***************************************************************!*\
  20965. !*** E:/work/Project_newGit/hptwxMiniProgram/config/index.js ***!
  20966. \***************************************************************/
  20967. /*! no static exports found */
  20968. /***/ (function(module, exports, __webpack_require__) {
  20969. "use strict";
  20970. Object.defineProperty(exports, "__esModule", {
  20971. value: true
  20972. });
  20973. exports.default = void 0;
  20974. var _default = {
  20975. base: {
  20976. // dev: 'https://api.xazhyc.com',
  20977. // dev: 'http://1.15.92.205:7001',
  20978. dev: "http://47.113.222.56:7001",
  20979. // dev: 'http://192.168.3.253:7001',
  20980. pro: 'https://api.xazhyc.com'
  20981. },
  20982. appID: '10007',
  20983. appKey: '82a8bf439373e311',
  20984. appSecret: '82a8bf439373e311',
  20985. permitTplId: 7,
  20986. TokenKey: "Authorization"
  20987. };
  20988. exports.default = _default;
  20989. /***/ }),
  20990. /***/ 47:
  20991. /*!******************************************************************!*\
  20992. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/scan.js ***!
  20993. \******************************************************************/
  20994. /*! no static exports found */
  20995. /***/ (function(module, exports, __webpack_require__) {
  20996. "use strict";
  20997. Object.defineProperty(exports, "__esModule", {
  20998. value: true
  20999. });
  21000. exports.getApps = getApps;
  21001. exports.getByQr = getByQr;
  21002. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  21003. /**
  21004. * 扫码请求
  21005. * @param ocId 单位ID
  21006. * @param qrCode 二维码
  21007. * @returns
  21008. */
  21009. function getByQr(ocId, qrCode) {
  21010. return (0, _request.request)({
  21011. url: "/qr/request/".concat(ocId, "/").concat(qrCode),
  21012. method: 'GET'
  21013. });
  21014. }
  21015. function getApps(targetId) {
  21016. return (0, _request.request)({
  21017. url: "/mini/permitted/".concat(targetId, " "),
  21018. method: 'GET'
  21019. });
  21020. }
  21021. /***/ }),
  21022. /***/ 472:
  21023. /*!***************************************************************************************************!*\
  21024. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  21025. \***************************************************************************************************/
  21026. /*! no static exports found */
  21027. /***/ (function(module, exports, __webpack_require__) {
  21028. "use strict";
  21029. Object.defineProperty(exports, "__esModule", {
  21030. value: true
  21031. });
  21032. exports.default = void 0;
  21033. var _default = {
  21034. "id": "2852637",
  21035. "name": "uniui图标库",
  21036. "font_family": "uniicons",
  21037. "css_prefix_text": "uniui-",
  21038. "description": "",
  21039. "glyphs": [{
  21040. "icon_id": "25027049",
  21041. "name": "yanse",
  21042. "font_class": "color",
  21043. "unicode": "e6cf",
  21044. "unicode_decimal": 59087
  21045. }, {
  21046. "icon_id": "25027048",
  21047. "name": "wallet",
  21048. "font_class": "wallet",
  21049. "unicode": "e6b1",
  21050. "unicode_decimal": 59057
  21051. }, {
  21052. "icon_id": "25015720",
  21053. "name": "settings-filled",
  21054. "font_class": "settings-filled",
  21055. "unicode": "e6ce",
  21056. "unicode_decimal": 59086
  21057. }, {
  21058. "icon_id": "25015434",
  21059. "name": "shimingrenzheng-filled",
  21060. "font_class": "auth-filled",
  21061. "unicode": "e6cc",
  21062. "unicode_decimal": 59084
  21063. }, {
  21064. "icon_id": "24934246",
  21065. "name": "shop-filled",
  21066. "font_class": "shop-filled",
  21067. "unicode": "e6cd",
  21068. "unicode_decimal": 59085
  21069. }, {
  21070. "icon_id": "24934159",
  21071. "name": "staff-filled-01",
  21072. "font_class": "staff-filled",
  21073. "unicode": "e6cb",
  21074. "unicode_decimal": 59083
  21075. }, {
  21076. "icon_id": "24932461",
  21077. "name": "VIP-filled",
  21078. "font_class": "vip-filled",
  21079. "unicode": "e6c6",
  21080. "unicode_decimal": 59078
  21081. }, {
  21082. "icon_id": "24932462",
  21083. "name": "plus_circle_fill",
  21084. "font_class": "plus-filled",
  21085. "unicode": "e6c7",
  21086. "unicode_decimal": 59079
  21087. }, {
  21088. "icon_id": "24932463",
  21089. "name": "folder_add-filled",
  21090. "font_class": "folder-add-filled",
  21091. "unicode": "e6c8",
  21092. "unicode_decimal": 59080
  21093. }, {
  21094. "icon_id": "24932464",
  21095. "name": "yanse-filled",
  21096. "font_class": "color-filled",
  21097. "unicode": "e6c9",
  21098. "unicode_decimal": 59081
  21099. }, {
  21100. "icon_id": "24932465",
  21101. "name": "tune-filled",
  21102. "font_class": "tune-filled",
  21103. "unicode": "e6ca",
  21104. "unicode_decimal": 59082
  21105. }, {
  21106. "icon_id": "24932455",
  21107. "name": "a-rilidaka-filled",
  21108. "font_class": "calendar-filled",
  21109. "unicode": "e6c0",
  21110. "unicode_decimal": 59072
  21111. }, {
  21112. "icon_id": "24932456",
  21113. "name": "notification-filled",
  21114. "font_class": "notification-filled",
  21115. "unicode": "e6c1",
  21116. "unicode_decimal": 59073
  21117. }, {
  21118. "icon_id": "24932457",
  21119. "name": "wallet-filled",
  21120. "font_class": "wallet-filled",
  21121. "unicode": "e6c2",
  21122. "unicode_decimal": 59074
  21123. }, {
  21124. "icon_id": "24932458",
  21125. "name": "paihangbang-filled",
  21126. "font_class": "medal-filled",
  21127. "unicode": "e6c3",
  21128. "unicode_decimal": 59075
  21129. }, {
  21130. "icon_id": "24932459",
  21131. "name": "gift-filled",
  21132. "font_class": "gift-filled",
  21133. "unicode": "e6c4",
  21134. "unicode_decimal": 59076
  21135. }, {
  21136. "icon_id": "24932460",
  21137. "name": "fire-filled",
  21138. "font_class": "fire-filled",
  21139. "unicode": "e6c5",
  21140. "unicode_decimal": 59077
  21141. }, {
  21142. "icon_id": "24928001",
  21143. "name": "refreshempty",
  21144. "font_class": "refreshempty",
  21145. "unicode": "e6bf",
  21146. "unicode_decimal": 59071
  21147. }, {
  21148. "icon_id": "24926853",
  21149. "name": "location-ellipse",
  21150. "font_class": "location-filled",
  21151. "unicode": "e6af",
  21152. "unicode_decimal": 59055
  21153. }, {
  21154. "icon_id": "24926735",
  21155. "name": "person-filled",
  21156. "font_class": "person-filled",
  21157. "unicode": "e69d",
  21158. "unicode_decimal": 59037
  21159. }, {
  21160. "icon_id": "24926703",
  21161. "name": "personadd-filled",
  21162. "font_class": "personadd-filled",
  21163. "unicode": "e698",
  21164. "unicode_decimal": 59032
  21165. }, {
  21166. "icon_id": "24923351",
  21167. "name": "back",
  21168. "font_class": "back",
  21169. "unicode": "e6b9",
  21170. "unicode_decimal": 59065
  21171. }, {
  21172. "icon_id": "24923352",
  21173. "name": "forward",
  21174. "font_class": "forward",
  21175. "unicode": "e6ba",
  21176. "unicode_decimal": 59066
  21177. }, {
  21178. "icon_id": "24923353",
  21179. "name": "arrowthinright",
  21180. "font_class": "arrow-right",
  21181. "unicode": "e6bb",
  21182. "unicode_decimal": 59067
  21183. }, {
  21184. "icon_id": "24923353",
  21185. "name": "arrowthinright",
  21186. "font_class": "arrowthinright",
  21187. "unicode": "e6bb",
  21188. "unicode_decimal": 59067
  21189. }, {
  21190. "icon_id": "24923354",
  21191. "name": "arrowthinleft",
  21192. "font_class": "arrow-left",
  21193. "unicode": "e6bc",
  21194. "unicode_decimal": 59068
  21195. }, {
  21196. "icon_id": "24923354",
  21197. "name": "arrowthinleft",
  21198. "font_class": "arrowthinleft",
  21199. "unicode": "e6bc",
  21200. "unicode_decimal": 59068
  21201. }, {
  21202. "icon_id": "24923355",
  21203. "name": "arrowthinup",
  21204. "font_class": "arrow-up",
  21205. "unicode": "e6bd",
  21206. "unicode_decimal": 59069
  21207. }, {
  21208. "icon_id": "24923355",
  21209. "name": "arrowthinup",
  21210. "font_class": "arrowthinup",
  21211. "unicode": "e6bd",
  21212. "unicode_decimal": 59069
  21213. }, {
  21214. "icon_id": "24923356",
  21215. "name": "arrowthindown",
  21216. "font_class": "arrow-down",
  21217. "unicode": "e6be",
  21218. "unicode_decimal": 59070
  21219. }, {
  21220. "icon_id": "24923356",
  21221. "name": "arrowthindown",
  21222. "font_class": "arrowthindown",
  21223. "unicode": "e6be",
  21224. "unicode_decimal": 59070
  21225. }, {
  21226. "icon_id": "24923349",
  21227. "name": "arrowdown",
  21228. "font_class": "bottom",
  21229. "unicode": "e6b8",
  21230. "unicode_decimal": 59064
  21231. }, {
  21232. "icon_id": "24923349",
  21233. "name": "arrowdown",
  21234. "font_class": "arrowdown",
  21235. "unicode": "e6b8",
  21236. "unicode_decimal": 59064
  21237. }, {
  21238. "icon_id": "24923346",
  21239. "name": "arrowright",
  21240. "font_class": "right",
  21241. "unicode": "e6b5",
  21242. "unicode_decimal": 59061
  21243. }, {
  21244. "icon_id": "24923346",
  21245. "name": "arrowright",
  21246. "font_class": "arrowright",
  21247. "unicode": "e6b5",
  21248. "unicode_decimal": 59061
  21249. }, {
  21250. "icon_id": "24923347",
  21251. "name": "arrowup",
  21252. "font_class": "top",
  21253. "unicode": "e6b6",
  21254. "unicode_decimal": 59062
  21255. }, {
  21256. "icon_id": "24923347",
  21257. "name": "arrowup",
  21258. "font_class": "arrowup",
  21259. "unicode": "e6b6",
  21260. "unicode_decimal": 59062
  21261. }, {
  21262. "icon_id": "24923348",
  21263. "name": "arrowleft",
  21264. "font_class": "left",
  21265. "unicode": "e6b7",
  21266. "unicode_decimal": 59063
  21267. }, {
  21268. "icon_id": "24923348",
  21269. "name": "arrowleft",
  21270. "font_class": "arrowleft",
  21271. "unicode": "e6b7",
  21272. "unicode_decimal": 59063
  21273. }, {
  21274. "icon_id": "24923334",
  21275. "name": "eye",
  21276. "font_class": "eye",
  21277. "unicode": "e651",
  21278. "unicode_decimal": 58961
  21279. }, {
  21280. "icon_id": "24923335",
  21281. "name": "eye-filled",
  21282. "font_class": "eye-filled",
  21283. "unicode": "e66a",
  21284. "unicode_decimal": 58986
  21285. }, {
  21286. "icon_id": "24923336",
  21287. "name": "eye-slash",
  21288. "font_class": "eye-slash",
  21289. "unicode": "e6b3",
  21290. "unicode_decimal": 59059
  21291. }, {
  21292. "icon_id": "24923337",
  21293. "name": "eye-slash-filled",
  21294. "font_class": "eye-slash-filled",
  21295. "unicode": "e6b4",
  21296. "unicode_decimal": 59060
  21297. }, {
  21298. "icon_id": "24923305",
  21299. "name": "info-filled",
  21300. "font_class": "info-filled",
  21301. "unicode": "e649",
  21302. "unicode_decimal": 58953
  21303. }, {
  21304. "icon_id": "24923299",
  21305. "name": "reload-01",
  21306. "font_class": "reload",
  21307. "unicode": "e6b2",
  21308. "unicode_decimal": 59058
  21309. }, {
  21310. "icon_id": "24923195",
  21311. "name": "mic_slash_fill",
  21312. "font_class": "micoff-filled",
  21313. "unicode": "e6b0",
  21314. "unicode_decimal": 59056
  21315. }, {
  21316. "icon_id": "24923165",
  21317. "name": "map-pin-ellipse",
  21318. "font_class": "map-pin-ellipse",
  21319. "unicode": "e6ac",
  21320. "unicode_decimal": 59052
  21321. }, {
  21322. "icon_id": "24923166",
  21323. "name": "map-pin",
  21324. "font_class": "map-pin",
  21325. "unicode": "e6ad",
  21326. "unicode_decimal": 59053
  21327. }, {
  21328. "icon_id": "24923167",
  21329. "name": "location",
  21330. "font_class": "location",
  21331. "unicode": "e6ae",
  21332. "unicode_decimal": 59054
  21333. }, {
  21334. "icon_id": "24923064",
  21335. "name": "starhalf",
  21336. "font_class": "starhalf",
  21337. "unicode": "e683",
  21338. "unicode_decimal": 59011
  21339. }, {
  21340. "icon_id": "24923065",
  21341. "name": "star",
  21342. "font_class": "star",
  21343. "unicode": "e688",
  21344. "unicode_decimal": 59016
  21345. }, {
  21346. "icon_id": "24923066",
  21347. "name": "star-filled",
  21348. "font_class": "star-filled",
  21349. "unicode": "e68f",
  21350. "unicode_decimal": 59023
  21351. }, {
  21352. "icon_id": "24899646",
  21353. "name": "a-rilidaka",
  21354. "font_class": "calendar",
  21355. "unicode": "e6a0",
  21356. "unicode_decimal": 59040
  21357. }, {
  21358. "icon_id": "24899647",
  21359. "name": "fire",
  21360. "font_class": "fire",
  21361. "unicode": "e6a1",
  21362. "unicode_decimal": 59041
  21363. }, {
  21364. "icon_id": "24899648",
  21365. "name": "paihangbang",
  21366. "font_class": "medal",
  21367. "unicode": "e6a2",
  21368. "unicode_decimal": 59042
  21369. }, {
  21370. "icon_id": "24899649",
  21371. "name": "font",
  21372. "font_class": "font",
  21373. "unicode": "e6a3",
  21374. "unicode_decimal": 59043
  21375. }, {
  21376. "icon_id": "24899650",
  21377. "name": "gift",
  21378. "font_class": "gift",
  21379. "unicode": "e6a4",
  21380. "unicode_decimal": 59044
  21381. }, {
  21382. "icon_id": "24899651",
  21383. "name": "link",
  21384. "font_class": "link",
  21385. "unicode": "e6a5",
  21386. "unicode_decimal": 59045
  21387. }, {
  21388. "icon_id": "24899652",
  21389. "name": "notification",
  21390. "font_class": "notification",
  21391. "unicode": "e6a6",
  21392. "unicode_decimal": 59046
  21393. }, {
  21394. "icon_id": "24899653",
  21395. "name": "staff",
  21396. "font_class": "staff",
  21397. "unicode": "e6a7",
  21398. "unicode_decimal": 59047
  21399. }, {
  21400. "icon_id": "24899654",
  21401. "name": "VIP",
  21402. "font_class": "vip",
  21403. "unicode": "e6a8",
  21404. "unicode_decimal": 59048
  21405. }, {
  21406. "icon_id": "24899655",
  21407. "name": "folder_add",
  21408. "font_class": "folder-add",
  21409. "unicode": "e6a9",
  21410. "unicode_decimal": 59049
  21411. }, {
  21412. "icon_id": "24899656",
  21413. "name": "tune",
  21414. "font_class": "tune",
  21415. "unicode": "e6aa",
  21416. "unicode_decimal": 59050
  21417. }, {
  21418. "icon_id": "24899657",
  21419. "name": "shimingrenzheng",
  21420. "font_class": "auth",
  21421. "unicode": "e6ab",
  21422. "unicode_decimal": 59051
  21423. }, {
  21424. "icon_id": "24899565",
  21425. "name": "person",
  21426. "font_class": "person",
  21427. "unicode": "e699",
  21428. "unicode_decimal": 59033
  21429. }, {
  21430. "icon_id": "24899566",
  21431. "name": "email-filled",
  21432. "font_class": "email-filled",
  21433. "unicode": "e69a",
  21434. "unicode_decimal": 59034
  21435. }, {
  21436. "icon_id": "24899567",
  21437. "name": "phone-filled",
  21438. "font_class": "phone-filled",
  21439. "unicode": "e69b",
  21440. "unicode_decimal": 59035
  21441. }, {
  21442. "icon_id": "24899568",
  21443. "name": "phone",
  21444. "font_class": "phone",
  21445. "unicode": "e69c",
  21446. "unicode_decimal": 59036
  21447. }, {
  21448. "icon_id": "24899570",
  21449. "name": "email",
  21450. "font_class": "email",
  21451. "unicode": "e69e",
  21452. "unicode_decimal": 59038
  21453. }, {
  21454. "icon_id": "24899571",
  21455. "name": "personadd",
  21456. "font_class": "personadd",
  21457. "unicode": "e69f",
  21458. "unicode_decimal": 59039
  21459. }, {
  21460. "icon_id": "24899558",
  21461. "name": "chatboxes-filled",
  21462. "font_class": "chatboxes-filled",
  21463. "unicode": "e692",
  21464. "unicode_decimal": 59026
  21465. }, {
  21466. "icon_id": "24899559",
  21467. "name": "contact",
  21468. "font_class": "contact",
  21469. "unicode": "e693",
  21470. "unicode_decimal": 59027
  21471. }, {
  21472. "icon_id": "24899560",
  21473. "name": "chatbubble-filled",
  21474. "font_class": "chatbubble-filled",
  21475. "unicode": "e694",
  21476. "unicode_decimal": 59028
  21477. }, {
  21478. "icon_id": "24899561",
  21479. "name": "contact-filled",
  21480. "font_class": "contact-filled",
  21481. "unicode": "e695",
  21482. "unicode_decimal": 59029
  21483. }, {
  21484. "icon_id": "24899562",
  21485. "name": "chatboxes",
  21486. "font_class": "chatboxes",
  21487. "unicode": "e696",
  21488. "unicode_decimal": 59030
  21489. }, {
  21490. "icon_id": "24899563",
  21491. "name": "chatbubble",
  21492. "font_class": "chatbubble",
  21493. "unicode": "e697",
  21494. "unicode_decimal": 59031
  21495. }, {
  21496. "icon_id": "24881290",
  21497. "name": "upload-filled",
  21498. "font_class": "upload-filled",
  21499. "unicode": "e68e",
  21500. "unicode_decimal": 59022
  21501. }, {
  21502. "icon_id": "24881292",
  21503. "name": "upload",
  21504. "font_class": "upload",
  21505. "unicode": "e690",
  21506. "unicode_decimal": 59024
  21507. }, {
  21508. "icon_id": "24881293",
  21509. "name": "weixin",
  21510. "font_class": "weixin",
  21511. "unicode": "e691",
  21512. "unicode_decimal": 59025
  21513. }, {
  21514. "icon_id": "24881274",
  21515. "name": "compose",
  21516. "font_class": "compose",
  21517. "unicode": "e67f",
  21518. "unicode_decimal": 59007
  21519. }, {
  21520. "icon_id": "24881275",
  21521. "name": "qq",
  21522. "font_class": "qq",
  21523. "unicode": "e680",
  21524. "unicode_decimal": 59008
  21525. }, {
  21526. "icon_id": "24881276",
  21527. "name": "download-filled",
  21528. "font_class": "download-filled",
  21529. "unicode": "e681",
  21530. "unicode_decimal": 59009
  21531. }, {
  21532. "icon_id": "24881277",
  21533. "name": "pengyouquan",
  21534. "font_class": "pyq",
  21535. "unicode": "e682",
  21536. "unicode_decimal": 59010
  21537. }, {
  21538. "icon_id": "24881279",
  21539. "name": "sound",
  21540. "font_class": "sound",
  21541. "unicode": "e684",
  21542. "unicode_decimal": 59012
  21543. }, {
  21544. "icon_id": "24881280",
  21545. "name": "trash-filled",
  21546. "font_class": "trash-filled",
  21547. "unicode": "e685",
  21548. "unicode_decimal": 59013
  21549. }, {
  21550. "icon_id": "24881281",
  21551. "name": "sound-filled",
  21552. "font_class": "sound-filled",
  21553. "unicode": "e686",
  21554. "unicode_decimal": 59014
  21555. }, {
  21556. "icon_id": "24881282",
  21557. "name": "trash",
  21558. "font_class": "trash",
  21559. "unicode": "e687",
  21560. "unicode_decimal": 59015
  21561. }, {
  21562. "icon_id": "24881284",
  21563. "name": "videocam-filled",
  21564. "font_class": "videocam-filled",
  21565. "unicode": "e689",
  21566. "unicode_decimal": 59017
  21567. }, {
  21568. "icon_id": "24881285",
  21569. "name": "spinner-cycle",
  21570. "font_class": "spinner-cycle",
  21571. "unicode": "e68a",
  21572. "unicode_decimal": 59018
  21573. }, {
  21574. "icon_id": "24881286",
  21575. "name": "weibo",
  21576. "font_class": "weibo",
  21577. "unicode": "e68b",
  21578. "unicode_decimal": 59019
  21579. }, {
  21580. "icon_id": "24881288",
  21581. "name": "videocam",
  21582. "font_class": "videocam",
  21583. "unicode": "e68c",
  21584. "unicode_decimal": 59020
  21585. }, {
  21586. "icon_id": "24881289",
  21587. "name": "download",
  21588. "font_class": "download",
  21589. "unicode": "e68d",
  21590. "unicode_decimal": 59021
  21591. }, {
  21592. "icon_id": "24879601",
  21593. "name": "help",
  21594. "font_class": "help",
  21595. "unicode": "e679",
  21596. "unicode_decimal": 59001
  21597. }, {
  21598. "icon_id": "24879602",
  21599. "name": "navigate-filled",
  21600. "font_class": "navigate-filled",
  21601. "unicode": "e67a",
  21602. "unicode_decimal": 59002
  21603. }, {
  21604. "icon_id": "24879603",
  21605. "name": "plusempty",
  21606. "font_class": "plusempty",
  21607. "unicode": "e67b",
  21608. "unicode_decimal": 59003
  21609. }, {
  21610. "icon_id": "24879604",
  21611. "name": "smallcircle",
  21612. "font_class": "smallcircle",
  21613. "unicode": "e67c",
  21614. "unicode_decimal": 59004
  21615. }, {
  21616. "icon_id": "24879605",
  21617. "name": "minus-filled",
  21618. "font_class": "minus-filled",
  21619. "unicode": "e67d",
  21620. "unicode_decimal": 59005
  21621. }, {
  21622. "icon_id": "24879606",
  21623. "name": "micoff",
  21624. "font_class": "micoff",
  21625. "unicode": "e67e",
  21626. "unicode_decimal": 59006
  21627. }, {
  21628. "icon_id": "24879588",
  21629. "name": "closeempty",
  21630. "font_class": "closeempty",
  21631. "unicode": "e66c",
  21632. "unicode_decimal": 58988
  21633. }, {
  21634. "icon_id": "24879589",
  21635. "name": "clear",
  21636. "font_class": "clear",
  21637. "unicode": "e66d",
  21638. "unicode_decimal": 58989
  21639. }, {
  21640. "icon_id": "24879590",
  21641. "name": "navigate",
  21642. "font_class": "navigate",
  21643. "unicode": "e66e",
  21644. "unicode_decimal": 58990
  21645. }, {
  21646. "icon_id": "24879591",
  21647. "name": "minus",
  21648. "font_class": "minus",
  21649. "unicode": "e66f",
  21650. "unicode_decimal": 58991
  21651. }, {
  21652. "icon_id": "24879592",
  21653. "name": "image",
  21654. "font_class": "image",
  21655. "unicode": "e670",
  21656. "unicode_decimal": 58992
  21657. }, {
  21658. "icon_id": "24879593",
  21659. "name": "mic",
  21660. "font_class": "mic",
  21661. "unicode": "e671",
  21662. "unicode_decimal": 58993
  21663. }, {
  21664. "icon_id": "24879594",
  21665. "name": "paperplane",
  21666. "font_class": "paperplane",
  21667. "unicode": "e672",
  21668. "unicode_decimal": 58994
  21669. }, {
  21670. "icon_id": "24879595",
  21671. "name": "close",
  21672. "font_class": "close",
  21673. "unicode": "e673",
  21674. "unicode_decimal": 58995
  21675. }, {
  21676. "icon_id": "24879596",
  21677. "name": "help-filled",
  21678. "font_class": "help-filled",
  21679. "unicode": "e674",
  21680. "unicode_decimal": 58996
  21681. }, {
  21682. "icon_id": "24879597",
  21683. "name": "plus-filled",
  21684. "font_class": "paperplane-filled",
  21685. "unicode": "e675",
  21686. "unicode_decimal": 58997
  21687. }, {
  21688. "icon_id": "24879598",
  21689. "name": "plus",
  21690. "font_class": "plus",
  21691. "unicode": "e676",
  21692. "unicode_decimal": 58998
  21693. }, {
  21694. "icon_id": "24879599",
  21695. "name": "mic-filled",
  21696. "font_class": "mic-filled",
  21697. "unicode": "e677",
  21698. "unicode_decimal": 58999
  21699. }, {
  21700. "icon_id": "24879600",
  21701. "name": "image-filled",
  21702. "font_class": "image-filled",
  21703. "unicode": "e678",
  21704. "unicode_decimal": 59000
  21705. }, {
  21706. "icon_id": "24855900",
  21707. "name": "locked-filled",
  21708. "font_class": "locked-filled",
  21709. "unicode": "e668",
  21710. "unicode_decimal": 58984
  21711. }, {
  21712. "icon_id": "24855901",
  21713. "name": "info",
  21714. "font_class": "info",
  21715. "unicode": "e669",
  21716. "unicode_decimal": 58985
  21717. }, {
  21718. "icon_id": "24855903",
  21719. "name": "locked",
  21720. "font_class": "locked",
  21721. "unicode": "e66b",
  21722. "unicode_decimal": 58987
  21723. }, {
  21724. "icon_id": "24855884",
  21725. "name": "camera-filled",
  21726. "font_class": "camera-filled",
  21727. "unicode": "e658",
  21728. "unicode_decimal": 58968
  21729. }, {
  21730. "icon_id": "24855885",
  21731. "name": "chat-filled",
  21732. "font_class": "chat-filled",
  21733. "unicode": "e659",
  21734. "unicode_decimal": 58969
  21735. }, {
  21736. "icon_id": "24855886",
  21737. "name": "camera",
  21738. "font_class": "camera",
  21739. "unicode": "e65a",
  21740. "unicode_decimal": 58970
  21741. }, {
  21742. "icon_id": "24855887",
  21743. "name": "circle",
  21744. "font_class": "circle",
  21745. "unicode": "e65b",
  21746. "unicode_decimal": 58971
  21747. }, {
  21748. "icon_id": "24855888",
  21749. "name": "checkmarkempty",
  21750. "font_class": "checkmarkempty",
  21751. "unicode": "e65c",
  21752. "unicode_decimal": 58972
  21753. }, {
  21754. "icon_id": "24855889",
  21755. "name": "chat",
  21756. "font_class": "chat",
  21757. "unicode": "e65d",
  21758. "unicode_decimal": 58973
  21759. }, {
  21760. "icon_id": "24855890",
  21761. "name": "circle-filled",
  21762. "font_class": "circle-filled",
  21763. "unicode": "e65e",
  21764. "unicode_decimal": 58974
  21765. }, {
  21766. "icon_id": "24855891",
  21767. "name": "flag",
  21768. "font_class": "flag",
  21769. "unicode": "e65f",
  21770. "unicode_decimal": 58975
  21771. }, {
  21772. "icon_id": "24855892",
  21773. "name": "flag-filled",
  21774. "font_class": "flag-filled",
  21775. "unicode": "e660",
  21776. "unicode_decimal": 58976
  21777. }, {
  21778. "icon_id": "24855893",
  21779. "name": "gear-filled",
  21780. "font_class": "gear-filled",
  21781. "unicode": "e661",
  21782. "unicode_decimal": 58977
  21783. }, {
  21784. "icon_id": "24855894",
  21785. "name": "home",
  21786. "font_class": "home",
  21787. "unicode": "e662",
  21788. "unicode_decimal": 58978
  21789. }, {
  21790. "icon_id": "24855895",
  21791. "name": "home-filled",
  21792. "font_class": "home-filled",
  21793. "unicode": "e663",
  21794. "unicode_decimal": 58979
  21795. }, {
  21796. "icon_id": "24855896",
  21797. "name": "gear",
  21798. "font_class": "gear",
  21799. "unicode": "e664",
  21800. "unicode_decimal": 58980
  21801. }, {
  21802. "icon_id": "24855897",
  21803. "name": "smallcircle-filled",
  21804. "font_class": "smallcircle-filled",
  21805. "unicode": "e665",
  21806. "unicode_decimal": 58981
  21807. }, {
  21808. "icon_id": "24855898",
  21809. "name": "map-filled",
  21810. "font_class": "map-filled",
  21811. "unicode": "e666",
  21812. "unicode_decimal": 58982
  21813. }, {
  21814. "icon_id": "24855899",
  21815. "name": "map",
  21816. "font_class": "map",
  21817. "unicode": "e667",
  21818. "unicode_decimal": 58983
  21819. }, {
  21820. "icon_id": "24855825",
  21821. "name": "refresh-filled",
  21822. "font_class": "refresh-filled",
  21823. "unicode": "e656",
  21824. "unicode_decimal": 58966
  21825. }, {
  21826. "icon_id": "24855826",
  21827. "name": "refresh",
  21828. "font_class": "refresh",
  21829. "unicode": "e657",
  21830. "unicode_decimal": 58967
  21831. }, {
  21832. "icon_id": "24855808",
  21833. "name": "cloud-upload",
  21834. "font_class": "cloud-upload",
  21835. "unicode": "e645",
  21836. "unicode_decimal": 58949
  21837. }, {
  21838. "icon_id": "24855809",
  21839. "name": "cloud-download-filled",
  21840. "font_class": "cloud-download-filled",
  21841. "unicode": "e646",
  21842. "unicode_decimal": 58950
  21843. }, {
  21844. "icon_id": "24855810",
  21845. "name": "cloud-download",
  21846. "font_class": "cloud-download",
  21847. "unicode": "e647",
  21848. "unicode_decimal": 58951
  21849. }, {
  21850. "icon_id": "24855811",
  21851. "name": "cloud-upload-filled",
  21852. "font_class": "cloud-upload-filled",
  21853. "unicode": "e648",
  21854. "unicode_decimal": 58952
  21855. }, {
  21856. "icon_id": "24855813",
  21857. "name": "redo",
  21858. "font_class": "redo",
  21859. "unicode": "e64a",
  21860. "unicode_decimal": 58954
  21861. }, {
  21862. "icon_id": "24855814",
  21863. "name": "images-filled",
  21864. "font_class": "images-filled",
  21865. "unicode": "e64b",
  21866. "unicode_decimal": 58955
  21867. }, {
  21868. "icon_id": "24855815",
  21869. "name": "undo-filled",
  21870. "font_class": "undo-filled",
  21871. "unicode": "e64c",
  21872. "unicode_decimal": 58956
  21873. }, {
  21874. "icon_id": "24855816",
  21875. "name": "more",
  21876. "font_class": "more",
  21877. "unicode": "e64d",
  21878. "unicode_decimal": 58957
  21879. }, {
  21880. "icon_id": "24855817",
  21881. "name": "more-filled",
  21882. "font_class": "more-filled",
  21883. "unicode": "e64e",
  21884. "unicode_decimal": 58958
  21885. }, {
  21886. "icon_id": "24855818",
  21887. "name": "undo",
  21888. "font_class": "undo",
  21889. "unicode": "e64f",
  21890. "unicode_decimal": 58959
  21891. }, {
  21892. "icon_id": "24855819",
  21893. "name": "images",
  21894. "font_class": "images",
  21895. "unicode": "e650",
  21896. "unicode_decimal": 58960
  21897. }, {
  21898. "icon_id": "24855821",
  21899. "name": "paperclip",
  21900. "font_class": "paperclip",
  21901. "unicode": "e652",
  21902. "unicode_decimal": 58962
  21903. }, {
  21904. "icon_id": "24855822",
  21905. "name": "settings",
  21906. "font_class": "settings",
  21907. "unicode": "e653",
  21908. "unicode_decimal": 58963
  21909. }, {
  21910. "icon_id": "24855823",
  21911. "name": "search",
  21912. "font_class": "search",
  21913. "unicode": "e654",
  21914. "unicode_decimal": 58964
  21915. }, {
  21916. "icon_id": "24855824",
  21917. "name": "redo-filled",
  21918. "font_class": "redo-filled",
  21919. "unicode": "e655",
  21920. "unicode_decimal": 58965
  21921. }, {
  21922. "icon_id": "24841702",
  21923. "name": "list",
  21924. "font_class": "list",
  21925. "unicode": "e644",
  21926. "unicode_decimal": 58948
  21927. }, {
  21928. "icon_id": "24841489",
  21929. "name": "mail-open-filled",
  21930. "font_class": "mail-open-filled",
  21931. "unicode": "e63a",
  21932. "unicode_decimal": 58938
  21933. }, {
  21934. "icon_id": "24841491",
  21935. "name": "hand-thumbsdown-filled",
  21936. "font_class": "hand-down-filled",
  21937. "unicode": "e63c",
  21938. "unicode_decimal": 58940
  21939. }, {
  21940. "icon_id": "24841492",
  21941. "name": "hand-thumbsdown",
  21942. "font_class": "hand-down",
  21943. "unicode": "e63d",
  21944. "unicode_decimal": 58941
  21945. }, {
  21946. "icon_id": "24841493",
  21947. "name": "hand-thumbsup-filled",
  21948. "font_class": "hand-up-filled",
  21949. "unicode": "e63e",
  21950. "unicode_decimal": 58942
  21951. }, {
  21952. "icon_id": "24841494",
  21953. "name": "hand-thumbsup",
  21954. "font_class": "hand-up",
  21955. "unicode": "e63f",
  21956. "unicode_decimal": 58943
  21957. }, {
  21958. "icon_id": "24841496",
  21959. "name": "heart-filled",
  21960. "font_class": "heart-filled",
  21961. "unicode": "e641",
  21962. "unicode_decimal": 58945
  21963. }, {
  21964. "icon_id": "24841498",
  21965. "name": "mail-open",
  21966. "font_class": "mail-open",
  21967. "unicode": "e643",
  21968. "unicode_decimal": 58947
  21969. }, {
  21970. "icon_id": "24841488",
  21971. "name": "heart",
  21972. "font_class": "heart",
  21973. "unicode": "e639",
  21974. "unicode_decimal": 58937
  21975. }, {
  21976. "icon_id": "24839963",
  21977. "name": "loop",
  21978. "font_class": "loop",
  21979. "unicode": "e633",
  21980. "unicode_decimal": 58931
  21981. }, {
  21982. "icon_id": "24839866",
  21983. "name": "pulldown",
  21984. "font_class": "pulldown",
  21985. "unicode": "e632",
  21986. "unicode_decimal": 58930
  21987. }, {
  21988. "icon_id": "24813798",
  21989. "name": "scan",
  21990. "font_class": "scan",
  21991. "unicode": "e62a",
  21992. "unicode_decimal": 58922
  21993. }, {
  21994. "icon_id": "24813786",
  21995. "name": "bars",
  21996. "font_class": "bars",
  21997. "unicode": "e627",
  21998. "unicode_decimal": 58919
  21999. }, {
  22000. "icon_id": "24813788",
  22001. "name": "cart-filled",
  22002. "font_class": "cart-filled",
  22003. "unicode": "e629",
  22004. "unicode_decimal": 58921
  22005. }, {
  22006. "icon_id": "24813790",
  22007. "name": "checkbox",
  22008. "font_class": "checkbox",
  22009. "unicode": "e62b",
  22010. "unicode_decimal": 58923
  22011. }, {
  22012. "icon_id": "24813791",
  22013. "name": "checkbox-filled",
  22014. "font_class": "checkbox-filled",
  22015. "unicode": "e62c",
  22016. "unicode_decimal": 58924
  22017. }, {
  22018. "icon_id": "24813794",
  22019. "name": "shop",
  22020. "font_class": "shop",
  22021. "unicode": "e62f",
  22022. "unicode_decimal": 58927
  22023. }, {
  22024. "icon_id": "24813795",
  22025. "name": "headphones",
  22026. "font_class": "headphones",
  22027. "unicode": "e630",
  22028. "unicode_decimal": 58928
  22029. }, {
  22030. "icon_id": "24813796",
  22031. "name": "cart",
  22032. "font_class": "cart",
  22033. "unicode": "e631",
  22034. "unicode_decimal": 58929
  22035. }]
  22036. };
  22037. exports.default = _default;
  22038. /***/ }),
  22039. /***/ 48:
  22040. /*!****************************************************************!*\
  22041. !*** E:/work/Project_newGit/hptwxMiniProgram/utils/request.js ***!
  22042. \****************************************************************/
  22043. /*! no static exports found */
  22044. /***/ (function(module, exports, __webpack_require__) {
  22045. "use strict";
  22046. /* WEBPACK VAR INJECTION */(function(uni) {
  22047. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  22048. Object.defineProperty(exports, "__esModule", {
  22049. value: true
  22050. });
  22051. exports.request = request;
  22052. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 40));
  22053. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  22054. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 42));
  22055. var _index = _interopRequireDefault(__webpack_require__(/*! @/config/index.js */ 46));
  22056. var _auth = __webpack_require__(/*! @/utils/auth.js */ 49);
  22057. 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; }
  22058. 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; }
  22059. var baseUrl = true ? _index.default.base.dev : undefined;
  22060. function request(_x) {
  22061. return _request.apply(this, arguments);
  22062. }
  22063. function _request() {
  22064. _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(parmas) {
  22065. return _regenerator.default.wrap(function _callee$(_context) {
  22066. while (1) {
  22067. switch (_context.prev = _context.next) {
  22068. case 0:
  22069. return _context.abrupt("return", new Promise(function (resolve, reject) {
  22070. try {
  22071. uni.showLoading({
  22072. title: '加载中',
  22073. mask: true
  22074. });
  22075. uni.request(_objectSpread(_objectSpread({}, formatRequestBody(parmas)), {}, {
  22076. success: function success(response) {
  22077. var data = response.data;
  22078. var code = data.code;
  22079. var msg = data.msg;
  22080. if (code === 200) {
  22081. resolve(data);
  22082. } else {
  22083. if (code === 401) {
  22084. uni.showToast({
  22085. title: msg || "登录失效!",
  22086. mask: true,
  22087. icon: "none",
  22088. complete: function complete() {
  22089. uni.redirectTo({
  22090. url: '/pages/authorizedLogin/index'
  22091. });
  22092. }
  22093. });
  22094. } else {
  22095. reject(data);
  22096. uni.showToast({
  22097. title: msg,
  22098. mask: true,
  22099. icon: "none"
  22100. });
  22101. }
  22102. }
  22103. },
  22104. fail: function fail(res) {
  22105. uni.showToast({
  22106. title: res,
  22107. mask: true,
  22108. icon: "none"
  22109. });
  22110. reject(res);
  22111. },
  22112. complete: function complete(res) {
  22113. uni.hideLoading();
  22114. }
  22115. }));
  22116. } catch (err) {
  22117. console.log(err);
  22118. reject(err);
  22119. }
  22120. }));
  22121. case 1:
  22122. case "end":
  22123. return _context.stop();
  22124. }
  22125. }
  22126. }, _callee);
  22127. }));
  22128. return _request.apply(this, arguments);
  22129. }
  22130. function formatRequestBody(parmas) {
  22131. var unionid = uni.getStorageSync('unionid');
  22132. var isAccount = uni.getStorageSync('isAccount');
  22133. var qrcode = uni.getStorageSync('qrcode');
  22134. var url = parmas.url;
  22135. url = baseUrl + url;
  22136. var data = _objectSpread({}, parmas.data);
  22137. var header = _objectSpread({}, parmas.header);
  22138. header[_index.default.TokenKey] = (0, _auth.getToken)();
  22139. header['AppID'] = _index.default.appID;
  22140. header['AppKey'] = _index.default.appKey;
  22141. header['AppSecret'] = _index.default.appSecret;
  22142. header['wxCode'] = unionid;
  22143. header['ocId'] = qrcode.ocId;
  22144. header['isAccount'] = isAccount;
  22145. header['AppType'] = 'mini';
  22146. var method = parmas.method || "get";
  22147. var dataType = parmas.dataType || "json";
  22148. var requestBody = {
  22149. url: url,
  22150. data: data,
  22151. header: header,
  22152. method: method,
  22153. dataType: dataType
  22154. };
  22155. return requestBody;
  22156. }
  22157. ;
  22158. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  22159. /***/ }),
  22160. /***/ 480:
  22161. /*!***********************************************************************************************************************!*\
  22162. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-transition/components/uni-transition/createAnimation.js ***!
  22163. \***********************************************************************************************************************/
  22164. /*! no static exports found */
  22165. /***/ (function(module, exports, __webpack_require__) {
  22166. "use strict";
  22167. /* WEBPACK VAR INJECTION */(function(uni) {
  22168. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  22169. Object.defineProperty(exports, "__esModule", {
  22170. value: true
  22171. });
  22172. exports.createAnimation = createAnimation;
  22173. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  22174. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  22175. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  22176. 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; }
  22177. 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; }
  22178. // const defaultOption = {
  22179. // duration: 300,
  22180. // timingFunction: 'linear',
  22181. // delay: 0,
  22182. // transformOrigin: '50% 50% 0'
  22183. // }
  22184. var MPAnimation = /*#__PURE__*/function () {
  22185. function MPAnimation(options, _this) {
  22186. (0, _classCallCheck2.default)(this, MPAnimation);
  22187. this.options = options;
  22188. // 在iOS10+QQ小程序平台下,传给原生的对象一定是个普通对象而不是Proxy对象,否则会报parameter should be Object instead of ProxyObject的错误
  22189. this.animation = uni.createAnimation(_objectSpread({}, options));
  22190. this.currentStepAnimates = {};
  22191. this.next = 0;
  22192. this.$ = _this;
  22193. }
  22194. (0, _createClass2.default)(MPAnimation, [{
  22195. key: "_nvuePushAnimates",
  22196. value: function _nvuePushAnimates(type, args) {
  22197. var aniObj = this.currentStepAnimates[this.next];
  22198. var styles = {};
  22199. if (!aniObj) {
  22200. styles = {
  22201. styles: {},
  22202. config: {}
  22203. };
  22204. } else {
  22205. styles = aniObj;
  22206. }
  22207. if (animateTypes1.includes(type)) {
  22208. if (!styles.styles.transform) {
  22209. styles.styles.transform = '';
  22210. }
  22211. var unit = '';
  22212. if (type === 'rotate') {
  22213. unit = 'deg';
  22214. }
  22215. styles.styles.transform += "".concat(type, "(").concat(args + unit, ") ");
  22216. } else {
  22217. styles.styles[type] = "".concat(args);
  22218. }
  22219. this.currentStepAnimates[this.next] = styles;
  22220. }
  22221. }, {
  22222. key: "_animateRun",
  22223. value: function _animateRun() {
  22224. var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  22225. var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  22226. var ref = this.$.$refs['ani'].ref;
  22227. if (!ref) return;
  22228. return new Promise(function (resolve, reject) {
  22229. nvueAnimation.transition(ref, _objectSpread({
  22230. styles: styles
  22231. }, config), function (res) {
  22232. resolve();
  22233. });
  22234. });
  22235. }
  22236. }, {
  22237. key: "_nvueNextAnimate",
  22238. value: function _nvueNextAnimate(animates) {
  22239. var _this2 = this;
  22240. var step = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  22241. var fn = arguments.length > 2 ? arguments[2] : undefined;
  22242. var obj = animates[step];
  22243. if (obj) {
  22244. var styles = obj.styles,
  22245. config = obj.config;
  22246. this._animateRun(styles, config).then(function () {
  22247. step += 1;
  22248. _this2._nvueNextAnimate(animates, step, fn);
  22249. });
  22250. } else {
  22251. this.currentStepAnimates = {};
  22252. typeof fn === 'function' && fn();
  22253. this.isEnd = true;
  22254. }
  22255. }
  22256. }, {
  22257. key: "step",
  22258. value: function step() {
  22259. var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  22260. this.animation.step(config);
  22261. return this;
  22262. }
  22263. }, {
  22264. key: "run",
  22265. value: function run(fn) {
  22266. this.$.animationData = this.animation.export();
  22267. this.$.timer = setTimeout(function () {
  22268. typeof fn === 'function' && fn();
  22269. }, this.$.durationTime);
  22270. }
  22271. }]);
  22272. return MPAnimation;
  22273. }();
  22274. var animateTypes1 = ['matrix', 'matrix3d', 'rotate', 'rotate3d', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scale3d', 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'translate', 'translate3d', 'translateX', 'translateY', 'translateZ'];
  22275. var animateTypes2 = ['opacity', 'backgroundColor'];
  22276. var animateTypes3 = ['width', 'height', 'left', 'right', 'top', 'bottom'];
  22277. animateTypes1.concat(animateTypes2, animateTypes3).forEach(function (type) {
  22278. MPAnimation.prototype[type] = function () {
  22279. var _this$animation;
  22280. (_this$animation = this.animation)[type].apply(_this$animation, arguments);
  22281. return this;
  22282. };
  22283. });
  22284. function createAnimation(option, _this) {
  22285. if (!_this) return;
  22286. clearTimeout(_this.timer);
  22287. return new MPAnimation(option, _this);
  22288. }
  22289. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  22290. /***/ }),
  22291. /***/ 49:
  22292. /*!*************************************************************!*\
  22293. !*** E:/work/Project_newGit/hptwxMiniProgram/utils/auth.js ***!
  22294. \*************************************************************/
  22295. /*! no static exports found */
  22296. /***/ (function(module, exports, __webpack_require__) {
  22297. "use strict";
  22298. /* WEBPACK VAR INJECTION */(function(uni) {
  22299. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  22300. Object.defineProperty(exports, "__esModule", {
  22301. value: true
  22302. });
  22303. exports.getToken = getToken;
  22304. exports.removeToken = removeToken;
  22305. exports.setToken = setToken;
  22306. var _index = _interopRequireDefault(__webpack_require__(/*! ../config/index.js */ 46));
  22307. var TokenKey = _index.default.TokenKey;
  22308. function getToken() {
  22309. return uni.getStorageSync(TokenKey);
  22310. }
  22311. function setToken(token) {
  22312. return uni.setStorageSync(TokenKey, token);
  22313. }
  22314. function removeToken() {
  22315. return uni.removeStorageSync(TokenKey);
  22316. }
  22317. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  22318. /***/ }),
  22319. /***/ 493:
  22320. /*!****************************************************************************************************************!*\
  22321. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js ***!
  22322. \****************************************************************************************************************/
  22323. /*! no static exports found */
  22324. /***/ (function(module, exports, __webpack_require__) {
  22325. "use strict";
  22326. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  22327. Object.defineProperty(exports, "__esModule", {
  22328. value: true
  22329. });
  22330. exports.default = void 0;
  22331. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 494));
  22332. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 495));
  22333. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 496));
  22334. var _default = {
  22335. en: _en.default,
  22336. 'zh-Hans': _zhHans.default,
  22337. 'zh-Hant': _zhHant.default
  22338. };
  22339. exports.default = _default;
  22340. /***/ }),
  22341. /***/ 494:
  22342. /*!***************************************************************************************************************!*\
  22343. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-load-more/components/uni-load-more/i18n/en.json ***!
  22344. \***************************************************************************************************************/
  22345. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  22346. /***/ (function(module) {
  22347. 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\"}");
  22348. /***/ }),
  22349. /***/ 495:
  22350. /*!********************************************************************************************************************!*\
  22351. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json ***!
  22352. \********************************************************************************************************************/
  22353. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  22354. /***/ (function(module) {
  22355. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉显示更多\",\"uni-load-more.contentrefresh\":\"正在加载...\",\"uni-load-more.contentnomore\":\"没有更多数据了\"}");
  22356. /***/ }),
  22357. /***/ 496:
  22358. /*!********************************************************************************************************************!*\
  22359. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json ***!
  22360. \********************************************************************************************************************/
  22361. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  22362. /***/ (function(module) {
  22363. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉顯示更多\",\"uni-load-more.contentrefresh\":\"正在加載...\",\"uni-load-more.contentnomore\":\"沒有更多數據了\"}");
  22364. /***/ }),
  22365. /***/ 5:
  22366. /*!**************************************************************!*\
  22367. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  22368. \**************************************************************/
  22369. /*! no static exports found */
  22370. /***/ (function(module, exports, __webpack_require__) {
  22371. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  22372. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  22373. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  22374. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  22375. function _slicedToArray(arr, i) {
  22376. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  22377. }
  22378. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  22379. /***/ }),
  22380. /***/ 50:
  22381. /*!**************************************************************!*\
  22382. !*** E:/work/Project_newGit/hptwxMiniProgram/utils/index.js ***!
  22383. \**************************************************************/
  22384. /*! no static exports found */
  22385. /***/ (function(module, exports, __webpack_require__) {
  22386. "use strict";
  22387. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  22388. Object.defineProperty(exports, "__esModule", {
  22389. value: true
  22390. });
  22391. exports.getQueryParams = getQueryParams;
  22392. exports.parseTime = parseTime;
  22393. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  22394. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  22395. function getQueryParams(url) {
  22396. var paramArr = url.slice(url.indexOf("?") + 1).split("&");
  22397. var params = {};
  22398. paramArr.map(function (param) {
  22399. var _param$split = param.split("="),
  22400. _param$split2 = (0, _slicedToArray2.default)(_param$split, 2),
  22401. key = _param$split2[0],
  22402. val = _param$split2[1];
  22403. params[key] = decodeURIComponent(val);
  22404. });
  22405. return params;
  22406. }
  22407. function parseTime(time, cFormat) {
  22408. if (arguments.length === 0 || !time) {
  22409. return null;
  22410. }
  22411. var format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}';
  22412. var date;
  22413. if ((0, _typeof2.default)(time) === 'object') {
  22414. date = time;
  22415. } else {
  22416. if (typeof time === 'string') {
  22417. if (/^[0-9]+$/.test(time)) {
  22418. // support "1548221490638"
  22419. time = parseInt(time);
  22420. } else {
  22421. // support safari
  22422. // https://stackoverflow.com/questions/4310953/invalid-date-in-safari
  22423. time = time.replace(new RegExp(/-/gm), '/');
  22424. }
  22425. }
  22426. if (typeof time === 'number' && time.toString().length === 10) {
  22427. time = time * 1000;
  22428. }
  22429. date = new Date(time);
  22430. }
  22431. var formatObj = {
  22432. y: date.getFullYear(),
  22433. m: date.getMonth() + 1,
  22434. d: date.getDate(),
  22435. h: date.getHours(),
  22436. i: date.getMinutes(),
  22437. s: date.getSeconds(),
  22438. a: date.getDay()
  22439. };
  22440. var time_str = format.replace(/{([ymdhisa])+}/g, function (result, key) {
  22441. var value = formatObj[key];
  22442. // Note: getDay() returns 0 on Sunday
  22443. if (key === 'a') {
  22444. return ['日', '一', '二', '三', '四', '五', '六'][value];
  22445. }
  22446. return value.toString().padStart(2, '0');
  22447. });
  22448. return time_str;
  22449. }
  22450. /***/ }),
  22451. /***/ 59:
  22452. /*!*********************************************************************!*\
  22453. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/dangerApi.js ***!
  22454. \*********************************************************************/
  22455. /*! no static exports found */
  22456. /***/ (function(module, exports, __webpack_require__) {
  22457. "use strict";
  22458. Object.defineProperty(exports, "__esModule", {
  22459. value: true
  22460. });
  22461. exports.deleteDangerById = deleteDangerById;
  22462. exports.getDangerById = getDangerById;
  22463. exports.getDangerByList = getDangerByList;
  22464. exports.getDangerByPage = getDangerByPage;
  22465. exports.getMyHandlingDangerByPage = getMyHandlingDangerByPage;
  22466. exports.handleDanger = handleDanger;
  22467. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  22468. /**
  22469. * 获取Danger列表
  22470. * @param data
  22471. * @returns
  22472. */
  22473. function getDangerByList(data) {
  22474. return (0, _request.request)({
  22475. url: '/danger',
  22476. method: 'GET',
  22477. data: data
  22478. });
  22479. }
  22480. /**
  22481. * 获取Danger分页
  22482. * @param data
  22483. * @returns
  22484. */
  22485. function getDangerByPage(data) {
  22486. return (0, _request.request)({
  22487. url: '/danger/page',
  22488. method: 'GET',
  22489. data: data
  22490. });
  22491. }
  22492. /**
  22493. * 根据Id获取Danger
  22494. * @param dangerId
  22495. * @returns
  22496. */
  22497. function getDangerById(dangerId) {
  22498. return (0, _request.request)({
  22499. url: "/danger/".concat(dangerId),
  22500. method: 'GET'
  22501. });
  22502. }
  22503. /**
  22504. * 删除Danger
  22505. * @param dangerId
  22506. * @returns
  22507. */
  22508. function deleteDangerById(dangerId) {
  22509. return (0, _request.request)({
  22510. url: "/danger/".concat(dangerId),
  22511. method: 'DELETE'
  22512. });
  22513. }
  22514. /**
  22515. * 处理Danger
  22516. * @param data
  22517. * @returns
  22518. */
  22519. function handleDanger(data) {
  22520. return (0, _request.request)({
  22521. url: "/danger/handle",
  22522. method: 'POST',
  22523. data: data
  22524. });
  22525. }
  22526. /**
  22527. * 待处理Danger
  22528. * @param data
  22529. * @returns
  22530. */
  22531. function getMyHandlingDangerByPage(data) {
  22532. return (0, _request.request)({
  22533. url: "/danger/myHandling/page",
  22534. method: 'GET',
  22535. data: data
  22536. });
  22537. }
  22538. /***/ }),
  22539. /***/ 6:
  22540. /*!***************************************************************!*\
  22541. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  22542. \***************************************************************/
  22543. /*! no static exports found */
  22544. /***/ (function(module, exports) {
  22545. function _arrayWithHoles(arr) {
  22546. if (Array.isArray(arr)) return arr;
  22547. }
  22548. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  22549. /***/ }),
  22550. /***/ 60:
  22551. /*!**************************************************************************!*\
  22552. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/checklistPoint.js ***!
  22553. \**************************************************************************/
  22554. /*! no static exports found */
  22555. /***/ (function(module, exports, __webpack_require__) {
  22556. "use strict";
  22557. Object.defineProperty(exports, "__esModule", {
  22558. value: true
  22559. });
  22560. exports.checklistBatchUpdate = checklistBatchUpdate;
  22561. exports.checklistCancel = checklistCancel;
  22562. exports.checklistComplete = checklistComplete;
  22563. exports.checklistInit = checklistInit;
  22564. exports.getDoingPoint = getDoingPoint;
  22565. exports.getPoint = getPoint;
  22566. exports.getchecklistByPage = getchecklistByPage;
  22567. exports.getchecklistRecord = getchecklistRecord;
  22568. exports.updateChecklistPoint = updateChecklistPoint;
  22569. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  22570. /**
  22571. * 清单初始化
  22572. * ocId
  22573. * targetId ,targetType,targetTitle,targetGroupId,,targetGroupName
  22574. * checklistId
  22575. */
  22576. function checklistInit(data) {
  22577. return (0, _request.request)({
  22578. url: "/checklist/point/record/init",
  22579. method: 'POST',
  22580. data: data
  22581. });
  22582. }
  22583. function updateChecklistPoint(data) {
  22584. return (0, _request.request)({
  22585. url: "/checklist/point/record/doing/update",
  22586. method: 'PUT',
  22587. data: data
  22588. });
  22589. }
  22590. function getchecklistRecord(checklistId, recordId) {
  22591. return (0, _request.request)({
  22592. url: "/checklist/point/record/view/".concat(recordId, "/").concat(checklistId),
  22593. method: 'GET'
  22594. });
  22595. }
  22596. function getchecklistByPage(data) {
  22597. return (0, _request.request)({
  22598. url: "/checklist/record/page",
  22599. method: 'GET',
  22600. data: data
  22601. });
  22602. }
  22603. // 巡检完成
  22604. function checklistComplete(recordId) {
  22605. return (0, _request.request)({
  22606. url: "/checklist/point/record/complete/".concat(recordId),
  22607. method: 'PUT'
  22608. });
  22609. }
  22610. // 巡检放弃
  22611. function checklistCancel(recordId) {
  22612. return (0, _request.request)({
  22613. url: "/checklist/point/record/cancel/".concat(recordId),
  22614. method: 'PUT'
  22615. });
  22616. }
  22617. // 批量操作
  22618. function checklistBatchUpdate(recordId, checkResult) {
  22619. return (0, _request.request)({
  22620. url: "/checklist/point/record/doing/batchUpdate/".concat(recordId, "/").concat(checkResult),
  22621. method: 'PUT'
  22622. });
  22623. }
  22624. // 批量操作
  22625. function getDoingPoint(checklistId, itemId, recordId, pointId) {
  22626. return (0, _request.request)({
  22627. url: "/checklist/point/record/doing/".concat(recordId, "/").concat(checklistId, "/").concat(itemId, "/").concat(pointId)
  22628. });
  22629. }
  22630. function getPoint(checklistId, itemId, recordId, pointId) {
  22631. return (0, _request.request)({
  22632. url: "/checklist/point/record/".concat(recordId, "/").concat(checklistId, "/").concat(itemId, "/").concat(pointId)
  22633. });
  22634. }
  22635. /***/ }),
  22636. /***/ 61:
  22637. /*!***********************************************************************!*\
  22638. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/snapshotApi.js ***!
  22639. \***********************************************************************/
  22640. /*! no static exports found */
  22641. /***/ (function(module, exports, __webpack_require__) {
  22642. "use strict";
  22643. Object.defineProperty(exports, "__esModule", {
  22644. value: true
  22645. });
  22646. exports.cancelSnapshot = cancelSnapshot;
  22647. exports.completeSnapshot = completeSnapshot;
  22648. exports.createSnapshot = createSnapshot;
  22649. exports.deleteSnapshotById = deleteSnapshotById;
  22650. exports.getSnapshotById = getSnapshotById;
  22651. exports.getSnapshotByList = getSnapshotByList;
  22652. exports.getSnapshotByPage = getSnapshotByPage;
  22653. exports.getSnapshotCounter = getSnapshotCounter;
  22654. exports.transferSnapshot = transferSnapshot;
  22655. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  22656. /**
  22657. * 问题反馈列表
  22658. * @param data
  22659. * @returns
  22660. */
  22661. function getSnapshotByList(data) {
  22662. return (0, _request.request)({
  22663. url: '/snapshot',
  22664. method: 'GET',
  22665. data: data
  22666. });
  22667. }
  22668. /**
  22669. * 问题反馈列表
  22670. * @param data
  22671. * @returns
  22672. */
  22673. function getSnapshotByPage(data) {
  22674. return (0, _request.request)({
  22675. url: '/snapshot/page',
  22676. method: 'GET',
  22677. data: data
  22678. });
  22679. }
  22680. /**
  22681. * 获取问题反馈详情
  22682. * @param snapshotId
  22683. * @returns
  22684. */
  22685. function getSnapshotById(snapshotId) {
  22686. return (0, _request.request)({
  22687. url: "/snapshot/".concat(snapshotId),
  22688. method: 'GET'
  22689. });
  22690. }
  22691. /**
  22692. * 添加问题反馈
  22693. * @param data
  22694. * @returns
  22695. */
  22696. function createSnapshot(data) {
  22697. return (0, _request.request)({
  22698. url: "/snapshot/add",
  22699. method: 'POST',
  22700. data: data
  22701. });
  22702. }
  22703. /**
  22704. * 完成处理
  22705. * @param snapshotId
  22706. * @param data
  22707. * @returns
  22708. */
  22709. function completeSnapshot(snapshotId, data) {
  22710. return (0, _request.request)({
  22711. url: "/snapshot/complete",
  22712. method: 'POST',
  22713. data: data
  22714. });
  22715. }
  22716. /**
  22717. * 转交他人
  22718. * @param snapshotId
  22719. * @param data
  22720. * @returns
  22721. */
  22722. function transferSnapshot(snapshotId, data) {
  22723. return (0, _request.request)({
  22724. url: "/snapshot/transfer/".concat(snapshotId),
  22725. method: 'POST',
  22726. data: data
  22727. });
  22728. }
  22729. /**
  22730. * 撤消
  22731. * @param snapshotId
  22732. * @returns
  22733. */
  22734. function cancelSnapshot(snapshotId) {
  22735. return (0, _request.request)({
  22736. url: "/snapshot/cancel/".concat(snapshotId),
  22737. method: 'GET'
  22738. });
  22739. }
  22740. /**
  22741. * 基于ID删除
  22742. * @param snapshotId
  22743. * @returns
  22744. */
  22745. function deleteSnapshotById(snapshotId) {
  22746. return (0, _request.request)({
  22747. url: "/snapshot/".concat(snapshotId),
  22748. method: 'DELETE'
  22749. });
  22750. }
  22751. /**
  22752. * 查询统计结果
  22753. */
  22754. function getSnapshotCounter() {
  22755. return (0, _request.request)({
  22756. url: '/snapshot/statis/counterByStatus',
  22757. method: 'GET'
  22758. });
  22759. }
  22760. /***/ }),
  22761. /***/ 7:
  22762. /*!*********************************************************************!*\
  22763. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  22764. \*********************************************************************/
  22765. /*! no static exports found */
  22766. /***/ (function(module, exports) {
  22767. function _iterableToArrayLimit(arr, i) {
  22768. var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  22769. if (null != _i) {
  22770. var _s,
  22771. _e,
  22772. _x,
  22773. _r,
  22774. _arr = [],
  22775. _n = !0,
  22776. _d = !1;
  22777. try {
  22778. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  22779. if (Object(_i) !== _i) return;
  22780. _n = !1;
  22781. } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  22782. ;
  22783. }
  22784. } catch (err) {
  22785. _d = !0, _e = err;
  22786. } finally {
  22787. try {
  22788. if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
  22789. } finally {
  22790. if (_d) throw _e;
  22791. }
  22792. }
  22793. return _arr;
  22794. }
  22795. }
  22796. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  22797. /***/ }),
  22798. /***/ 70:
  22799. /*!*******************************************************************!*\
  22800. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/wfApi.js ***!
  22801. \*******************************************************************/
  22802. /*! no static exports found */
  22803. /***/ (function(module, exports, __webpack_require__) {
  22804. "use strict";
  22805. Object.defineProperty(exports, "__esModule", {
  22806. value: true
  22807. });
  22808. exports.cancelWorkflow = cancelWorkflow;
  22809. exports.getWorkflowById = getWorkflowById;
  22810. exports.getWorkflowById2 = getWorkflowById2;
  22811. exports.getWorkflowById3 = getWorkflowById3;
  22812. exports.getWorkflowDetailsById = getWorkflowDetailsById;
  22813. exports.getWorkflowRecordById = getWorkflowRecordById;
  22814. exports.handleWorkflow = handleWorkflow;
  22815. exports.startWorkflow = startWorkflow;
  22816. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  22817. /**
  22818. * 启动Workflow
  22819. * @param wfDefId
  22820. * @returns
  22821. */
  22822. function startWorkflow(wfDefId) {
  22823. return (0, _request.request)({
  22824. url: "/wf/start/".concat(wfDefId),
  22825. method: 'GET'
  22826. });
  22827. }
  22828. function getWorkflowById(wfInsId) {
  22829. return (0, _request.request)({
  22830. url: "/wf/getIns/".concat(wfInsId),
  22831. method: 'GET'
  22832. });
  22833. }
  22834. function getWorkflowById2(wfInsId, activityInsId) {
  22835. return (0, _request.request)({
  22836. url: "/wf/getIns/".concat(wfInsId, "/").concat(activityInsId),
  22837. method: 'GET'
  22838. });
  22839. }
  22840. function getWorkflowById3(wfInsId, activityInsId, actionInsId) {
  22841. return (0, _request.request)({
  22842. url: "/wf/getIns/".concat(wfInsId, "/").concat(activityInsId, "/").concat(actionInsId),
  22843. method: 'GET'
  22844. });
  22845. }
  22846. function getWorkflowDetailsById(wfInsId) {
  22847. return (0, _request.request)({
  22848. url: "/wf/details/".concat(wfInsId),
  22849. method: 'GET'
  22850. });
  22851. }
  22852. function getWorkflowRecordById(wfInsId) {
  22853. return (0, _request.request)({
  22854. url: "/wf/record/".concat(wfInsId),
  22855. method: 'GET'
  22856. });
  22857. }
  22858. /**
  22859. * 处理
  22860. * @param data
  22861. * @returns
  22862. */
  22863. function handleWorkflow(data) {
  22864. return (0, _request.request)({
  22865. url: "/wf/handle",
  22866. method: 'POST',
  22867. data: data
  22868. });
  22869. }
  22870. /**
  22871. * 撤消
  22872. * @param wfInsId
  22873. * @returns
  22874. */
  22875. function cancelWorkflow(wfInsId) {
  22876. return (0, _request.request)({
  22877. url: "/wf/cancel/".concat(wfInsId),
  22878. method: 'GET'
  22879. });
  22880. }
  22881. /***/ }),
  22882. /***/ 79:
  22883. /*!******************************************************************!*\
  22884. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/user.js ***!
  22885. \******************************************************************/
  22886. /*! no static exports found */
  22887. /***/ (function(module, exports, __webpack_require__) {
  22888. "use strict";
  22889. Object.defineProperty(exports, "__esModule", {
  22890. value: true
  22891. });
  22892. exports.getUserInfo = getUserInfo;
  22893. exports.getUserList = getUserList;
  22894. exports.login = login;
  22895. exports.logout = logout;
  22896. exports.register = register;
  22897. exports.updatePwd = updatePwd;
  22898. exports.uploadFile = uploadFile;
  22899. exports.wxWorkLogin = wxWorkLogin;
  22900. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  22901. function login(data) {
  22902. return (0, _request.request)({
  22903. url: '/login',
  22904. method: 'post',
  22905. header: {
  22906. 'content-type': "application/x-www-form-urlencoded"
  22907. },
  22908. data: data
  22909. });
  22910. }
  22911. function getUserInfo() {
  22912. return (0, _request.request)({
  22913. url: '/user/profile'
  22914. });
  22915. }
  22916. function logout() {
  22917. return (0, _request.request)({
  22918. url: '/logout',
  22919. method: 'GET'
  22920. });
  22921. }
  22922. function register(data) {
  22923. return (0, _request.request)({
  22924. url: '/user/register',
  22925. method: 'post',
  22926. data: data
  22927. });
  22928. }
  22929. /**公用上传接口 */
  22930. function uploadFile(data) {
  22931. return (0, _request.request)({
  22932. url: '/upload/file',
  22933. method: "post",
  22934. headers: {
  22935. 'Content-Type': 'multipart/form-data'
  22936. },
  22937. data: data
  22938. });
  22939. }
  22940. function updatePwd(data) {
  22941. return (0, _request.request)({
  22942. url: '/user/updatePwd',
  22943. method: "post",
  22944. data: data
  22945. });
  22946. }
  22947. //查询用户的带岗位
  22948. function getUserList() {
  22949. return (0, _request.request)({
  22950. url: '/user/select',
  22951. method: 'get'
  22952. });
  22953. }
  22954. //企业微信登录
  22955. function wxWorkLogin(_ref) {
  22956. var userId = _ref.userId,
  22957. code = _ref.code;
  22958. return (0, _request.request)({
  22959. url: "/user/updateWxUserId/".concat(userId, "/").concat(code),
  22960. method: 'post'
  22961. });
  22962. }
  22963. /***/ }),
  22964. /***/ 8:
  22965. /*!***************************************************************************!*\
  22966. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  22967. \***************************************************************************/
  22968. /*! no static exports found */
  22969. /***/ (function(module, exports, __webpack_require__) {
  22970. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  22971. function _unsupportedIterableToArray(o, minLen) {
  22972. if (!o) return;
  22973. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  22974. var n = Object.prototype.toString.call(o).slice(8, -1);
  22975. if (n === "Object" && o.constructor) n = o.constructor.name;
  22976. if (n === "Map" || n === "Set") return Array.from(o);
  22977. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  22978. }
  22979. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  22980. /***/ }),
  22981. /***/ 80:
  22982. /*!****************************************************************!*\
  22983. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/task.js ***!
  22984. \****************************************************************/
  22985. /*! no static exports found */
  22986. /***/ (function(module, exports, __webpack_require__) {
  22987. "use strict";
  22988. Object.defineProperty(exports, "__esModule", {
  22989. value: true
  22990. });
  22991. exports.cancelCheckTask = cancelCheckTask;
  22992. exports.completeCheckTask = completeCheckTask;
  22993. exports.getMyWaitingTaskTop = getMyWaitingTaskTop;
  22994. exports.getTaskMyHandlingByList = getTaskMyHandlingByList;
  22995. exports.handleCheckTask = handleCheckTask;
  22996. exports.transferCheckTask = transferCheckTask;
  22997. exports.waitHandleStatistics = waitHandleStatistics;
  22998. var _request = __webpack_require__(/*! @/utils/request.js */ 48);
  22999. /**
  23000. * 列表查询Danger Category
  23001. * @returns
  23002. */
  23003. function getTaskMyHandlingByList(data) {
  23004. return (0, _request.request)({
  23005. url: '/task/myHandling/page',
  23006. method: 'GET',
  23007. data: data
  23008. });
  23009. }
  23010. /**
  23011. * Handle CheckTask
  23012. * @param taskId
  23013. */
  23014. function handleCheckTask(taskId) {
  23015. return (0, _request.request)({
  23016. url: "/check/task/handle/".concat(taskId),
  23017. method: 'PUT'
  23018. });
  23019. }
  23020. /**
  23021. * Handle CheckTask
  23022. * @param taskId
  23023. */
  23024. function waitHandleStatistics() {
  23025. return (0, _request.request)({
  23026. url: "/myCounter"
  23027. });
  23028. }
  23029. /**
  23030. * 列表查询我的待办Task:
  23031. * @param limit待办数目
  23032. * @returns
  23033. */
  23034. function getMyWaitingTaskTop(limit) {
  23035. return (0, _request.request)({
  23036. url: "/task/myWaiting/top/".concat(limit),
  23037. method: 'GET'
  23038. });
  23039. }
  23040. /**
  23041. * Transfer CheckTask
  23042. * @param data
  23043. */
  23044. function transferCheckTask(data) {
  23045. return (0, _request.request)({
  23046. url: "/check/task/transfer",
  23047. method: 'PUT',
  23048. data: data
  23049. });
  23050. }
  23051. /**
  23052. * Cancel CheckTask
  23053. * @param taskId
  23054. */
  23055. function cancelCheckTask(taskId) {
  23056. return (0, _request.request)({
  23057. url: "/check/task/cancel/".concat(taskId),
  23058. method: 'PUT'
  23059. });
  23060. }
  23061. /**
  23062. * Complete CheckTask
  23063. * @param taskId
  23064. */
  23065. function completeCheckTask(taskId) {
  23066. return (0, _request.request)({
  23067. url: "/check/task/complete/".concat(taskId),
  23068. method: 'PUT'
  23069. });
  23070. }
  23071. /***/ }),
  23072. /***/ 89:
  23073. /*!**************************************************************!*\
  23074. !*** E:/work/Project_newGit/hptwxMiniProgram/store/index.js ***!
  23075. \**************************************************************/
  23076. /*! no static exports found */
  23077. /***/ (function(module, exports, __webpack_require__) {
  23078. "use strict";
  23079. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  23080. Object.defineProperty(exports, "__esModule", {
  23081. value: true
  23082. });
  23083. exports.default = void 0;
  23084. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  23085. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 90));
  23086. _vue.default.use(_vuex.default);
  23087. //实例store对象
  23088. var store = new _vuex.default.Store({
  23089. state: {
  23090. access_token: "",
  23091. jpush: null
  23092. },
  23093. mutations: {
  23094. setToken: function setToken(state, token) {
  23095. state.access_token = token;
  23096. },
  23097. initJpush: function initJpush(state, jpush) {
  23098. state.jpush = jpush;
  23099. }
  23100. }
  23101. });
  23102. //导出store对象
  23103. var _default = store;
  23104. exports.default = _default;
  23105. /***/ }),
  23106. /***/ 9:
  23107. /*!*****************************************************************!*\
  23108. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  23109. \*****************************************************************/
  23110. /*! no static exports found */
  23111. /***/ (function(module, exports) {
  23112. function _arrayLikeToArray(arr, len) {
  23113. if (len == null || len > arr.length) len = arr.length;
  23114. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  23115. arr2[i] = arr[i];
  23116. }
  23117. return arr2;
  23118. }
  23119. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  23120. /***/ }),
  23121. /***/ 90:
  23122. /*!**************************************************************************************!*\
  23123. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vuex3/dist/vuex.common.js ***!
  23124. \**************************************************************************************/
  23125. /*! no static exports found */
  23126. /***/ (function(module, exports, __webpack_require__) {
  23127. "use strict";
  23128. /* WEBPACK VAR INJECTION */(function(global) {/*!
  23129. * vuex v3.6.2
  23130. * (c) 2021 Evan You
  23131. * @license MIT
  23132. */
  23133. function applyMixin (Vue) {
  23134. var version = Number(Vue.version.split('.')[0]);
  23135. if (version >= 2) {
  23136. Vue.mixin({ beforeCreate: vuexInit });
  23137. } else {
  23138. // override init and inject vuex init procedure
  23139. // for 1.x backwards compatibility.
  23140. var _init = Vue.prototype._init;
  23141. Vue.prototype._init = function (options) {
  23142. if ( options === void 0 ) options = {};
  23143. options.init = options.init
  23144. ? [vuexInit].concat(options.init)
  23145. : vuexInit;
  23146. _init.call(this, options);
  23147. };
  23148. }
  23149. /**
  23150. * Vuex init hook, injected into each instances init hooks list.
  23151. */
  23152. function vuexInit () {
  23153. var options = this.$options;
  23154. // store injection
  23155. if (options.store) {
  23156. this.$store = typeof options.store === 'function'
  23157. ? options.store()
  23158. : options.store;
  23159. } else if (options.parent && options.parent.$store) {
  23160. this.$store = options.parent.$store;
  23161. }
  23162. }
  23163. }
  23164. var target = typeof window !== 'undefined'
  23165. ? window
  23166. : typeof global !== 'undefined'
  23167. ? global
  23168. : {};
  23169. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  23170. function devtoolPlugin (store) {
  23171. if (!devtoolHook) { return }
  23172. store._devtoolHook = devtoolHook;
  23173. devtoolHook.emit('vuex:init', store);
  23174. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  23175. store.replaceState(targetState);
  23176. });
  23177. store.subscribe(function (mutation, state) {
  23178. devtoolHook.emit('vuex:mutation', mutation, state);
  23179. }, { prepend: true });
  23180. store.subscribeAction(function (action, state) {
  23181. devtoolHook.emit('vuex:action', action, state);
  23182. }, { prepend: true });
  23183. }
  23184. /**
  23185. * Get the first item that pass the test
  23186. * by second argument function
  23187. *
  23188. * @param {Array} list
  23189. * @param {Function} f
  23190. * @return {*}
  23191. */
  23192. function find (list, f) {
  23193. return list.filter(f)[0]
  23194. }
  23195. /**
  23196. * Deep copy the given object considering circular structure.
  23197. * This function caches all nested objects and its copies.
  23198. * If it detects circular structure, use cached copy to avoid infinite loop.
  23199. *
  23200. * @param {*} obj
  23201. * @param {Array<Object>} cache
  23202. * @return {*}
  23203. */
  23204. function deepCopy (obj, cache) {
  23205. if ( cache === void 0 ) cache = [];
  23206. // just return if obj is immutable value
  23207. if (obj === null || typeof obj !== 'object') {
  23208. return obj
  23209. }
  23210. // if obj is hit, it is in circular structure
  23211. var hit = find(cache, function (c) { return c.original === obj; });
  23212. if (hit) {
  23213. return hit.copy
  23214. }
  23215. var copy = Array.isArray(obj) ? [] : {};
  23216. // put the copy into cache at first
  23217. // because we want to refer it in recursive deepCopy
  23218. cache.push({
  23219. original: obj,
  23220. copy: copy
  23221. });
  23222. Object.keys(obj).forEach(function (key) {
  23223. copy[key] = deepCopy(obj[key], cache);
  23224. });
  23225. return copy
  23226. }
  23227. /**
  23228. * forEach for object
  23229. */
  23230. function forEachValue (obj, fn) {
  23231. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  23232. }
  23233. function isObject (obj) {
  23234. return obj !== null && typeof obj === 'object'
  23235. }
  23236. function isPromise (val) {
  23237. return val && typeof val.then === 'function'
  23238. }
  23239. function assert (condition, msg) {
  23240. if (!condition) { throw new Error(("[vuex] " + msg)) }
  23241. }
  23242. function partial (fn, arg) {
  23243. return function () {
  23244. return fn(arg)
  23245. }
  23246. }
  23247. // Base data struct for store's module, package with some attribute and method
  23248. var Module = function Module (rawModule, runtime) {
  23249. this.runtime = runtime;
  23250. // Store some children item
  23251. this._children = Object.create(null);
  23252. // Store the origin module object which passed by programmer
  23253. this._rawModule = rawModule;
  23254. var rawState = rawModule.state;
  23255. // Store the origin module's state
  23256. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  23257. };
  23258. var prototypeAccessors = { namespaced: { configurable: true } };
  23259. prototypeAccessors.namespaced.get = function () {
  23260. return !!this._rawModule.namespaced
  23261. };
  23262. Module.prototype.addChild = function addChild (key, module) {
  23263. this._children[key] = module;
  23264. };
  23265. Module.prototype.removeChild = function removeChild (key) {
  23266. delete this._children[key];
  23267. };
  23268. Module.prototype.getChild = function getChild (key) {
  23269. return this._children[key]
  23270. };
  23271. Module.prototype.hasChild = function hasChild (key) {
  23272. return key in this._children
  23273. };
  23274. Module.prototype.update = function update (rawModule) {
  23275. this._rawModule.namespaced = rawModule.namespaced;
  23276. if (rawModule.actions) {
  23277. this._rawModule.actions = rawModule.actions;
  23278. }
  23279. if (rawModule.mutations) {
  23280. this._rawModule.mutations = rawModule.mutations;
  23281. }
  23282. if (rawModule.getters) {
  23283. this._rawModule.getters = rawModule.getters;
  23284. }
  23285. };
  23286. Module.prototype.forEachChild = function forEachChild (fn) {
  23287. forEachValue(this._children, fn);
  23288. };
  23289. Module.prototype.forEachGetter = function forEachGetter (fn) {
  23290. if (this._rawModule.getters) {
  23291. forEachValue(this._rawModule.getters, fn);
  23292. }
  23293. };
  23294. Module.prototype.forEachAction = function forEachAction (fn) {
  23295. if (this._rawModule.actions) {
  23296. forEachValue(this._rawModule.actions, fn);
  23297. }
  23298. };
  23299. Module.prototype.forEachMutation = function forEachMutation (fn) {
  23300. if (this._rawModule.mutations) {
  23301. forEachValue(this._rawModule.mutations, fn);
  23302. }
  23303. };
  23304. Object.defineProperties( Module.prototype, prototypeAccessors );
  23305. var ModuleCollection = function ModuleCollection (rawRootModule) {
  23306. // register root module (Vuex.Store options)
  23307. this.register([], rawRootModule, false);
  23308. };
  23309. ModuleCollection.prototype.get = function get (path) {
  23310. return path.reduce(function (module, key) {
  23311. return module.getChild(key)
  23312. }, this.root)
  23313. };
  23314. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  23315. var module = this.root;
  23316. return path.reduce(function (namespace, key) {
  23317. module = module.getChild(key);
  23318. return namespace + (module.namespaced ? key + '/' : '')
  23319. }, '')
  23320. };
  23321. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  23322. update([], this.root, rawRootModule);
  23323. };
  23324. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  23325. var this$1 = this;
  23326. if ( runtime === void 0 ) runtime = true;
  23327. if ((true)) {
  23328. assertRawModule(path, rawModule);
  23329. }
  23330. var newModule = new Module(rawModule, runtime);
  23331. if (path.length === 0) {
  23332. this.root = newModule;
  23333. } else {
  23334. var parent = this.get(path.slice(0, -1));
  23335. parent.addChild(path[path.length - 1], newModule);
  23336. }
  23337. // register nested modules
  23338. if (rawModule.modules) {
  23339. forEachValue(rawModule.modules, function (rawChildModule, key) {
  23340. this$1.register(path.concat(key), rawChildModule, runtime);
  23341. });
  23342. }
  23343. };
  23344. ModuleCollection.prototype.unregister = function unregister (path) {
  23345. var parent = this.get(path.slice(0, -1));
  23346. var key = path[path.length - 1];
  23347. var child = parent.getChild(key);
  23348. if (!child) {
  23349. if ((true)) {
  23350. console.warn(
  23351. "[vuex] trying to unregister module '" + key + "', which is " +
  23352. "not registered"
  23353. );
  23354. }
  23355. return
  23356. }
  23357. if (!child.runtime) {
  23358. return
  23359. }
  23360. parent.removeChild(key);
  23361. };
  23362. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  23363. var parent = this.get(path.slice(0, -1));
  23364. var key = path[path.length - 1];
  23365. if (parent) {
  23366. return parent.hasChild(key)
  23367. }
  23368. return false
  23369. };
  23370. function update (path, targetModule, newModule) {
  23371. if ((true)) {
  23372. assertRawModule(path, newModule);
  23373. }
  23374. // update target module
  23375. targetModule.update(newModule);
  23376. // update nested modules
  23377. if (newModule.modules) {
  23378. for (var key in newModule.modules) {
  23379. if (!targetModule.getChild(key)) {
  23380. if ((true)) {
  23381. console.warn(
  23382. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  23383. 'manual reload is needed'
  23384. );
  23385. }
  23386. return
  23387. }
  23388. update(
  23389. path.concat(key),
  23390. targetModule.getChild(key),
  23391. newModule.modules[key]
  23392. );
  23393. }
  23394. }
  23395. }
  23396. var functionAssert = {
  23397. assert: function (value) { return typeof value === 'function'; },
  23398. expected: 'function'
  23399. };
  23400. var objectAssert = {
  23401. assert: function (value) { return typeof value === 'function' ||
  23402. (typeof value === 'object' && typeof value.handler === 'function'); },
  23403. expected: 'function or object with "handler" function'
  23404. };
  23405. var assertTypes = {
  23406. getters: functionAssert,
  23407. mutations: functionAssert,
  23408. actions: objectAssert
  23409. };
  23410. function assertRawModule (path, rawModule) {
  23411. Object.keys(assertTypes).forEach(function (key) {
  23412. if (!rawModule[key]) { return }
  23413. var assertOptions = assertTypes[key];
  23414. forEachValue(rawModule[key], function (value, type) {
  23415. assert(
  23416. assertOptions.assert(value),
  23417. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  23418. );
  23419. });
  23420. });
  23421. }
  23422. function makeAssertionMessage (path, key, type, value, expected) {
  23423. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  23424. if (path.length > 0) {
  23425. buf += " in module \"" + (path.join('.')) + "\"";
  23426. }
  23427. buf += " is " + (JSON.stringify(value)) + ".";
  23428. return buf
  23429. }
  23430. var Vue; // bind on install
  23431. var Store = function Store (options) {
  23432. var this$1 = this;
  23433. if ( options === void 0 ) options = {};
  23434. // Auto install if it is not done yet and `window` has `Vue`.
  23435. // To allow users to avoid auto-installation in some cases,
  23436. // this code should be placed here. See #731
  23437. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  23438. install(window.Vue);
  23439. }
  23440. if ((true)) {
  23441. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  23442. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  23443. assert(this instanceof Store, "store must be called with the new operator.");
  23444. }
  23445. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  23446. var strict = options.strict; if ( strict === void 0 ) strict = false;
  23447. // store internal state
  23448. this._committing = false;
  23449. this._actions = Object.create(null);
  23450. this._actionSubscribers = [];
  23451. this._mutations = Object.create(null);
  23452. this._wrappedGetters = Object.create(null);
  23453. this._modules = new ModuleCollection(options);
  23454. this._modulesNamespaceMap = Object.create(null);
  23455. this._subscribers = [];
  23456. this._watcherVM = new Vue();
  23457. this._makeLocalGettersCache = Object.create(null);
  23458. // bind commit and dispatch to self
  23459. var store = this;
  23460. var ref = this;
  23461. var dispatch = ref.dispatch;
  23462. var commit = ref.commit;
  23463. this.dispatch = function boundDispatch (type, payload) {
  23464. return dispatch.call(store, type, payload)
  23465. };
  23466. this.commit = function boundCommit (type, payload, options) {
  23467. return commit.call(store, type, payload, options)
  23468. };
  23469. // strict mode
  23470. this.strict = strict;
  23471. var state = this._modules.root.state;
  23472. // init root module.
  23473. // this also recursively registers all sub-modules
  23474. // and collects all module getters inside this._wrappedGetters
  23475. installModule(this, state, [], this._modules.root);
  23476. // initialize the store vm, which is responsible for the reactivity
  23477. // (also registers _wrappedGetters as computed properties)
  23478. resetStoreVM(this, state);
  23479. // apply plugins
  23480. plugins.forEach(function (plugin) { return plugin(this$1); });
  23481. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  23482. if (useDevtools) {
  23483. devtoolPlugin(this);
  23484. }
  23485. };
  23486. var prototypeAccessors$1 = { state: { configurable: true } };
  23487. prototypeAccessors$1.state.get = function () {
  23488. return this._vm._data.$$state
  23489. };
  23490. prototypeAccessors$1.state.set = function (v) {
  23491. if ((true)) {
  23492. assert(false, "use store.replaceState() to explicit replace store state.");
  23493. }
  23494. };
  23495. Store.prototype.commit = function commit (_type, _payload, _options) {
  23496. var this$1 = this;
  23497. // check object-style commit
  23498. var ref = unifyObjectStyle(_type, _payload, _options);
  23499. var type = ref.type;
  23500. var payload = ref.payload;
  23501. var options = ref.options;
  23502. var mutation = { type: type, payload: payload };
  23503. var entry = this._mutations[type];
  23504. if (!entry) {
  23505. if ((true)) {
  23506. console.error(("[vuex] unknown mutation type: " + type));
  23507. }
  23508. return
  23509. }
  23510. this._withCommit(function () {
  23511. entry.forEach(function commitIterator (handler) {
  23512. handler(payload);
  23513. });
  23514. });
  23515. this._subscribers
  23516. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  23517. .forEach(function (sub) { return sub(mutation, this$1.state); });
  23518. if (
  23519. ( true) &&
  23520. options && options.silent
  23521. ) {
  23522. console.warn(
  23523. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  23524. 'Use the filter functionality in the vue-devtools'
  23525. );
  23526. }
  23527. };
  23528. Store.prototype.dispatch = function dispatch (_type, _payload) {
  23529. var this$1 = this;
  23530. // check object-style dispatch
  23531. var ref = unifyObjectStyle(_type, _payload);
  23532. var type = ref.type;
  23533. var payload = ref.payload;
  23534. var action = { type: type, payload: payload };
  23535. var entry = this._actions[type];
  23536. if (!entry) {
  23537. if ((true)) {
  23538. console.error(("[vuex] unknown action type: " + type));
  23539. }
  23540. return
  23541. }
  23542. try {
  23543. this._actionSubscribers
  23544. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  23545. .filter(function (sub) { return sub.before; })
  23546. .forEach(function (sub) { return sub.before(action, this$1.state); });
  23547. } catch (e) {
  23548. if ((true)) {
  23549. console.warn("[vuex] error in before action subscribers: ");
  23550. console.error(e);
  23551. }
  23552. }
  23553. var result = entry.length > 1
  23554. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  23555. : entry[0](payload);
  23556. return new Promise(function (resolve, reject) {
  23557. result.then(function (res) {
  23558. try {
  23559. this$1._actionSubscribers
  23560. .filter(function (sub) { return sub.after; })
  23561. .forEach(function (sub) { return sub.after(action, this$1.state); });
  23562. } catch (e) {
  23563. if ((true)) {
  23564. console.warn("[vuex] error in after action subscribers: ");
  23565. console.error(e);
  23566. }
  23567. }
  23568. resolve(res);
  23569. }, function (error) {
  23570. try {
  23571. this$1._actionSubscribers
  23572. .filter(function (sub) { return sub.error; })
  23573. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  23574. } catch (e) {
  23575. if ((true)) {
  23576. console.warn("[vuex] error in error action subscribers: ");
  23577. console.error(e);
  23578. }
  23579. }
  23580. reject(error);
  23581. });
  23582. })
  23583. };
  23584. Store.prototype.subscribe = function subscribe (fn, options) {
  23585. return genericSubscribe(fn, this._subscribers, options)
  23586. };
  23587. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  23588. var subs = typeof fn === 'function' ? { before: fn } : fn;
  23589. return genericSubscribe(subs, this._actionSubscribers, options)
  23590. };
  23591. Store.prototype.watch = function watch (getter, cb, options) {
  23592. var this$1 = this;
  23593. if ((true)) {
  23594. assert(typeof getter === 'function', "store.watch only accepts a function.");
  23595. }
  23596. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  23597. };
  23598. Store.prototype.replaceState = function replaceState (state) {
  23599. var this$1 = this;
  23600. this._withCommit(function () {
  23601. this$1._vm._data.$$state = state;
  23602. });
  23603. };
  23604. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  23605. if ( options === void 0 ) options = {};
  23606. if (typeof path === 'string') { path = [path]; }
  23607. if ((true)) {
  23608. assert(Array.isArray(path), "module path must be a string or an Array.");
  23609. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  23610. }
  23611. this._modules.register(path, rawModule);
  23612. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  23613. // reset store to update getters...
  23614. resetStoreVM(this, this.state);
  23615. };
  23616. Store.prototype.unregisterModule = function unregisterModule (path) {
  23617. var this$1 = this;
  23618. if (typeof path === 'string') { path = [path]; }
  23619. if ((true)) {
  23620. assert(Array.isArray(path), "module path must be a string or an Array.");
  23621. }
  23622. this._modules.unregister(path);
  23623. this._withCommit(function () {
  23624. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  23625. Vue.delete(parentState, path[path.length - 1]);
  23626. });
  23627. resetStore(this);
  23628. };
  23629. Store.prototype.hasModule = function hasModule (path) {
  23630. if (typeof path === 'string') { path = [path]; }
  23631. if ((true)) {
  23632. assert(Array.isArray(path), "module path must be a string or an Array.");
  23633. }
  23634. return this._modules.isRegistered(path)
  23635. };
  23636. Store.prototype[[104,111,116,85,112,100,97,116,101].map(function (item) {return String.fromCharCode(item)}).join('')] = function (newOptions) {
  23637. this._modules.update(newOptions);
  23638. resetStore(this, true);
  23639. };
  23640. Store.prototype._withCommit = function _withCommit (fn) {
  23641. var committing = this._committing;
  23642. this._committing = true;
  23643. fn();
  23644. this._committing = committing;
  23645. };
  23646. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  23647. function genericSubscribe (fn, subs, options) {
  23648. if (subs.indexOf(fn) < 0) {
  23649. options && options.prepend
  23650. ? subs.unshift(fn)
  23651. : subs.push(fn);
  23652. }
  23653. return function () {
  23654. var i = subs.indexOf(fn);
  23655. if (i > -1) {
  23656. subs.splice(i, 1);
  23657. }
  23658. }
  23659. }
  23660. function resetStore (store, hot) {
  23661. store._actions = Object.create(null);
  23662. store._mutations = Object.create(null);
  23663. store._wrappedGetters = Object.create(null);
  23664. store._modulesNamespaceMap = Object.create(null);
  23665. var state = store.state;
  23666. // init all modules
  23667. installModule(store, state, [], store._modules.root, true);
  23668. // reset vm
  23669. resetStoreVM(store, state, hot);
  23670. }
  23671. function resetStoreVM (store, state, hot) {
  23672. var oldVm = store._vm;
  23673. // bind store public getters
  23674. store.getters = {};
  23675. // reset local getters cache
  23676. store._makeLocalGettersCache = Object.create(null);
  23677. var wrappedGetters = store._wrappedGetters;
  23678. var computed = {};
  23679. forEachValue(wrappedGetters, function (fn, key) {
  23680. // use computed to leverage its lazy-caching mechanism
  23681. // direct inline function use will lead to closure preserving oldVm.
  23682. // using partial to return function with only arguments preserved in closure environment.
  23683. computed[key] = partial(fn, store);
  23684. Object.defineProperty(store.getters, key, {
  23685. get: function () { return store._vm[key]; },
  23686. enumerable: true // for local getters
  23687. });
  23688. });
  23689. // use a Vue instance to store the state tree
  23690. // suppress warnings just in case the user has added
  23691. // some funky global mixins
  23692. var silent = Vue.config.silent;
  23693. Vue.config.silent = true;
  23694. store._vm = new Vue({
  23695. data: {
  23696. $$state: state
  23697. },
  23698. computed: computed
  23699. });
  23700. Vue.config.silent = silent;
  23701. // enable strict mode for new vm
  23702. if (store.strict) {
  23703. enableStrictMode(store);
  23704. }
  23705. if (oldVm) {
  23706. if (hot) {
  23707. // dispatch changes in all subscribed watchers
  23708. // to force getter re-evaluation for hot reloading.
  23709. store._withCommit(function () {
  23710. oldVm._data.$$state = null;
  23711. });
  23712. }
  23713. Vue.nextTick(function () { return oldVm.$destroy(); });
  23714. }
  23715. }
  23716. function installModule (store, rootState, path, module, hot) {
  23717. var isRoot = !path.length;
  23718. var namespace = store._modules.getNamespace(path);
  23719. // register in namespace map
  23720. if (module.namespaced) {
  23721. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  23722. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  23723. }
  23724. store._modulesNamespaceMap[namespace] = module;
  23725. }
  23726. // set state
  23727. if (!isRoot && !hot) {
  23728. var parentState = getNestedState(rootState, path.slice(0, -1));
  23729. var moduleName = path[path.length - 1];
  23730. store._withCommit(function () {
  23731. if ((true)) {
  23732. if (moduleName in parentState) {
  23733. console.warn(
  23734. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  23735. );
  23736. }
  23737. }
  23738. Vue.set(parentState, moduleName, module.state);
  23739. });
  23740. }
  23741. var local = module.context = makeLocalContext(store, namespace, path);
  23742. module.forEachMutation(function (mutation, key) {
  23743. var namespacedType = namespace + key;
  23744. registerMutation(store, namespacedType, mutation, local);
  23745. });
  23746. module.forEachAction(function (action, key) {
  23747. var type = action.root ? key : namespace + key;
  23748. var handler = action.handler || action;
  23749. registerAction(store, type, handler, local);
  23750. });
  23751. module.forEachGetter(function (getter, key) {
  23752. var namespacedType = namespace + key;
  23753. registerGetter(store, namespacedType, getter, local);
  23754. });
  23755. module.forEachChild(function (child, key) {
  23756. installModule(store, rootState, path.concat(key), child, hot);
  23757. });
  23758. }
  23759. /**
  23760. * make localized dispatch, commit, getters and state
  23761. * if there is no namespace, just use root ones
  23762. */
  23763. function makeLocalContext (store, namespace, path) {
  23764. var noNamespace = namespace === '';
  23765. var local = {
  23766. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  23767. var args = unifyObjectStyle(_type, _payload, _options);
  23768. var payload = args.payload;
  23769. var options = args.options;
  23770. var type = args.type;
  23771. if (!options || !options.root) {
  23772. type = namespace + type;
  23773. if (( true) && !store._actions[type]) {
  23774. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  23775. return
  23776. }
  23777. }
  23778. return store.dispatch(type, payload)
  23779. },
  23780. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  23781. var args = unifyObjectStyle(_type, _payload, _options);
  23782. var payload = args.payload;
  23783. var options = args.options;
  23784. var type = args.type;
  23785. if (!options || !options.root) {
  23786. type = namespace + type;
  23787. if (( true) && !store._mutations[type]) {
  23788. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  23789. return
  23790. }
  23791. }
  23792. store.commit(type, payload, options);
  23793. }
  23794. };
  23795. // getters and state object must be gotten lazily
  23796. // because they will be changed by vm update
  23797. Object.defineProperties(local, {
  23798. getters: {
  23799. get: noNamespace
  23800. ? function () { return store.getters; }
  23801. : function () { return makeLocalGetters(store, namespace); }
  23802. },
  23803. state: {
  23804. get: function () { return getNestedState(store.state, path); }
  23805. }
  23806. });
  23807. return local
  23808. }
  23809. function makeLocalGetters (store, namespace) {
  23810. if (!store._makeLocalGettersCache[namespace]) {
  23811. var gettersProxy = {};
  23812. var splitPos = namespace.length;
  23813. Object.keys(store.getters).forEach(function (type) {
  23814. // skip if the target getter is not match this namespace
  23815. if (type.slice(0, splitPos) !== namespace) { return }
  23816. // extract local getter type
  23817. var localType = type.slice(splitPos);
  23818. // Add a port to the getters proxy.
  23819. // Define as getter property because
  23820. // we do not want to evaluate the getters in this time.
  23821. Object.defineProperty(gettersProxy, localType, {
  23822. get: function () { return store.getters[type]; },
  23823. enumerable: true
  23824. });
  23825. });
  23826. store._makeLocalGettersCache[namespace] = gettersProxy;
  23827. }
  23828. return store._makeLocalGettersCache[namespace]
  23829. }
  23830. function registerMutation (store, type, handler, local) {
  23831. var entry = store._mutations[type] || (store._mutations[type] = []);
  23832. entry.push(function wrappedMutationHandler (payload) {
  23833. handler.call(store, local.state, payload);
  23834. });
  23835. }
  23836. function registerAction (store, type, handler, local) {
  23837. var entry = store._actions[type] || (store._actions[type] = []);
  23838. entry.push(function wrappedActionHandler (payload) {
  23839. var res = handler.call(store, {
  23840. dispatch: local.dispatch,
  23841. commit: local.commit,
  23842. getters: local.getters,
  23843. state: local.state,
  23844. rootGetters: store.getters,
  23845. rootState: store.state
  23846. }, payload);
  23847. if (!isPromise(res)) {
  23848. res = Promise.resolve(res);
  23849. }
  23850. if (store._devtoolHook) {
  23851. return res.catch(function (err) {
  23852. store._devtoolHook.emit('vuex:error', err);
  23853. throw err
  23854. })
  23855. } else {
  23856. return res
  23857. }
  23858. });
  23859. }
  23860. function registerGetter (store, type, rawGetter, local) {
  23861. if (store._wrappedGetters[type]) {
  23862. if ((true)) {
  23863. console.error(("[vuex] duplicate getter key: " + type));
  23864. }
  23865. return
  23866. }
  23867. store._wrappedGetters[type] = function wrappedGetter (store) {
  23868. return rawGetter(
  23869. local.state, // local state
  23870. local.getters, // local getters
  23871. store.state, // root state
  23872. store.getters // root getters
  23873. )
  23874. };
  23875. }
  23876. function enableStrictMode (store) {
  23877. store._vm.$watch(function () { return this._data.$$state }, function () {
  23878. if ((true)) {
  23879. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  23880. }
  23881. }, { deep: true, sync: true });
  23882. }
  23883. function getNestedState (state, path) {
  23884. return path.reduce(function (state, key) { return state[key]; }, state)
  23885. }
  23886. function unifyObjectStyle (type, payload, options) {
  23887. if (isObject(type) && type.type) {
  23888. options = payload;
  23889. payload = type;
  23890. type = type.type;
  23891. }
  23892. if ((true)) {
  23893. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  23894. }
  23895. return { type: type, payload: payload, options: options }
  23896. }
  23897. function install (_Vue) {
  23898. if (Vue && _Vue === Vue) {
  23899. if ((true)) {
  23900. console.error(
  23901. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  23902. );
  23903. }
  23904. return
  23905. }
  23906. Vue = _Vue;
  23907. applyMixin(Vue);
  23908. }
  23909. /**
  23910. * Reduce the code which written in Vue.js for getting the state.
  23911. * @param {String} [namespace] - Module's namespace
  23912. * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.
  23913. * @param {Object}
  23914. */
  23915. var mapState = normalizeNamespace(function (namespace, states) {
  23916. var res = {};
  23917. if (( true) && !isValidMap(states)) {
  23918. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  23919. }
  23920. normalizeMap(states).forEach(function (ref) {
  23921. var key = ref.key;
  23922. var val = ref.val;
  23923. res[key] = function mappedState () {
  23924. var state = this.$store.state;
  23925. var getters = this.$store.getters;
  23926. if (namespace) {
  23927. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  23928. if (!module) {
  23929. return
  23930. }
  23931. state = module.context.state;
  23932. getters = module.context.getters;
  23933. }
  23934. return typeof val === 'function'
  23935. ? val.call(this, state, getters)
  23936. : state[val]
  23937. };
  23938. // mark vuex getter for devtools
  23939. res[key].vuex = true;
  23940. });
  23941. return res
  23942. });
  23943. /**
  23944. * Reduce the code which written in Vue.js for committing the mutation
  23945. * @param {String} [namespace] - Module's namespace
  23946. * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept another params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  23947. * @return {Object}
  23948. */
  23949. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  23950. var res = {};
  23951. if (( true) && !isValidMap(mutations)) {
  23952. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  23953. }
  23954. normalizeMap(mutations).forEach(function (ref) {
  23955. var key = ref.key;
  23956. var val = ref.val;
  23957. res[key] = function mappedMutation () {
  23958. var args = [], len = arguments.length;
  23959. while ( len-- ) args[ len ] = arguments[ len ];
  23960. // Get the commit method from store
  23961. var commit = this.$store.commit;
  23962. if (namespace) {
  23963. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  23964. if (!module) {
  23965. return
  23966. }
  23967. commit = module.context.commit;
  23968. }
  23969. return typeof val === 'function'
  23970. ? val.apply(this, [commit].concat(args))
  23971. : commit.apply(this.$store, [val].concat(args))
  23972. };
  23973. });
  23974. return res
  23975. });
  23976. /**
  23977. * Reduce the code which written in Vue.js for getting the getters
  23978. * @param {String} [namespace] - Module's namespace
  23979. * @param {Object|Array} getters
  23980. * @return {Object}
  23981. */
  23982. var mapGetters = normalizeNamespace(function (namespace, getters) {
  23983. var res = {};
  23984. if (( true) && !isValidMap(getters)) {
  23985. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  23986. }
  23987. normalizeMap(getters).forEach(function (ref) {
  23988. var key = ref.key;
  23989. var val = ref.val;
  23990. // The namespace has been mutated by normalizeNamespace
  23991. val = namespace + val;
  23992. res[key] = function mappedGetter () {
  23993. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  23994. return
  23995. }
  23996. if (( true) && !(val in this.$store.getters)) {
  23997. console.error(("[vuex] unknown getter: " + val));
  23998. return
  23999. }
  24000. return this.$store.getters[val]
  24001. };
  24002. // mark vuex getter for devtools
  24003. res[key].vuex = true;
  24004. });
  24005. return res
  24006. });
  24007. /**
  24008. * Reduce the code which written in Vue.js for dispatch the action
  24009. * @param {String} [namespace] - Module's namespace
  24010. * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  24011. * @return {Object}
  24012. */
  24013. var mapActions = normalizeNamespace(function (namespace, actions) {
  24014. var res = {};
  24015. if (( true) && !isValidMap(actions)) {
  24016. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  24017. }
  24018. normalizeMap(actions).forEach(function (ref) {
  24019. var key = ref.key;
  24020. var val = ref.val;
  24021. res[key] = function mappedAction () {
  24022. var args = [], len = arguments.length;
  24023. while ( len-- ) args[ len ] = arguments[ len ];
  24024. // get dispatch function from store
  24025. var dispatch = this.$store.dispatch;
  24026. if (namespace) {
  24027. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  24028. if (!module) {
  24029. return
  24030. }
  24031. dispatch = module.context.dispatch;
  24032. }
  24033. return typeof val === 'function'
  24034. ? val.apply(this, [dispatch].concat(args))
  24035. : dispatch.apply(this.$store, [val].concat(args))
  24036. };
  24037. });
  24038. return res
  24039. });
  24040. /**
  24041. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  24042. * @param {String} namespace
  24043. * @return {Object}
  24044. */
  24045. var createNamespacedHelpers = function (namespace) { return ({
  24046. mapState: mapState.bind(null, namespace),
  24047. mapGetters: mapGetters.bind(null, namespace),
  24048. mapMutations: mapMutations.bind(null, namespace),
  24049. mapActions: mapActions.bind(null, namespace)
  24050. }); };
  24051. /**
  24052. * Normalize the map
  24053. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  24054. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  24055. * @param {Array|Object} map
  24056. * @return {Object}
  24057. */
  24058. function normalizeMap (map) {
  24059. if (!isValidMap(map)) {
  24060. return []
  24061. }
  24062. return Array.isArray(map)
  24063. ? map.map(function (key) { return ({ key: key, val: key }); })
  24064. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  24065. }
  24066. /**
  24067. * Validate whether given map is valid or not
  24068. * @param {*} map
  24069. * @return {Boolean}
  24070. */
  24071. function isValidMap (map) {
  24072. return Array.isArray(map) || isObject(map)
  24073. }
  24074. /**
  24075. * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.
  24076. * @param {Function} fn
  24077. * @return {Function}
  24078. */
  24079. function normalizeNamespace (fn) {
  24080. return function (namespace, map) {
  24081. if (typeof namespace !== 'string') {
  24082. map = namespace;
  24083. namespace = '';
  24084. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  24085. namespace += '/';
  24086. }
  24087. return fn(namespace, map)
  24088. }
  24089. }
  24090. /**
  24091. * Search a special module from store by namespace. if module not exist, print error message.
  24092. * @param {Object} store
  24093. * @param {String} helper
  24094. * @param {String} namespace
  24095. * @return {Object}
  24096. */
  24097. function getModuleByNamespace (store, helper, namespace) {
  24098. var module = store._modulesNamespaceMap[namespace];
  24099. if (( true) && !module) {
  24100. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  24101. }
  24102. return module
  24103. }
  24104. // Credits: borrowed code from fcomb/redux-logger
  24105. function createLogger (ref) {
  24106. if ( ref === void 0 ) ref = {};
  24107. var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;
  24108. var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };
  24109. var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };
  24110. var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };
  24111. var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };
  24112. var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };
  24113. var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;
  24114. var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;
  24115. var logger = ref.logger; if ( logger === void 0 ) logger = console;
  24116. return function (store) {
  24117. var prevState = deepCopy(store.state);
  24118. if (typeof logger === 'undefined') {
  24119. return
  24120. }
  24121. if (logMutations) {
  24122. store.subscribe(function (mutation, state) {
  24123. var nextState = deepCopy(state);
  24124. if (filter(mutation, prevState, nextState)) {
  24125. var formattedTime = getFormattedTime();
  24126. var formattedMutation = mutationTransformer(mutation);
  24127. var message = "mutation " + (mutation.type) + formattedTime;
  24128. startMessage(logger, message, collapsed);
  24129. logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));
  24130. logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);
  24131. logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));
  24132. endMessage(logger);
  24133. }
  24134. prevState = nextState;
  24135. });
  24136. }
  24137. if (logActions) {
  24138. store.subscribeAction(function (action, state) {
  24139. if (actionFilter(action, state)) {
  24140. var formattedTime = getFormattedTime();
  24141. var formattedAction = actionTransformer(action);
  24142. var message = "action " + (action.type) + formattedTime;
  24143. startMessage(logger, message, collapsed);
  24144. logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);
  24145. endMessage(logger);
  24146. }
  24147. });
  24148. }
  24149. }
  24150. }
  24151. function startMessage (logger, message, collapsed) {
  24152. var startMessage = collapsed
  24153. ? logger.groupCollapsed
  24154. : logger.group;
  24155. // render
  24156. try {
  24157. startMessage.call(logger, message);
  24158. } catch (e) {
  24159. logger.log(message);
  24160. }
  24161. }
  24162. function endMessage (logger) {
  24163. try {
  24164. logger.groupEnd();
  24165. } catch (e) {
  24166. logger.log('—— log end ——');
  24167. }
  24168. }
  24169. function getFormattedTime () {
  24170. var time = new Date();
  24171. return (" @ " + (pad(time.getHours(), 2)) + ":" + (pad(time.getMinutes(), 2)) + ":" + (pad(time.getSeconds(), 2)) + "." + (pad(time.getMilliseconds(), 3)))
  24172. }
  24173. function repeat (str, times) {
  24174. return (new Array(times + 1)).join(str)
  24175. }
  24176. function pad (num, maxLength) {
  24177. return repeat('0', maxLength - num.toString().length) + num
  24178. }
  24179. var index_cjs = {
  24180. Store: Store,
  24181. install: install,
  24182. version: '3.6.2',
  24183. mapState: mapState,
  24184. mapMutations: mapMutations,
  24185. mapGetters: mapGetters,
  24186. mapActions: mapActions,
  24187. createNamespacedHelpers: createNamespacedHelpers,
  24188. createLogger: createLogger
  24189. };
  24190. module.exports = index_cjs;
  24191. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  24192. /***/ })
  24193. }]);
  24194. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map